Index: content/browser/renderer_host/media/video_capture_controller.cc |
diff --git a/content/browser/renderer_host/media/video_capture_controller.cc b/content/browser/renderer_host/media/video_capture_controller.cc |
index 6f1cbc0fb083faa2c1a2b69b8f9e1fa29479e4f4..418ea443b9bfe92e24e88cc501bb812cd54e52e4 100644 |
--- a/content/browser/renderer_host/media/video_capture_controller.cc |
+++ b/content/browser/renderer_host/media/video_capture_controller.cc |
@@ -177,6 +177,10 @@ void VideoCaptureController::AddClient( |
<< ", " << session_id |
<< ")"; |
+ // If this is the first client added to the controller, cache the parameters. |
+ if (!controller_clients_.size()) |
+ video_capture_format_ = params.requested_format; |
+ |
// Signal error in case device is already in error state. |
if (state_ == VIDEO_CAPTURE_STATE_ERROR) { |
event_handler->OnError(id); |
@@ -253,6 +257,12 @@ void VideoCaptureController::ReturnBuffer( |
buffer_pool_->RelinquishConsumerHold(buffer_id, 1); |
} |
+const media::VideoCaptureFormat& |
+VideoCaptureController::GetVideoCaptureFormat() const { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
+ return video_capture_format_; |
+} |
+ |
scoped_refptr<media::VideoCaptureDevice::Client::Buffer> |
VideoCaptureController::VideoCaptureDeviceClient::ReserveOutputBuffer( |
media::VideoFrame::Format format, |