// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: media.proto

#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "media.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)

namespace {

const ::google::protobuf::Descriptor* MediaRequest_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  MediaRequest_reflection_ = NULL;
const ::google::protobuf::Descriptor* MediaRequest_Prepare_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  MediaRequest_Prepare_reflection_ = NULL;
const ::google::protobuf::Descriptor* MediaRequest_GetPart_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  MediaRequest_GetPart_reflection_ = NULL;
const ::google::protobuf::Descriptor* MediaRequest_Terminate_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  MediaRequest_Terminate_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* MediaRequest_Type_descriptor_ = NULL;
const ::google::protobuf::Descriptor* MediaResponse_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  MediaResponse_reflection_ = NULL;
const ::google::protobuf::Descriptor* MediaResponse_MediaPart_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  MediaResponse_MediaPart_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* MediaResponse_Type_descriptor_ = NULL;
const ::google::protobuf::EnumDescriptor* CodecType_descriptor_ = NULL;

}  // namespace


void protobuf_AssignDesc_media_2eproto() {
  protobuf_AddDesc_media_2eproto();
  const ::google::protobuf::FileDescriptor* file =
    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
      "media.proto");
  GOOGLE_CHECK(file != NULL);
  MediaRequest_descriptor_ = file->message_type(0);
  static const int MediaRequest_offsets_[4] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest, request_type_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest, prepare_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest, get_part_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest, terminate_),
  };
  MediaRequest_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      MediaRequest_descriptor_,
      MediaRequest::default_instance_,
      MediaRequest_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(MediaRequest));
  MediaRequest_Prepare_descriptor_ = MediaRequest_descriptor_->nested_type(0);
  static const int MediaRequest_Prepare_offsets_[8] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, id_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, offset_secs_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, codec_type_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, audio_bitrate_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, video_bitrate_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, audio_stream_idx_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, video_stream_idx_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, subtitle_stream_idx_),
  };
  MediaRequest_Prepare_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      MediaRequest_Prepare_descriptor_,
      MediaRequest_Prepare::default_instance_,
      MediaRequest_Prepare_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(MediaRequest_Prepare));
  MediaRequest_GetPart_descriptor_ = MediaRequest_descriptor_->nested_type(1);
  static const int MediaRequest_GetPart_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_GetPart, requested_data_size_),
  };
  MediaRequest_GetPart_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      MediaRequest_GetPart_descriptor_,
      MediaRequest_GetPart::default_instance_,
      MediaRequest_GetPart_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_GetPart, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_GetPart, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(MediaRequest_GetPart));
  MediaRequest_Terminate_descriptor_ = MediaRequest_descriptor_->nested_type(2);
  static const int MediaRequest_Terminate_offsets_[1] = {
  };
  MediaRequest_Terminate_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      MediaRequest_Terminate_descriptor_,
      MediaRequest_Terminate::default_instance_,
      MediaRequest_Terminate_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Terminate, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Terminate, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(MediaRequest_Terminate));
  MediaRequest_Type_descriptor_ = MediaRequest_descriptor_->enum_type(0);
  MediaResponse_descriptor_ = file->message_type(1);
  static const int MediaResponse_offsets_[3] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaResponse, error_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaResponse, response_type_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaResponse, part_),
  };
  MediaResponse_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      MediaResponse_descriptor_,
      MediaResponse::default_instance_,
      MediaResponse_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaResponse, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaResponse, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(MediaResponse));
  MediaResponse_MediaPart_descriptor_ = MediaResponse_descriptor_->nested_type(0);
  static const int MediaResponse_MediaPart_offsets_[2] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaResponse_MediaPart, byte_offset_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaResponse_MediaPart, data_),
  };
  MediaResponse_MediaPart_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      MediaResponse_MediaPart_descriptor_,
      MediaResponse_MediaPart::default_instance_,
      MediaResponse_MediaPart_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaResponse_MediaPart, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaResponse_MediaPart, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(MediaResponse_MediaPart));
  MediaResponse_Type_descriptor_ = MediaResponse_descriptor_->enum_type(0);
  CodecType_descriptor_ = file->enum_type(0);
}

namespace {

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                 &protobuf_AssignDesc_media_2eproto);
}

void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    MediaRequest_descriptor_, &MediaRequest::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    MediaRequest_Prepare_descriptor_, &MediaRequest_Prepare::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    MediaRequest_GetPart_descriptor_, &MediaRequest_GetPart::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    MediaRequest_Terminate_descriptor_, &MediaRequest_Terminate::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    MediaResponse_descriptor_, &MediaResponse::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    MediaResponse_MediaPart_descriptor_, &MediaResponse_MediaPart::default_instance());
}

}  // namespace

