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

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: Addressed comments 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
« no previous file with comments | « content/renderer/pepper/video_decoder_shim.h ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9dab8b96ae2631f9d17930cc2c6ea3ff419f8f68 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";
+ 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;
« no previous file with comments | « content/renderer/pepper/video_decoder_shim.h ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698