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

Unified Diff: content/browser/renderer_host/media/video_capture_host.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_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 4c458f5d0da72417407e3eefd565bb9d37e7cc44..44286425747ce054da13965b243de000de33dc42 100644
--- a/content/browser/renderer_host/media/video_capture_host.cc
+++ b/content/browser/renderer_host/media/video_capture_host.cc
@@ -12,6 +12,7 @@
#include "content/browser/browser_main_loop.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/browser/renderer_host/media/video_capture_manager.h"
+#include "mojo/common/values_struct_traits.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
namespace content {
@@ -86,7 +87,7 @@ void VideoCaptureHost::OnBufferDestroyed(VideoCaptureControllerID controller_id,
void VideoCaptureHost::OnBufferReady(
VideoCaptureControllerID controller_id,
int buffer_id,
- const scoped_refptr<media::VideoFrame>& video_frame) {
+ const media::mojom::VideoFrameInfoPtr& frame_info) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (controllers_.find(controller_id) == controllers_.end())
return;
@@ -94,19 +95,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));
+ frame_info.Clone());
}
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