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

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

Issue 2583603002: [Mojo Video Capture] Split OnIncomingCapturedVideoFrame() to OnNewBuffer() + OnFrameReadyInBuffer() (Closed)
Patch Set: Improve naming and fix Android background issue Created 4 years 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_host.cc
diff --git a/content/browser/renderer_host/media/video_capture_host.cc b/content/browser/renderer_host/media/video_capture_host.cc
index b818ae3be0b83918828ebdf47df29a20cfdf01c4..04e4af0577bb6e1330d7e2ca3cc0b5ed849eb585 100644
--- a/content/browser/renderer_host/media/video_capture_host.cc
+++ b/content/browser/renderer_host/media/video_capture_host.cc
@@ -85,7 +85,7 @@ void VideoCaptureHost::OnBufferDestroyed(VideoCaptureControllerID controller_id,
void VideoCaptureHost::OnBufferReady(
VideoCaptureControllerID controller_id,
int buffer_id,
- const scoped_refptr<media::VideoFrame>& video_frame) {
+ media::mojom::VideoFrameInfoPtr frame_info) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (controllers_.find(controller_id) == controllers_.end())
return;
@@ -93,19 +93,8 @@ void VideoCaptureHost::OnBufferReady(
if (!base::ContainsKey(device_id_to_observer_map_, controller_id))
return;
- media::mojom::VideoFrameInfoPtr info = media::mojom::VideoFrameInfo::New();
- info->timestamp = video_frame->timestamp();
- info->metadata = video_frame->metadata()->CopyInternalValues();
-
- DCHECK(media::PIXEL_FORMAT_I420 == video_frame->format() ||
- media::PIXEL_FORMAT_Y16 == video_frame->format());
- info->pixel_format = video_frame->format();
- info->storage_type = media::PIXEL_STORAGE_CPU;
- info->coded_size = video_frame->coded_size();
- info->visible_rect = video_frame->visible_rect();
-
- device_id_to_observer_map_[controller_id]->OnBufferReady(buffer_id,
- std::move(info));
+ device_id_to_observer_map_[controller_id]->OnBufferReady(
+ buffer_id, std::move(frame_info));
}
void VideoCaptureHost::OnEnded(VideoCaptureControllerID controller_id) {
« no previous file with comments | « content/browser/renderer_host/media/video_capture_host.h ('k') | content/browser/renderer_host/media/video_capture_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698