void protobuf_ShutdownFile_media_2eproto() {
  delete MediaRequest::default_instance_;
  delete MediaRequest_reflection_;
  delete MediaRequest_Prepare::default_instance_;
  delete MediaRequest_Prepare_reflection_;
  delete MediaRequest_GetPart::default_instance_;
  delete MediaRequest_GetPart_reflection_;
  delete MediaRequest_Terminate::default_instance_;
  delete MediaRequest_Terminate_reflection_;
  delete MediaResponse::default_instance_;
  delete MediaResponse_reflection_;
  delete MediaResponse_MediaPart::default_instance_;
  delete MediaResponse_MediaPart_reflection_;
}

void protobuf_AddDesc_media_2eproto() {
  static bool already_here = false;
  if (already_here) return;
  already_here = true;
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  ::protobuf_AddDesc_common_2eproto();
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
    "\n\013media.proto\032\014common.proto\"\376\003\n\014MediaReq"
    "uest\022(\n\014request_type\030\001 \002(\0162\022.MediaReques"
    "t.Type\022&\n\007prepare\030\002 \001(\0132\025.MediaRequest.P"
    "repare\022\'\n\010get_part\030\003 \001(\0132\025.MediaRequest."
    "GetPart\022*\n\tterminate\030\004 \001(\0132\027.MediaReques"
    "t.Terminate\032\311\001\n\007Prepare\022\n\n\002id\030\001 \002(\003\022\023\n\013o"
    "ffset_secs\030\002 \002(\r\022\036\n\ncodec_type\030\003 \001(\0162\n.C"
    "odecType\022\025\n\raudio_bitrate\030\004 \001(\r\022\025\n\rvideo"
    "_bitrate\030\005 \001(\r\022\030\n\020audio_stream_idx\030\006 \001(\r"
    "\022\030\n\020video_stream_idx\030\007 \001(\r\022\033\n\023subtitle_s"
    "tream_idx\030\010 \001(\r\032&\n\007GetPart\022\033\n\023requested_"
    "data_size\030\001 \002(\r\032\013\n\tTerminate\"F\n\004Type\022\024\n\020"
    "TypeMediaPrepare\020\001\022\020\n\014TypeMediaGet\020\002\022\026\n\022"
    "TypeMediaTerminate\020\003\"\305\001\n\rMediaResponse\022\025"
    "\n\005error\030\001 \002(\0132\006.Error\022*\n\rresponse_type\030\002"
    " \002(\0162\023.MediaResponse.Type\022&\n\004part\030\003 \001(\0132"
    "\030.MediaResponse.MediaPart\032.\n\tMediaPart\022\023"
    "\n\013byte_offset\030\001 \002(\004\022\014\n\004data\030\002 \003(\014\"\031\n\004Typ"
    "e\022\021\n\rTypeMediaPart\020\001*\035\n\tCodecType\022\020\n\014Cod"
    "ecTypeOGG\020\001", 771);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "media.proto", &protobuf_RegisterTypes);
  MediaRequest::default_instance_ = new MediaRequest();
  MediaRequest_Prepare::default_instance_ = new MediaRequest_Prepare();
  MediaRequest_GetPart::default_instance_ = new MediaRequest_GetPart();
  MediaRequest_Terminate::default_instance_ = new MediaRequest_Terminate();
  MediaResponse::default_instance_ = new MediaResponse();
  MediaResponse_MediaPart::default_instance_ = new MediaResponse_MediaPart();
  MediaRequest::default_instance_->InitAsDefaultInstance();
  MediaRequest_Prepare::default_instance_->InitAsDefaultInstance();
  MediaRequest_GetPart::default_instance_->InitAsDefaultInstance();
  MediaRequest_Terminate::default_instance_->InitAsDefaultInstance();
  MediaResponse::default_instance_->InitAsDefaultInstance();
  MediaResponse_MediaPart::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_media_2eproto);
}

// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_media_2eproto {
  StaticDescriptorInitializer_media_2eproto() {
    protobuf_AddDesc_media_2eproto();
  }
} static_descriptor_initializer_media_2eproto_;
const ::google::protobuf::EnumDescriptor* CodecType_descriptor() {
  protobuf_AssignDescriptorsOnce();
  return CodecType_descriptor_;
}
bool CodecType_IsValid(int value) {
  switch(value) {
    case 1:
      return true;
    default:
      return false;
  }
}


// ===================================================================

const ::google::protobuf::EnumDescriptor* MediaRequest_Type_descriptor() {
  protobuf_AssignDescriptorsOnce();
  return MediaRequest_Type_descriptor_;
}
bool MediaRequest_Type_IsValid(int value) {
  switch(value) {
    case 1:
    case 2:
    case 3:
      return true;
    default:
      return false;
  }
}

