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

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

Issue 496203002: Pepper: PPB_VideoDecoder software-only mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 6 years, 4 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: content/renderer/pepper/pepper_video_decoder_host.cc
diff --git a/content/renderer/pepper/pepper_video_decoder_host.cc b/content/renderer/pepper/pepper_video_decoder_host.cc
index 3f39c940e74ed86bd576eb29ae20a49204f9965e..086c15093c10fd8b481b95285c4dc0a2e1c15d34 100644
--- a/content/renderer/pepper/pepper_video_decoder_host.cc
+++ b/content/renderer/pepper/pepper_video_decoder_host.cc
@@ -111,7 +111,7 @@ int32_t PepperVideoDecoderHost::OnHostMsgInitialize(
ppapi::host::HostMessageContext* context,
const ppapi::HostResource& graphics_context,
PP_VideoProfile profile,
- bool allow_software_fallback) {
+ PP_HardwareAcceleration acceleration) {
if (initialized_)
return PP_ERROR_FAILED;
@@ -128,23 +128,24 @@ int32_t PepperVideoDecoderHost::OnHostMsgInitialize(
media::VideoCodecProfile media_profile = PepperToMediaVideoProfile(profile);
- // This is not synchronous, but subsequent IPC messages will be buffered, so
- // it is okay to immediately send IPC messages through the returned channel.
- GpuChannelHost* channel = graphics3d->channel();
- DCHECK(channel);
- decoder_ = channel->CreateVideoDecoder(command_buffer_route_id);
- if (decoder_ && decoder_->Initialize(media_profile, this)) {
- initialized_ = true;
- return PP_OK;
+ if (acceleration != PP_HARDWAREACCELERATION_NONE) {
+ // This is not synchronous, but subsequent IPC messages will be buffered, so
+ // it is okay to immediately send IPC messages through the returned channel.
+ GpuChannelHost* channel = graphics3d->channel();
+ DCHECK(channel);
+ decoder_ = channel->CreateVideoDecoder(command_buffer_route_id);
+ if (decoder_ && decoder_->Initialize(media_profile, this)) {
+ initialized_ = true;
+ return PP_OK;
+ }
+ decoder_.reset();
+ if (acceleration == PP_HARDWAREACCELERATION_ONLY)
+ return PP_ERROR_NOTSUPPORTED;
}
- decoder_.reset();
#if defined(OS_ANDROID)
return PP_ERROR_NOTSUPPORTED;
#else
- if (!allow_software_fallback)
- return PP_ERROR_NOTSUPPORTED;
-
decoder_.reset(new VideoDecoderShim(this));
initialize_reply_context_ = context->MakeReplyMessageContext();
decoder_->Initialize(media_profile, this);
« no previous file with comments | « content/renderer/pepper/pepper_video_decoder_host.h ('k') | native_client_sdk/src/examples/api/video_decode/video_decode.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698