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

Unified Diff: media/capture/thread_safe_capture_oracle.cc

Issue 1204063005: Reland: Video Capture: extract storage info from pixel format in VideoCaptureFormat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheng@ nit on DCHECK_EQ(expected, actual) Created 5 years, 6 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
« no previous file with comments | « media/capture/screen_capture_device_core.cc ('k') | media/video/capture/fake_video_capture_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/thread_safe_capture_oracle.cc
diff --git a/media/capture/thread_safe_capture_oracle.cc b/media/capture/thread_safe_capture_oracle.cc
index 5de1b3b6173eeac946b28f636ed27094b32c9efd..040e3940c2e9d19d98a72e04fc1caa5653c3e60d 100644
--- a/media/capture/thread_safe_capture_oracle.cc
+++ b/media/capture/thread_safe_capture_oracle.cc
@@ -52,9 +52,13 @@ bool ThreadSafeCaptureOracle::ObserveEventAndDecideCapture(
const gfx::Size coded_size((visible_size.width() + 15) & ~15,
(visible_size.height() + 15) & ~15);
- scoped_ptr<VideoCaptureDevice::Client::Buffer> output_buffer(
- client_->ReserveOutputBuffer(params_.requested_format.pixel_format,
- coded_size));
+ scoped_ptr<media::VideoCaptureDevice::Client::Buffer> output_buffer(
+ client_->ReserveOutputBuffer(coded_size,
+ (params_.requested_format.pixel_storage !=
+ media::PIXEL_STORAGE_TEXTURE)
+ ? media::PIXEL_FORMAT_I420
+ : media::PIXEL_FORMAT_ARGB,
+ params_.requested_format.pixel_storage));
// TODO(miu): Use current buffer pool utilization to drive automatic video
// resolution changes. http://crbug.com/156767.
VLOG(2) << "Current buffer pool utilization is "
@@ -98,9 +102,9 @@ bool ThreadSafeCaptureOracle::ObserveEventAndDecideCapture(
TRACE_EVENT_ASYNC_BEGIN2("gpu.capture", "Capture", output_buffer.get(),
"frame_number", frame_number,
"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 (params_.requested_format.pixel_format != PIXEL_FORMAT_TEXTURE) {
+ // Texture frames wrap a texture mailbox, which we don't have at the moment.
+ // We do not construct those frames.
+ if (params_.requested_format.pixel_storage != media::PIXEL_STORAGE_TEXTURE) {
*storage = VideoFrame::WrapExternalData(
VideoFrame::I420,
coded_size,
« no previous file with comments | « media/capture/screen_capture_device_core.cc ('k') | media/video/capture/fake_video_capture_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698