#ifndef _MSC_VER
const MediaRequest_Type MediaRequest::TypeMediaPrepare;
const MediaRequest_Type MediaRequest::TypeMediaGet;
const MediaRequest_Type MediaRequest::TypeMediaTerminate;
const MediaRequest_Type MediaRequest::Type_MIN;
const MediaRequest_Type MediaRequest::Type_MAX;
const int MediaRequest::Type_ARRAYSIZE;
#endif  // _MSC_VER
#ifndef _MSC_VER
const int MediaRequest_Prepare::kIdFieldNumber;
const int MediaRequest_Prepare::kOffsetSecsFieldNumber;
const int MediaRequest_Prepare::kCodecTypeFieldNumber;
const int MediaRequest_Prepare::kAudioBitrateFieldNumber;
const int MediaRequest_Prepare::kVideoBitrateFieldNumber;
const int MediaRequest_Prepare::kAudioStreamIdxFieldNumber;
const int MediaRequest_Prepare::kVideoStreamIdxFieldNumber;
const int MediaRequest_Prepare::kSubtitleStreamIdxFieldNumber;
#endif  // !_MSC_VER

MediaRequest_Prepare::MediaRequest_Prepare()
  : ::google::protobuf::Message() {
  SharedCtor();
}

void MediaRequest_Prepare::InitAsDefaultInstance() {
}

MediaRequest_Prepare::MediaRequest_Prepare(const MediaRequest_Prepare& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
}

void MediaRequest_Prepare::SharedCtor() {
  _cached_size_ = 0;
  id_ = GOOGLE_LONGLONG(0);
  offset_secs_ = 0u;
  codec_type_ = 1;
  audio_bitrate_ = 0u;
  video_bitrate_ = 0u;
  audio_stream_idx_ = 0u;
  video_stream_idx_ = 0u;
  subtitle_stream_idx_ = 0u;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

MediaRequest_Prepare::~MediaRequest_Prepare() {
  SharedDtor();
}

void MediaRequest_Prepare::SharedDtor() {
  if (this != default_instance_) {
  }
}

void MediaRequest_Prepare::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* MediaRequest_Prepare::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return MediaRequest_Prepare_descriptor_;
}

const MediaRequest_Prepare& MediaRequest_Prepare::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_media_2eproto();
  return *default_instance_;
}

MediaRequest_Prepare* MediaRequest_Prepare::default_instance_ = NULL;

MediaRequest_Prepare* MediaRequest_Prepare::New() const {
  return new MediaRequest_Prepare;
}

