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

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: Disable VP9 correctly in hosts. 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
Index: remoting/codec/video_decoder_vpx.cc
diff --git a/remoting/codec/video_decoder_vpx.cc b/remoting/codec/video_decoder_vpx.cc
index a312ba059fe769837f157387f01db42e9e79c045..fd0069d3ed9bf265914215c8d394a239781a2ba2 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) {

Powered by Google App Engine
This is Rietveld 408576698