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

Unified Diff: content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc

Issue 2686763002: [Mojo Video Capture] Split OnIncomingCapturedVideoFrame() to OnNewBuffer() and OnFrameReadyInBuffer( (Closed)
Patch Set: rebase Created 3 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/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
diff --git a/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc b/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
index eabae96a079bcb20da1e7fd23f1fa690ae00f859..1d0d800bb8df7d89e95ae725babfcf9392ded7e2 100644
--- a/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
+++ b/content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc
@@ -122,13 +122,12 @@ void VideoCaptureGpuJpegDecoder::DecodeCapturedData(
// Mask against 30 bits, to avoid (undefined) wraparound on signed integer.
next_bitstream_buffer_id_ = (next_bitstream_buffer_id_ + 1) & 0x3FFFFFFF;
- // The APIs of |decoder_| and |decode_done_cb_| require us to wrap the
- // |out_buffer| in a VideoFrame.
+ // The API of |decoder_| requires us to wrap the |out_buffer| in a VideoFrame.
const gfx::Size dimensions = frame_format.frame_size;
std::unique_ptr<media::VideoCaptureBufferHandle> out_buffer_access =
- out_buffer.handle_provider()->GetHandleForInProcessAccess();
+ out_buffer.handle_provider->GetHandleForInProcessAccess();
base::SharedMemoryHandle out_handle =
- out_buffer.handle_provider()->GetNonOwnedSharedMemoryHandleForLegacyIPC();
+ out_buffer.handle_provider->GetNonOwnedSharedMemoryHandleForLegacyIPC();
scoped_refptr<media::VideoFrame> out_frame =
media::VideoFrame::WrapExternalSharedMemory(
media::PIXEL_FORMAT_I420, // format
@@ -152,10 +151,21 @@ void VideoCaptureGpuJpegDecoder::DecodeCapturedData(
out_frame->metadata()->SetTimeTicks(media::VideoFrameMetadata::REFERENCE_TIME,
reference_time);
+ media::mojom::VideoFrameInfoPtr out_frame_info =
+ media::mojom::VideoFrameInfo::New();
+ out_frame_info->timestamp = timestamp;
+ out_frame_info->pixel_format = media::PIXEL_FORMAT_I420;
+ out_frame_info->storage_type = media::PIXEL_STORAGE_CPU;
+ out_frame_info->coded_size = dimensions;
+ out_frame_info->visible_rect = gfx::Rect(dimensions);
+ out_frame_info->metadata = out_frame->metadata()->CopyInternalValues();
+
{
base::AutoLock lock(lock_);
decode_done_closure_ =
- base::Bind(decode_done_cb_, base::Passed(&out_buffer), out_frame);
+ base::Bind(decode_done_cb_, out_buffer.id, out_buffer.frame_feedback_id,
+ base::Passed(&out_buffer.access_permission),
+ base::Passed(&out_frame_info));
}
decoder_->Decode(in_buffer, std::move(out_frame));
}

Powered by Google App Engine
This is Rietveld 408576698