Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1287)

Unified Diff: remoting/codec/video_decoder_vpx.cc

Issue 26921005: Add VP9 decode support to the remoting client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update libvpx/webm comment. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/codec/video_decoder_vpx.h ('k') | remoting/codec/video_encoder_vpx.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/codec/video_decoder_vpx.cc
diff --git a/remoting/codec/video_decoder_vpx.cc b/remoting/codec/video_decoder_vpx.cc
index ba65e88bc0c425d2d3124da5836f4bda50601d3a..156c233f8f8c12e846b09faa937a4d00321915eb 100644
--- a/remoting/codec/video_decoder_vpx.cc
+++ b/remoting/codec/video_decoder_vpx.cc
@@ -61,6 +61,26 @@ scoped_ptr<VideoDecoderVpx> VideoDecoderVpx::CreateForVP8() {
return scoped_ptr<VideoDecoderVpx>(new VideoDecoderVpx(codec.Pass()));
}
+// static
+scoped_ptr<VideoDecoderVpx> VideoDecoderVpx::CreateForVP9() {
+ ScopedVpxCodec codec(new vpx_codec_ctx_t);
+
+ // TODO(hclam): Scale the number of threads with number of cores of the
+ // machine.
+ vpx_codec_dec_cfg config;
+ config.w = 0;
+ config.h = 0;
+ config.threads = 2;
+ vpx_codec_err_t ret =
+ vpx_codec_dec_init(codec.get(), vpx_codec_vp9_dx(), &config, 0);
+ if (ret != VPX_CODEC_OK) {
+ LOG(INFO) << "Cannot initialize codec.";
+ return scoped_ptr<VideoDecoderVpx>();
+ }
+
+ return scoped_ptr<VideoDecoderVpx>(new VideoDecoderVpx(codec.Pass()));
+}
+
VideoDecoderVpx::~VideoDecoderVpx() {}
void VideoDecoderVpx::Initialize(const webrtc::DesktopSize& screen_size) {
« no previous file with comments | « remoting/codec/video_decoder_vpx.h ('k') | remoting/codec/video_encoder_vpx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698