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

Unified Diff: media/gpu/dxva_video_decode_accelerator_win.cc

Issue 2495753002: Reenable idle suspension of media elements on Windows. (Closed)
Patch Set: change ifdef Created 4 years, 1 month 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 | « media/gpu/dxva_video_decode_accelerator_win.h ('k') | media/gpu/gpu_video_decode_accelerator_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/dxva_video_decode_accelerator_win.cc
diff --git a/media/gpu/dxva_video_decode_accelerator_win.cc b/media/gpu/dxva_video_decode_accelerator_win.cc
index e368dd35728060fa7d46dd57dc67eb3a6809b59f..5d55ae1af79f3fa3f7c7d7da6da341128ef58978 100644
--- a/media/gpu/dxva_video_decode_accelerator_win.cc
+++ b/media/gpu/dxva_video_decode_accelerator_win.cc
@@ -486,6 +486,7 @@ DXVAVideoDecodeAccelerator::PendingSampleInfo::~PendingSampleInfo() {}
DXVAVideoDecodeAccelerator::DXVAVideoDecodeAccelerator(
const GetGLContextCallback& get_gl_context_cb,
const MakeGLContextCurrentCallback& make_context_current_cb,
+ const BindGLImageCallback& bind_image_cb,
const gpu::GpuDriverBugWorkarounds& workarounds,
const gpu::GpuPreferences& gpu_preferences)
: client_(NULL),
@@ -498,6 +499,7 @@ DXVAVideoDecodeAccelerator::DXVAVideoDecodeAccelerator(
sent_drain_message_(false),
get_gl_context_cb_(get_gl_context_cb),
make_context_current_cb_(make_context_current_cb),
+ bind_image_cb_(bind_image_cb),
codec_(kUnknownVideoCodec),
decoder_thread_("DXVAVideoDecoderThread"),
pending_flush_(false),
@@ -880,11 +882,23 @@ void DXVAVideoDecodeAccelerator::AssignPictureBuffers(
// Copy the picture buffers provided by the client to the available list,
// and mark these buffers as available for use.
for (size_t buffer_index = 0; buffer_index < buffers.size(); ++buffer_index) {
+ RETURN_AND_NOTIFY_ON_FAILURE(
+ buffers[buffer_index].service_texture_ids().size() ==
+ buffers[buffer_index].client_texture_ids().size(),
+ "Number of service and client ids do not match", PLATFORM_FAILURE, );
sandersd (OOO until July 31) 2016/11/14 19:16:22 Is this still correct for the vda unittest? At one
linked_ptr<DXVAPictureBuffer> picture_buffer =
DXVAPictureBuffer::Create(*this, buffers[buffer_index], egl_config_);
RETURN_AND_NOTIFY_ON_FAILURE(picture_buffer.get(),
"Failed to allocate picture buffer",
PLATFORM_FAILURE, );
+ if (bind_image_cb_) {
+ for (size_t i = 0; i < buffers[buffer_index].client_texture_ids().size();
+ i++) {
+ bind_image_cb_.Run(buffers[buffer_index].client_texture_ids()[i],
+ buffers[buffer_index].service_texture_ids()[i],
sandersd (OOO until July 31) 2016/11/14 19:16:22 The second parameter should be the texture target.
+ picture_buffer->gl_image(), true);
+ }
+ }
bool inserted =
output_picture_buffers_
« no previous file with comments | « media/gpu/dxva_video_decode_accelerator_win.h ('k') | media/gpu/gpu_video_decode_accelerator_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698