void MediaRequest_Prepare::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    id_ = GOOGLE_LONGLONG(0);
    offset_secs_ = 0u;
    codec_type_ = 1;
    audio_bitrate_ = 0u;
    video_bitrate_ = 0u;
    audio_stream_idx_ = 0u;
    video_stream_idx_ = 0u;
    subtitle_stream_idx_ = 0u;
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool MediaRequest_Prepare::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required int64 id = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
                 input, &id_)));
          set_has_id();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(16)) goto parse_offset_secs;
        break;
      }

      // required uint32 offset_secs = 2;
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_offset_secs:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &offset_secs_)));
          set_has_offset_secs();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(24)) goto parse_codec_type;
        break;
      }

      // optional .CodecType codec_type = 3;
      case 3: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_codec_type:
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::CodecType_IsValid(value)) {
            set_codec_type(static_cast< ::CodecType >(value));
          } else {
            mutable_unknown_fields()->AddVarint(3, value);
          }
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(32)) goto parse_audio_bitrate;
        break;
      }

      // optional uint32 audio_bitrate = 4;
      case 4: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_audio_bitrate:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &audio_bitrate_)));
          set_has_audio_bitrate();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(40)) goto parse_video_bitrate;
        break;
      }

      // optional uint32 video_bitrate = 5;
      case 5: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_video_bitrate:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &video_bitrate_)));
          set_has_video_bitrate();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(48)) goto parse_audio_stream_idx;
        break;
      }

      // optional uint32 audio_stream_idx = 6;
      case 6: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_audio_stream_idx:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &audio_stream_idx_)));
          set_has_audio_stream_idx();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(56)) goto parse_video_stream_idx;
        break;
      }

      // optional uint32 video_stream_idx = 7;
      case 7: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_video_stream_idx:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &video_stream_idx_)));
          set_has_video_stream_idx();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(64)) goto parse_subtitle_stream_idx;
        break;
      }

      // optional uint32 subtitle_stream_idx = 8;
      case 8: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_subtitle_stream_idx:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &subtitle_stream_idx_)));
          set_has_subtitle_stream_idx();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }

      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void MediaRequest_Prepare::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // required int64 id = 1;
  if (has_id()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->id(), output);
  }

  // required uint32 offset_secs = 2;
  if (has_offset_secs()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->offset_secs(), output);
  }

  // optional .CodecType codec_type = 3;
  if (has_codec_type()) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      3, this->codec_type(), output);
  }

  // optional uint32 audio_bitrate = 4;
  if (has_audio_bitrate()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->audio_bitrate(), output);
  }

  // optional uint32 video_bitrate = 5;
  if (has_video_bitrate()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->video_bitrate(), output);
  }

  // optional uint32 audio_stream_idx = 6;
  if (has_audio_stream_idx()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->audio_stream_idx(), output);
  }

  // optional uint32 video_stream_idx = 7;
  if (has_video_stream_idx()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->video_stream_idx(), output);
  }

  // optional uint32 subtitle_stream_idx = 8;
  if (has_subtitle_stream_idx()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->subtitle_stream_idx(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
}

::google::protobuf::uint8* MediaRequest_Prepare::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // required int64 id = 1;
  if (has_id()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->id(), target);
  }

  // required uint32 offset_secs = 2;
  if (has_offset_secs()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->offset_secs(), target);
  }

  // optional .CodecType codec_type = 3;
  if (has_codec_type()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      3, this->codec_type(), target);
  }

  // optional uint32 audio_bitrate = 4;
  if (has_audio_bitrate()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->audio_bitrate(), target);
  }

  // optional uint32 video_bitrate = 5;
  if (has_video_bitrate()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->video_bitrate(), target);
  }

  // optional uint32 audio_stream_idx = 6;
  if (has_audio_stream_idx()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->audio_stream_idx(), target);
  }

  // optional uint32 video_stream_idx = 7;
  if (has_video_stream_idx()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->video_stream_idx(), target);
  }

  // optional uint32 subtitle_stream_idx = 8;
  if (has_subtitle_stream_idx()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->subtitle_stream_idx(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  return target;
}

int MediaRequest_Prepare::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required int64 id = 1;
    if (has_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int64Size(
          this->id());
    }

    // required uint32 offset_secs = 2;
    if (has_offset_secs()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->offset_secs());
    }

    // optional .CodecType codec_type = 3;
    if (has_codec_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::EnumSize(this->codec_type());
    }

    // optional uint32 audio_bitrate = 4;
    if (has_audio_bitrate()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->audio_bitrate());
    }

    // optional uint32 video_bitrate = 5;
    if (has_video_bitrate()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->video_bitrate());
    }

    // optional uint32 audio_stream_idx = 6;
    if (has_audio_stream_idx()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->audio_stream_idx());
    }

    // optional uint32 video_stream_idx = 7;
    if (has_video_stream_idx()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->video_stream_idx());
    }

    // optional uint32 subtitle_stream_idx = 8;
    if (has_subtitle_stream_idx()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->subtitle_stream_idx());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void MediaRequest_Prepare::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const MediaRequest_Prepare* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const MediaRequest_Prepare*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void MediaRequest_Prepare::MergeFrom(const MediaRequest_Prepare& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_id()) {
      set_id(from.id());
    }
    if (from.has_offset_secs()) {
      set_offset_secs(from.offset_secs());
    }
    if (from.has_codec_type()) {
      set_codec_type(from.codec_type());
    }
    if (from.has_audio_bitrate()) {
      set_audio_bitrate(from.audio_bitrate());
    }
    if (from.has_video_bitrate()) {
      set_video_bitrate(from.video_bitrate());
    }
    if (from.has_audio_stream_idx()) {
      set_audio_stream_idx(from.audio_stream_idx());
    }
    if (from.has_video_stream_idx()) {
      set_video_stream_idx(from.video_stream_idx());
    }
    if (from.has_subtitle_stream_idx()) {
      set_subtitle_stream_idx(from.subtitle_stream_idx());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void MediaRequest_Prepare::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void MediaRequest_Prepare::CopyFrom(const MediaRequest_Prepare& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool MediaRequest_Prepare::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;

  return true;
}

void MediaRequest_Prepare::Swap(MediaRequest_Prepare* other) {
  if (other != this) {
    std::swap(id_, other->id_);
    std::swap(offset_secs_, other->offset_secs_);
    std::swap(codec_type_, other->codec_type_);
    std::swap(audio_bitrate_, other->audio_bitrate_);
    std::swap(video_bitrate_, other->video_bitrate_);
    std::swap(audio_stream_idx_, other->audio_stream_idx_);
    std::swap(video_stream_idx_, other->video_stream_idx_);
    std::swap(subtitle_stream_idx_, other->subtitle_stream_idx_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata MediaRequest_Prepare::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = MediaRequest_Prepare_descriptor_;
  metadata.reflection = MediaRequest_Prepare_reflection_;
  return metadata;
}


// -------------------------------------------------------------------

#ifndef _MSC_VER
const int MediaRequest_GetPart::kRequestedDataSizeFieldNumber;
#endif  // !_MSC_VER

MediaRequest_GetPart::MediaRequest_GetPart()
  : ::google::protobuf::Message() {
  SharedCtor();
}

void MediaRequest_GetPart::InitAsDefaultInstance() {
}

MediaRequest_GetPart::MediaRequest_GetPart(const MediaRequest_GetPart& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
}

void MediaRequest_GetPart::SharedCtor() {
  _cached_size_ = 0;
  requested_data_size_ = 0u;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

MediaRequest_GetPart::~MediaRequest_GetPart() {
  SharedDtor();
}

void MediaRequest_GetPart::SharedDtor() {
  if (this != default_instance_) {
  }
}

void MediaRequest_GetPart::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* MediaRequest_GetPart::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return MediaRequest_GetPart_descriptor_;
}

const MediaRequest_GetPart& MediaRequest_GetPart::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_media_2eproto();
  return *default_instance_;
}

MediaRequest_GetPart* MediaRequest_GetPart::default_instance_ = NULL;

MediaRequest_GetPart* MediaRequest_GetPart::New() const {
  return new MediaRequest_GetPart;
}

void MediaRequest_GetPart::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    requested_data_size_ = 0u;
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool MediaRequest_GetPart::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required uint32 requested_data_size = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &requested_data_size_)));
          set_has_requested_data_size();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }

      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void MediaRequest_GetPart::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // required uint32 requested_data_size = 1;
  if (has_requested_data_size()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->requested_data_size(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
}

::google::protobuf::uint8* MediaRequest_GetPart::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // required uint32 requested_data_size = 1;
  if (has_requested_data_size()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->requested_data_size(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  return target;
}

int MediaRequest_GetPart::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required uint32 requested_data_size = 1;
    if (has_requested_data_size()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->requested_data_size());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void MediaRequest_GetPart::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const MediaRequest_GetPart* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const MediaRequest_GetPart*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void MediaRequest_GetPart::MergeFrom(const MediaRequest_GetPart& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_requested_data_size()) {
      set_requested_data_size(from.requested_data_size());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void MediaRequest_GetPart::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void MediaRequest_GetPart::CopyFrom(const MediaRequest_GetPart& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool MediaRequest_GetPart::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;

  return true;
}

void MediaRequest_GetPart::Swap(MediaRequest_GetPart* other) {
  if (other != this) {
    std::swap(requested_data_size_, other->requested_data_size_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata MediaRequest_GetPart::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = MediaRequest_GetPart_descriptor_;
  metadata.reflection = MediaRequest_GetPart_reflection_;
  return metadata;
}


// -------------------------------------------------------------------

#ifndef _MSC_VER
#endif  // !_MSC_VER

MediaRequest_Terminate::MediaRequest_Terminate()
  : ::google::protobuf::Message() {
  SharedCtor();
}

void MediaRequest_Terminate::InitAsDefaultInstance() {
}

MediaRequest_Terminate::MediaRequest_Terminate(const MediaRequest_Terminate& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
}

void MediaRequest_Terminate::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

MediaRequest_Terminate::~MediaRequest_Terminate() {
  SharedDtor();
}

void MediaRequest_Terminate::SharedDtor() {
  if (this != default_instance_) {
  }
}

void MediaRequest_Terminate::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* MediaRequest_Terminate::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return MediaRequest_Terminate_descriptor_;
}

const MediaRequest_Terminate& MediaRequest_Terminate::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_media_2eproto();
  return *default_instance_;
}

MediaRequest_Terminate* MediaRequest_Terminate::default_instance_ = NULL;

MediaRequest_Terminate* MediaRequest_Terminate::New() const {
  return new MediaRequest_Terminate;
}

void MediaRequest_Terminate::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool MediaRequest_Terminate::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      return true;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
  return true;
#undef DO_
}

void MediaRequest_Terminate::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
}

::google::protobuf::uint8* MediaRequest_Terminate::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  return target;
}

