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

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

Issue 9958034: Convert plugin and GPU process to brokered handle duplication. (Closed) Base URL: svn://chrome-svn/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 132263)
+++ content/common/gpu/media/dxva_video_decode_accelerator.cc (working copy)
@@ -142,20 +142,9 @@
static IMFSample* CreateSampleFromInputBuffer(
const media::BitstreamBuffer& bitstream_buffer,
- base::ProcessHandle renderer_process,
DWORD stream_size,
DWORD alignment) {
- 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);
+ base::SharedMemory shm(bitstream_buffer.handle(), true);
RETURN_ON_FAILURE(shm.Map(bitstream_buffer.size()),
"Failed in base::SharedMemory::Map", NULL);
@@ -505,13 +494,11 @@
}
DXVAVideoDecodeAccelerator::DXVAVideoDecodeAccelerator(
- media::VideoDecodeAccelerator::Client* client,
- base::ProcessHandle renderer_process)
+ media::VideoDecodeAccelerator::Client* client)
: 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_));
@@ -560,7 +547,6 @@
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