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

Unified Diff: content/common/gpu/client/gpu_video_decode_accelerator_host.cc

Issue 10163013: Fix DXVA2 video decoding which was broken with recent process handle brokering changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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
« no previous file with comments | « no previous file | content/common/sandbox_policy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/gpu_video_decode_accelerator_host.cc
===================================================================
--- content/common/gpu/client/gpu_video_decode_accelerator_host.cc (revision 133066)
+++ content/common/gpu/client/gpu_video_decode_accelerator_host.cc (working copy)
@@ -13,6 +13,10 @@
#include "ipc/ipc_message_macros.h"
#include "ipc/ipc_message_utils.h"
+#if defined(OS_WIN)
+#include "content/public/common/sandbox_init.h"
+#endif // OS_WIN
+
using media::VideoDecodeAccelerator;
GpuVideoDecodeAcceleratorHost::GpuVideoDecodeAcceleratorHost(
@@ -65,9 +69,20 @@
void GpuVideoDecodeAcceleratorHost::Decode(
const media::BitstreamBuffer& bitstream_buffer) {
DCHECK(CalledOnValidThread());
+ base::SharedMemoryHandle buffer_handle = bitstream_buffer.handle();
+#if defined(OS_WIN)
+ if (!content::BrokerDuplicateHandle(bitstream_buffer.handle(),
+ channel_->gpu_pid(),
+ &buffer_handle, 0,
+ DUPLICATE_SAME_ACCESS)) {
+ NOTREACHED() << "Failed to duplicate buffer handler";
+ return;
+ }
+#endif // OS_WIN
+
Send(new AcceleratedVideoDecoderMsg_Decode(
- decoder_route_id_, bitstream_buffer.handle(),
- bitstream_buffer.id(), bitstream_buffer.size()));
+ decoder_route_id_, buffer_handle, bitstream_buffer.id(),
+ bitstream_buffer.size()));
}
void GpuVideoDecodeAcceleratorHost::AssignPictureBuffers(
« no previous file with comments | « no previous file | content/common/sandbox_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698