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

Unified Diff: content/renderer/pepper/video_decoder_shim.cc

Issue 1485043002: Passed is_encrypted parameter to the VDA initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years 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: content/renderer/pepper/video_decoder_shim.cc
diff --git a/content/renderer/pepper/video_decoder_shim.cc b/content/renderer/pepper/video_decoder_shim.cc
index 84dd33a4f367b527692cb90a09c12b92d4dbc5c2..bdbebd78e0833789b4c2d71b7c9c91837fb02975 100644
--- a/content/renderer/pepper/video_decoder_shim.cc
+++ b/content/renderer/pepper/video_decoder_shim.cc
@@ -868,18 +868,22 @@ VideoDecoderShim::~VideoDecoderShim() {
base::Owned(decoder_impl_.release())));
}
-bool VideoDecoderShim::Initialize(
- media::VideoCodecProfile profile,
- media::VideoDecodeAccelerator::Client* client) {
+bool VideoDecoderShim::Initialize(const Config& vda_config, Client* client) {
DCHECK_EQ(client, host_);
DCHECK(RenderThreadImpl::current());
DCHECK_EQ(state_, UNINITIALIZED);
+
+ if (vda_config.is_encrypted) {
+ NOTREACHED() << "Encrypted streams are not supported for this VDA";
Pawel Osciak 2015/12/04 00:48:58 s/for this VDA//
Tima Vaisburd 2015/12/04 01:36:51 Done.
+ return false;
+ }
+
media::VideoCodec codec = media::kUnknownVideoCodec;
- if (profile <= media::H264PROFILE_MAX)
+ if (vda_config.profile <= media::H264PROFILE_MAX)
codec = media::kCodecH264;
- else if (profile <= media::VP8PROFILE_MAX)
+ else if (vda_config.profile <= media::VP8PROFILE_MAX)
codec = media::kCodecVP8;
- else if (profile <= media::VP9PROFILE_MAX)
+ else if (vda_config.profile <= media::VP9PROFILE_MAX)
codec = media::kCodecVP9;
DCHECK_NE(codec, media::kUnknownVideoCodec);
@@ -889,8 +893,9 @@ bool VideoDecoderShim::Initialize(
if (!yuv_converter_->Initialize())
return false;
- media::VideoDecoderConfig config(
- codec, profile, media::PIXEL_FORMAT_YV12, media::COLOR_SPACE_UNSPECIFIED,
+ media::VideoDecoderConfig video_decoder_config(
+ codec, vda_config.profile, media::PIXEL_FORMAT_YV12,
+ media::COLOR_SPACE_UNSPECIFIED,
gfx::Size(32, 24), // Small sizes that won't fail.
gfx::Rect(32, 24), gfx::Size(32, 24),
// TODO(bbudge): Verify extra data isn't needed.
@@ -899,8 +904,7 @@ bool VideoDecoderShim::Initialize(
media_task_runner_->PostTask(
FROM_HERE,
base::Bind(&VideoDecoderShim::DecoderImpl::Initialize,
- base::Unretained(decoder_impl_.get()),
- config));
+ base::Unretained(decoder_impl_.get()), video_decoder_config));
state_ = DECODING;

Powered by Google App Engine
This is Rietveld 408576698