| 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 657a3e8fa88cde6b1b5b3c006b4f2e18f3d3cd35..87b299db64dd5d12f1d17da22d868ed0c9e55ddb 100644
|
| --- a/content/browser/renderer_host/media/video_capture_controller.cc
|
| +++ b/content/browser/renderer_host/media/video_capture_controller.cc
|
| @@ -19,7 +19,7 @@
|
| #include "third_party/libyuv/include/libyuv.h"
|
| #endif
|
|
|
| -using media::VideoCaptureCapability;
|
| +using media::VideoCaptureFormat;
|
|
|
| namespace content {
|
|
|
| @@ -112,7 +112,7 @@ class VideoCaptureController::VideoCaptureDeviceClient
|
| int rotation,
|
| bool flip_vert,
|
| bool flip_horiz,
|
| - const VideoCaptureCapability& frame_info)
|
| + const VideoCaptureFormat& frame_format)
|
| OVERRIDE;
|
| virtual void OnIncomingCapturedBuffer(const scoped_refptr<Buffer>& buffer,
|
| media::VideoFrame::Format format,
|
| @@ -167,8 +167,7 @@ void VideoCaptureController::AddClient(
|
| const media::VideoCaptureParams& params) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| DVLOG(1) << "VideoCaptureController::AddClient, id " << id.device_id
|
| - << ", (" << params.requested_format.width
|
| - << ", " << params.requested_format.height
|
| + << ", " << params.requested_format.frame_size.ToString()
|
| << ", " << params.requested_format.frame_rate
|
| << ", " << params.session_id
|
| << ")";
|
| @@ -263,24 +262,24 @@ void VideoCaptureController::VideoCaptureDeviceClient::OnIncomingCapturedFrame(
|
| int rotation,
|
| bool flip_vert,
|
| bool flip_horiz,
|
| - const VideoCaptureCapability& frame_info) {
|
| + const VideoCaptureFormat& frame_format) {
|
| TRACE_EVENT0("video", "VideoCaptureController::OnIncomingCapturedFrame");
|
|
|
| - if (!frame_info.IsValid())
|
| + if (!frame_format.IsValid())
|
| return;
|
|
|
| // Chopped pixels in width/height in case video capture device has odd
|
| // numbers for width/height.
|
| int chopped_width = 0;
|
| int chopped_height = 0;
|
| - int new_width = frame_info.width;
|
| - int new_height = frame_info.height;
|
| + int new_width = frame_format.frame_size.width();
|
| + int new_height = frame_format.frame_size.height();
|
|
|
| - if (frame_info.width & 1) {
|
| + if (new_width & 1) {
|
| --new_width;
|
| chopped_width = 1;
|
| }
|
| - if (frame_info.height & 1) {
|
| + if (new_height & 1) {
|
| --new_height;
|
| chopped_height = 1;
|
| }
|
| @@ -321,7 +320,7 @@ void VideoCaptureController::VideoCaptureDeviceClient::OnIncomingCapturedFrame(
|
| else if (new_rotation_angle == 270)
|
| rotation_mode = libyuv::kRotate270;
|
|
|
| - switch (frame_info.color) {
|
| + switch (frame_format.pixel_format) {
|
| case media::PIXEL_FORMAT_UNKNOWN: // Color format not set.
|
| break;
|
| case media::PIXEL_FORMAT_I420:
|
| @@ -361,7 +360,7 @@ void VideoCaptureController::VideoCaptureDeviceClient::OnIncomingCapturedFrame(
|
| #if defined(OS_WIN)
|
| // kRGB24 on Windows start at the bottom line and has a negative stride. This
|
| // is not supported by libyuv, so the media API is used instead.
|
| - if (frame_info.color == media::PIXEL_FORMAT_RGB24) {
|
| + if (frame_format.pixel_format == media::PIXEL_FORMAT_RGB24) {
|
| // Rotation and flipping is not supported in kRGB24 and OS_WIN case.
|
| DCHECK(!rotation && !flip_vert && !flip_horiz);
|
| need_convert_rgb24_on_win = true;
|
| @@ -431,7 +430,7 @@ void VideoCaptureController::VideoCaptureDeviceClient::OnIncomingCapturedFrame(
|
| controller_,
|
| buffer,
|
| dimensions,
|
| - frame_info.frame_rate,
|
| + frame_format.frame_rate,
|
| timestamp));
|
| }
|
|
|
| @@ -523,11 +522,8 @@ void VideoCaptureController::DoIncomingCapturedI420BufferOnIOThread(
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| DCHECK_NE(buffer->id(), VideoCaptureBufferPool::kInvalidId);
|
|
|
| - media::VideoCaptureFormat frame_format(
|
| - dimensions.width(),
|
| - dimensions.height(),
|
| - frame_rate,
|
| - media::VariableResolutionVideoCaptureDevice);
|
| + VideoCaptureFormat frame_format(
|
| + dimensions, frame_rate, media::PIXEL_FORMAT_I420);
|
|
|
| int count = 0;
|
| if (state_ == VIDEO_CAPTURE_STATE_STARTED) {
|
|
|