diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-22 01:53:39 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-22 01:53:39 +0000 |
commit | 87196ce1202e3fdbaff773b40374995f8a14aca3 (patch) | |
tree | 71c696306305596a3ae31230dc9628c6fc8a5cbb /remoting/protocol | |
parent | 6be0c2a3d8906f07f98a55212633c91c913b0d6f (diff) | |
download | chromium_src-87196ce1202e3fdbaff773b40374995f8a14aca3.zip chromium_src-87196ce1202e3fdbaff773b40374995f8a14aca3.tar.gz chromium_src-87196ce1202e3fdbaff773b40374995f8a14aca3.tar.bz2 |
Add VP9 decode support to the remoting client.
BUG=260879
Review URL: https://codereview.chromium.org/26921005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230003 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol')
-rw-r--r-- | remoting/protocol/content_description.cc | 1 | ||||
-rw-r--r-- | remoting/protocol/session_config.cc | 21 | ||||
-rw-r--r-- | remoting/protocol/session_config.h | 5 | ||||
-rw-r--r-- | remoting/protocol/video_reader.cc | 3 |
4 files changed, 28 insertions, 2 deletions
diff --git a/remoting/protocol/content_description.cc b/remoting/protocol/content_description.cc index e2c2c86..7a2db7d 100644 --- a/remoting/protocol/content_description.cc +++ b/remoting/protocol/content_description.cc @@ -47,6 +47,7 @@ const NameMapElement<ChannelConfig::TransportType> kTransports[] = { const NameMapElement<ChannelConfig::Codec> kCodecs[] = { { ChannelConfig::CODEC_VERBATIM, "verbatim" }, { ChannelConfig::CODEC_VP8, "vp8" }, + { ChannelConfig::CODEC_VP9, "vp9" }, { ChannelConfig::CODEC_ZIP, "zip" }, { ChannelConfig::CODEC_OPUS, "opus" }, { ChannelConfig::CODEC_SPEEX, "speex" }, diff --git a/remoting/protocol/session_config.cc b/remoting/protocol/session_config.cc index 7e3100a..bee25d0 100644 --- a/remoting/protocol/session_config.cc +++ b/remoting/protocol/session_config.cc @@ -195,6 +195,10 @@ scoped_ptr<CandidateSessionConfig> CandidateSessionConfig::CreateDefault() { result->mutable_video_configs()->push_back( ChannelConfig(ChannelConfig::TRANSPORT_STREAM, kDefaultStreamVersion, + ChannelConfig::CODEC_VP9)); + result->mutable_video_configs()->push_back( + ChannelConfig(ChannelConfig::TRANSPORT_STREAM, + kDefaultStreamVersion, ChannelConfig::CODEC_VP8)); // Audio channel. @@ -209,10 +213,25 @@ scoped_ptr<CandidateSessionConfig> CandidateSessionConfig::CreateDefault() { // static void CandidateSessionConfig::DisableAudioChannel( - CandidateSessionConfig* config) { + CandidateSessionConfig* config) { config->mutable_audio_configs()->clear(); config->mutable_audio_configs()->push_back(ChannelConfig()); } +// static +void CandidateSessionConfig::DisableVideoCodec( + CandidateSessionConfig* config, + ChannelConfig::Codec codec) { + std ::vector<ChannelConfig>::iterator i; + for (i = config->mutable_video_configs()->begin(); + i != config->mutable_video_configs()->end();) { + if (i->codec == codec) { + i = config->mutable_video_configs()->erase(i); + } else { + ++i; + } + } +} + } // namespace protocol } // namespace remoting diff --git a/remoting/protocol/session_config.h b/remoting/protocol/session_config.h index ac5f0c1..b3fa90a 100644 --- a/remoting/protocol/session_config.h +++ b/remoting/protocol/session_config.h @@ -32,6 +32,7 @@ struct ChannelConfig { CODEC_VERBATIM, CODEC_ZIP, CODEC_VP8, + CODEC_VP9, CODEC_OPUS, CODEC_SPEEX, }; @@ -157,8 +158,10 @@ class CandidateSessionConfig { const SessionConfig& config); static scoped_ptr<CandidateSessionConfig> CreateDefault(); - // Helper method that modifies |config| to disable audio support. + // Modifies |config| to disable specific features. static void DisableAudioChannel(CandidateSessionConfig* config); + static void DisableVideoCodec(CandidateSessionConfig* config, + ChannelConfig::Codec codec); private: CandidateSessionConfig(); diff --git a/remoting/protocol/video_reader.cc b/remoting/protocol/video_reader.cc index 8fd3afe5..0dfa10a 100644 --- a/remoting/protocol/video_reader.cc +++ b/remoting/protocol/video_reader.cc @@ -19,6 +19,9 @@ scoped_ptr<VideoReader> VideoReader::Create(const SessionConfig& config) { if (video_config.codec == ChannelConfig::CODEC_VP8) { return scoped_ptr<VideoReader>( new ProtobufVideoReader(VideoPacketFormat::ENCODING_VP8)); + } else if (video_config.codec == ChannelConfig::CODEC_VP9) { + return scoped_ptr<VideoReader>( + new ProtobufVideoReader(VideoPacketFormat::ENCODING_VP9)); } else if (video_config.codec == ChannelConfig::CODEC_ZIP) { return scoped_ptr<VideoReader>( new ProtobufVideoReader(VideoPacketFormat::ENCODING_ZLIB)); |