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

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

Issue 1645873002: Use ParamTraits for media::BitstreamBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compiling errors on mac and address review comments Created 4 years, 10 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/client/gpu_video_decode_accelerator_host.cc
diff --git a/content/common/gpu/client/gpu_video_decode_accelerator_host.cc b/content/common/gpu/client/gpu_video_decode_accelerator_host.cc
index 19a336b9ca30af573159449f4eef9911b2b01b8d..15b514a2b5e7ace52f2aa26da758111845488541 100644
--- a/content/common/gpu/client/gpu_video_decode_accelerator_host.cc
+++ b/content/common/gpu/client/gpu_video_decode_accelerator_host.cc
@@ -119,24 +119,16 @@ void GpuVideoDecodeAcceleratorHost::Decode(
DCHECK(CalledOnValidThread());
if (!channel_)
return;
-
- base::SharedMemoryHandle handle = channel_->ShareToGpuProcess(
- bitstream_buffer.handle());
+ media::BitstreamBuffer buffer_to_send = bitstream_buffer;
+ base::SharedMemoryHandle handle =
dcheng 2016/02/18 21:06:09 I think the IPC subsystem has been improved so you
erikchen 2016/02/18 21:07:31 correct. no need to dupe shared memory handles bef
Owen Lin 2016/02/23 03:40:11 Thanks. That's great. But I think we should do tha
+ channel_->ShareToGpuProcess(bitstream_buffer.handle());
if (!base::SharedMemory::IsHandleValid(handle)) {
NOTREACHED() << "Failed to duplicate buffer handler";
return;
}
-
- AcceleratedVideoDecoderMsg_Decode_Params params;
- params.bitstream_buffer_id = bitstream_buffer.id();
- params.buffer_handle = handle;
- params.size = bitstream_buffer.size();
- params.presentation_timestamp = bitstream_buffer.presentation_timestamp();
- params.key_id = bitstream_buffer.key_id();
- params.iv = bitstream_buffer.iv();
- params.subsamples = bitstream_buffer.subsamples();
-
- Send(new AcceleratedVideoDecoderMsg_Decode(decoder_route_id_, params));
+ buffer_to_send.set_handle(handle);
+ Send(
+ new AcceleratedVideoDecoderMsg_Decode(decoder_route_id_, buffer_to_send));
}
void GpuVideoDecodeAcceleratorHost::AssignPictureBuffers(

Powered by Google App Engine
This is Rietveld 408576698