diff --git a/Makefile.am b/Makefile.am index 93f7965b..b648f282 100644 --- a/Makefile.am +++ b/Makefile.am @@ -53,6 +53,7 @@ lms_SOURCES = \ $(top_srcdir)/remote/server/Connection.cpp \ $(top_srcdir)/remote/server/ConnectionManager.cpp \ $(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp \ + $(top_srcdir)/remote/server/MediaRequestHandler.cpp \ $(top_srcdir)/remote/server/RequestHandler.cpp \ $(top_srcdir)/remote/server/Server.cpp \ $(top_srcdir)/metadata/Utils.cpp diff --git a/database/AudioTypes.hpp b/database/AudioTypes.hpp index 12df571d..65e1df97 100644 --- a/database/AudioTypes.hpp +++ b/database/AudioTypes.hpp @@ -140,6 +140,7 @@ class Track // Find utilities static pointer getByPath(Wt::Dbo::Session& session, const boost::filesystem::path& p); + static pointer getById(Wt::Dbo::Session& session, id_type id); static Wt::Dbo::collection< pointer > getAll(Wt::Dbo::Session& session); static Wt::Dbo::collection< pointer > getAll(Wt::Dbo::Session& session, const std::vector& artistIds, diff --git a/database/Track.cpp b/database/Track.cpp index 4e3aaf1c..fdb19988 100644 --- a/database/Track.cpp +++ b/database/Track.cpp @@ -30,11 +30,15 @@ Track::setGenres(std::vector genres) Track::pointer Track::getByPath(Wt::Dbo::Session& session, const boost::filesystem::path& p) { - Wt::Dbo::Transaction transaction(session); - return session.find().where("path = ?").bind(p.string()); } +Track::pointer +Track::getById(Wt::Dbo::Session& session, id_type id) +{ + return session.find().where("id = ?").bind(id); +} + Track::pointer Track::create(Wt::Dbo::Session& session, const boost::filesystem::path& p, Artist::pointer artist, Release::pointer release) diff --git a/remote/messages/Header.hpp b/remote/messages/Header.hpp index b04a47bd..c2121951 100644 --- a/remote/messages/Header.hpp +++ b/remote/messages/Header.hpp @@ -31,13 +31,18 @@ class Header bool from_buffer(const std::array& buffer) { - if (decode32(&buffer[0]) != _magic) + if (decode32(&buffer[0]) != _magic) { + std::cerr << "Header: bad magic" << std::endl; return false; + } else { _size = decode32(&buffer[4]); - return _size < _maxSize; + if (_size > _maxSize) + std::cerr << "Header: msg too big (" << _size << ")!" << std::endl; + + return _size <= _maxSize; } } diff --git a/remote/messages/media.pb.cc b/remote/messages/media.pb.cc index fd32a038..3e254c8e 100644 --- a/remote/messages/media.pb.cc +++ b/remote/messages/media.pb.cc @@ -26,6 +26,13 @@ const ::google::protobuf::internal::GeneratedMessageReflection* const ::google::protobuf::Descriptor* MediaRequest_Prepare_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* MediaRequest_Prepare_reflection_ = NULL; +const ::google::protobuf::Descriptor* MediaRequest_Prepare_Audio_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + MediaRequest_Prepare_Audio_reflection_ = NULL; +const ::google::protobuf::Descriptor* MediaRequest_Prepare_Video_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + MediaRequest_Prepare_Video_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* MediaRequest_Prepare_Type_descriptor_ = NULL; const ::google::protobuf::Descriptor* MediaRequest_GetPart_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* MediaRequest_GetPart_reflection_ = NULL; @@ -36,11 +43,12 @@ 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::Descriptor* MediaResponse_Part_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* - MediaResponse_MediaPart_reflection_ = NULL; + MediaResponse_Part_reflection_ = NULL; const ::google::protobuf::EnumDescriptor* MediaResponse_Type_descriptor_ = NULL; -const ::google::protobuf::EnumDescriptor* CodecType_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* AudioCodecType_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* VideoCodecType_descriptor_ = NULL; } // namespace @@ -53,7 +61,7 @@ void protobuf_AssignDesc_media_2eproto() { 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, 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_), @@ -70,15 +78,10 @@ void protobuf_AssignDesc_media_2eproto() { ::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_), + static const int MediaRequest_Prepare_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, audio_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare, video_), }; MediaRequest_Prepare_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( @@ -91,6 +94,47 @@ void protobuf_AssignDesc_media_2eproto() { ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), sizeof(MediaRequest_Prepare)); + MediaRequest_Prepare_Audio_descriptor_ = MediaRequest_Prepare_descriptor_->nested_type(0); + static const int MediaRequest_Prepare_Audio_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Audio, track_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Audio, codec_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Audio, bitrate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Audio, stream_idx_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Audio, offset_secs_), + }; + MediaRequest_Prepare_Audio_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + MediaRequest_Prepare_Audio_descriptor_, + MediaRequest_Prepare_Audio::default_instance_, + MediaRequest_Prepare_Audio_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Audio, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Audio, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(MediaRequest_Prepare_Audio)); + MediaRequest_Prepare_Video_descriptor_ = MediaRequest_Prepare_descriptor_->nested_type(1); + static const int MediaRequest_Prepare_Video_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Video, video_id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Video, codec_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Video, bitrate_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Video, offset_secs_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Video, audio_stream_idx_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Video, video_stream_idx_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Video, subtitle_stream_idx_), + }; + MediaRequest_Prepare_Video_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + MediaRequest_Prepare_Video_descriptor_, + MediaRequest_Prepare_Video::default_instance_, + MediaRequest_Prepare_Video_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Video, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaRequest_Prepare_Video, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(MediaRequest_Prepare_Video)); + MediaRequest_Prepare_Type_descriptor_ = MediaRequest_Prepare_descriptor_->enum_type(0); 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_), @@ -123,8 +167,8 @@ void protobuf_AssignDesc_media_2eproto() { 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, type_), 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_ = @@ -138,24 +182,24 @@ void protobuf_AssignDesc_media_2eproto() { ::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_Part_descriptor_ = MediaResponse_descriptor_->nested_type(0); + static const int MediaResponse_Part_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaResponse_Part, data_), }; - MediaResponse_MediaPart_reflection_ = + MediaResponse_Part_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_), + MediaResponse_Part_descriptor_, + MediaResponse_Part::default_instance_, + MediaResponse_Part_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaResponse_Part, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MediaResponse_Part, _unknown_fields_), -1, ::google::protobuf::DescriptorPool::generated_pool(), ::google::protobuf::MessageFactory::generated_factory(), - sizeof(MediaResponse_MediaPart)); + sizeof(MediaResponse_Part)); MediaResponse_Type_descriptor_ = MediaResponse_descriptor_->enum_type(0); - CodecType_descriptor_ = file->enum_type(0); + AudioCodecType_descriptor_ = file->enum_type(0); + VideoCodecType_descriptor_ = file->enum_type(1); } namespace { @@ -172,6 +216,10 @@ void protobuf_RegisterTypes(const ::std::string&) { MediaRequest_descriptor_, &MediaRequest::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( MediaRequest_Prepare_descriptor_, &MediaRequest_Prepare::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + MediaRequest_Prepare_Audio_descriptor_, &MediaRequest_Prepare_Audio::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + MediaRequest_Prepare_Video_descriptor_, &MediaRequest_Prepare_Video::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( MediaRequest_GetPart_descriptor_, &MediaRequest_GetPart::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( @@ -179,7 +227,7 @@ void protobuf_RegisterTypes(const ::std::string&) { ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( MediaResponse_descriptor_, &MediaResponse::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( - MediaResponse_MediaPart_descriptor_, &MediaResponse_MediaPart::default_instance()); + MediaResponse_Part_descriptor_, &MediaResponse_Part::default_instance()); } } // namespace @@ -189,14 +237,18 @@ void protobuf_ShutdownFile_media_2eproto() { delete MediaRequest_reflection_; delete MediaRequest_Prepare::default_instance_; delete MediaRequest_Prepare_reflection_; + delete MediaRequest_Prepare_Audio::default_instance_; + delete MediaRequest_Prepare_Audio_reflection_; + delete MediaRequest_Prepare_Video::default_instance_; + delete MediaRequest_Prepare_Video_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_; + delete MediaResponse_Part::default_instance_; + delete MediaResponse_Part_reflection_; } void protobuf_AddDesc_media_2eproto() { @@ -207,41 +259,53 @@ void protobuf_AddDesc_media_2eproto() { ::Remote::protobuf_AddDesc_common_2eproto(); ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( - "\n\013media.proto\022\006Remote\032\014common.proto\"\241\004\n\014" - "MediaRequest\022/\n\014request_type\030\001 \002(\0162\031.Rem" - "ote.MediaRequest.Type\022-\n\007prepare\030\002 \001(\0132\034" - ".Remote.MediaRequest.Prepare\022.\n\010get_part" - "\030\003 \001(\0132\034.Remote.MediaRequest.GetPart\0221\n\t" - "terminate\030\004 \001(\0132\036.Remote.MediaRequest.Te" - "rminate\032\320\001\n\007Prepare\022\n\n\002id\030\001 \002(\003\022\023\n\013offse" - "t_secs\030\002 \002(\r\022%\n\ncodec_type\030\003 \001(\0162\021.Remot" - "e.CodecType\022\025\n\raudio_bitrate\030\004 \001(\r\022\025\n\rvi" - "deo_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\023subtitl" - "e_stream_idx\030\010 \001(\r\032&\n\007GetPart\022\033\n\023request" - "ed_data_size\030\001 \002(\r\032\013\n\tTerminate\"F\n\004Type\022" - "\024\n\020TypeMediaPrepare\020\001\022\020\n\014TypeMediaGet\020\002\022" - "\026\n\022TypeMediaTerminate\020\003\"\332\001\n\rMediaRespons" - "e\022\034\n\005error\030\001 \002(\0132\r.Remote.Error\0221\n\rrespo" - "nse_type\030\002 \002(\0162\032.Remote.MediaResponse.Ty" - "pe\022-\n\004part\030\003 \001(\0132\037.Remote.MediaResponse." - "MediaPart\032.\n\tMediaPart\022\023\n\013byte_offset\030\001 " - "\002(\004\022\014\n\004data\030\002 \003(\014\"\031\n\004Type\022\021\n\rTypeMediaPa" - "rt\020\001*\035\n\tCodecType\022\020\n\014CodecTypeOGG\020\001", 835); + "\n\013media.proto\022\006Remote\032\014common.proto\"\331\006\n\014" + "MediaRequest\022\'\n\004type\030\001 \002(\0162\031.Remote.Medi" + "aRequest.Type\022-\n\007prepare\030\002 \001(\0132\034.Remote." + "MediaRequest.Prepare\022.\n\010get_part\030\003 \001(\0132\034" + ".Remote.MediaRequest.GetPart\0221\n\tterminat" + "e\030\004 \001(\0132\036.Remote.MediaRequest.Terminate\032" + "\214\004\n\007Prepare\022/\n\004type\030\001 \002(\0162!.Remote.Media" + "Request.Prepare.Type\0221\n\005audio\030\002 \001(\0132\".Re" + "mote.MediaRequest.Prepare.Audio\0221\n\005video" + "\030\003 \001(\0132\".Remote.MediaRequest.Prepare.Vid" + "eo\032\177\n\005Audio\022\020\n\010track_id\030\001 \002(\003\022*\n\ncodec_t" + "ype\030\002 \001(\0162\026.Remote.AudioCodecType\022\017\n\007bit" + "rate\030\003 \001(\r\022\022\n\nstream_idx\030\004 \001(\r\022\023\n\013offset" + "_secs\030\005 \001(\r\032\274\001\n\005Video\022\020\n\010video_id\030\001 \002(\003\022" + "*\n\ncodec_type\030\002 \001(\0162\026.Remote.VideoCodecT" + "ype\022\017\n\007bitrate\030\003 \001(\r\022\023\n\013offset_secs\030\004 \001(" + "\r\022\030\n\020audio_stream_idx\030\005 \001(\r\022\030\n\020video_str" + "eam_idx\030\006 \001(\r\022\033\n\023subtitle_stream_idx\030\007 \001" + "(\r\"*\n\004Type\022\020\n\014AudioRequest\020\001\022\020\n\014VideoReq" + "uest\020\002\032&\n\007GetPart\022\033\n\023requested_data_size" + "\030\001 \002(\r\032\013\n\tTerminate\"J\n\004Type\022\024\n\020TypeMedia" + "Prepare\020\001\022\024\n\020TypeMediaGetPart\020\002\022\026\n\022TypeM" + "ediaTerminate\020\003\"\274\001\n\rMediaResponse\022(\n\004typ" + "e\030\001 \002(\0162\032.Remote.MediaResponse.Type\022\034\n\005e" + "rror\030\002 \001(\0132\r.Remote.Error\022(\n\004part\030\003 \001(\0132" + "\032.Remote.MediaResponse.Part\032\024\n\004Part\022\014\n\004d" + "ata\030\001 \002(\014\"#\n\004Type\022\r\n\tTypeError\020\001\022\014\n\010Type" + "Part\020\002*\"\n\016AudioCodecType\022\020\n\014CodecTypeOGA" + "\020\001*\"\n\016VideoCodecType\022\020\n\014CodecTypeOGV\020\001", 1158); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "media.proto", &protobuf_RegisterTypes); MediaRequest::default_instance_ = new MediaRequest(); MediaRequest_Prepare::default_instance_ = new MediaRequest_Prepare(); + MediaRequest_Prepare_Audio::default_instance_ = new MediaRequest_Prepare_Audio(); + MediaRequest_Prepare_Video::default_instance_ = new MediaRequest_Prepare_Video(); 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(); + MediaResponse_Part::default_instance_ = new MediaResponse_Part(); MediaRequest::default_instance_->InitAsDefaultInstance(); MediaRequest_Prepare::default_instance_->InitAsDefaultInstance(); + MediaRequest_Prepare_Audio::default_instance_->InitAsDefaultInstance(); + MediaRequest_Prepare_Video::default_instance_->InitAsDefaultInstance(); MediaRequest_GetPart::default_instance_->InitAsDefaultInstance(); MediaRequest_Terminate::default_instance_->InitAsDefaultInstance(); MediaResponse::default_instance_->InitAsDefaultInstance(); - MediaResponse_MediaPart::default_instance_->InitAsDefaultInstance(); + MediaResponse_Part::default_instance_->InitAsDefaultInstance(); ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_media_2eproto); } @@ -251,11 +315,24 @@ struct StaticDescriptorInitializer_media_2eproto { protobuf_AddDesc_media_2eproto(); } } static_descriptor_initializer_media_2eproto_; -const ::google::protobuf::EnumDescriptor* CodecType_descriptor() { +const ::google::protobuf::EnumDescriptor* AudioCodecType_descriptor() { protobuf_AssignDescriptorsOnce(); - return CodecType_descriptor_; + return AudioCodecType_descriptor_; } -bool CodecType_IsValid(int value) { +bool AudioCodecType_IsValid(int value) { + switch(value) { + case 1: + return true; + default: + return false; + } +} + +const ::google::protobuf::EnumDescriptor* VideoCodecType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return VideoCodecType_descriptor_; +} +bool VideoCodecType_IsValid(int value) { switch(value) { case 1: return true; @@ -284,118 +361,183 @@ bool MediaRequest_Type_IsValid(int value) { #ifndef _MSC_VER const MediaRequest_Type MediaRequest::TypeMediaPrepare; -const MediaRequest_Type MediaRequest::TypeMediaGet; +const MediaRequest_Type MediaRequest::TypeMediaGetPart; 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 +const ::google::protobuf::EnumDescriptor* MediaRequest_Prepare_Type_descriptor() { + protobuf_AssignDescriptorsOnce(); + return MediaRequest_Prepare_Type_descriptor_; +} +bool MediaRequest_Prepare_Type_IsValid(int value) { + switch(value) { + case 1: + case 2: + return true; + default: + return false; + } +} + #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; +const MediaRequest_Prepare_Type MediaRequest_Prepare::AudioRequest; +const MediaRequest_Prepare_Type MediaRequest_Prepare::VideoRequest; +const MediaRequest_Prepare_Type MediaRequest_Prepare::Type_MIN; +const MediaRequest_Prepare_Type MediaRequest_Prepare::Type_MAX; +const int MediaRequest_Prepare::Type_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int MediaRequest_Prepare_Audio::kTrackIdFieldNumber; +const int MediaRequest_Prepare_Audio::kCodecTypeFieldNumber; +const int MediaRequest_Prepare_Audio::kBitrateFieldNumber; +const int MediaRequest_Prepare_Audio::kStreamIdxFieldNumber; +const int MediaRequest_Prepare_Audio::kOffsetSecsFieldNumber; #endif // !_MSC_VER -MediaRequest_Prepare::MediaRequest_Prepare() +MediaRequest_Prepare_Audio::MediaRequest_Prepare_Audio() : ::google::protobuf::Message() { SharedCtor(); } -void MediaRequest_Prepare::InitAsDefaultInstance() { +void MediaRequest_Prepare_Audio::InitAsDefaultInstance() { } -MediaRequest_Prepare::MediaRequest_Prepare(const MediaRequest_Prepare& from) +MediaRequest_Prepare_Audio::MediaRequest_Prepare_Audio(const MediaRequest_Prepare_Audio& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } -void MediaRequest_Prepare::SharedCtor() { +void MediaRequest_Prepare_Audio::SharedCtor() { _cached_size_ = 0; - id_ = GOOGLE_LONGLONG(0); - offset_secs_ = 0u; + track_id_ = GOOGLE_LONGLONG(0); codec_type_ = 1; - audio_bitrate_ = 0u; - video_bitrate_ = 0u; - audio_stream_idx_ = 0u; - video_stream_idx_ = 0u; - subtitle_stream_idx_ = 0u; + bitrate_ = 0u; + stream_idx_ = 0u; + offset_secs_ = 0u; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } -MediaRequest_Prepare::~MediaRequest_Prepare() { +MediaRequest_Prepare_Audio::~MediaRequest_Prepare_Audio() { SharedDtor(); } -void MediaRequest_Prepare::SharedDtor() { +void MediaRequest_Prepare_Audio::SharedDtor() { if (this != default_instance_) { } } -void MediaRequest_Prepare::SetCachedSize(int size) const { +void MediaRequest_Prepare_Audio::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } -const ::google::protobuf::Descriptor* MediaRequest_Prepare::descriptor() { +const ::google::protobuf::Descriptor* MediaRequest_Prepare_Audio::descriptor() { protobuf_AssignDescriptorsOnce(); - return MediaRequest_Prepare_descriptor_; + return MediaRequest_Prepare_Audio_descriptor_; } -const MediaRequest_Prepare& MediaRequest_Prepare::default_instance() { +const MediaRequest_Prepare_Audio& MediaRequest_Prepare_Audio::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_media_2eproto(); return *default_instance_; } -MediaRequest_Prepare* MediaRequest_Prepare::default_instance_ = NULL; +MediaRequest_Prepare_Audio* MediaRequest_Prepare_Audio::default_instance_ = NULL; -MediaRequest_Prepare* MediaRequest_Prepare::New() const { - return new MediaRequest_Prepare; +MediaRequest_Prepare_Audio* MediaRequest_Prepare_Audio::New() const { + return new MediaRequest_Prepare_Audio; } -void MediaRequest_Prepare::Clear() { +void MediaRequest_Prepare_Audio::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - id_ = GOOGLE_LONGLONG(0); - offset_secs_ = 0u; + track_id_ = GOOGLE_LONGLONG(0); codec_type_ = 1; - audio_bitrate_ = 0u; - video_bitrate_ = 0u; - audio_stream_idx_ = 0u; - video_stream_idx_ = 0u; - subtitle_stream_idx_ = 0u; + bitrate_ = 0u; + stream_idx_ = 0u; + offset_secs_ = 0u; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } -bool MediaRequest_Prepare::MergePartialFromCodedStream( +bool MediaRequest_Prepare_Audio::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; + // required int64 track_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(); + input, &track_id_))); + set_has_track_id(); } else { goto handle_uninterpreted; } - if (input->ExpectTag(16)) goto parse_offset_secs; + if (input->ExpectTag(16)) goto parse_codec_type; break; } - // required uint32 offset_secs = 2; + // optional .Remote.AudioCodecType codec_type = 2; case 2: { + 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 (::Remote::AudioCodecType_IsValid(value)) { + set_codec_type(static_cast< ::Remote::AudioCodecType >(value)); + } else { + mutable_unknown_fields()->AddVarint(2, value); + } + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(24)) goto parse_bitrate; + break; + } + + // optional uint32 bitrate = 3; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_bitrate: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &bitrate_))); + set_has_bitrate(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(32)) goto parse_stream_idx; + break; + } + + // optional uint32 stream_idx = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_stream_idx: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &stream_idx_))); + set_has_stream_idx(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(40)) goto parse_offset_secs; + break; + } + + // optional uint32 offset_secs = 5; + case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_offset_secs: @@ -406,12 +548,324 @@ bool MediaRequest_Prepare::MergePartialFromCodedStream( } else { goto handle_uninterpreted; } - if (input->ExpectTag(24)) goto parse_codec_type; + if (input->ExpectAtEnd()) return true; break; } - // optional .Remote.CodecType codec_type = 3; - case 3: { + 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_Audio::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required int64 track_id = 1; + if (has_track_id()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->track_id(), output); + } + + // optional .Remote.AudioCodecType codec_type = 2; + if (has_codec_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->codec_type(), output); + } + + // optional uint32 bitrate = 3; + if (has_bitrate()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->bitrate(), output); + } + + // optional uint32 stream_idx = 4; + if (has_stream_idx()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->stream_idx(), output); + } + + // optional uint32 offset_secs = 5; + if (has_offset_secs()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->offset_secs(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* MediaRequest_Prepare_Audio::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // required int64 track_id = 1; + if (has_track_id()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->track_id(), target); + } + + // optional .Remote.AudioCodecType codec_type = 2; + if (has_codec_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->codec_type(), target); + } + + // optional uint32 bitrate = 3; + if (has_bitrate()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->bitrate(), target); + } + + // optional uint32 stream_idx = 4; + if (has_stream_idx()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->stream_idx(), target); + } + + // optional uint32 offset_secs = 5; + if (has_offset_secs()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->offset_secs(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int MediaRequest_Prepare_Audio::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int64 track_id = 1; + if (has_track_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->track_id()); + } + + // optional .Remote.AudioCodecType codec_type = 2; + if (has_codec_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->codec_type()); + } + + // optional uint32 bitrate = 3; + if (has_bitrate()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->bitrate()); + } + + // optional uint32 stream_idx = 4; + if (has_stream_idx()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->stream_idx()); + } + + // optional uint32 offset_secs = 5; + if (has_offset_secs()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->offset_secs()); + } + + } + 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_Audio::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const MediaRequest_Prepare_Audio* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void MediaRequest_Prepare_Audio::MergeFrom(const MediaRequest_Prepare_Audio& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_track_id()) { + set_track_id(from.track_id()); + } + if (from.has_codec_type()) { + set_codec_type(from.codec_type()); + } + if (from.has_bitrate()) { + set_bitrate(from.bitrate()); + } + if (from.has_stream_idx()) { + set_stream_idx(from.stream_idx()); + } + if (from.has_offset_secs()) { + set_offset_secs(from.offset_secs()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void MediaRequest_Prepare_Audio::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MediaRequest_Prepare_Audio::CopyFrom(const MediaRequest_Prepare_Audio& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MediaRequest_Prepare_Audio::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + return true; +} + +void MediaRequest_Prepare_Audio::Swap(MediaRequest_Prepare_Audio* other) { + if (other != this) { + std::swap(track_id_, other->track_id_); + std::swap(codec_type_, other->codec_type_); + std::swap(bitrate_, other->bitrate_); + std::swap(stream_idx_, other->stream_idx_); + std::swap(offset_secs_, other->offset_secs_); + 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_Audio::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = MediaRequest_Prepare_Audio_descriptor_; + metadata.reflection = MediaRequest_Prepare_Audio_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int MediaRequest_Prepare_Video::kVideoIdFieldNumber; +const int MediaRequest_Prepare_Video::kCodecTypeFieldNumber; +const int MediaRequest_Prepare_Video::kBitrateFieldNumber; +const int MediaRequest_Prepare_Video::kOffsetSecsFieldNumber; +const int MediaRequest_Prepare_Video::kAudioStreamIdxFieldNumber; +const int MediaRequest_Prepare_Video::kVideoStreamIdxFieldNumber; +const int MediaRequest_Prepare_Video::kSubtitleStreamIdxFieldNumber; +#endif // !_MSC_VER + +MediaRequest_Prepare_Video::MediaRequest_Prepare_Video() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void MediaRequest_Prepare_Video::InitAsDefaultInstance() { +} + +MediaRequest_Prepare_Video::MediaRequest_Prepare_Video(const MediaRequest_Prepare_Video& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void MediaRequest_Prepare_Video::SharedCtor() { + _cached_size_ = 0; + video_id_ = GOOGLE_LONGLONG(0); + codec_type_ = 1; + bitrate_ = 0u; + offset_secs_ = 0u; + audio_stream_idx_ = 0u; + video_stream_idx_ = 0u; + subtitle_stream_idx_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MediaRequest_Prepare_Video::~MediaRequest_Prepare_Video() { + SharedDtor(); +} + +void MediaRequest_Prepare_Video::SharedDtor() { + if (this != default_instance_) { + } +} + +void MediaRequest_Prepare_Video::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* MediaRequest_Prepare_Video::descriptor() { + protobuf_AssignDescriptorsOnce(); + return MediaRequest_Prepare_Video_descriptor_; +} + +const MediaRequest_Prepare_Video& MediaRequest_Prepare_Video::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_media_2eproto(); + return *default_instance_; +} + +MediaRequest_Prepare_Video* MediaRequest_Prepare_Video::default_instance_ = NULL; + +MediaRequest_Prepare_Video* MediaRequest_Prepare_Video::New() const { + return new MediaRequest_Prepare_Video; +} + +void MediaRequest_Prepare_Video::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + video_id_ = GOOGLE_LONGLONG(0); + codec_type_ = 1; + bitrate_ = 0u; + offset_secs_ = 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_Video::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 video_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, &video_id_))); + set_has_video_id(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(16)) goto parse_codec_type; + break; + } + + // optional .Remote.VideoCodecType codec_type = 2; + case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_codec_type: @@ -419,52 +873,52 @@ bool MediaRequest_Prepare::MergePartialFromCodedStream( DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); - if (::Remote::CodecType_IsValid(value)) { - set_codec_type(static_cast< ::Remote::CodecType >(value)); + if (::Remote::VideoCodecType_IsValid(value)) { + set_codec_type(static_cast< ::Remote::VideoCodecType >(value)); } else { - mutable_unknown_fields()->AddVarint(3, value); + mutable_unknown_fields()->AddVarint(2, value); } } else { goto handle_uninterpreted; } - if (input->ExpectTag(32)) goto parse_audio_bitrate; + if (input->ExpectTag(24)) goto parse_bitrate; break; } - // optional uint32 audio_bitrate = 4; + // optional uint32 bitrate = 3; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_bitrate: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &bitrate_))); + set_has_bitrate(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(32)) goto parse_offset_secs; + break; + } + + // optional uint32 offset_secs = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { - parse_audio_bitrate: + parse_offset_secs: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( - input, &audio_bitrate_))); - set_has_audio_bitrate(); + input, &offset_secs_))); + set_has_offset_secs(); } else { goto handle_uninterpreted; } - if (input->ExpectTag(40)) goto parse_video_bitrate; + if (input->ExpectTag(40)) goto parse_audio_stream_idx; break; } - // optional uint32 video_bitrate = 5; + // optional uint32 audio_stream_idx = 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: @@ -475,12 +929,12 @@ bool MediaRequest_Prepare::MergePartialFromCodedStream( } else { goto handle_uninterpreted; } - if (input->ExpectTag(56)) goto parse_video_stream_idx; + if (input->ExpectTag(48)) goto parse_video_stream_idx; break; } - // optional uint32 video_stream_idx = 7; - case 7: { + // optional uint32 video_stream_idx = 6; + case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_video_stream_idx: @@ -491,12 +945,12 @@ bool MediaRequest_Prepare::MergePartialFromCodedStream( } else { goto handle_uninterpreted; } - if (input->ExpectTag(64)) goto parse_subtitle_stream_idx; + if (input->ExpectTag(56)) goto parse_subtitle_stream_idx; break; } - // optional uint32 subtitle_stream_idx = 8; - case 8: { + // optional uint32 subtitle_stream_idx = 7; + case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_subtitle_stream_idx: @@ -527,47 +981,407 @@ bool MediaRequest_Prepare::MergePartialFromCodedStream( #undef DO_ } -void MediaRequest_Prepare::SerializeWithCachedSizes( +void MediaRequest_Prepare_Video::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { - // required int64 id = 1; - if (has_id()) { - ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->id(), output); + // required int64 video_id = 1; + if (has_video_id()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->video_id(), output); } - // required uint32 offset_secs = 2; - if (has_offset_secs()) { - ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->offset_secs(), output); - } - - // optional .Remote.CodecType codec_type = 3; + // optional .Remote.VideoCodecType codec_type = 2; if (has_codec_type()) { ::google::protobuf::internal::WireFormatLite::WriteEnum( - 3, this->codec_type(), output); + 2, 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 bitrate = 3; + if (has_bitrate()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->bitrate(), output); } - // optional uint32 video_bitrate = 5; - if (has_video_bitrate()) { - ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->video_bitrate(), output); + // optional uint32 offset_secs = 4; + if (has_offset_secs()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->offset_secs(), output); } - // optional uint32 audio_stream_idx = 6; + // optional uint32 audio_stream_idx = 5; if (has_audio_stream_idx()) { - ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->audio_stream_idx(), output); + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->audio_stream_idx(), output); } - // optional uint32 video_stream_idx = 7; + // optional uint32 video_stream_idx = 6; if (has_video_stream_idx()) { - ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->video_stream_idx(), output); + ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->video_stream_idx(), output); } - // optional uint32 subtitle_stream_idx = 8; + // optional uint32 subtitle_stream_idx = 7; if (has_subtitle_stream_idx()) { - ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->subtitle_stream_idx(), output); + ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->subtitle_stream_idx(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* MediaRequest_Prepare_Video::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // required int64 video_id = 1; + if (has_video_id()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->video_id(), target); + } + + // optional .Remote.VideoCodecType codec_type = 2; + if (has_codec_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 2, this->codec_type(), target); + } + + // optional uint32 bitrate = 3; + if (has_bitrate()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->bitrate(), target); + } + + // optional uint32 offset_secs = 4; + if (has_offset_secs()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->offset_secs(), target); + } + + // optional uint32 audio_stream_idx = 5; + if (has_audio_stream_idx()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->audio_stream_idx(), target); + } + + // optional uint32 video_stream_idx = 6; + if (has_video_stream_idx()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->video_stream_idx(), target); + } + + // optional uint32 subtitle_stream_idx = 7; + if (has_subtitle_stream_idx()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->subtitle_stream_idx(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int MediaRequest_Prepare_Video::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int64 video_id = 1; + if (has_video_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->video_id()); + } + + // optional .Remote.VideoCodecType codec_type = 2; + if (has_codec_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->codec_type()); + } + + // optional uint32 bitrate = 3; + if (has_bitrate()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->bitrate()); + } + + // optional uint32 offset_secs = 4; + if (has_offset_secs()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->offset_secs()); + } + + // optional uint32 audio_stream_idx = 5; + if (has_audio_stream_idx()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->audio_stream_idx()); + } + + // optional uint32 video_stream_idx = 6; + if (has_video_stream_idx()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->video_stream_idx()); + } + + // optional uint32 subtitle_stream_idx = 7; + 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_Video::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const MediaRequest_Prepare_Video* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void MediaRequest_Prepare_Video::MergeFrom(const MediaRequest_Prepare_Video& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_video_id()) { + set_video_id(from.video_id()); + } + if (from.has_codec_type()) { + set_codec_type(from.codec_type()); + } + if (from.has_bitrate()) { + set_bitrate(from.bitrate()); + } + if (from.has_offset_secs()) { + set_offset_secs(from.offset_secs()); + } + 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_Video::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MediaRequest_Prepare_Video::CopyFrom(const MediaRequest_Prepare_Video& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MediaRequest_Prepare_Video::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + return true; +} + +void MediaRequest_Prepare_Video::Swap(MediaRequest_Prepare_Video* other) { + if (other != this) { + std::swap(video_id_, other->video_id_); + std::swap(codec_type_, other->codec_type_); + std::swap(bitrate_, other->bitrate_); + std::swap(offset_secs_, other->offset_secs_); + 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_Video::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = MediaRequest_Prepare_Video_descriptor_; + metadata.reflection = MediaRequest_Prepare_Video_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int MediaRequest_Prepare::kTypeFieldNumber; +const int MediaRequest_Prepare::kAudioFieldNumber; +const int MediaRequest_Prepare::kVideoFieldNumber; +#endif // !_MSC_VER + +MediaRequest_Prepare::MediaRequest_Prepare() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void MediaRequest_Prepare::InitAsDefaultInstance() { + audio_ = const_cast< ::Remote::MediaRequest_Prepare_Audio*>(&::Remote::MediaRequest_Prepare_Audio::default_instance()); + video_ = const_cast< ::Remote::MediaRequest_Prepare_Video*>(&::Remote::MediaRequest_Prepare_Video::default_instance()); +} + +MediaRequest_Prepare::MediaRequest_Prepare(const MediaRequest_Prepare& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void MediaRequest_Prepare::SharedCtor() { + _cached_size_ = 0; + type_ = 1; + audio_ = NULL; + video_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MediaRequest_Prepare::~MediaRequest_Prepare() { + SharedDtor(); +} + +void MediaRequest_Prepare::SharedDtor() { + if (this != default_instance_) { + delete audio_; + delete video_; + } +} + +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))) { + type_ = 1; + if (has_audio()) { + if (audio_ != NULL) audio_->::Remote::MediaRequest_Prepare_Audio::Clear(); + } + if (has_video()) { + if (video_ != NULL) video_->::Remote::MediaRequest_Prepare_Video::Clear(); + } + } + ::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 .Remote.MediaRequest.Prepare.Type 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 (::Remote::MediaRequest_Prepare_Type_IsValid(value)) { + set_type(static_cast< ::Remote::MediaRequest_Prepare_Type >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(18)) goto parse_audio; + break; + } + + // optional .Remote.MediaRequest.Prepare.Audio audio = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_audio: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_audio())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(26)) goto parse_video; + break; + } + + // optional .Remote.MediaRequest.Prepare.Video video = 3; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_video: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_video())); + } 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 .Remote.MediaRequest.Prepare.Type type = 1; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->type(), output); + } + + // optional .Remote.MediaRequest.Prepare.Audio audio = 2; + if (has_audio()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->audio(), output); + } + + // optional .Remote.MediaRequest.Prepare.Video video = 3; + if (has_video()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->video(), output); } if (!unknown_fields().empty()) { @@ -578,45 +1392,24 @@ void MediaRequest_Prepare::SerializeWithCachedSizes( ::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 .Remote.CodecType codec_type = 3; - if (has_codec_type()) { + // required .Remote.MediaRequest.Prepare.Type type = 1; + if (has_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( - 3, this->codec_type(), target); + 1, this->type(), target); } - // optional uint32 audio_bitrate = 4; - if (has_audio_bitrate()) { - target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->audio_bitrate(), target); + // optional .Remote.MediaRequest.Prepare.Audio audio = 2; + if (has_audio()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->audio(), 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); + // optional .Remote.MediaRequest.Prepare.Video video = 3; + if (has_video()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->video(), target); } if (!unknown_fields().empty()) { @@ -630,59 +1423,24 @@ int MediaRequest_Prepare::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - // required int64 id = 1; - if (has_id()) { + // required .Remote.MediaRequest.Prepare.Type type = 1; + if (has_type()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::Int64Size( - this->id()); + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); } - // required uint32 offset_secs = 2; - if (has_offset_secs()) { + // optional .Remote.MediaRequest.Prepare.Audio audio = 2; + if (has_audio()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::UInt32Size( - this->offset_secs()); + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->audio()); } - // optional .Remote.CodecType codec_type = 3; - if (has_codec_type()) { + // optional .Remote.MediaRequest.Prepare.Video video = 3; + if (has_video()) { 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()); + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->video()); } } @@ -712,29 +1470,14 @@ void MediaRequest_Prepare::MergeFrom(const ::google::protobuf::Message& from) { 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_type()) { + set_type(from.type()); } - if (from.has_offset_secs()) { - set_offset_secs(from.offset_secs()); + if (from.has_audio()) { + mutable_audio()->::Remote::MediaRequest_Prepare_Audio::MergeFrom(from.audio()); } - 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()); + if (from.has_video()) { + mutable_video()->::Remote::MediaRequest_Prepare_Video::MergeFrom(from.video()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); @@ -753,21 +1496,22 @@ void MediaRequest_Prepare::CopyFrom(const MediaRequest_Prepare& from) { } bool MediaRequest_Prepare::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + if (has_audio()) { + if (!this->audio().IsInitialized()) return false; + } + if (has_video()) { + if (!this->video().IsInitialized()) 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(type_, other->type_); + std::swap(audio_, other->audio_); + std::swap(video_, other->video_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); @@ -1151,7 +1895,7 @@ void MediaRequest_Terminate::Swap(MediaRequest_Terminate* other) { // ------------------------------------------------------------------- #ifndef _MSC_VER -const int MediaRequest::kRequestTypeFieldNumber; +const int MediaRequest::kTypeFieldNumber; const int MediaRequest::kPrepareFieldNumber; const int MediaRequest::kGetPartFieldNumber; const int MediaRequest::kTerminateFieldNumber; @@ -1176,7 +1920,7 @@ MediaRequest::MediaRequest(const MediaRequest& from) void MediaRequest::SharedCtor() { _cached_size_ = 0; - request_type_ = 1; + type_ = 1; prepare_ = NULL; get_part_ = NULL; terminate_ = NULL; @@ -1218,7 +1962,7 @@ MediaRequest* MediaRequest::New() const { void MediaRequest::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - request_type_ = 1; + type_ = 1; if (has_prepare()) { if (prepare_ != NULL) prepare_->::Remote::MediaRequest_Prepare::Clear(); } @@ -1239,7 +1983,7 @@ bool MediaRequest::MergePartialFromCodedStream( ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required .Remote.MediaRequest.Type request_type = 1; + // required .Remote.MediaRequest.Type type = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { @@ -1248,7 +1992,7 @@ bool MediaRequest::MergePartialFromCodedStream( int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); if (::Remote::MediaRequest_Type_IsValid(value)) { - set_request_type(static_cast< ::Remote::MediaRequest_Type >(value)); + set_type(static_cast< ::Remote::MediaRequest_Type >(value)); } else { mutable_unknown_fields()->AddVarint(1, value); } @@ -1319,10 +2063,10 @@ bool MediaRequest::MergePartialFromCodedStream( void MediaRequest::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { - // required .Remote.MediaRequest.Type request_type = 1; - if (has_request_type()) { + // required .Remote.MediaRequest.Type type = 1; + if (has_type()) { ::google::protobuf::internal::WireFormatLite::WriteEnum( - 1, this->request_type(), output); + 1, this->type(), output); } // optional .Remote.MediaRequest.Prepare prepare = 2; @@ -1351,10 +2095,10 @@ void MediaRequest::SerializeWithCachedSizes( ::google::protobuf::uint8* MediaRequest::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { - // required .Remote.MediaRequest.Type request_type = 1; - if (has_request_type()) { + // required .Remote.MediaRequest.Type type = 1; + if (has_type()) { target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( - 1, this->request_type(), target); + 1, this->type(), target); } // optional .Remote.MediaRequest.Prepare prepare = 2; @@ -1389,10 +2133,10 @@ int MediaRequest::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - // required .Remote.MediaRequest.Type request_type = 1; - if (has_request_type()) { + // required .Remote.MediaRequest.Type type = 1; + if (has_type()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::EnumSize(this->request_type()); + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); } // optional .Remote.MediaRequest.Prepare prepare = 2; @@ -1443,8 +2187,8 @@ void MediaRequest::MergeFrom(const ::google::protobuf::Message& from) { 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_type()) { + set_type(from.type()); } if (from.has_prepare()) { mutable_prepare()->::Remote::MediaRequest_Prepare::MergeFrom(from.prepare()); @@ -1485,7 +2229,7 @@ bool MediaRequest::IsInitialized() const { void MediaRequest::Swap(MediaRequest* other) { if (other != this) { - std::swap(request_type_, other->request_type_); + std::swap(type_, other->type_); std::swap(prepare_, other->prepare_); std::swap(get_part_, other->get_part_); std::swap(terminate_, other->terminate_); @@ -1513,6 +2257,7 @@ const ::google::protobuf::EnumDescriptor* MediaResponse_Type_descriptor() { bool MediaResponse_Type_IsValid(int value) { switch(value) { case 1: + case 2: return true; default: return false; @@ -1520,107 +2265,96 @@ bool MediaResponse_Type_IsValid(int value) { } #ifndef _MSC_VER -const MediaResponse_Type MediaResponse::TypeMediaPart; +const MediaResponse_Type MediaResponse::TypeError; +const MediaResponse_Type MediaResponse::TypePart; 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; +const int MediaResponse_Part::kDataFieldNumber; #endif // !_MSC_VER -MediaResponse_MediaPart::MediaResponse_MediaPart() +MediaResponse_Part::MediaResponse_Part() : ::google::protobuf::Message() { SharedCtor(); } -void MediaResponse_MediaPart::InitAsDefaultInstance() { +void MediaResponse_Part::InitAsDefaultInstance() { } -MediaResponse_MediaPart::MediaResponse_MediaPart(const MediaResponse_MediaPart& from) +MediaResponse_Part::MediaResponse_Part(const MediaResponse_Part& from) : ::google::protobuf::Message() { SharedCtor(); MergeFrom(from); } -void MediaResponse_MediaPart::SharedCtor() { +void MediaResponse_Part::SharedCtor() { _cached_size_ = 0; - byte_offset_ = GOOGLE_ULONGLONG(0); + data_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); ::memset(_has_bits_, 0, sizeof(_has_bits_)); } -MediaResponse_MediaPart::~MediaResponse_MediaPart() { +MediaResponse_Part::~MediaResponse_Part() { SharedDtor(); } -void MediaResponse_MediaPart::SharedDtor() { +void MediaResponse_Part::SharedDtor() { + if (data_ != &::google::protobuf::internal::kEmptyString) { + delete data_; + } if (this != default_instance_) { } } -void MediaResponse_MediaPart::SetCachedSize(int size) const { +void MediaResponse_Part::SetCachedSize(int size) const { GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); _cached_size_ = size; GOOGLE_SAFE_CONCURRENT_WRITES_END(); } -const ::google::protobuf::Descriptor* MediaResponse_MediaPart::descriptor() { +const ::google::protobuf::Descriptor* MediaResponse_Part::descriptor() { protobuf_AssignDescriptorsOnce(); - return MediaResponse_MediaPart_descriptor_; + return MediaResponse_Part_descriptor_; } -const MediaResponse_MediaPart& MediaResponse_MediaPart::default_instance() { +const MediaResponse_Part& MediaResponse_Part::default_instance() { if (default_instance_ == NULL) protobuf_AddDesc_media_2eproto(); return *default_instance_; } -MediaResponse_MediaPart* MediaResponse_MediaPart::default_instance_ = NULL; +MediaResponse_Part* MediaResponse_Part::default_instance_ = NULL; -MediaResponse_MediaPart* MediaResponse_MediaPart::New() const { - return new MediaResponse_MediaPart; +MediaResponse_Part* MediaResponse_Part::New() const { + return new MediaResponse_Part; } -void MediaResponse_MediaPart::Clear() { +void MediaResponse_Part::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - byte_offset_ = GOOGLE_ULONGLONG(0); + if (has_data()) { + if (data_ != &::google::protobuf::internal::kEmptyString) { + data_->clear(); + } + } } - data_.Clear(); ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); } -bool MediaResponse_MediaPart::MergePartialFromCodedStream( +bool MediaResponse_Part::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; + // required bytes data = 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())); + input, this->mutable_data())); } else { goto handle_uninterpreted; } - if (input->ExpectTag(18)) goto parse_data; if (input->ExpectAtEnd()) return true; break; } @@ -1641,17 +2375,12 @@ bool MediaResponse_MediaPart::MergePartialFromCodedStream( #undef DO_ } -void MediaResponse_MediaPart::SerializeWithCachedSizes( +void MediaResponse_Part::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++) { + // required bytes data = 1; + if (has_data()) { ::google::protobuf::internal::WireFormatLite::WriteBytes( - 2, this->data(i), output); + 1, this->data(), output); } if (!unknown_fields().empty()) { @@ -1660,17 +2389,13 @@ void MediaResponse_MediaPart::SerializeWithCachedSizes( } } -::google::protobuf::uint8* MediaResponse_MediaPart::SerializeWithCachedSizesToArray( +::google::protobuf::uint8* MediaResponse_Part::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); + // required bytes data = 1; + if (has_data()) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 1, this->data(), target); } if (!unknown_fields().empty()) { @@ -1680,25 +2405,18 @@ void MediaResponse_MediaPart::SerializeWithCachedSizes( return target; } -int MediaResponse_MediaPart::ByteSize() const { +int MediaResponse_Part::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - // required uint64 byte_offset = 1; - if (has_byte_offset()) { + // required bytes data = 1; + if (has_data()) { total_size += 1 + - ::google::protobuf::internal::WireFormatLite::UInt64Size( - this->byte_offset()); + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->data()); } } - // 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( @@ -1710,10 +2428,10 @@ int MediaResponse_MediaPart::ByteSize() const { return total_size; } -void MediaResponse_MediaPart::MergeFrom(const ::google::protobuf::Message& from) { +void MediaResponse_Part::MergeFrom(const ::google::protobuf::Message& from) { GOOGLE_CHECK_NE(&from, this); - const MediaResponse_MediaPart* source = - ::google::protobuf::internal::dynamic_cast_if_available( + const MediaResponse_Part* source = + ::google::protobuf::internal::dynamic_cast_if_available( &from); if (source == NULL) { ::google::protobuf::internal::ReflectionOps::Merge(from, this); @@ -1722,50 +2440,48 @@ void MediaResponse_MediaPart::MergeFrom(const ::google::protobuf::Message& from) } } -void MediaResponse_MediaPart::MergeFrom(const MediaResponse_MediaPart& from) { +void MediaResponse_Part::MergeFrom(const MediaResponse_Part& 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()); + if (from.has_data()) { + set_data(from.data()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } -void MediaResponse_MediaPart::CopyFrom(const ::google::protobuf::Message& from) { +void MediaResponse_Part::CopyFrom(const ::google::protobuf::Message& from) { if (&from == this) return; Clear(); MergeFrom(from); } -void MediaResponse_MediaPart::CopyFrom(const MediaResponse_MediaPart& from) { +void MediaResponse_Part::CopyFrom(const MediaResponse_Part& from) { if (&from == this) return; Clear(); MergeFrom(from); } -bool MediaResponse_MediaPart::IsInitialized() const { +bool MediaResponse_Part::IsInitialized() const { if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; return true; } -void MediaResponse_MediaPart::Swap(MediaResponse_MediaPart* other) { +void MediaResponse_Part::Swap(MediaResponse_Part* other) { if (other != this) { - std::swap(byte_offset_, other->byte_offset_); - data_.Swap(&other->data_); + std::swap(data_, 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 { +::google::protobuf::Metadata MediaResponse_Part::GetMetadata() const { protobuf_AssignDescriptorsOnce(); ::google::protobuf::Metadata metadata; - metadata.descriptor = MediaResponse_MediaPart_descriptor_; - metadata.reflection = MediaResponse_MediaPart_reflection_; + metadata.descriptor = MediaResponse_Part_descriptor_; + metadata.reflection = MediaResponse_Part_reflection_; return metadata; } @@ -1773,8 +2489,8 @@ void MediaResponse_MediaPart::Swap(MediaResponse_MediaPart* other) { // ------------------------------------------------------------------- #ifndef _MSC_VER +const int MediaResponse::kTypeFieldNumber; const int MediaResponse::kErrorFieldNumber; -const int MediaResponse::kResponseTypeFieldNumber; const int MediaResponse::kPartFieldNumber; #endif // !_MSC_VER @@ -1785,7 +2501,7 @@ MediaResponse::MediaResponse() void MediaResponse::InitAsDefaultInstance() { error_ = const_cast< ::Remote::Error*>(&::Remote::Error::default_instance()); - part_ = const_cast< ::Remote::MediaResponse_MediaPart*>(&::Remote::MediaResponse_MediaPart::default_instance()); + part_ = const_cast< ::Remote::MediaResponse_Part*>(&::Remote::MediaResponse_Part::default_instance()); } MediaResponse::MediaResponse(const MediaResponse& from) @@ -1796,8 +2512,8 @@ MediaResponse::MediaResponse(const MediaResponse& from) void MediaResponse::SharedCtor() { _cached_size_ = 0; + type_ = 1; error_ = NULL; - response_type_ = 1; part_ = NULL; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -1836,12 +2552,12 @@ MediaResponse* MediaResponse::New() const { void MediaResponse::Clear() { if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + type_ = 1; if (has_error()) { if (error_ != NULL) error_->::Remote::Error::Clear(); } - response_type_ = 1; if (has_part()) { - if (part_ != NULL) part_->::Remote::MediaResponse_MediaPart::Clear(); + if (part_ != NULL) part_->::Remote::MediaResponse_Part::Clear(); } } ::memset(_has_bits_, 0, sizeof(_has_bits_)); @@ -1854,41 +2570,41 @@ bool MediaResponse::MergePartialFromCodedStream( ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // required .Remote.Error error = 1; + // required .Remote.MediaResponse.Type type = 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 .Remote.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 (::Remote::MediaResponse_Type_IsValid(value)) { - set_response_type(static_cast< ::Remote::MediaResponse_Type >(value)); + set_type(static_cast< ::Remote::MediaResponse_Type >(value)); } else { - mutable_unknown_fields()->AddVarint(2, value); + mutable_unknown_fields()->AddVarint(1, value); } } else { goto handle_uninterpreted; } + if (input->ExpectTag(18)) goto parse_error; + break; + } + + // optional .Remote.Error error = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_error: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_error())); + } else { + goto handle_uninterpreted; + } if (input->ExpectTag(26)) goto parse_part; break; } - // optional .Remote.MediaResponse.MediaPart part = 3; + // optional .Remote.MediaResponse.Part part = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { @@ -1920,19 +2636,19 @@ bool MediaResponse::MergePartialFromCodedStream( void MediaResponse::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { - // required .Remote.Error error = 1; + // required .Remote.MediaResponse.Type type = 1; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->type(), output); + } + + // optional .Remote.Error error = 2; if (has_error()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, this->error(), output); + 2, this->error(), output); } - // required .Remote.MediaResponse.Type response_type = 2; - if (has_response_type()) { - ::google::protobuf::internal::WireFormatLite::WriteEnum( - 2, this->response_type(), output); - } - - // optional .Remote.MediaResponse.MediaPart part = 3; + // optional .Remote.MediaResponse.Part part = 3; if (has_part()) { ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 3, this->part(), output); @@ -1946,20 +2662,20 @@ void MediaResponse::SerializeWithCachedSizes( ::google::protobuf::uint8* MediaResponse::SerializeWithCachedSizesToArray( ::google::protobuf::uint8* target) const { - // required .Remote.Error error = 1; + // required .Remote.MediaResponse.Type type = 1; + if (has_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->type(), target); + } + + // optional .Remote.Error error = 2; if (has_error()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( - 1, this->error(), target); + 2, this->error(), target); } - // required .Remote.MediaResponse.Type response_type = 2; - if (has_response_type()) { - target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( - 2, this->response_type(), target); - } - - // optional .Remote.MediaResponse.MediaPart part = 3; + // optional .Remote.MediaResponse.Part part = 3; if (has_part()) { target = ::google::protobuf::internal::WireFormatLite:: WriteMessageNoVirtualToArray( @@ -1977,20 +2693,20 @@ int MediaResponse::ByteSize() const { int total_size = 0; if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { - // required .Remote.Error error = 1; + // required .Remote.MediaResponse.Type type = 1; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + // optional .Remote.Error error = 2; if (has_error()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( this->error()); } - // required .Remote.MediaResponse.Type response_type = 2; - if (has_response_type()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::EnumSize(this->response_type()); - } - - // optional .Remote.MediaResponse.MediaPart part = 3; + // optional .Remote.MediaResponse.Part part = 3; if (has_part()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( @@ -2024,14 +2740,14 @@ void MediaResponse::MergeFrom(const ::google::protobuf::Message& from) { void MediaResponse::MergeFrom(const MediaResponse& from) { GOOGLE_CHECK_NE(&from, this); if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_type()) { + set_type(from.type()); + } if (from.has_error()) { mutable_error()->::Remote::Error::MergeFrom(from.error()); } - if (from.has_response_type()) { - set_response_type(from.response_type()); - } if (from.has_part()) { - mutable_part()->::Remote::MediaResponse_MediaPart::MergeFrom(from.part()); + mutable_part()->::Remote::MediaResponse_Part::MergeFrom(from.part()); } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); @@ -2050,7 +2766,7 @@ void MediaResponse::CopyFrom(const MediaResponse& from) { } bool MediaResponse::IsInitialized() const { - if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; if (has_error()) { if (!this->error().IsInitialized()) return false; @@ -2063,8 +2779,8 @@ bool MediaResponse::IsInitialized() const { void MediaResponse::Swap(MediaResponse* other) { if (other != this) { + std::swap(type_, other->type_); 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_); diff --git a/remote/messages/media.pb.h b/remote/messages/media.pb.h index 05c1f95e..679be240 100644 --- a/remote/messages/media.pb.h +++ b/remote/messages/media.pb.h @@ -37,14 +37,35 @@ void protobuf_ShutdownFile_media_2eproto(); class MediaRequest; class MediaRequest_Prepare; +class MediaRequest_Prepare_Audio; +class MediaRequest_Prepare_Video; class MediaRequest_GetPart; class MediaRequest_Terminate; class MediaResponse; -class MediaResponse_MediaPart; +class MediaResponse_Part; +enum MediaRequest_Prepare_Type { + MediaRequest_Prepare_Type_AudioRequest = 1, + MediaRequest_Prepare_Type_VideoRequest = 2 +}; +bool MediaRequest_Prepare_Type_IsValid(int value); +const MediaRequest_Prepare_Type MediaRequest_Prepare_Type_Type_MIN = MediaRequest_Prepare_Type_AudioRequest; +const MediaRequest_Prepare_Type MediaRequest_Prepare_Type_Type_MAX = MediaRequest_Prepare_Type_VideoRequest; +const int MediaRequest_Prepare_Type_Type_ARRAYSIZE = MediaRequest_Prepare_Type_Type_MAX + 1; + +const ::google::protobuf::EnumDescriptor* MediaRequest_Prepare_Type_descriptor(); +inline const ::std::string& MediaRequest_Prepare_Type_Name(MediaRequest_Prepare_Type value) { + return ::google::protobuf::internal::NameOfEnum( + MediaRequest_Prepare_Type_descriptor(), value); +} +inline bool MediaRequest_Prepare_Type_Parse( + const ::std::string& name, MediaRequest_Prepare_Type* value) { + return ::google::protobuf::internal::ParseNamedEnum( + MediaRequest_Prepare_Type_descriptor(), name, value); +} enum MediaRequest_Type { MediaRequest_Type_TypeMediaPrepare = 1, - MediaRequest_Type_TypeMediaGet = 2, + MediaRequest_Type_TypeMediaGetPart = 2, MediaRequest_Type_TypeMediaTerminate = 3 }; bool MediaRequest_Type_IsValid(int value); @@ -63,11 +84,12 @@ inline bool MediaRequest_Type_Parse( MediaRequest_Type_descriptor(), name, value); } enum MediaResponse_Type { - MediaResponse_Type_TypeMediaPart = 1 + MediaResponse_Type_TypeError = 1, + MediaResponse_Type_TypePart = 2 }; bool MediaResponse_Type_IsValid(int value); -const MediaResponse_Type MediaResponse_Type_Type_MIN = MediaResponse_Type_TypeMediaPart; -const MediaResponse_Type MediaResponse_Type_Type_MAX = MediaResponse_Type_TypeMediaPart; +const MediaResponse_Type MediaResponse_Type_Type_MIN = MediaResponse_Type_TypeError; +const MediaResponse_Type MediaResponse_Type_Type_MAX = MediaResponse_Type_TypePart; const int MediaResponse_Type_Type_ARRAYSIZE = MediaResponse_Type_Type_MAX + 1; const ::google::protobuf::EnumDescriptor* MediaResponse_Type_descriptor(); @@ -80,26 +102,308 @@ inline bool MediaResponse_Type_Parse( return ::google::protobuf::internal::ParseNamedEnum( MediaResponse_Type_descriptor(), name, value); } -enum CodecType { - CodecTypeOGG = 1 +enum AudioCodecType { + CodecTypeOGA = 1 }; -bool CodecType_IsValid(int value); -const CodecType CodecType_MIN = CodecTypeOGG; -const CodecType CodecType_MAX = CodecTypeOGG; -const int CodecType_ARRAYSIZE = CodecType_MAX + 1; +bool AudioCodecType_IsValid(int value); +const AudioCodecType AudioCodecType_MIN = CodecTypeOGA; +const AudioCodecType AudioCodecType_MAX = CodecTypeOGA; +const int AudioCodecType_ARRAYSIZE = AudioCodecType_MAX + 1; -const ::google::protobuf::EnumDescriptor* CodecType_descriptor(); -inline const ::std::string& CodecType_Name(CodecType value) { +const ::google::protobuf::EnumDescriptor* AudioCodecType_descriptor(); +inline const ::std::string& AudioCodecType_Name(AudioCodecType value) { return ::google::protobuf::internal::NameOfEnum( - CodecType_descriptor(), value); + AudioCodecType_descriptor(), value); } -inline bool CodecType_Parse( - const ::std::string& name, CodecType* value) { - return ::google::protobuf::internal::ParseNamedEnum( - CodecType_descriptor(), name, value); +inline bool AudioCodecType_Parse( + const ::std::string& name, AudioCodecType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + AudioCodecType_descriptor(), name, value); +} +enum VideoCodecType { + CodecTypeOGV = 1 +}; +bool VideoCodecType_IsValid(int value); +const VideoCodecType VideoCodecType_MIN = CodecTypeOGV; +const VideoCodecType VideoCodecType_MAX = CodecTypeOGV; +const int VideoCodecType_ARRAYSIZE = VideoCodecType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* VideoCodecType_descriptor(); +inline const ::std::string& VideoCodecType_Name(VideoCodecType value) { + return ::google::protobuf::internal::NameOfEnum( + VideoCodecType_descriptor(), value); +} +inline bool VideoCodecType_Parse( + const ::std::string& name, VideoCodecType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + VideoCodecType_descriptor(), name, value); } // =================================================================== +class MediaRequest_Prepare_Audio : public ::google::protobuf::Message { + public: + MediaRequest_Prepare_Audio(); + virtual ~MediaRequest_Prepare_Audio(); + + MediaRequest_Prepare_Audio(const MediaRequest_Prepare_Audio& from); + + inline MediaRequest_Prepare_Audio& operator=(const MediaRequest_Prepare_Audio& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const MediaRequest_Prepare_Audio& default_instance(); + + void Swap(MediaRequest_Prepare_Audio* other); + + // implements Message ---------------------------------------------- + + MediaRequest_Prepare_Audio* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const MediaRequest_Prepare_Audio& from); + void MergeFrom(const MediaRequest_Prepare_Audio& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required int64 track_id = 1; + inline bool has_track_id() const; + inline void clear_track_id(); + static const int kTrackIdFieldNumber = 1; + inline ::google::protobuf::int64 track_id() const; + inline void set_track_id(::google::protobuf::int64 value); + + // optional .Remote.AudioCodecType codec_type = 2; + inline bool has_codec_type() const; + inline void clear_codec_type(); + static const int kCodecTypeFieldNumber = 2; + inline ::Remote::AudioCodecType codec_type() const; + inline void set_codec_type(::Remote::AudioCodecType value); + + // optional uint32 bitrate = 3; + inline bool has_bitrate() const; + inline void clear_bitrate(); + static const int kBitrateFieldNumber = 3; + inline ::google::protobuf::uint32 bitrate() const; + inline void set_bitrate(::google::protobuf::uint32 value); + + // optional uint32 stream_idx = 4; + inline bool has_stream_idx() const; + inline void clear_stream_idx(); + static const int kStreamIdxFieldNumber = 4; + inline ::google::protobuf::uint32 stream_idx() const; + inline void set_stream_idx(::google::protobuf::uint32 value); + + // optional uint32 offset_secs = 5; + inline bool has_offset_secs() const; + inline void clear_offset_secs(); + static const int kOffsetSecsFieldNumber = 5; + inline ::google::protobuf::uint32 offset_secs() const; + inline void set_offset_secs(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:Remote.MediaRequest.Prepare.Audio) + private: + inline void set_has_track_id(); + inline void clear_has_track_id(); + inline void set_has_codec_type(); + inline void clear_has_codec_type(); + inline void set_has_bitrate(); + inline void clear_has_bitrate(); + inline void set_has_stream_idx(); + inline void clear_has_stream_idx(); + inline void set_has_offset_secs(); + inline void clear_has_offset_secs(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::int64 track_id_; + int codec_type_; + ::google::protobuf::uint32 bitrate_; + ::google::protobuf::uint32 stream_idx_; + ::google::protobuf::uint32 offset_secs_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(5 + 31) / 32]; + + friend void protobuf_AddDesc_media_2eproto(); + friend void protobuf_AssignDesc_media_2eproto(); + friend void protobuf_ShutdownFile_media_2eproto(); + + void InitAsDefaultInstance(); + static MediaRequest_Prepare_Audio* default_instance_; +}; +// ------------------------------------------------------------------- + +class MediaRequest_Prepare_Video : public ::google::protobuf::Message { + public: + MediaRequest_Prepare_Video(); + virtual ~MediaRequest_Prepare_Video(); + + MediaRequest_Prepare_Video(const MediaRequest_Prepare_Video& from); + + inline MediaRequest_Prepare_Video& operator=(const MediaRequest_Prepare_Video& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const MediaRequest_Prepare_Video& default_instance(); + + void Swap(MediaRequest_Prepare_Video* other); + + // implements Message ---------------------------------------------- + + MediaRequest_Prepare_Video* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const MediaRequest_Prepare_Video& from); + void MergeFrom(const MediaRequest_Prepare_Video& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required int64 video_id = 1; + inline bool has_video_id() const; + inline void clear_video_id(); + static const int kVideoIdFieldNumber = 1; + inline ::google::protobuf::int64 video_id() const; + inline void set_video_id(::google::protobuf::int64 value); + + // optional .Remote.VideoCodecType codec_type = 2; + inline bool has_codec_type() const; + inline void clear_codec_type(); + static const int kCodecTypeFieldNumber = 2; + inline ::Remote::VideoCodecType codec_type() const; + inline void set_codec_type(::Remote::VideoCodecType value); + + // optional uint32 bitrate = 3; + inline bool has_bitrate() const; + inline void clear_bitrate(); + static const int kBitrateFieldNumber = 3; + inline ::google::protobuf::uint32 bitrate() const; + inline void set_bitrate(::google::protobuf::uint32 value); + + // optional uint32 offset_secs = 4; + inline bool has_offset_secs() const; + inline void clear_offset_secs(); + static const int kOffsetSecsFieldNumber = 4; + inline ::google::protobuf::uint32 offset_secs() const; + inline void set_offset_secs(::google::protobuf::uint32 value); + + // optional uint32 audio_stream_idx = 5; + inline bool has_audio_stream_idx() const; + inline void clear_audio_stream_idx(); + static const int kAudioStreamIdxFieldNumber = 5; + inline ::google::protobuf::uint32 audio_stream_idx() const; + inline void set_audio_stream_idx(::google::protobuf::uint32 value); + + // optional uint32 video_stream_idx = 6; + inline bool has_video_stream_idx() const; + inline void clear_video_stream_idx(); + static const int kVideoStreamIdxFieldNumber = 6; + inline ::google::protobuf::uint32 video_stream_idx() const; + inline void set_video_stream_idx(::google::protobuf::uint32 value); + + // optional uint32 subtitle_stream_idx = 7; + inline bool has_subtitle_stream_idx() const; + inline void clear_subtitle_stream_idx(); + static const int kSubtitleStreamIdxFieldNumber = 7; + inline ::google::protobuf::uint32 subtitle_stream_idx() const; + inline void set_subtitle_stream_idx(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:Remote.MediaRequest.Prepare.Video) + private: + inline void set_has_video_id(); + inline void clear_has_video_id(); + inline void set_has_codec_type(); + inline void clear_has_codec_type(); + inline void set_has_bitrate(); + inline void clear_has_bitrate(); + inline void set_has_offset_secs(); + inline void clear_has_offset_secs(); + inline void set_has_audio_stream_idx(); + inline void clear_has_audio_stream_idx(); + inline void set_has_video_stream_idx(); + inline void clear_has_video_stream_idx(); + inline void set_has_subtitle_stream_idx(); + inline void clear_has_subtitle_stream_idx(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::int64 video_id_; + int codec_type_; + ::google::protobuf::uint32 bitrate_; + ::google::protobuf::uint32 offset_secs_; + ::google::protobuf::uint32 audio_stream_idx_; + ::google::protobuf::uint32 video_stream_idx_; + ::google::protobuf::uint32 subtitle_stream_idx_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(7 + 31) / 32]; + + friend void protobuf_AddDesc_media_2eproto(); + friend void protobuf_AssignDesc_media_2eproto(); + friend void protobuf_ShutdownFile_media_2eproto(); + + void InitAsDefaultInstance(); + static MediaRequest_Prepare_Video* default_instance_; +}; +// ------------------------------------------------------------------- + class MediaRequest_Prepare : public ::google::protobuf::Message { public: MediaRequest_Prepare(); @@ -152,96 +456,77 @@ class MediaRequest_Prepare : public ::google::protobuf::Message { // nested types ---------------------------------------------------- + typedef MediaRequest_Prepare_Audio Audio; + typedef MediaRequest_Prepare_Video Video; + + typedef MediaRequest_Prepare_Type Type; + static const Type AudioRequest = MediaRequest_Prepare_Type_AudioRequest; + static const Type VideoRequest = MediaRequest_Prepare_Type_VideoRequest; + static inline bool Type_IsValid(int value) { + return MediaRequest_Prepare_Type_IsValid(value); + } + static const Type Type_MIN = + MediaRequest_Prepare_Type_Type_MIN; + static const Type Type_MAX = + MediaRequest_Prepare_Type_Type_MAX; + static const int Type_ARRAYSIZE = + MediaRequest_Prepare_Type_Type_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Type_descriptor() { + return MediaRequest_Prepare_Type_descriptor(); + } + static inline const ::std::string& Type_Name(Type value) { + return MediaRequest_Prepare_Type_Name(value); + } + static inline bool Type_Parse(const ::std::string& name, + Type* value) { + return MediaRequest_Prepare_Type_Parse(name, value); + } + // accessors ------------------------------------------------------- - // required int64 id = 1; - inline bool has_id() const; - inline void clear_id(); - static const int kIdFieldNumber = 1; - inline ::google::protobuf::int64 id() const; - inline void set_id(::google::protobuf::int64 value); + // required .Remote.MediaRequest.Prepare.Type type = 1; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 1; + inline ::Remote::MediaRequest_Prepare_Type type() const; + inline void set_type(::Remote::MediaRequest_Prepare_Type value); - // required uint32 offset_secs = 2; - inline bool has_offset_secs() const; - inline void clear_offset_secs(); - static const int kOffsetSecsFieldNumber = 2; - inline ::google::protobuf::uint32 offset_secs() const; - inline void set_offset_secs(::google::protobuf::uint32 value); + // optional .Remote.MediaRequest.Prepare.Audio audio = 2; + inline bool has_audio() const; + inline void clear_audio(); + static const int kAudioFieldNumber = 2; + inline const ::Remote::MediaRequest_Prepare_Audio& audio() const; + inline ::Remote::MediaRequest_Prepare_Audio* mutable_audio(); + inline ::Remote::MediaRequest_Prepare_Audio* release_audio(); + inline void set_allocated_audio(::Remote::MediaRequest_Prepare_Audio* audio); - // optional .Remote.CodecType codec_type = 3; - inline bool has_codec_type() const; - inline void clear_codec_type(); - static const int kCodecTypeFieldNumber = 3; - inline ::Remote::CodecType codec_type() const; - inline void set_codec_type(::Remote::CodecType value); - - // optional uint32 audio_bitrate = 4; - inline bool has_audio_bitrate() const; - inline void clear_audio_bitrate(); - static const int kAudioBitrateFieldNumber = 4; - inline ::google::protobuf::uint32 audio_bitrate() const; - inline void set_audio_bitrate(::google::protobuf::uint32 value); - - // optional uint32 video_bitrate = 5; - inline bool has_video_bitrate() const; - inline void clear_video_bitrate(); - static const int kVideoBitrateFieldNumber = 5; - inline ::google::protobuf::uint32 video_bitrate() const; - inline void set_video_bitrate(::google::protobuf::uint32 value); - - // optional uint32 audio_stream_idx = 6; - inline bool has_audio_stream_idx() const; - inline void clear_audio_stream_idx(); - static const int kAudioStreamIdxFieldNumber = 6; - inline ::google::protobuf::uint32 audio_stream_idx() const; - inline void set_audio_stream_idx(::google::protobuf::uint32 value); - - // optional uint32 video_stream_idx = 7; - inline bool has_video_stream_idx() const; - inline void clear_video_stream_idx(); - static const int kVideoStreamIdxFieldNumber = 7; - inline ::google::protobuf::uint32 video_stream_idx() const; - inline void set_video_stream_idx(::google::protobuf::uint32 value); - - // optional uint32 subtitle_stream_idx = 8; - inline bool has_subtitle_stream_idx() const; - inline void clear_subtitle_stream_idx(); - static const int kSubtitleStreamIdxFieldNumber = 8; - inline ::google::protobuf::uint32 subtitle_stream_idx() const; - inline void set_subtitle_stream_idx(::google::protobuf::uint32 value); + // optional .Remote.MediaRequest.Prepare.Video video = 3; + inline bool has_video() const; + inline void clear_video(); + static const int kVideoFieldNumber = 3; + inline const ::Remote::MediaRequest_Prepare_Video& video() const; + inline ::Remote::MediaRequest_Prepare_Video* mutable_video(); + inline ::Remote::MediaRequest_Prepare_Video* release_video(); + inline void set_allocated_video(::Remote::MediaRequest_Prepare_Video* video); // @@protoc_insertion_point(class_scope:Remote.MediaRequest.Prepare) private: - inline void set_has_id(); - inline void clear_has_id(); - inline void set_has_offset_secs(); - inline void clear_has_offset_secs(); - inline void set_has_codec_type(); - inline void clear_has_codec_type(); - inline void set_has_audio_bitrate(); - inline void clear_has_audio_bitrate(); - inline void set_has_video_bitrate(); - inline void clear_has_video_bitrate(); - inline void set_has_audio_stream_idx(); - inline void clear_has_audio_stream_idx(); - inline void set_has_video_stream_idx(); - inline void clear_has_video_stream_idx(); - inline void set_has_subtitle_stream_idx(); - inline void clear_has_subtitle_stream_idx(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_audio(); + inline void clear_has_audio(); + inline void set_has_video(); + inline void clear_has_video(); ::google::protobuf::UnknownFieldSet _unknown_fields_; - ::google::protobuf::int64 id_; - ::google::protobuf::uint32 offset_secs_; - int codec_type_; - ::google::protobuf::uint32 audio_bitrate_; - ::google::protobuf::uint32 video_bitrate_; - ::google::protobuf::uint32 audio_stream_idx_; - ::google::protobuf::uint32 video_stream_idx_; - ::google::protobuf::uint32 subtitle_stream_idx_; + ::Remote::MediaRequest_Prepare_Audio* audio_; + ::Remote::MediaRequest_Prepare_Video* video_; + int type_; mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(8 + 31) / 32]; + ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; friend void protobuf_AddDesc_media_2eproto(); friend void protobuf_AssignDesc_media_2eproto(); @@ -464,7 +749,7 @@ class MediaRequest : public ::google::protobuf::Message { typedef MediaRequest_Type Type; static const Type TypeMediaPrepare = MediaRequest_Type_TypeMediaPrepare; - static const Type TypeMediaGet = MediaRequest_Type_TypeMediaGet; + static const Type TypeMediaGetPart = MediaRequest_Type_TypeMediaGetPart; static const Type TypeMediaTerminate = MediaRequest_Type_TypeMediaTerminate; static inline bool Type_IsValid(int value) { return MediaRequest_Type_IsValid(value); @@ -489,12 +774,12 @@ class MediaRequest : public ::google::protobuf::Message { // accessors ------------------------------------------------------- - // required .Remote.MediaRequest.Type request_type = 1; - inline bool has_request_type() const; - inline void clear_request_type(); - static const int kRequestTypeFieldNumber = 1; - inline ::Remote::MediaRequest_Type request_type() const; - inline void set_request_type(::Remote::MediaRequest_Type value); + // required .Remote.MediaRequest.Type type = 1; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 1; + inline ::Remote::MediaRequest_Type type() const; + inline void set_type(::Remote::MediaRequest_Type value); // optional .Remote.MediaRequest.Prepare prepare = 2; inline bool has_prepare() const; @@ -525,8 +810,8 @@ class MediaRequest : public ::google::protobuf::Message { // @@protoc_insertion_point(class_scope:Remote.MediaRequest) private: - inline void set_has_request_type(); - inline void clear_has_request_type(); + inline void set_has_type(); + inline void clear_has_type(); inline void set_has_prepare(); inline void clear_has_prepare(); inline void set_has_get_part(); @@ -539,7 +824,7 @@ class MediaRequest : public ::google::protobuf::Message { ::Remote::MediaRequest_Prepare* prepare_; ::Remote::MediaRequest_GetPart* get_part_; ::Remote::MediaRequest_Terminate* terminate_; - int request_type_; + int type_; mutable int _cached_size_; ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32]; @@ -553,14 +838,14 @@ class MediaRequest : public ::google::protobuf::Message { }; // ------------------------------------------------------------------- -class MediaResponse_MediaPart : public ::google::protobuf::Message { +class MediaResponse_Part : public ::google::protobuf::Message { public: - MediaResponse_MediaPart(); - virtual ~MediaResponse_MediaPart(); + MediaResponse_Part(); + virtual ~MediaResponse_Part(); - MediaResponse_MediaPart(const MediaResponse_MediaPart& from); + MediaResponse_Part(const MediaResponse_Part& from); - inline MediaResponse_MediaPart& operator=(const MediaResponse_MediaPart& from) { + inline MediaResponse_Part& operator=(const MediaResponse_Part& from) { CopyFrom(from); return *this; } @@ -574,17 +859,17 @@ class MediaResponse_MediaPart : public ::google::protobuf::Message { } static const ::google::protobuf::Descriptor* descriptor(); - static const MediaResponse_MediaPart& default_instance(); + static const MediaResponse_Part& default_instance(); - void Swap(MediaResponse_MediaPart* other); + void Swap(MediaResponse_Part* other); // implements Message ---------------------------------------------- - MediaResponse_MediaPart* New() const; + MediaResponse_Part* New() const; void CopyFrom(const ::google::protobuf::Message& from); void MergeFrom(const ::google::protobuf::Message& from); - void CopyFrom(const MediaResponse_MediaPart& from); - void MergeFrom(const MediaResponse_MediaPart& from); + void CopyFrom(const MediaResponse_Part& from); + void MergeFrom(const MediaResponse_Part& from); void Clear(); bool IsInitialized() const; @@ -607,48 +892,36 @@ class MediaResponse_MediaPart : public ::google::protobuf::Message { // accessors ------------------------------------------------------- - // required uint64 byte_offset = 1; - inline bool has_byte_offset() const; - inline void clear_byte_offset(); - static const int kByteOffsetFieldNumber = 1; - inline ::google::protobuf::uint64 byte_offset() const; - inline void set_byte_offset(::google::protobuf::uint64 value); - - // repeated bytes data = 2; - inline int data_size() const; + // required bytes data = 1; + inline bool has_data() const; inline void clear_data(); - static const int kDataFieldNumber = 2; - inline const ::std::string& data(int index) const; - inline ::std::string* mutable_data(int index); - inline void set_data(int index, const ::std::string& value); - inline void set_data(int index, const char* value); - inline void set_data(int index, const void* value, size_t size); - inline ::std::string* add_data(); - inline void add_data(const ::std::string& value); - inline void add_data(const char* value); - inline void add_data(const void* value, size_t size); - inline const ::google::protobuf::RepeatedPtrField< ::std::string>& data() const; - inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_data(); + static const int kDataFieldNumber = 1; + inline const ::std::string& data() const; + inline void set_data(const ::std::string& value); + inline void set_data(const char* value); + inline void set_data(const void* value, size_t size); + inline ::std::string* mutable_data(); + inline ::std::string* release_data(); + inline void set_allocated_data(::std::string* data); - // @@protoc_insertion_point(class_scope:Remote.MediaResponse.MediaPart) + // @@protoc_insertion_point(class_scope:Remote.MediaResponse.Part) private: - inline void set_has_byte_offset(); - inline void clear_has_byte_offset(); + inline void set_has_data(); + inline void clear_has_data(); ::google::protobuf::UnknownFieldSet _unknown_fields_; - ::google::protobuf::uint64 byte_offset_; - ::google::protobuf::RepeatedPtrField< ::std::string> data_; + ::std::string* data_; mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; + ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32]; friend void protobuf_AddDesc_media_2eproto(); friend void protobuf_AssignDesc_media_2eproto(); friend void protobuf_ShutdownFile_media_2eproto(); void InitAsDefaultInstance(); - static MediaResponse_MediaPart* default_instance_; + static MediaResponse_Part* default_instance_; }; // ------------------------------------------------------------------- @@ -704,10 +977,11 @@ class MediaResponse : public ::google::protobuf::Message { // nested types ---------------------------------------------------- - typedef MediaResponse_MediaPart MediaPart; + typedef MediaResponse_Part Part; typedef MediaResponse_Type Type; - static const Type TypeMediaPart = MediaResponse_Type_TypeMediaPart; + static const Type TypeError = MediaResponse_Type_TypeError; + static const Type TypePart = MediaResponse_Type_TypePart; static inline bool Type_IsValid(int value) { return MediaResponse_Type_IsValid(value); } @@ -731,45 +1005,45 @@ class MediaResponse : public ::google::protobuf::Message { // accessors ------------------------------------------------------- - // required .Remote.Error error = 1; + // required .Remote.MediaResponse.Type type = 1; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 1; + inline ::Remote::MediaResponse_Type type() const; + inline void set_type(::Remote::MediaResponse_Type value); + + // optional .Remote.Error error = 2; inline bool has_error() const; inline void clear_error(); - static const int kErrorFieldNumber = 1; + static const int kErrorFieldNumber = 2; inline const ::Remote::Error& error() const; inline ::Remote::Error* mutable_error(); inline ::Remote::Error* release_error(); inline void set_allocated_error(::Remote::Error* error); - // required .Remote.MediaResponse.Type response_type = 2; - inline bool has_response_type() const; - inline void clear_response_type(); - static const int kResponseTypeFieldNumber = 2; - inline ::Remote::MediaResponse_Type response_type() const; - inline void set_response_type(::Remote::MediaResponse_Type value); - - // optional .Remote.MediaResponse.MediaPart part = 3; + // optional .Remote.MediaResponse.Part part = 3; inline bool has_part() const; inline void clear_part(); static const int kPartFieldNumber = 3; - inline const ::Remote::MediaResponse_MediaPart& part() const; - inline ::Remote::MediaResponse_MediaPart* mutable_part(); - inline ::Remote::MediaResponse_MediaPart* release_part(); - inline void set_allocated_part(::Remote::MediaResponse_MediaPart* part); + inline const ::Remote::MediaResponse_Part& part() const; + inline ::Remote::MediaResponse_Part* mutable_part(); + inline ::Remote::MediaResponse_Part* release_part(); + inline void set_allocated_part(::Remote::MediaResponse_Part* part); // @@protoc_insertion_point(class_scope:Remote.MediaResponse) private: + inline void set_has_type(); + inline void clear_has_type(); inline void set_has_error(); inline void clear_has_error(); - inline void set_has_response_type(); - inline void clear_has_response_type(); inline void set_has_part(); inline void clear_has_part(); ::google::protobuf::UnknownFieldSet _unknown_fields_; ::Remote::Error* error_; - ::Remote::MediaResponse_MediaPart* part_; - int response_type_; + ::Remote::MediaResponse_Part* part_; + int type_; mutable int _cached_size_; ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; @@ -786,187 +1060,383 @@ class MediaResponse : public ::google::protobuf::Message { // =================================================================== -// MediaRequest_Prepare +// MediaRequest_Prepare_Audio -// required int64 id = 1; -inline bool MediaRequest_Prepare::has_id() const { +// required int64 track_id = 1; +inline bool MediaRequest_Prepare_Audio::has_track_id() const { return (_has_bits_[0] & 0x00000001u) != 0; } -inline void MediaRequest_Prepare::set_has_id() { +inline void MediaRequest_Prepare_Audio::set_has_track_id() { _has_bits_[0] |= 0x00000001u; } -inline void MediaRequest_Prepare::clear_has_id() { +inline void MediaRequest_Prepare_Audio::clear_has_track_id() { _has_bits_[0] &= ~0x00000001u; } -inline void MediaRequest_Prepare::clear_id() { - id_ = GOOGLE_LONGLONG(0); - clear_has_id(); +inline void MediaRequest_Prepare_Audio::clear_track_id() { + track_id_ = GOOGLE_LONGLONG(0); + clear_has_track_id(); } -inline ::google::protobuf::int64 MediaRequest_Prepare::id() const { - return id_; +inline ::google::protobuf::int64 MediaRequest_Prepare_Audio::track_id() const { + return track_id_; } -inline void MediaRequest_Prepare::set_id(::google::protobuf::int64 value) { - set_has_id(); - id_ = value; +inline void MediaRequest_Prepare_Audio::set_track_id(::google::protobuf::int64 value) { + set_has_track_id(); + track_id_ = value; } -// required uint32 offset_secs = 2; -inline bool MediaRequest_Prepare::has_offset_secs() const { +// optional .Remote.AudioCodecType codec_type = 2; +inline bool MediaRequest_Prepare_Audio::has_codec_type() const { return (_has_bits_[0] & 0x00000002u) != 0; } -inline void MediaRequest_Prepare::set_has_offset_secs() { +inline void MediaRequest_Prepare_Audio::set_has_codec_type() { _has_bits_[0] |= 0x00000002u; } -inline void MediaRequest_Prepare::clear_has_offset_secs() { +inline void MediaRequest_Prepare_Audio::clear_has_codec_type() { _has_bits_[0] &= ~0x00000002u; } -inline void MediaRequest_Prepare::clear_offset_secs() { - offset_secs_ = 0u; - clear_has_offset_secs(); -} -inline ::google::protobuf::uint32 MediaRequest_Prepare::offset_secs() const { - return offset_secs_; -} -inline void MediaRequest_Prepare::set_offset_secs(::google::protobuf::uint32 value) { - set_has_offset_secs(); - offset_secs_ = value; -} - -// optional .Remote.CodecType codec_type = 3; -inline bool MediaRequest_Prepare::has_codec_type() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -inline void MediaRequest_Prepare::set_has_codec_type() { - _has_bits_[0] |= 0x00000004u; -} -inline void MediaRequest_Prepare::clear_has_codec_type() { - _has_bits_[0] &= ~0x00000004u; -} -inline void MediaRequest_Prepare::clear_codec_type() { +inline void MediaRequest_Prepare_Audio::clear_codec_type() { codec_type_ = 1; clear_has_codec_type(); } -inline ::Remote::CodecType MediaRequest_Prepare::codec_type() const { - return static_cast< ::Remote::CodecType >(codec_type_); +inline ::Remote::AudioCodecType MediaRequest_Prepare_Audio::codec_type() const { + return static_cast< ::Remote::AudioCodecType >(codec_type_); } -inline void MediaRequest_Prepare::set_codec_type(::Remote::CodecType value) { - assert(::Remote::CodecType_IsValid(value)); +inline void MediaRequest_Prepare_Audio::set_codec_type(::Remote::AudioCodecType value) { + assert(::Remote::AudioCodecType_IsValid(value)); set_has_codec_type(); codec_type_ = value; } -// optional uint32 audio_bitrate = 4; -inline bool MediaRequest_Prepare::has_audio_bitrate() const { +// optional uint32 bitrate = 3; +inline bool MediaRequest_Prepare_Audio::has_bitrate() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void MediaRequest_Prepare_Audio::set_has_bitrate() { + _has_bits_[0] |= 0x00000004u; +} +inline void MediaRequest_Prepare_Audio::clear_has_bitrate() { + _has_bits_[0] &= ~0x00000004u; +} +inline void MediaRequest_Prepare_Audio::clear_bitrate() { + bitrate_ = 0u; + clear_has_bitrate(); +} +inline ::google::protobuf::uint32 MediaRequest_Prepare_Audio::bitrate() const { + return bitrate_; +} +inline void MediaRequest_Prepare_Audio::set_bitrate(::google::protobuf::uint32 value) { + set_has_bitrate(); + bitrate_ = value; +} + +// optional uint32 stream_idx = 4; +inline bool MediaRequest_Prepare_Audio::has_stream_idx() const { return (_has_bits_[0] & 0x00000008u) != 0; } -inline void MediaRequest_Prepare::set_has_audio_bitrate() { +inline void MediaRequest_Prepare_Audio::set_has_stream_idx() { _has_bits_[0] |= 0x00000008u; } -inline void MediaRequest_Prepare::clear_has_audio_bitrate() { +inline void MediaRequest_Prepare_Audio::clear_has_stream_idx() { _has_bits_[0] &= ~0x00000008u; } -inline void MediaRequest_Prepare::clear_audio_bitrate() { - audio_bitrate_ = 0u; - clear_has_audio_bitrate(); +inline void MediaRequest_Prepare_Audio::clear_stream_idx() { + stream_idx_ = 0u; + clear_has_stream_idx(); } -inline ::google::protobuf::uint32 MediaRequest_Prepare::audio_bitrate() const { - return audio_bitrate_; +inline ::google::protobuf::uint32 MediaRequest_Prepare_Audio::stream_idx() const { + return stream_idx_; } -inline void MediaRequest_Prepare::set_audio_bitrate(::google::protobuf::uint32 value) { - set_has_audio_bitrate(); - audio_bitrate_ = value; +inline void MediaRequest_Prepare_Audio::set_stream_idx(::google::protobuf::uint32 value) { + set_has_stream_idx(); + stream_idx_ = value; } -// optional uint32 video_bitrate = 5; -inline bool MediaRequest_Prepare::has_video_bitrate() const { +// optional uint32 offset_secs = 5; +inline bool MediaRequest_Prepare_Audio::has_offset_secs() const { return (_has_bits_[0] & 0x00000010u) != 0; } -inline void MediaRequest_Prepare::set_has_video_bitrate() { +inline void MediaRequest_Prepare_Audio::set_has_offset_secs() { _has_bits_[0] |= 0x00000010u; } -inline void MediaRequest_Prepare::clear_has_video_bitrate() { +inline void MediaRequest_Prepare_Audio::clear_has_offset_secs() { _has_bits_[0] &= ~0x00000010u; } -inline void MediaRequest_Prepare::clear_video_bitrate() { - video_bitrate_ = 0u; - clear_has_video_bitrate(); +inline void MediaRequest_Prepare_Audio::clear_offset_secs() { + offset_secs_ = 0u; + clear_has_offset_secs(); } -inline ::google::protobuf::uint32 MediaRequest_Prepare::video_bitrate() const { - return video_bitrate_; +inline ::google::protobuf::uint32 MediaRequest_Prepare_Audio::offset_secs() const { + return offset_secs_; } -inline void MediaRequest_Prepare::set_video_bitrate(::google::protobuf::uint32 value) { - set_has_video_bitrate(); - video_bitrate_ = value; +inline void MediaRequest_Prepare_Audio::set_offset_secs(::google::protobuf::uint32 value) { + set_has_offset_secs(); + offset_secs_ = value; } -// optional uint32 audio_stream_idx = 6; -inline bool MediaRequest_Prepare::has_audio_stream_idx() const { - return (_has_bits_[0] & 0x00000020u) != 0; +// ------------------------------------------------------------------- + +// MediaRequest_Prepare_Video + +// required int64 video_id = 1; +inline bool MediaRequest_Prepare_Video::has_video_id() const { + return (_has_bits_[0] & 0x00000001u) != 0; } -inline void MediaRequest_Prepare::set_has_audio_stream_idx() { - _has_bits_[0] |= 0x00000020u; +inline void MediaRequest_Prepare_Video::set_has_video_id() { + _has_bits_[0] |= 0x00000001u; } -inline void MediaRequest_Prepare::clear_has_audio_stream_idx() { - _has_bits_[0] &= ~0x00000020u; +inline void MediaRequest_Prepare_Video::clear_has_video_id() { + _has_bits_[0] &= ~0x00000001u; } -inline void MediaRequest_Prepare::clear_audio_stream_idx() { +inline void MediaRequest_Prepare_Video::clear_video_id() { + video_id_ = GOOGLE_LONGLONG(0); + clear_has_video_id(); +} +inline ::google::protobuf::int64 MediaRequest_Prepare_Video::video_id() const { + return video_id_; +} +inline void MediaRequest_Prepare_Video::set_video_id(::google::protobuf::int64 value) { + set_has_video_id(); + video_id_ = value; +} + +// optional .Remote.VideoCodecType codec_type = 2; +inline bool MediaRequest_Prepare_Video::has_codec_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void MediaRequest_Prepare_Video::set_has_codec_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void MediaRequest_Prepare_Video::clear_has_codec_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void MediaRequest_Prepare_Video::clear_codec_type() { + codec_type_ = 1; + clear_has_codec_type(); +} +inline ::Remote::VideoCodecType MediaRequest_Prepare_Video::codec_type() const { + return static_cast< ::Remote::VideoCodecType >(codec_type_); +} +inline void MediaRequest_Prepare_Video::set_codec_type(::Remote::VideoCodecType value) { + assert(::Remote::VideoCodecType_IsValid(value)); + set_has_codec_type(); + codec_type_ = value; +} + +// optional uint32 bitrate = 3; +inline bool MediaRequest_Prepare_Video::has_bitrate() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void MediaRequest_Prepare_Video::set_has_bitrate() { + _has_bits_[0] |= 0x00000004u; +} +inline void MediaRequest_Prepare_Video::clear_has_bitrate() { + _has_bits_[0] &= ~0x00000004u; +} +inline void MediaRequest_Prepare_Video::clear_bitrate() { + bitrate_ = 0u; + clear_has_bitrate(); +} +inline ::google::protobuf::uint32 MediaRequest_Prepare_Video::bitrate() const { + return bitrate_; +} +inline void MediaRequest_Prepare_Video::set_bitrate(::google::protobuf::uint32 value) { + set_has_bitrate(); + bitrate_ = value; +} + +// optional uint32 offset_secs = 4; +inline bool MediaRequest_Prepare_Video::has_offset_secs() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void MediaRequest_Prepare_Video::set_has_offset_secs() { + _has_bits_[0] |= 0x00000008u; +} +inline void MediaRequest_Prepare_Video::clear_has_offset_secs() { + _has_bits_[0] &= ~0x00000008u; +} +inline void MediaRequest_Prepare_Video::clear_offset_secs() { + offset_secs_ = 0u; + clear_has_offset_secs(); +} +inline ::google::protobuf::uint32 MediaRequest_Prepare_Video::offset_secs() const { + return offset_secs_; +} +inline void MediaRequest_Prepare_Video::set_offset_secs(::google::protobuf::uint32 value) { + set_has_offset_secs(); + offset_secs_ = value; +} + +// optional uint32 audio_stream_idx = 5; +inline bool MediaRequest_Prepare_Video::has_audio_stream_idx() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void MediaRequest_Prepare_Video::set_has_audio_stream_idx() { + _has_bits_[0] |= 0x00000010u; +} +inline void MediaRequest_Prepare_Video::clear_has_audio_stream_idx() { + _has_bits_[0] &= ~0x00000010u; +} +inline void MediaRequest_Prepare_Video::clear_audio_stream_idx() { audio_stream_idx_ = 0u; clear_has_audio_stream_idx(); } -inline ::google::protobuf::uint32 MediaRequest_Prepare::audio_stream_idx() const { +inline ::google::protobuf::uint32 MediaRequest_Prepare_Video::audio_stream_idx() const { return audio_stream_idx_; } -inline void MediaRequest_Prepare::set_audio_stream_idx(::google::protobuf::uint32 value) { +inline void MediaRequest_Prepare_Video::set_audio_stream_idx(::google::protobuf::uint32 value) { set_has_audio_stream_idx(); audio_stream_idx_ = value; } -// optional uint32 video_stream_idx = 7; -inline bool MediaRequest_Prepare::has_video_stream_idx() const { - return (_has_bits_[0] & 0x00000040u) != 0; +// optional uint32 video_stream_idx = 6; +inline bool MediaRequest_Prepare_Video::has_video_stream_idx() const { + return (_has_bits_[0] & 0x00000020u) != 0; } -inline void MediaRequest_Prepare::set_has_video_stream_idx() { - _has_bits_[0] |= 0x00000040u; +inline void MediaRequest_Prepare_Video::set_has_video_stream_idx() { + _has_bits_[0] |= 0x00000020u; } -inline void MediaRequest_Prepare::clear_has_video_stream_idx() { - _has_bits_[0] &= ~0x00000040u; +inline void MediaRequest_Prepare_Video::clear_has_video_stream_idx() { + _has_bits_[0] &= ~0x00000020u; } -inline void MediaRequest_Prepare::clear_video_stream_idx() { +inline void MediaRequest_Prepare_Video::clear_video_stream_idx() { video_stream_idx_ = 0u; clear_has_video_stream_idx(); } -inline ::google::protobuf::uint32 MediaRequest_Prepare::video_stream_idx() const { +inline ::google::protobuf::uint32 MediaRequest_Prepare_Video::video_stream_idx() const { return video_stream_idx_; } -inline void MediaRequest_Prepare::set_video_stream_idx(::google::protobuf::uint32 value) { +inline void MediaRequest_Prepare_Video::set_video_stream_idx(::google::protobuf::uint32 value) { set_has_video_stream_idx(); video_stream_idx_ = value; } -// optional uint32 subtitle_stream_idx = 8; -inline bool MediaRequest_Prepare::has_subtitle_stream_idx() const { - return (_has_bits_[0] & 0x00000080u) != 0; +// optional uint32 subtitle_stream_idx = 7; +inline bool MediaRequest_Prepare_Video::has_subtitle_stream_idx() const { + return (_has_bits_[0] & 0x00000040u) != 0; } -inline void MediaRequest_Prepare::set_has_subtitle_stream_idx() { - _has_bits_[0] |= 0x00000080u; +inline void MediaRequest_Prepare_Video::set_has_subtitle_stream_idx() { + _has_bits_[0] |= 0x00000040u; } -inline void MediaRequest_Prepare::clear_has_subtitle_stream_idx() { - _has_bits_[0] &= ~0x00000080u; +inline void MediaRequest_Prepare_Video::clear_has_subtitle_stream_idx() { + _has_bits_[0] &= ~0x00000040u; } -inline void MediaRequest_Prepare::clear_subtitle_stream_idx() { +inline void MediaRequest_Prepare_Video::clear_subtitle_stream_idx() { subtitle_stream_idx_ = 0u; clear_has_subtitle_stream_idx(); } -inline ::google::protobuf::uint32 MediaRequest_Prepare::subtitle_stream_idx() const { +inline ::google::protobuf::uint32 MediaRequest_Prepare_Video::subtitle_stream_idx() const { return subtitle_stream_idx_; } -inline void MediaRequest_Prepare::set_subtitle_stream_idx(::google::protobuf::uint32 value) { +inline void MediaRequest_Prepare_Video::set_subtitle_stream_idx(::google::protobuf::uint32 value) { set_has_subtitle_stream_idx(); subtitle_stream_idx_ = value; } // ------------------------------------------------------------------- +// MediaRequest_Prepare + +// required .Remote.MediaRequest.Prepare.Type type = 1; +inline bool MediaRequest_Prepare::has_type() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void MediaRequest_Prepare::set_has_type() { + _has_bits_[0] |= 0x00000001u; +} +inline void MediaRequest_Prepare::clear_has_type() { + _has_bits_[0] &= ~0x00000001u; +} +inline void MediaRequest_Prepare::clear_type() { + type_ = 1; + clear_has_type(); +} +inline ::Remote::MediaRequest_Prepare_Type MediaRequest_Prepare::type() const { + return static_cast< ::Remote::MediaRequest_Prepare_Type >(type_); +} +inline void MediaRequest_Prepare::set_type(::Remote::MediaRequest_Prepare_Type value) { + assert(::Remote::MediaRequest_Prepare_Type_IsValid(value)); + set_has_type(); + type_ = value; +} + +// optional .Remote.MediaRequest.Prepare.Audio audio = 2; +inline bool MediaRequest_Prepare::has_audio() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void MediaRequest_Prepare::set_has_audio() { + _has_bits_[0] |= 0x00000002u; +} +inline void MediaRequest_Prepare::clear_has_audio() { + _has_bits_[0] &= ~0x00000002u; +} +inline void MediaRequest_Prepare::clear_audio() { + if (audio_ != NULL) audio_->::Remote::MediaRequest_Prepare_Audio::Clear(); + clear_has_audio(); +} +inline const ::Remote::MediaRequest_Prepare_Audio& MediaRequest_Prepare::audio() const { + return audio_ != NULL ? *audio_ : *default_instance_->audio_; +} +inline ::Remote::MediaRequest_Prepare_Audio* MediaRequest_Prepare::mutable_audio() { + set_has_audio(); + if (audio_ == NULL) audio_ = new ::Remote::MediaRequest_Prepare_Audio; + return audio_; +} +inline ::Remote::MediaRequest_Prepare_Audio* MediaRequest_Prepare::release_audio() { + clear_has_audio(); + ::Remote::MediaRequest_Prepare_Audio* temp = audio_; + audio_ = NULL; + return temp; +} +inline void MediaRequest_Prepare::set_allocated_audio(::Remote::MediaRequest_Prepare_Audio* audio) { + delete audio_; + audio_ = audio; + if (audio) { + set_has_audio(); + } else { + clear_has_audio(); + } +} + +// optional .Remote.MediaRequest.Prepare.Video video = 3; +inline bool MediaRequest_Prepare::has_video() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void MediaRequest_Prepare::set_has_video() { + _has_bits_[0] |= 0x00000004u; +} +inline void MediaRequest_Prepare::clear_has_video() { + _has_bits_[0] &= ~0x00000004u; +} +inline void MediaRequest_Prepare::clear_video() { + if (video_ != NULL) video_->::Remote::MediaRequest_Prepare_Video::Clear(); + clear_has_video(); +} +inline const ::Remote::MediaRequest_Prepare_Video& MediaRequest_Prepare::video() const { + return video_ != NULL ? *video_ : *default_instance_->video_; +} +inline ::Remote::MediaRequest_Prepare_Video* MediaRequest_Prepare::mutable_video() { + set_has_video(); + if (video_ == NULL) video_ = new ::Remote::MediaRequest_Prepare_Video; + return video_; +} +inline ::Remote::MediaRequest_Prepare_Video* MediaRequest_Prepare::release_video() { + clear_has_video(); + ::Remote::MediaRequest_Prepare_Video* temp = video_; + video_ = NULL; + return temp; +} +inline void MediaRequest_Prepare::set_allocated_video(::Remote::MediaRequest_Prepare_Video* video) { + delete video_; + video_ = video; + if (video) { + set_has_video(); + } else { + clear_has_video(); + } +} + +// ------------------------------------------------------------------- + // MediaRequest_GetPart // required uint32 requested_data_size = 1; @@ -999,27 +1469,27 @@ inline void MediaRequest_GetPart::set_requested_data_size(::google::protobuf::ui // MediaRequest -// required .Remote.MediaRequest.Type request_type = 1; -inline bool MediaRequest::has_request_type() const { +// required .Remote.MediaRequest.Type type = 1; +inline bool MediaRequest::has_type() const { return (_has_bits_[0] & 0x00000001u) != 0; } -inline void MediaRequest::set_has_request_type() { +inline void MediaRequest::set_has_type() { _has_bits_[0] |= 0x00000001u; } -inline void MediaRequest::clear_has_request_type() { +inline void MediaRequest::clear_has_type() { _has_bits_[0] &= ~0x00000001u; } -inline void MediaRequest::clear_request_type() { - request_type_ = 1; - clear_has_request_type(); +inline void MediaRequest::clear_type() { + type_ = 1; + clear_has_type(); } -inline ::Remote::MediaRequest_Type MediaRequest::request_type() const { - return static_cast< ::Remote::MediaRequest_Type >(request_type_); +inline ::Remote::MediaRequest_Type MediaRequest::type() const { + return static_cast< ::Remote::MediaRequest_Type >(type_); } -inline void MediaRequest::set_request_type(::Remote::MediaRequest_Type value) { +inline void MediaRequest::set_type(::Remote::MediaRequest_Type value) { assert(::Remote::MediaRequest_Type_IsValid(value)); - set_has_request_type(); - request_type_ = value; + set_has_type(); + type_ = value; } // optional .Remote.MediaRequest.Prepare prepare = 2; @@ -1138,88 +1608,115 @@ inline void MediaRequest::set_allocated_terminate(::Remote::MediaRequest_Termina // ------------------------------------------------------------------- -// MediaResponse_MediaPart +// MediaResponse_Part -// required uint64 byte_offset = 1; -inline bool MediaResponse_MediaPart::has_byte_offset() const { +// required bytes data = 1; +inline bool MediaResponse_Part::has_data() const { return (_has_bits_[0] & 0x00000001u) != 0; } -inline void MediaResponse_MediaPart::set_has_byte_offset() { +inline void MediaResponse_Part::set_has_data() { _has_bits_[0] |= 0x00000001u; } -inline void MediaResponse_MediaPart::clear_has_byte_offset() { +inline void MediaResponse_Part::clear_has_data() { _has_bits_[0] &= ~0x00000001u; } -inline void MediaResponse_MediaPart::clear_byte_offset() { - byte_offset_ = GOOGLE_ULONGLONG(0); - clear_has_byte_offset(); +inline void MediaResponse_Part::clear_data() { + if (data_ != &::google::protobuf::internal::kEmptyString) { + data_->clear(); + } + clear_has_data(); } -inline ::google::protobuf::uint64 MediaResponse_MediaPart::byte_offset() const { - return byte_offset_; +inline const ::std::string& MediaResponse_Part::data() const { + return *data_; } -inline void MediaResponse_MediaPart::set_byte_offset(::google::protobuf::uint64 value) { - set_has_byte_offset(); - byte_offset_ = value; +inline void MediaResponse_Part::set_data(const ::std::string& value) { + set_has_data(); + if (data_ == &::google::protobuf::internal::kEmptyString) { + data_ = new ::std::string; + } + data_->assign(value); } - -// repeated bytes data = 2; -inline int MediaResponse_MediaPart::data_size() const { - return data_.size(); +inline void MediaResponse_Part::set_data(const char* value) { + set_has_data(); + if (data_ == &::google::protobuf::internal::kEmptyString) { + data_ = new ::std::string; + } + data_->assign(value); } -inline void MediaResponse_MediaPart::clear_data() { - data_.Clear(); +inline void MediaResponse_Part::set_data(const void* value, size_t size) { + set_has_data(); + if (data_ == &::google::protobuf::internal::kEmptyString) { + data_ = new ::std::string; + } + data_->assign(reinterpret_cast(value), size); } -inline const ::std::string& MediaResponse_MediaPart::data(int index) const { - return data_.Get(index); -} -inline ::std::string* MediaResponse_MediaPart::mutable_data(int index) { - return data_.Mutable(index); -} -inline void MediaResponse_MediaPart::set_data(int index, const ::std::string& value) { - data_.Mutable(index)->assign(value); -} -inline void MediaResponse_MediaPart::set_data(int index, const char* value) { - data_.Mutable(index)->assign(value); -} -inline void MediaResponse_MediaPart::set_data(int index, const void* value, size_t size) { - data_.Mutable(index)->assign( - reinterpret_cast(value), size); -} -inline ::std::string* MediaResponse_MediaPart::add_data() { - return data_.Add(); -} -inline void MediaResponse_MediaPart::add_data(const ::std::string& value) { - data_.Add()->assign(value); -} -inline void MediaResponse_MediaPart::add_data(const char* value) { - data_.Add()->assign(value); -} -inline void MediaResponse_MediaPart::add_data(const void* value, size_t size) { - data_.Add()->assign(reinterpret_cast(value), size); -} -inline const ::google::protobuf::RepeatedPtrField< ::std::string>& -MediaResponse_MediaPart::data() const { +inline ::std::string* MediaResponse_Part::mutable_data() { + set_has_data(); + if (data_ == &::google::protobuf::internal::kEmptyString) { + data_ = new ::std::string; + } return data_; } -inline ::google::protobuf::RepeatedPtrField< ::std::string>* -MediaResponse_MediaPart::mutable_data() { - return &data_; +inline ::std::string* MediaResponse_Part::release_data() { + clear_has_data(); + if (data_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = data_; + data_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} +inline void MediaResponse_Part::set_allocated_data(::std::string* data) { + if (data_ != &::google::protobuf::internal::kEmptyString) { + delete data_; + } + if (data) { + set_has_data(); + data_ = data; + } else { + clear_has_data(); + data_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + } } // ------------------------------------------------------------------- // MediaResponse -// required .Remote.Error error = 1; -inline bool MediaResponse::has_error() const { +// required .Remote.MediaResponse.Type type = 1; +inline bool MediaResponse::has_type() const { return (_has_bits_[0] & 0x00000001u) != 0; } -inline void MediaResponse::set_has_error() { +inline void MediaResponse::set_has_type() { _has_bits_[0] |= 0x00000001u; } -inline void MediaResponse::clear_has_error() { +inline void MediaResponse::clear_has_type() { _has_bits_[0] &= ~0x00000001u; } +inline void MediaResponse::clear_type() { + type_ = 1; + clear_has_type(); +} +inline ::Remote::MediaResponse_Type MediaResponse::type() const { + return static_cast< ::Remote::MediaResponse_Type >(type_); +} +inline void MediaResponse::set_type(::Remote::MediaResponse_Type value) { + assert(::Remote::MediaResponse_Type_IsValid(value)); + set_has_type(); + type_ = value; +} + +// optional .Remote.Error error = 2; +inline bool MediaResponse::has_error() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void MediaResponse::set_has_error() { + _has_bits_[0] |= 0x00000002u; +} +inline void MediaResponse::clear_has_error() { + _has_bits_[0] &= ~0x00000002u; +} inline void MediaResponse::clear_error() { if (error_ != NULL) error_->::Remote::Error::Clear(); clear_has_error(); @@ -1248,30 +1745,7 @@ inline void MediaResponse::set_allocated_error(::Remote::Error* error) { } } -// required .Remote.MediaResponse.Type response_type = 2; -inline bool MediaResponse::has_response_type() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -inline void MediaResponse::set_has_response_type() { - _has_bits_[0] |= 0x00000002u; -} -inline void MediaResponse::clear_has_response_type() { - _has_bits_[0] &= ~0x00000002u; -} -inline void MediaResponse::clear_response_type() { - response_type_ = 1; - clear_has_response_type(); -} -inline ::Remote::MediaResponse_Type MediaResponse::response_type() const { - return static_cast< ::Remote::MediaResponse_Type >(response_type_); -} -inline void MediaResponse::set_response_type(::Remote::MediaResponse_Type value) { - assert(::Remote::MediaResponse_Type_IsValid(value)); - set_has_response_type(); - response_type_ = value; -} - -// optional .Remote.MediaResponse.MediaPart part = 3; +// optional .Remote.MediaResponse.Part part = 3; inline bool MediaResponse::has_part() const { return (_has_bits_[0] & 0x00000004u) != 0; } @@ -1282,24 +1756,24 @@ inline void MediaResponse::clear_has_part() { _has_bits_[0] &= ~0x00000004u; } inline void MediaResponse::clear_part() { - if (part_ != NULL) part_->::Remote::MediaResponse_MediaPart::Clear(); + if (part_ != NULL) part_->::Remote::MediaResponse_Part::Clear(); clear_has_part(); } -inline const ::Remote::MediaResponse_MediaPart& MediaResponse::part() const { +inline const ::Remote::MediaResponse_Part& MediaResponse::part() const { return part_ != NULL ? *part_ : *default_instance_->part_; } -inline ::Remote::MediaResponse_MediaPart* MediaResponse::mutable_part() { +inline ::Remote::MediaResponse_Part* MediaResponse::mutable_part() { set_has_part(); - if (part_ == NULL) part_ = new ::Remote::MediaResponse_MediaPart; + if (part_ == NULL) part_ = new ::Remote::MediaResponse_Part; return part_; } -inline ::Remote::MediaResponse_MediaPart* MediaResponse::release_part() { +inline ::Remote::MediaResponse_Part* MediaResponse::release_part() { clear_has_part(); - ::Remote::MediaResponse_MediaPart* temp = part_; + ::Remote::MediaResponse_Part* temp = part_; part_ = NULL; return temp; } -inline void MediaResponse::set_allocated_part(::Remote::MediaResponse_MediaPart* part) { +inline void MediaResponse::set_allocated_part(::Remote::MediaResponse_Part* part) { delete part_; part_ = part; if (part) { @@ -1318,6 +1792,10 @@ inline void MediaResponse::set_allocated_part(::Remote::MediaResponse_MediaPart* namespace google { namespace protobuf { +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::Remote::MediaRequest_Prepare_Type>() { + return ::Remote::MediaRequest_Prepare_Type_descriptor(); +} template <> inline const EnumDescriptor* GetEnumDescriptor< ::Remote::MediaRequest_Type>() { return ::Remote::MediaRequest_Type_descriptor(); @@ -1327,8 +1805,12 @@ inline const EnumDescriptor* GetEnumDescriptor< ::Remote::MediaResponse_Type>() return ::Remote::MediaResponse_Type_descriptor(); } template <> -inline const EnumDescriptor* GetEnumDescriptor< ::Remote::CodecType>() { - return ::Remote::CodecType_descriptor(); +inline const EnumDescriptor* GetEnumDescriptor< ::Remote::AudioCodecType>() { + return ::Remote::AudioCodecType_descriptor(); +} +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::Remote::VideoCodecType>() { + return ::Remote::VideoCodecType_descriptor(); } } // namespace google diff --git a/remote/proto/media.proto b/remote/proto/media.proto index 0e5eccfe..b020b9d7 100644 --- a/remote/proto/media.proto +++ b/remote/proto/media.proto @@ -2,9 +2,14 @@ import "common.proto"; package Remote; -enum CodecType +enum AudioCodecType { - CodecTypeOGG = 1; + CodecTypeOGA = 1; +} + +enum VideoCodecType +{ + CodecTypeOGV = 1; } @@ -13,24 +18,41 @@ message MediaRequest message Prepare { - required int64 id = 1; // Id if the media - required uint32 offset_secs = 2; // Offset in seconds - optional CodecType codec_type = 3; // Codec of the media + message Audio + { + required int64 track_id = 1; // Id if the media + optional AudioCodecType codec_type = 2; + optional uint32 bitrate = 3; + optional uint32 stream_idx = 4; + optional uint32 offset_secs = 5; + } - optional uint32 audio_bitrate = 4; + message Video + { + required int64 video_id = 1; // Id if the media + optional VideoCodecType codec_type = 2; + optional uint32 bitrate = 3; + optional uint32 offset_secs = 4; + optional uint32 audio_stream_idx = 5; + optional uint32 video_stream_idx = 6; + optional uint32 subtitle_stream_idx = 7; + } - // Video specifics - optional uint32 video_bitrate = 5; - optional uint32 audio_stream_idx = 6; - optional uint32 video_stream_idx = 7; - optional uint32 subtitle_stream_idx = 8; + enum Type { + AudioRequest = 1; + VideoRequest = 2; + } + + required Type type = 1; + + optional Audio audio = 2; + optional Video video = 3; } message GetPart { - required uint32 requested_data_size = 1; // Amount of data requested. May receive more or less - + required uint32 requested_data_size = 1; // Amount of data requested. May receive more or less. May receive 0 byte if complete } message Terminate @@ -41,11 +63,11 @@ message MediaRequest enum Type { TypeMediaPrepare = 1; - TypeMediaGet = 2; + TypeMediaGetPart = 2; TypeMediaTerminate = 3; } - required Type request_type = 1; + required Type type = 1; optional Prepare prepare = 2; optional GetPart get_part = 3; @@ -55,21 +77,20 @@ message MediaRequest message MediaResponse { - message MediaPart + message Part { - required uint64 byte_offset = 1; - repeated bytes data = 2; + required bytes data = 1; } enum Type { - TypeMediaPart = 1; + TypeError = 1; + TypePart = 2; } - required Error error = 1; + required Type type = 1; - required Type response_type = 2; - - optional MediaPart part = 3; + optional Error error = 2; + optional Part part = 3; } diff --git a/remote/server/AudioCollectionRequestHandler.cpp b/remote/server/AudioCollectionRequestHandler.cpp index a55fdfbd..32ac4803 100644 --- a/remote/server/AudioCollectionRequestHandler.cpp +++ b/remote/server/AudioCollectionRequestHandler.cpp @@ -22,47 +22,47 @@ AudioCollectionRequestHandler::process(const AudioCollectionRequest& request, Au switch (request.type()) { - case AudioCollectionRequest_Type_TypeGetGenreList: + case AudioCollectionRequest::TypeGetGenreList: if (request.has_get_genres()) { res = processGetGenres(request.get_genres(), *response.mutable_genre_list()); if (res) - response.set_type(AudioCollectionResponse_Type_TypeArtistList); + response.set_type(AudioCollectionResponse::TypeArtistList); } else std::cerr << "Bad AudioCollectionRequest_Type_TypeGetGenreList" << std::endl; break; - case AudioCollectionRequest_Type_TypeGetArtistList: + case AudioCollectionRequest::TypeGetArtistList: if (request.has_get_artists()) { res = processGetArtists(request.get_artists(), *response.mutable_artist_list()); if (res) - response.set_type(AudioCollectionResponse_Type_TypeArtistList); + response.set_type(AudioCollectionResponse::TypeArtistList); } else std::cerr << "Bad AudioCollectionRequest_Type_TypeGetArtistList" << std::endl; break; - case AudioCollectionRequest_Type_TypeGetReleaseList: + case AudioCollectionRequest::TypeGetReleaseList: if (request.has_get_releases()) { res = processGetReleases(request.get_releases(), *response.mutable_release_list()); if (res) - response.set_type(AudioCollectionResponse_Type_TypeReleaseList); + response.set_type(AudioCollectionResponse::TypeReleaseList); } else std::cerr << "Bad AudioCollectionRequest_Type_TypeGetReleaseList" << std::endl; break; - case AudioCollectionRequest_Type_TypeGetTrackList: + case AudioCollectionRequest::TypeGetTrackList: if (request.has_get_tracks()) { res = processGetTracks(request.get_tracks(), *response.mutable_track_list()); if (res) - response.set_type(AudioCollectionResponse_Type_TypeTrackList); + response.set_type(AudioCollectionResponse::TypeTrackList); } else diff --git a/remote/server/AudioCollectionRequestHandler.hpp b/remote/server/AudioCollectionRequestHandler.hpp index 6edf8895..a3b71602 100644 --- a/remote/server/AudioCollectionRequestHandler.hpp +++ b/remote/server/AudioCollectionRequestHandler.hpp @@ -27,7 +27,7 @@ class AudioCollectionRequestHandler static const std::size_t _maxListArtists = 256; static const std::size_t _maxListGenres = 256; static const std::size_t _maxListReleases = 256; - static const std::size_t _maxListTracks = 256; + static const std::size_t _maxListTracks = 1024; }; } // namespace Remote diff --git a/remote/server/Connection.cpp b/remote/server/Connection.cpp index 50fe80fb..319d94c3 100644 --- a/remote/server/Connection.cpp +++ b/remote/server/Connection.cpp @@ -18,7 +18,8 @@ namespace Server { Connection::Connection(boost::asio::ip::tcp::socket socket, ConnectionManager& manager, RequestHandler& handler) -: _socket(std::move(socket)), +: _closing(false), +_socket(std::move(socket)), _connectionManager(manager), _requestHandler(handler) { @@ -47,8 +48,15 @@ Connection::start() void Connection::stop() { - std::cout << "Server::Connection::stop, Stopping connection" << std::endl; - _socket.close(); + if (!_closing) + { + _closing = true; + std::cout << "Server::Connection::stop, Stopping connection " << this << std::endl; + _socket.close(); + std::cout << "Server::Connection::stop, connection stopped " << this << std::endl; + } + else + std::cout << "Close in progress..." << std::endl; } void @@ -88,7 +96,7 @@ Connection::handleReadHeader(const boost::system::error_code& error, std::size_t } else if (error != boost::asio::error::operation_aborted) { - std::cerr << "Connection::handleRead: " << error.message() << std::endl; + std::cerr << "Connection::handleReadHeader: " << error.message() << std::endl; _connectionManager.stop(shared_from_this()); } } diff --git a/remote/server/Connection.hpp b/remote/server/Connection.hpp index 5a589178..8bd23a60 100644 --- a/remote/server/Connection.hpp +++ b/remote/server/Connection.hpp @@ -38,6 +38,8 @@ class Connection : public std::enable_shared_from_this void stop(); private: + bool _closing; + /// Handle completion of a read operation. void handleReadHeader(const boost::system::error_code& e, std::size_t bytes_transferred); diff --git a/remote/server/MediaRequestHandler.cpp b/remote/server/MediaRequestHandler.cpp new file mode 100644 index 00000000..b0c8fe2b --- /dev/null +++ b/remote/server/MediaRequestHandler.cpp @@ -0,0 +1,176 @@ +#include "MediaRequestHandler.hpp" + +#include "database/AudioTypes.hpp" + +namespace Remote { +namespace Server { + +MediaRequestHandler::MediaRequestHandler(DatabaseHandler& db) +: _db(db) +{} + +bool +MediaRequestHandler::process(const MediaRequest& request, MediaResponse& response) +{ + + bool res = false; + + switch (request.type()) + { + case MediaRequest::TypeMediaPrepare: + if (request.has_prepare()) + { + if (request.prepare().has_audio()) + res = processAudioPrepare(request.prepare().audio(), response); + else if (request.prepare().has_video()) + ;// TODO; + else + std::cerr << "Bad MediaRequest::TypeMediaPrepare!" << std::endl; + + } + else + std::cerr << "Bad MediaRequest::TypeMediaPrepare!" << std::endl; + break; + + case MediaRequest::TypeMediaGetPart: + if (request.has_get_part()) + res = processGetPart(request.get_part(), response); + else + std::cerr << "Bad MediaRequest::TypeMediaGet!" << std::endl; + break; + + case MediaRequest::TypeMediaTerminate: + if (request.has_terminate()) + res = processTerminate(request.terminate(), response); + else + std::cerr << "Bad MediaRequest::TypeMediaTerminate!" << std::endl; + break; + + default: + std::cerr << "Unhandled MediaRequest type = " << request.type() << std::endl; + } + + return res; +} + +bool +MediaRequestHandler::processAudioPrepare(const MediaRequest::Prepare::Audio& request, MediaResponse& response) +{ + // TODO, get user default values + Transcode::Format::Encoding format = Transcode::Format::OGA; + std::size_t bitrate = 128000; + + if (request.has_codec_type()) + { + switch( request.codec_type()) + { + case AudioCodecType::CodecTypeOGA: + format = Transcode::Format::OGA; + break; + default: + std::cerr << "Unhandled codec type = " << request.codec_type() << std::endl; + return false; + } + } + if (request.has_bitrate()) + bitrate = request.bitrate(); + + if (_transcoder) + { + response.mutable_error()->set_error(true); + response.mutable_error()->set_message("Transcode already in progress"); + response.set_type(MediaResponse::TypeError); + return true; + } + + Wt::Dbo::Transaction transaction( _db.getSession()); + + Track::pointer track = Track::getById( _db.getSession(), request.track_id() ); + + if (!track) + { + response.mutable_error()->set_error(true); + response.mutable_error()->set_message("Cannot find requested track!"); + response.set_type(MediaResponse::TypeError); + return true; + } + + try + { + Transcode::InputMediaFile inputFile(track->getPath()); + Transcode::Parameters parameters(inputFile, Transcode::Format::get( format ), bitrate); + + _transcoder = std::make_shared( parameters ); + + response.mutable_error()->set_error(false); + response.mutable_error()->set_message(""); + response.set_type(MediaResponse::TypeError); + } + catch(std::exception& e) + { + std::cerr << "Caught exception: " << e.what() << std::endl; + response.mutable_error()->set_error(true); + response.mutable_error()->set_message("exception: " + std::string(e.what())); + response.set_type(MediaResponse::TypeError); + } + + return true; +} + +bool +MediaRequestHandler::processGetPart(const MediaRequest::GetPart& request, MediaResponse& response) +{ + std::size_t dataSize = request.requested_data_size(); + if (dataSize > _maxPartSize) + dataSize = _maxPartSize; + + if (!_transcoder) + { + response.mutable_error()->set_error(true); + response.mutable_error()->set_message("No transcoder set!"); + response.set_type(MediaResponse::TypeError); + return true; + } + + while (!_transcoder->isComplete() && _transcoder->getOutputData().size() < dataSize) + _transcoder->process(); + + std::cout << "MediaRequestHandler::processGetPart, isComplete = " << std::boolalpha << _transcoder->isComplete() << ", size = " << _transcoder->getOutputData().size() << std::endl; + + Transcode::AvConvTranscoder::data_type::iterator itEnd; + if (_transcoder->getOutputData().size() > dataSize) + itEnd = _transcoder->getOutputData().begin() + dataSize; + else + itEnd = _transcoder->getOutputData().end(); + + response.set_type(MediaResponse::TypePart); + std::copy(_transcoder->getOutputData().begin(), itEnd, std::back_inserter(*response.mutable_part()->mutable_data())); + + // Consume sent bytes + _transcoder->getOutputData().erase(_transcoder->getOutputData().begin(), itEnd); + + return true; +} + + +bool +MediaRequestHandler::processTerminate(const MediaRequest::Terminate& /*request*/, MediaResponse& response) +{ + std::cout << "MediaRequestHandler: resetting transcoder" << std::endl; + _transcoder.reset(); + + assert(!_transcoder); + + response.mutable_error()->set_error(false); + response.mutable_error()->set_message(""); + response.set_type(MediaResponse::TypeError); + + return true; +} + + + +} // namespace Remote +} // namespace Server + + diff --git a/remote/server/MediaRequestHandler.hpp b/remote/server/MediaRequestHandler.hpp new file mode 100644 index 00000000..fc17ee15 --- /dev/null +++ b/remote/server/MediaRequestHandler.hpp @@ -0,0 +1,40 @@ +#ifndef REMOTE_MEDIA_REQUEST_HANDLER +#define REMOTE_MEDIA_REQUEST_HANDLER + +#include + +#include "messages/media.pb.h" + +#include "database/DatabaseHandler.hpp" +#include "transcode/AvConvTranscoder.hpp" + +namespace Remote { +namespace Server { + +class MediaRequestHandler +{ + public: + MediaRequestHandler(DatabaseHandler& db); + + bool process(const MediaRequest& request, MediaResponse& response); + + private: + + bool processAudioPrepare(const MediaRequest::Prepare::Audio& request, MediaResponse& response); + bool processGetPart(const MediaRequest::GetPart& request, MediaResponse& response); + bool processTerminate(const MediaRequest::Terminate& request, MediaResponse& response); + +// bool processVideoPrepare(const AudioCollectionRequest::GetGenreList& request, AudioCollectionResponse::GenreList& response); + + std::shared_ptr _transcoder; + + DatabaseHandler& _db; + + static const std::size_t _maxPartSize = 65536 - 128; +}; + +} // namespace Remote +} // namespace Server + +#endif + diff --git a/remote/server/RequestHandler.cpp b/remote/server/RequestHandler.cpp index c8732f73..24ac783c 100644 --- a/remote/server/RequestHandler.cpp +++ b/remote/server/RequestHandler.cpp @@ -6,7 +6,8 @@ namespace Server { RequestHandler::RequestHandler(boost::filesystem::path dbPath) : _db( dbPath ), -_audioCollectionRequestHandler(_db) +_audioCollectionRequestHandler(_db), +_mediaRequestHandler(_db) { } @@ -26,13 +27,22 @@ RequestHandler::process(const ClientMessage& request, ServerMessage& response) { res = _audioCollectionRequestHandler.process(request.audio_collection_request(), *response.mutable_audio_collection_response()); if (res) - response.set_type( ServerMessage_Type_AudioCollectionResponse); + response.set_type( ServerMessage::AudioCollectionResponse); } else std::cerr << "Malformed AudioCollectionRequest message!" << std::endl; break; case ClientMessage_Type_MediaRequest: + if (request.has_media_request()) + { + res = _mediaRequestHandler.process(request.media_request(), *response.mutable_media_response()); + if (res) + response.set_type( ServerMessage::MediaResponse); + } + else + std::cerr << "Malformed AudioCollectionRequest message!" << std::endl; + break; break; default: diff --git a/remote/server/RequestHandler.hpp b/remote/server/RequestHandler.hpp index 6611d584..3ae15e5c 100644 --- a/remote/server/RequestHandler.hpp +++ b/remote/server/RequestHandler.hpp @@ -8,6 +8,7 @@ #include "database/DatabaseHandler.hpp" #include "AudioCollectionRequestHandler.hpp" +#include "MediaRequestHandler.hpp" namespace Remote { namespace Server { @@ -26,8 +27,8 @@ class RequestHandler DatabaseHandler _db; - AudioCollectionRequestHandler _audioCollectionRequestHandler; - + AudioCollectionRequestHandler _audioCollectionRequestHandler; + MediaRequestHandler _mediaRequestHandler; }; } // namespace Server diff --git a/test/Makefile.am b/test/Makefile.am index 036c63ed..c6625800 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -6,9 +6,16 @@ check_PROGRAMS = database-integrity sql-query database-basics remote remote_SOURCES = \ $(srcdir)/RemoteClientServer.cpp \ $(srcdir)/TestDatabase.cpp \ + $(top_srcdir)/av/CodecContext.cpp \ + $(top_srcdir)/av/Common.cpp \ + $(top_srcdir)/av/Dictionary.cpp \ + $(top_srcdir)/av/FormatContext.cpp \ + $(top_srcdir)/av/InputFormatContext.cpp \ + $(top_srcdir)/av/Stream.cpp \ $(top_srcdir)/remote/server/Server.cpp \ $(top_srcdir)/remote/server/RequestHandler.cpp \ $(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp \ + $(top_srcdir)/remote/server/MediaRequestHandler.cpp \ $(top_srcdir)/remote/server/ConnectionManager.cpp \ $(top_srcdir)/remote/server/Connection.cpp \ $(top_srcdir)/remote/messages/auth.pb.cc \ @@ -16,6 +23,10 @@ remote_SOURCES = \ $(top_srcdir)/remote/messages/common.pb.cc \ $(top_srcdir)/remote/messages/media.pb.cc \ $(top_srcdir)/remote/messages/messages.pb.cc \ + $(top_srcdir)/transcode/AvConvTranscoder.cpp \ + $(top_srcdir)/transcode/Format.cpp \ + $(top_srcdir)/transcode/Parameters.cpp \ + $(top_srcdir)/transcode/InputMediaFile.cpp \ $(top_srcdir)/database/Artist.cpp \ $(top_srcdir)/database/Genre.cpp \ $(top_srcdir)/database/Release.cpp \ diff --git a/test/Makefile.in b/test/Makefile.in index 46e81f7d..9125cd4b 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -120,13 +120,19 @@ database_integrity_LDADD = $(LDADD) database_integrity_LINK = $(CXXLD) $(database_integrity_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_remote_OBJECTS = remote-RemoteClientServer.$(OBJEXT) \ - remote-TestDatabase.$(OBJEXT) remote-Server.$(OBJEXT) \ - remote-RequestHandler.$(OBJEXT) \ + remote-TestDatabase.$(OBJEXT) remote-CodecContext.$(OBJEXT) \ + remote-Common.$(OBJEXT) remote-Dictionary.$(OBJEXT) \ + remote-FormatContext.$(OBJEXT) \ + remote-InputFormatContext.$(OBJEXT) remote-Stream.$(OBJEXT) \ + remote-Server.$(OBJEXT) remote-RequestHandler.$(OBJEXT) \ remote-AudioCollectionRequestHandler.$(OBJEXT) \ + remote-MediaRequestHandler.$(OBJEXT) \ remote-ConnectionManager.$(OBJEXT) remote-Connection.$(OBJEXT) \ remote-auth.pb.$(OBJEXT) remote-collection.pb.$(OBJEXT) \ remote-common.pb.$(OBJEXT) remote-media.pb.$(OBJEXT) \ - remote-messages.pb.$(OBJEXT) remote-Artist.$(OBJEXT) \ + remote-messages.pb.$(OBJEXT) remote-AvConvTranscoder.$(OBJEXT) \ + remote-Format.$(OBJEXT) remote-Parameters.$(OBJEXT) \ + remote-InputMediaFile.$(OBJEXT) remote-Artist.$(OBJEXT) \ remote-Genre.$(OBJEXT) remote-Release.$(OBJEXT) \ remote-Track.$(OBJEXT) remote-DatabaseHandler.$(OBJEXT) \ remote-SqlQuery.$(OBJEXT) remote-Path.$(OBJEXT) \ @@ -498,9 +504,16 @@ top_srcdir = @top_srcdir@ remote_SOURCES = \ $(srcdir)/RemoteClientServer.cpp \ $(srcdir)/TestDatabase.cpp \ + $(top_srcdir)/av/CodecContext.cpp \ + $(top_srcdir)/av/Common.cpp \ + $(top_srcdir)/av/Dictionary.cpp \ + $(top_srcdir)/av/FormatContext.cpp \ + $(top_srcdir)/av/InputFormatContext.cpp \ + $(top_srcdir)/av/Stream.cpp \ $(top_srcdir)/remote/server/Server.cpp \ $(top_srcdir)/remote/server/RequestHandler.cpp \ $(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp \ + $(top_srcdir)/remote/server/MediaRequestHandler.cpp \ $(top_srcdir)/remote/server/ConnectionManager.cpp \ $(top_srcdir)/remote/server/Connection.cpp \ $(top_srcdir)/remote/messages/auth.pb.cc \ @@ -508,6 +521,10 @@ remote_SOURCES = \ $(top_srcdir)/remote/messages/common.pb.cc \ $(top_srcdir)/remote/messages/media.pb.cc \ $(top_srcdir)/remote/messages/messages.pb.cc \ + $(top_srcdir)/transcode/AvConvTranscoder.cpp \ + $(top_srcdir)/transcode/Format.cpp \ + $(top_srcdir)/transcode/Parameters.cpp \ + $(top_srcdir)/transcode/InputMediaFile.cpp \ $(top_srcdir)/database/Artist.cpp \ $(top_srcdir)/database/Genre.cpp \ $(top_srcdir)/database/Release.cpp \ @@ -632,17 +649,28 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/database_integrity-Video.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Artist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-AudioCollectionRequestHandler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-AvConvTranscoder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Checksum.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-CodecContext.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Connection.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-ConnectionManager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-DatabaseHandler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Dictionary.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Format.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-FormatContext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Genre.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-InputFormatContext.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-InputMediaFile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-MediaRequestHandler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Parameters.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Path.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Release.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-RemoteClientServer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-RequestHandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-SqlQuery.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-TestDatabase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Track.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote-Video.Po@am__quote@ @@ -976,6 +1004,90 @@ remote-TestDatabase.obj: $(srcdir)/TestDatabase.cpp @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-TestDatabase.obj `if test -f '$(srcdir)/TestDatabase.cpp'; then $(CYGPATH_W) '$(srcdir)/TestDatabase.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/TestDatabase.cpp'; fi` +remote-CodecContext.o: $(top_srcdir)/av/CodecContext.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-CodecContext.o -MD -MP -MF $(DEPDIR)/remote-CodecContext.Tpo -c -o remote-CodecContext.o `test -f '$(top_srcdir)/av/CodecContext.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/CodecContext.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-CodecContext.Tpo $(DEPDIR)/remote-CodecContext.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/CodecContext.cpp' object='remote-CodecContext.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-CodecContext.o `test -f '$(top_srcdir)/av/CodecContext.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/CodecContext.cpp + +remote-CodecContext.obj: $(top_srcdir)/av/CodecContext.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-CodecContext.obj -MD -MP -MF $(DEPDIR)/remote-CodecContext.Tpo -c -o remote-CodecContext.obj `if test -f '$(top_srcdir)/av/CodecContext.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/CodecContext.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/CodecContext.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-CodecContext.Tpo $(DEPDIR)/remote-CodecContext.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/CodecContext.cpp' object='remote-CodecContext.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-CodecContext.obj `if test -f '$(top_srcdir)/av/CodecContext.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/CodecContext.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/CodecContext.cpp'; fi` + +remote-Common.o: $(top_srcdir)/av/Common.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Common.o -MD -MP -MF $(DEPDIR)/remote-Common.Tpo -c -o remote-Common.o `test -f '$(top_srcdir)/av/Common.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/Common.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Common.Tpo $(DEPDIR)/remote-Common.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/Common.cpp' object='remote-Common.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Common.o `test -f '$(top_srcdir)/av/Common.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/Common.cpp + +remote-Common.obj: $(top_srcdir)/av/Common.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Common.obj -MD -MP -MF $(DEPDIR)/remote-Common.Tpo -c -o remote-Common.obj `if test -f '$(top_srcdir)/av/Common.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/Common.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/Common.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Common.Tpo $(DEPDIR)/remote-Common.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/Common.cpp' object='remote-Common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Common.obj `if test -f '$(top_srcdir)/av/Common.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/Common.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/Common.cpp'; fi` + +remote-Dictionary.o: $(top_srcdir)/av/Dictionary.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Dictionary.o -MD -MP -MF $(DEPDIR)/remote-Dictionary.Tpo -c -o remote-Dictionary.o `test -f '$(top_srcdir)/av/Dictionary.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/Dictionary.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Dictionary.Tpo $(DEPDIR)/remote-Dictionary.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/Dictionary.cpp' object='remote-Dictionary.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Dictionary.o `test -f '$(top_srcdir)/av/Dictionary.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/Dictionary.cpp + +remote-Dictionary.obj: $(top_srcdir)/av/Dictionary.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Dictionary.obj -MD -MP -MF $(DEPDIR)/remote-Dictionary.Tpo -c -o remote-Dictionary.obj `if test -f '$(top_srcdir)/av/Dictionary.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/Dictionary.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/Dictionary.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Dictionary.Tpo $(DEPDIR)/remote-Dictionary.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/Dictionary.cpp' object='remote-Dictionary.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Dictionary.obj `if test -f '$(top_srcdir)/av/Dictionary.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/Dictionary.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/Dictionary.cpp'; fi` + +remote-FormatContext.o: $(top_srcdir)/av/FormatContext.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-FormatContext.o -MD -MP -MF $(DEPDIR)/remote-FormatContext.Tpo -c -o remote-FormatContext.o `test -f '$(top_srcdir)/av/FormatContext.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/FormatContext.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-FormatContext.Tpo $(DEPDIR)/remote-FormatContext.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/FormatContext.cpp' object='remote-FormatContext.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-FormatContext.o `test -f '$(top_srcdir)/av/FormatContext.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/FormatContext.cpp + +remote-FormatContext.obj: $(top_srcdir)/av/FormatContext.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-FormatContext.obj -MD -MP -MF $(DEPDIR)/remote-FormatContext.Tpo -c -o remote-FormatContext.obj `if test -f '$(top_srcdir)/av/FormatContext.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/FormatContext.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/FormatContext.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-FormatContext.Tpo $(DEPDIR)/remote-FormatContext.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/FormatContext.cpp' object='remote-FormatContext.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-FormatContext.obj `if test -f '$(top_srcdir)/av/FormatContext.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/FormatContext.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/FormatContext.cpp'; fi` + +remote-InputFormatContext.o: $(top_srcdir)/av/InputFormatContext.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-InputFormatContext.o -MD -MP -MF $(DEPDIR)/remote-InputFormatContext.Tpo -c -o remote-InputFormatContext.o `test -f '$(top_srcdir)/av/InputFormatContext.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/InputFormatContext.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-InputFormatContext.Tpo $(DEPDIR)/remote-InputFormatContext.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/InputFormatContext.cpp' object='remote-InputFormatContext.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-InputFormatContext.o `test -f '$(top_srcdir)/av/InputFormatContext.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/InputFormatContext.cpp + +remote-InputFormatContext.obj: $(top_srcdir)/av/InputFormatContext.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-InputFormatContext.obj -MD -MP -MF $(DEPDIR)/remote-InputFormatContext.Tpo -c -o remote-InputFormatContext.obj `if test -f '$(top_srcdir)/av/InputFormatContext.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/InputFormatContext.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/InputFormatContext.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-InputFormatContext.Tpo $(DEPDIR)/remote-InputFormatContext.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/InputFormatContext.cpp' object='remote-InputFormatContext.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-InputFormatContext.obj `if test -f '$(top_srcdir)/av/InputFormatContext.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/InputFormatContext.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/InputFormatContext.cpp'; fi` + +remote-Stream.o: $(top_srcdir)/av/Stream.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Stream.o -MD -MP -MF $(DEPDIR)/remote-Stream.Tpo -c -o remote-Stream.o `test -f '$(top_srcdir)/av/Stream.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/Stream.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Stream.Tpo $(DEPDIR)/remote-Stream.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/Stream.cpp' object='remote-Stream.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Stream.o `test -f '$(top_srcdir)/av/Stream.cpp' || echo '$(srcdir)/'`$(top_srcdir)/av/Stream.cpp + +remote-Stream.obj: $(top_srcdir)/av/Stream.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Stream.obj -MD -MP -MF $(DEPDIR)/remote-Stream.Tpo -c -o remote-Stream.obj `if test -f '$(top_srcdir)/av/Stream.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/Stream.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/Stream.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Stream.Tpo $(DEPDIR)/remote-Stream.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/av/Stream.cpp' object='remote-Stream.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Stream.obj `if test -f '$(top_srcdir)/av/Stream.cpp'; then $(CYGPATH_W) '$(top_srcdir)/av/Stream.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/av/Stream.cpp'; fi` + remote-Server.o: $(top_srcdir)/remote/server/Server.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Server.o -MD -MP -MF $(DEPDIR)/remote-Server.Tpo -c -o remote-Server.o `test -f '$(top_srcdir)/remote/server/Server.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/Server.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Server.Tpo $(DEPDIR)/remote-Server.Po @@ -1018,6 +1130,20 @@ remote-AudioCollectionRequestHandler.obj: $(top_srcdir)/remote/server/AudioColle @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-AudioCollectionRequestHandler.obj `if test -f '$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/AudioCollectionRequestHandler.cpp'; fi` +remote-MediaRequestHandler.o: $(top_srcdir)/remote/server/MediaRequestHandler.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-MediaRequestHandler.o -MD -MP -MF $(DEPDIR)/remote-MediaRequestHandler.Tpo -c -o remote-MediaRequestHandler.o `test -f '$(top_srcdir)/remote/server/MediaRequestHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/MediaRequestHandler.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-MediaRequestHandler.Tpo $(DEPDIR)/remote-MediaRequestHandler.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/MediaRequestHandler.cpp' object='remote-MediaRequestHandler.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-MediaRequestHandler.o `test -f '$(top_srcdir)/remote/server/MediaRequestHandler.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/MediaRequestHandler.cpp + +remote-MediaRequestHandler.obj: $(top_srcdir)/remote/server/MediaRequestHandler.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-MediaRequestHandler.obj -MD -MP -MF $(DEPDIR)/remote-MediaRequestHandler.Tpo -c -o remote-MediaRequestHandler.obj `if test -f '$(top_srcdir)/remote/server/MediaRequestHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/MediaRequestHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/MediaRequestHandler.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-MediaRequestHandler.Tpo $(DEPDIR)/remote-MediaRequestHandler.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/remote/server/MediaRequestHandler.cpp' object='remote-MediaRequestHandler.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-MediaRequestHandler.obj `if test -f '$(top_srcdir)/remote/server/MediaRequestHandler.cpp'; then $(CYGPATH_W) '$(top_srcdir)/remote/server/MediaRequestHandler.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/server/MediaRequestHandler.cpp'; fi` + remote-ConnectionManager.o: $(top_srcdir)/remote/server/ConnectionManager.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-ConnectionManager.o -MD -MP -MF $(DEPDIR)/remote-ConnectionManager.Tpo -c -o remote-ConnectionManager.o `test -f '$(top_srcdir)/remote/server/ConnectionManager.cpp' || echo '$(srcdir)/'`$(top_srcdir)/remote/server/ConnectionManager.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-ConnectionManager.Tpo $(DEPDIR)/remote-ConnectionManager.Po @@ -1116,6 +1242,62 @@ remote-messages.pb.obj: $(top_srcdir)/remote/messages/messages.pb.cc @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-messages.pb.obj `if test -f '$(top_srcdir)/remote/messages/messages.pb.cc'; then $(CYGPATH_W) '$(top_srcdir)/remote/messages/messages.pb.cc'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/remote/messages/messages.pb.cc'; fi` +remote-AvConvTranscoder.o: $(top_srcdir)/transcode/AvConvTranscoder.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-AvConvTranscoder.o -MD -MP -MF $(DEPDIR)/remote-AvConvTranscoder.Tpo -c -o remote-AvConvTranscoder.o `test -f '$(top_srcdir)/transcode/AvConvTranscoder.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/AvConvTranscoder.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-AvConvTranscoder.Tpo $(DEPDIR)/remote-AvConvTranscoder.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/AvConvTranscoder.cpp' object='remote-AvConvTranscoder.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-AvConvTranscoder.o `test -f '$(top_srcdir)/transcode/AvConvTranscoder.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/AvConvTranscoder.cpp + +remote-AvConvTranscoder.obj: $(top_srcdir)/transcode/AvConvTranscoder.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-AvConvTranscoder.obj -MD -MP -MF $(DEPDIR)/remote-AvConvTranscoder.Tpo -c -o remote-AvConvTranscoder.obj `if test -f '$(top_srcdir)/transcode/AvConvTranscoder.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/AvConvTranscoder.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/AvConvTranscoder.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-AvConvTranscoder.Tpo $(DEPDIR)/remote-AvConvTranscoder.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/AvConvTranscoder.cpp' object='remote-AvConvTranscoder.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-AvConvTranscoder.obj `if test -f '$(top_srcdir)/transcode/AvConvTranscoder.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/AvConvTranscoder.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/AvConvTranscoder.cpp'; fi` + +remote-Format.o: $(top_srcdir)/transcode/Format.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Format.o -MD -MP -MF $(DEPDIR)/remote-Format.Tpo -c -o remote-Format.o `test -f '$(top_srcdir)/transcode/Format.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/Format.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Format.Tpo $(DEPDIR)/remote-Format.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/Format.cpp' object='remote-Format.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Format.o `test -f '$(top_srcdir)/transcode/Format.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/Format.cpp + +remote-Format.obj: $(top_srcdir)/transcode/Format.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Format.obj -MD -MP -MF $(DEPDIR)/remote-Format.Tpo -c -o remote-Format.obj `if test -f '$(top_srcdir)/transcode/Format.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/Format.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/Format.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Format.Tpo $(DEPDIR)/remote-Format.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/Format.cpp' object='remote-Format.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Format.obj `if test -f '$(top_srcdir)/transcode/Format.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/Format.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/Format.cpp'; fi` + +remote-Parameters.o: $(top_srcdir)/transcode/Parameters.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Parameters.o -MD -MP -MF $(DEPDIR)/remote-Parameters.Tpo -c -o remote-Parameters.o `test -f '$(top_srcdir)/transcode/Parameters.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/Parameters.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Parameters.Tpo $(DEPDIR)/remote-Parameters.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/Parameters.cpp' object='remote-Parameters.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Parameters.o `test -f '$(top_srcdir)/transcode/Parameters.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/Parameters.cpp + +remote-Parameters.obj: $(top_srcdir)/transcode/Parameters.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Parameters.obj -MD -MP -MF $(DEPDIR)/remote-Parameters.Tpo -c -o remote-Parameters.obj `if test -f '$(top_srcdir)/transcode/Parameters.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/Parameters.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/Parameters.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Parameters.Tpo $(DEPDIR)/remote-Parameters.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/Parameters.cpp' object='remote-Parameters.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-Parameters.obj `if test -f '$(top_srcdir)/transcode/Parameters.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/Parameters.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/Parameters.cpp'; fi` + +remote-InputMediaFile.o: $(top_srcdir)/transcode/InputMediaFile.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-InputMediaFile.o -MD -MP -MF $(DEPDIR)/remote-InputMediaFile.Tpo -c -o remote-InputMediaFile.o `test -f '$(top_srcdir)/transcode/InputMediaFile.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/InputMediaFile.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-InputMediaFile.Tpo $(DEPDIR)/remote-InputMediaFile.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/InputMediaFile.cpp' object='remote-InputMediaFile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-InputMediaFile.o `test -f '$(top_srcdir)/transcode/InputMediaFile.cpp' || echo '$(srcdir)/'`$(top_srcdir)/transcode/InputMediaFile.cpp + +remote-InputMediaFile.obj: $(top_srcdir)/transcode/InputMediaFile.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-InputMediaFile.obj -MD -MP -MF $(DEPDIR)/remote-InputMediaFile.Tpo -c -o remote-InputMediaFile.obj `if test -f '$(top_srcdir)/transcode/InputMediaFile.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/InputMediaFile.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/InputMediaFile.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-InputMediaFile.Tpo $(DEPDIR)/remote-InputMediaFile.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$(top_srcdir)/transcode/InputMediaFile.cpp' object='remote-InputMediaFile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -c -o remote-InputMediaFile.obj `if test -f '$(top_srcdir)/transcode/InputMediaFile.cpp'; then $(CYGPATH_W) '$(top_srcdir)/transcode/InputMediaFile.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/transcode/InputMediaFile.cpp'; fi` + remote-Artist.o: $(top_srcdir)/database/Artist.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(remote_CXXFLAGS) $(CXXFLAGS) -MT remote-Artist.o -MD -MP -MF $(DEPDIR)/remote-Artist.Tpo -c -o remote-Artist.o `test -f '$(top_srcdir)/database/Artist.cpp' || echo '$(srcdir)/'`$(top_srcdir)/database/Artist.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/remote-Artist.Tpo $(DEPDIR)/remote-Artist.Po diff --git a/test/RemoteClientServer.cpp b/test/RemoteClientServer.cpp index 50e73de8..6f1f88a1 100644 --- a/test/RemoteClientServer.cpp +++ b/test/RemoteClientServer.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -10,6 +11,8 @@ #include "remote/messages/Header.hpp" #include "remote/messages/messages.pb.h" +#include "av/Common.hpp" + #include "TestDatabase.hpp" struct GenreInfo @@ -85,9 +88,9 @@ class TestServer _server.run(); } - void stop() + ~TestServer() { - _ioService.stop(); + _server.stop(); _thread.join(); } @@ -172,7 +175,7 @@ class TestClient void getGenres(std::vector& genres) { - const std::size_t requestedBatchSize = 128; + const std::size_t requestedBatchSize = 8; std::size_t offset = 0; std::size_t res = 0; @@ -225,7 +228,7 @@ class TestClient void getReleases(std::vector& releases, const std::vector artistIds) { - const std::size_t requestedBatchSize = 128; + const std::size_t requestedBatchSize = 256; std::size_t offset = 0; std::size_t res = 0; @@ -281,7 +284,7 @@ class TestClient void getTracks(std::vector& tracks, const std::vector artistIds, const std::vector releaseIds, const std::vector genreIds) { - const std::size_t requestedBatchSize = 256; + const std::size_t requestedBatchSize = 0; std::size_t offset = 0; std::size_t res = 0; @@ -342,8 +345,154 @@ class TestClient return nbAdded; } + + void getMediaAudio(uint64_t audioId, std::vector& data) + { + + // Prepare + mediaAudioPrepare( audioId ); + + // Get while available + mediaGet( data ); + + // Terminate + mediaTerminate(); + } + + private: + void mediaAudioPrepare(uint64_t audioId) + { + + // Send request + Remote::ClientMessage request; + + request.set_type( Remote::ClientMessage_Type_MediaRequest); + + request.mutable_media_request()->set_type( Remote::MediaRequest_Type_TypeMediaPrepare); + request.mutable_media_request()->mutable_prepare()->set_type(Remote::MediaRequest_Prepare_Type_AudioRequest); + + // Set fields + request.mutable_media_request()->mutable_prepare()->mutable_audio()->set_track_id( audioId ); + + std::cout << "Sending prepare request" << std::endl; + sendMsg(request); + + std::cout << "Waiting for response" << std::endl; + // Receive response + Remote::ServerMessage response; + recvMsg(response); + + std::cout << "Got a response" << std::endl; + + // Process message + if (!response.has_media_response()) + throw std::runtime_error("Preapre: not an media reponse!"); + + if (!response.media_response().has_error()) + throw std::runtime_error("Prepare: not an error msg!"); + + if (response.media_response().error().error()) + throw std::runtime_error("Prepare failed: '" + response.media_response().error().message() + "'"); + + } + + void mediaGet(std::vector& data) + { + while (mediaGetPart(data) > 0) + ; + } + + + std::size_t mediaGetPart(std::vector& data) + { + // Send request + Remote::ClientMessage request; + + request.set_type( Remote::ClientMessage::MediaRequest); + + request.mutable_media_request()->set_type( Remote::MediaRequest::TypeMediaGetPart); + request.mutable_media_request()->mutable_get_part()->set_requested_data_size(65536); + + std::cout << "Sending GetPart request" << std::endl; + sendMsg(request); + + std::cout << "Waiting for response" << std::endl; + // Receive response + Remote::ServerMessage response; + recvMsg(response); + + std::cout << "Got a response" << std::endl; + + if (!response.has_media_response()) + throw std::runtime_error("not an media response"); + + // Process message + switch( response.media_response().type()) + { + case Remote::MediaResponse::TypeError: + { + std::string msg; + if (response.media_response().has_error()) + { + if (response.media_response().error().has_message()) + throw std::runtime_error("Error spotted: '" + response.media_response().error().message()+ "'"); + else + throw std::runtime_error("Error spotted, no msg"); + } + else + throw std::runtime_error("Error spotted but no error message"); + } + break; + + case Remote::MediaResponse::TypePart: + if (!response.media_response().has_part()) + throw std::runtime_error("not an media part"); + + std::copy(response.media_response().part().data().begin(), response.media_response().part().data().end(), std::back_inserter(data)); + + return response.media_response().part().data().size(); + break; + + default: + throw std::runtime_error("Unhandled response.media_response().type()!"); + } + + return 0; + } + + void mediaTerminate(void) + { + // Send request + Remote::ClientMessage request; + + request.set_type( Remote::ClientMessage::MediaRequest); + + request.mutable_media_request()->set_type( Remote::MediaRequest::TypeMediaTerminate); + request.mutable_media_request()->mutable_terminate(); + + + sendMsg(request); + + // Receive response + Remote::ServerMessage response; + recvMsg(response); + + + // Process message + if (!response.has_media_response()) + throw std::runtime_error("Terminate: not an media response"); + + if (!response.media_response().has_error()) + throw std::runtime_error("Terminate: not an error msg!"); + + if (response.media_response().error().error()) + throw std::runtime_error("Terminate failed: '" + response.media_response().error().message() + "'"); + + } + + void sendMsg(const ::google::protobuf::Message& message) { std::ostream os(&_outputStreamBuf); @@ -431,6 +580,11 @@ class TestClient int main() { try { + // lib init + Av::AvInit(); + Transcode::AvConvTranscoder::init(); + + bool extendedTests = false; // Runs in its own thread // Listen on any @@ -440,20 +594,18 @@ int main() // connect to loopback TestClient client( boost::asio::ip::tcp::endpoint( boost::asio::ip::address_v4::loopback(), 5080)); - // Get Artists + // ****** Artists ********* std::vector artists; client.getArtists(artists); - // Dump artists std::cout << "Got " << artists.size() << " artists!" << std::endl; BOOST_FOREACH(const ArtistInfo& artist, artists) std::cout << "Artist: '" << artist << "'" << std::endl; - // Get genres + // ***** Genres ********* std::vector genres; client.getGenres(genres); - // Dump genres std::cout << "Got " << genres.size() << " genres!" << std::endl; BOOST_FOREACH(const GenreInfo& genre, genres) std::cout << "Genre: '" << genre << "'" << std::endl; @@ -465,25 +617,44 @@ int main() std::cout << "Release: '" << release << "'" << std::endl; // **** Tracks ****** -/* { + { std::vector tracks; client.getTracks(tracks, std::vector(), std::vector(), std::vector()); BOOST_FOREACH(const TrackInfo& track, tracks) std::cout << "Track: '" << track << "'" << std::endl; - }*/ - - BOOST_FOREACH(const ArtistInfo& artist, artists) - { - // Get the tracks for each artist - std::vector tracks; - client.getTracks(tracks, std::vector(1, artist.id), std::vector(), std::vector()); - - std::cout << "Artist '" << artist.name << "', nb tracks = " << tracks.size() << std::endl; - BOOST_FOREACH(const TrackInfo& track, tracks) - std::cout << "Track: '" << track << "'" << std::endl; } - testServer.stop(); + // Caution: long test! + if (extendedTests) + { + BOOST_FOREACH(const ArtistInfo& artist, artists) + { + // Get the tracks for each artist + std::vector tracks; + client.getTracks(tracks, std::vector(1, artist.id), std::vector(), std::vector()); + + std::cout << "Artist '" << artist.name << "', nb tracks = " << tracks.size() << std::endl; + BOOST_FOREACH(const TrackInfo& track, tracks) + std::cout << "Track: '" << track << "'" << std::endl; + } + } + + // ****** Transcode test ******** + { + std::vector data; + client.getMediaAudio(1, data); + + std::cout << "Media size = " << data.size() << std::endl; + } + { + std::vector data; + client.getMediaAudio(100, data); + + std::cout << "Media size = " << data.size() << std::endl; + } + + + std::cout << "End of tests!" << std::endl; } catch(std::exception& e) { @@ -491,6 +662,7 @@ int main() return EXIT_FAILURE; } + std::cout << "Normal quit..." << std::endl; return EXIT_SUCCESS; } diff --git a/transcode/AvConvTranscoder.cpp b/transcode/AvConvTranscoder.cpp index 53a08001..678a8627 100644 --- a/transcode/AvConvTranscoder.cpp +++ b/transcode/AvConvTranscoder.cpp @@ -121,7 +121,7 @@ AvConvTranscoder::AvConvTranscoder(const Parameters& parameters) } - void +void AvConvTranscoder::process(void) { std::size_t readDatasSize = 1024; // TODO parametrize elsewhere?