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

Unified Diff: content/common/gpu/media/dxva_video_decode_accelerator.cc

Issue 10081018: Revert 132218 - Convert plugin and GPU process to brokered handle duplication. (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
Index: content/common/gpu/media/dxva_video_decode_accelerator.cc
===================================================================
--- content/common/gpu/media/dxva_video_decode_accelerator.cc (revision 132251)
+++ content/common/gpu/media/dxva_video_decode_accelerator.cc (working copy)
@@ -142,9 +142,20 @@
static IMFSample* CreateSampleFromInputBuffer(
const media::BitstreamBuffer& bitstream_buffer,
+ base::ProcessHandle renderer_process,
DWORD stream_size,
DWORD alignment) {
- base::SharedMemory shm(bitstream_buffer.handle(), true);
+ HANDLE shared_memory_handle = NULL;
+ RETURN_ON_FAILURE(::DuplicateHandle(renderer_process,
+ bitstream_buffer.handle(),
+ base::GetCurrentProcessHandle(),
+ &shared_memory_handle,
+ 0,
+ FALSE,
+ DUPLICATE_SAME_ACCESS),
+ "Duplicate handle failed", NULL);
+
+ base::SharedMemory shm(shared_memory_handle, true);
RETURN_ON_FAILURE(shm.Map(bitstream_buffer.size()),
"Failed in base::SharedMemory::Map", NULL);
@@ -494,11 +505,13 @@
}
DXVAVideoDecodeAccelerator::DXVAVideoDecodeAccelerator(
- media::VideoDecodeAccelerator::Client* client)
+ media::VideoDecodeAccelerator::Client* client,
+ base::ProcessHandle renderer_process)
: client_(client),
egl_config_(NULL),
state_(kUninitialized),
pictures_requested_(false),
+ renderer_process_(renderer_process),
last_input_buffer_id_(-1),
inputs_before_decode_(0) {
memset(&input_stream_info_, 0, sizeof(input_stream_info_));
@@ -547,6 +560,7 @@
base::win::ScopedComPtr<IMFSample> sample;
sample.Attach(CreateSampleFromInputBuffer(bitstream_buffer,
+ renderer_process_,
input_stream_info_.cbSize,
input_stream_info_.cbAlignment));
RETURN_AND_NOTIFY_ON_FAILURE(sample, "Failed to create input sample",
« no previous file with comments | « content/common/gpu/media/dxva_video_decode_accelerator.h ('k') | content/common/gpu/media/gpu_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698