Commit aaf5663f authored by mcasas@chromium.org's avatar mcasas@chromium.org

Mac Video Capture format change ARGB->YUY2.

Using RGBA implies a colour space conversion in the driver from YUY2 (native capture) to RGBA, which is undone in VideoCaptureController, RGBA to YUV I420. Avoiding this double conversion uses about 5% less CPU in the CMIO thread.

BUG=285967

Review URL: https://chromiumcodereview.appspot.com/23693004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222250 0039d316-1c4b-4281-b951-d872f2087c98
parent b47197cc
......@@ -322,6 +322,10 @@ void VideoCaptureController::OnIncomingCapturedFrame(
DCHECK(!chopped_width_ && !chopped_height_);
origin_colorspace = libyuv::FOURCC_YUY2;
break;
case media::PIXEL_FORMAT_UYVY:
DCHECK(!chopped_width_ && !chopped_height_);
origin_colorspace = libyuv::FOURCC_UYVY;
break;
case media::PIXEL_FORMAT_RGB24:
origin_colorspace = libyuv::FOURCC_RAW;
break;
......
......@@ -149,7 +149,7 @@ void VideoCaptureDeviceMac::Allocate(
state_ = kAllocated;
VideoCaptureCapability current_settings;
current_settings.color = PIXEL_FORMAT_ARGB;
current_settings.color = PIXEL_FORMAT_UYVY;
current_settings.width = width;
current_settings.height = height;
current_settings.frame_rate = frame_rate;
......
......@@ -171,7 +171,7 @@
(id)kCVPixelBufferWidthKey,
[NSNumber numberWithDouble:frameHeight_],
(id)kCVPixelBufferHeightKey,
[NSNumber numberWithUnsignedInt:kCVPixelFormatType_32BGRA],
[NSNumber numberWithUnsignedInt:kCVPixelFormatType_422YpCbCr8],
(id)kCVPixelBufferPixelFormatTypeKey,
nil];
[[[captureSession_ outputs] objectAtIndex:0]
......@@ -266,7 +266,7 @@
captureCapability.width = frameWidth_;
captureCapability.height = frameHeight_;
captureCapability.frame_rate = frameRate_;
captureCapability.color = media::PIXEL_FORMAT_ARGB;
captureCapability.color = media::PIXEL_FORMAT_UYVY;
captureCapability.expected_capture_delay = 0;
captureCapability.interlaced = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment