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

Unified Diff: content/browser/media/capture/content_video_capture_device_core.cc

Issue 1064703002: VideoCaptureBufferPool: Refactor to allow support of non-ShMem backed buffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/browser/media/capture/content_video_capture_device_core.cc
diff --git a/content/browser/media/capture/content_video_capture_device_core.cc b/content/browser/media/capture/content_video_capture_device_core.cc
index 5030f6d633005666cc4961f9d52ee99a1d698b20..8cbcc9706d083c18820865b187e4827549a4d869 100644
--- a/content/browser/media/capture/content_video_capture_device_core.cc
+++ b/content/browser/media/capture/content_video_capture_device_core.cc
@@ -67,10 +67,6 @@ bool ThreadSafeCaptureOracle::ObserveEventAndDecideCapture(
if (!client_)
return false; // Capture is stopped.
- const media::VideoFrame::Format video_frame_format =
- params_.requested_format.pixel_format == media::PIXEL_FORMAT_TEXTURE ?
- media::VideoFrame::NATIVE_TEXTURE : media::VideoFrame::I420;
-
if (capture_size_.IsEmpty())
capture_size_ = max_frame_size();
const gfx::Size visible_size = capture_size_;
@@ -78,9 +74,12 @@ bool ThreadSafeCaptureOracle::ObserveEventAndDecideCapture(
// See http://crbug.com/402151.
const gfx::Size coded_size((visible_size.width() + 15) & ~15,
(visible_size.height() + 15) & ~15);
+ const media::VideoCaptureFormat video_frame_format(
+ coded_size, params_.requested_format.frame_rate,
+ params_.requested_format.pixel_format);
scoped_refptr<media::VideoCaptureDevice::Client::Buffer> output_buffer =
- client_->ReserveOutputBuffer(video_frame_format, coded_size);
+ client_->ReserveOutputBuffer(video_frame_format);
const bool should_capture =
oracle_.ObserveEventAndDecideCapture(event, damage_rect, event_time);
const char* event_name =
@@ -120,9 +119,9 @@ bool ThreadSafeCaptureOracle::ObserveEventAndDecideCapture(
"trigger", event_name);
// NATIVE_TEXTURE frames wrap a texture mailbox, which we don't have at the
// moment. We do not construct those frames.
- if (video_frame_format != media::VideoFrame::NATIVE_TEXTURE) {
+ if (video_frame_format.pixel_format != media::PIXEL_FORMAT_TEXTURE) {
*storage = media::VideoFrame::WrapExternalPackedMemory(
- video_frame_format,
+ media::VideoFrame::I420,
coded_size,
gfx::Rect(visible_size),
visible_size,

Powered by Google App Engine
This is Rietveld 408576698