int MediaRequest_Terminate::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void MediaRequest_Terminate::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const MediaRequest_Terminate* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const MediaRequest_Terminate*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void MediaRequest_Terminate::MergeFrom(const MediaRequest_Terminate& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void MediaRequest_Terminate::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void MediaRequest_Terminate::CopyFrom(const MediaRequest_Terminate& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool MediaRequest_Terminate::IsInitialized() const {

  return true;
}

void MediaRequest_Terminate::Swap(MediaRequest_Terminate* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata MediaRequest_Terminate::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = MediaRequest_Terminate_descriptor_;
  metadata.reflection = MediaRequest_Terminate_reflection_;
  return metadata;
}


// -------------------------------------------------------------------

#ifndef _MSC_VER
const int MediaRequest::kRequestTypeFieldNumber;
const int MediaRequest::kPrepareFieldNumber;
const int MediaRequest::kGetPartFieldNumber;
const int MediaRequest::kTerminateFieldNumber;
#endif  // !_MSC_VER

MediaRequest::MediaRequest()
  : ::google::protobuf::Message() {
  SharedCtor();
}

void MediaRequest::InitAsDefaultInstance() {
  prepare_ = const_cast< ::MediaRequest_Prepare*>(&::MediaRequest_Prepare::default_instance());
  get_part_ = const_cast< ::MediaRequest_GetPart*>(&::MediaRequest_GetPart::default_instance());
  terminate_ = const_cast< ::MediaRequest_Terminate*>(&::MediaRequest_Terminate::default_instance());
}

MediaRequest::MediaRequest(const MediaRequest& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
}

void MediaRequest::SharedCtor() {
  _cached_size_ = 0;
  request_type_ = 1;
  prepare_ = NULL;
  get_part_ = NULL;
  terminate_ = NULL;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

MediaRequest::~MediaRequest() {
  SharedDtor();
}

void MediaRequest::SharedDtor() {
  if (this != default_instance_) {
    delete prepare_;
    delete get_part_;
    delete terminate_;
  }
}

void MediaRequest::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* MediaRequest::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return MediaRequest_descriptor_;
}

const MediaRequest& MediaRequest::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_media_2eproto();
  return *default_instance_;
}

MediaRequest* MediaRequest::default_instance_ = NULL;

MediaRequest* MediaRequest::New() const {
  return new MediaRequest;
}

void MediaRequest::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    request_type_ = 1;
    if (has_prepare()) {
      if (prepare_ != NULL) prepare_->::MediaRequest_Prepare::Clear();
    }
    if (has_get_part()) {
      if (get_part_ != NULL) get_part_->::MediaRequest_GetPart::Clear();
    }
    if (has_terminate()) {
      if (terminate_ != NULL) terminate_->::MediaRequest_Terminate::Clear();
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool MediaRequest::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required .MediaRequest.Type request_type = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::MediaRequest_Type_IsValid(value)) {
            set_request_type(static_cast< ::MediaRequest_Type >(value));
          } else {
            mutable_unknown_fields()->AddVarint(1, value);
          }
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(18)) goto parse_prepare;
        break;
      }

      // optional .MediaRequest.Prepare prepare = 2;
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_prepare:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_prepare()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(26)) goto parse_get_part;
        break;
      }

      // optional .MediaRequest.GetPart get_part = 3;
      case 3: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_get_part:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_get_part()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(34)) goto parse_terminate;
        break;
      }

      // optional .MediaRequest.Terminate terminate = 4;
      case 4: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_terminate:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_terminate()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }

      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void MediaRequest::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // required .MediaRequest.Type request_type = 1;
  if (has_request_type()) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      1, this->request_type(), output);
  }

  // optional .MediaRequest.Prepare prepare = 2;
  if (has_prepare()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2, this->prepare(), output);
  }

  // optional .MediaRequest.GetPart get_part = 3;
  if (has_get_part()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3, this->get_part(), output);
  }

  // optional .MediaRequest.Terminate terminate = 4;
  if (has_terminate()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      4, this->terminate(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
}

::google::protobuf::uint8* MediaRequest::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // required .MediaRequest.Type request_type = 1;
  if (has_request_type()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      1, this->request_type(), target);
  }

  // optional .MediaRequest.Prepare prepare = 2;
  if (has_prepare()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        2, this->prepare(), target);
  }

  // optional .MediaRequest.GetPart get_part = 3;
  if (has_get_part()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        3, this->get_part(), target);
  }

  // optional .MediaRequest.Terminate terminate = 4;
  if (has_terminate()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        4, this->terminate(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  return target;
}

int MediaRequest::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required .MediaRequest.Type request_type = 1;
    if (has_request_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::EnumSize(this->request_type());
    }

    // optional .MediaRequest.Prepare prepare = 2;
    if (has_prepare()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->prepare());
    }

    // optional .MediaRequest.GetPart get_part = 3;
    if (has_get_part()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->get_part());
    }

    // optional .MediaRequest.Terminate terminate = 4;
    if (has_terminate()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->terminate());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void MediaRequest::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const MediaRequest* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const MediaRequest*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void MediaRequest::MergeFrom(const MediaRequest& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_request_type()) {
      set_request_type(from.request_type());
    }
    if (from.has_prepare()) {
      mutable_prepare()->::MediaRequest_Prepare::MergeFrom(from.prepare());
    }
    if (from.has_get_part()) {
      mutable_get_part()->::MediaRequest_GetPart::MergeFrom(from.get_part());
    }
    if (from.has_terminate()) {
      mutable_terminate()->::MediaRequest_Terminate::MergeFrom(from.terminate());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void MediaRequest::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void MediaRequest::CopyFrom(const MediaRequest& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool MediaRequest::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;

  if (has_prepare()) {
    if (!this->prepare().IsInitialized()) return false;
  }
  if (has_get_part()) {
    if (!this->get_part().IsInitialized()) return false;
  }
  return true;
}

void MediaRequest::Swap(MediaRequest* other) {
  if (other != this) {
    std::swap(request_type_, other->request_type_);
    std::swap(prepare_, other->prepare_);
    std::swap(get_part_, other->get_part_);
    std::swap(terminate_, other->terminate_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata MediaRequest::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = MediaRequest_descriptor_;
  metadata.reflection = MediaRequest_reflection_;
  return metadata;
}


// ===================================================================

const ::google::protobuf::EnumDescriptor* MediaResponse_Type_descriptor() {
  protobuf_AssignDescriptorsOnce();
  return MediaResponse_Type_descriptor_;
}
bool MediaResponse_Type_IsValid(int value) {
  switch(value) {
    case 1:
      return true;
    default:
      return false;
  }
}

#ifndef _MSC_VER
const MediaResponse_Type MediaResponse::TypeMediaPart;
const MediaResponse_Type MediaResponse::Type_MIN;
const MediaResponse_Type MediaResponse::Type_MAX;
const int MediaResponse::Type_ARRAYSIZE;
#endif  // _MSC_VER
#ifndef _MSC_VER
const int MediaResponse_MediaPart::kByteOffsetFieldNumber;
const int MediaResponse_MediaPart::kDataFieldNumber;
#endif  // !_MSC_VER

MediaResponse_MediaPart::MediaResponse_MediaPart()
  : ::google::protobuf::Message() {
  SharedCtor();
}

void MediaResponse_MediaPart::InitAsDefaultInstance() {
}

MediaResponse_MediaPart::MediaResponse_MediaPart(const MediaResponse_MediaPart& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
}

void MediaResponse_MediaPart::SharedCtor() {
  _cached_size_ = 0;
  byte_offset_ = GOOGLE_ULONGLONG(0);
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

MediaResponse_MediaPart::~MediaResponse_MediaPart() {
  SharedDtor();
}

void MediaResponse_MediaPart::SharedDtor() {
  if (this != default_instance_) {
  }
}

void MediaResponse_MediaPart::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* MediaResponse_MediaPart::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return MediaResponse_MediaPart_descriptor_;
}

const MediaResponse_MediaPart& MediaResponse_MediaPart::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_media_2eproto();
  return *default_instance_;
}

MediaResponse_MediaPart* MediaResponse_MediaPart::default_instance_ = NULL;

MediaResponse_MediaPart* MediaResponse_MediaPart::New() const {
  return new MediaResponse_MediaPart;
}

void MediaResponse_MediaPart::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    byte_offset_ = GOOGLE_ULONGLONG(0);
  }
  data_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool MediaResponse_MediaPart::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required uint64 byte_offset = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
                 input, &byte_offset_)));
          set_has_byte_offset();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(18)) goto parse_data;
        break;
      }

      // repeated bytes data = 2;
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_data:
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->add_data()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(18)) goto parse_data;
        if (input->ExpectAtEnd()) return true;
        break;
      }

      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void MediaResponse_MediaPart::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // required uint64 byte_offset = 1;
  if (has_byte_offset()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->byte_offset(), output);
  }

  // repeated bytes data = 2;
  for (int i = 0; i < this->data_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteBytes(
      2, this->data(i), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
}

::google::protobuf::uint8* MediaResponse_MediaPart::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // required uint64 byte_offset = 1;
  if (has_byte_offset()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->byte_offset(), target);
  }

  // repeated bytes data = 2;
  for (int i = 0; i < this->data_size(); i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteBytesToArray(2, this->data(i), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  return target;
}

int MediaResponse_MediaPart::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required uint64 byte_offset = 1;
    if (has_byte_offset()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt64Size(
          this->byte_offset());
    }

  }
  // repeated bytes data = 2;
  total_size += 1 * this->data_size();
  for (int i = 0; i < this->data_size(); i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
      this->data(i));
  }

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void MediaResponse_MediaPart::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const MediaResponse_MediaPart* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const MediaResponse_MediaPart*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void MediaResponse_MediaPart::MergeFrom(const MediaResponse_MediaPart& from) {
  GOOGLE_CHECK_NE(&from, this);
  data_.MergeFrom(from.data_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_byte_offset()) {
      set_byte_offset(from.byte_offset());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void MediaResponse_MediaPart::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void MediaResponse_MediaPart::CopyFrom(const MediaResponse_MediaPart& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool MediaResponse_MediaPart::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;

  return true;
}

void MediaResponse_MediaPart::Swap(MediaResponse_MediaPart* other) {
  if (other != this) {
    std::swap(byte_offset_, other->byte_offset_);
    data_.Swap(&other->data_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata MediaResponse_MediaPart::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = MediaResponse_MediaPart_descriptor_;
  metadata.reflection = MediaResponse_MediaPart_reflection_;
  return metadata;
}


// -------------------------------------------------------------------

#ifndef _MSC_VER
const int MediaResponse::kErrorFieldNumber;
const int MediaResponse::kResponseTypeFieldNumber;
const int MediaResponse::kPartFieldNumber;
#endif  // !_MSC_VER

MediaResponse::MediaResponse()
  : ::google::protobuf::Message() {
  SharedCtor();
}

void MediaResponse::InitAsDefaultInstance() {
  error_ = const_cast< ::Error*>(&::Error::default_instance());
  part_ = const_cast< ::MediaResponse_MediaPart*>(&::MediaResponse_MediaPart::default_instance());
}

MediaResponse::MediaResponse(const MediaResponse& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
}

void MediaResponse::SharedCtor() {
  _cached_size_ = 0;
  error_ = NULL;
  response_type_ = 1;
  part_ = NULL;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

MediaResponse::~MediaResponse() {
  SharedDtor();
}

void MediaResponse::SharedDtor() {
  if (this != default_instance_) {
    delete error_;
    delete part_;
  }
}

void MediaResponse::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* MediaResponse::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return MediaResponse_descriptor_;
}

const MediaResponse& MediaResponse::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_media_2eproto();
  return *default_instance_;
}

MediaResponse* MediaResponse::default_instance_ = NULL;

MediaResponse* MediaResponse::New() const {
  return new MediaResponse;
}

void MediaResponse::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (has_error()) {
      if (error_ != NULL) error_->::Error::Clear();
    }
    response_type_ = 1;
    if (has_part()) {
      if (part_ != NULL) part_->::MediaResponse_MediaPart::Clear();
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool MediaResponse::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required .Error error = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_error()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(16)) goto parse_response_type;
        break;
      }

      // required .MediaResponse.Type response_type = 2;
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_response_type:
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::MediaResponse_Type_IsValid(value)) {
            set_response_type(static_cast< ::MediaResponse_Type >(value));
          } else {
            mutable_unknown_fields()->AddVarint(2, value);
          }
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(26)) goto parse_part;
        break;
      }

      // optional .MediaResponse.MediaPart part = 3;
      case 3: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_part:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_part()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }

      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void MediaResponse::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // required .Error error = 1;
  if (has_error()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, this->error(), output);
  }

  // required .MediaResponse.Type response_type = 2;
  if (has_response_type()) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      2, this->response_type(), output);
  }

  // optional .MediaResponse.MediaPart part = 3;
  if (has_part()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3, this->part(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
}

::google::protobuf::uint8* MediaResponse::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // required .Error error = 1;
  if (has_error()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        1, this->error(), target);
  }

  // required .MediaResponse.Type response_type = 2;
  if (has_response_type()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      2, this->response_type(), target);
  }

  // optional .MediaResponse.MediaPart part = 3;
  if (has_part()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        3, this->part(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  return target;
}

int MediaResponse::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required .Error error = 1;
    if (has_error()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->error());
    }

    // required .MediaResponse.Type response_type = 2;
    if (has_response_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::EnumSize(this->response_type());
    }

    // optional .MediaResponse.MediaPart part = 3;
    if (has_part()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->part());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void MediaResponse::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const MediaResponse* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const MediaResponse*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void MediaResponse::MergeFrom(const MediaResponse& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_error()) {
      mutable_error()->::Error::MergeFrom(from.error());
    }
    if (from.has_response_type()) {
      set_response_type(from.response_type());
    }
    if (from.has_part()) {
      mutable_part()->::MediaResponse_MediaPart::MergeFrom(from.part());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void MediaResponse::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void MediaResponse::CopyFrom(const MediaResponse& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool MediaResponse::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;

  if (has_error()) {
    if (!this->error().IsInitialized()) return false;
  }
  if (has_part()) {
    if (!this->part().IsInitialized()) return false;
  }
  return true;
}

void MediaResponse::Swap(MediaResponse* other) {
  if (other != this) {
    std::swap(error_, other->error_);
    std::swap(response_type_, other->response_type_);
    std::swap(part_, other->part_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata MediaResponse::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = MediaResponse_descriptor_;
  metadata.reflection = MediaResponse_reflection_;
  return metadata;
}


// @@protoc_insertion_point(namespace_scope)

// @@protoc_insertion_point(global_scope)
