| Index: content/browser/renderer_host/media/video_capture_manager.cc
|
| diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc
|
| index b4e9a5c6362f099852b6a5cf9d04f058bc7d3f01..ed39aca9f131f4c00d985e0418646d2e39be76ee 100644
|
| --- a/content/browser/renderer_host/media/video_capture_manager.cc
|
| +++ b/content/browser/renderer_host/media/video_capture_manager.cc
|
| @@ -57,7 +57,11 @@ bool IsCaptureFormatSmaller(const media::VideoCaptureFormat& format1,
|
| DCHECK(format2.frame_size.GetCheckedArea().IsValid());
|
| if (format1.frame_size.GetCheckedArea().ValueOrDefault(0) ==
|
| format2.frame_size.GetCheckedArea().ValueOrDefault(0)) {
|
| - return format1.frame_rate > format2.frame_rate;
|
| + return format1.frame_rate > format2.frame_rate ||
|
| + // Prefer Y8 and Y16 capture format for the same frame rate.
|
| + (format1.frame_rate == format2.frame_rate &&
|
| + (format2.pixel_format != media::PIXEL_FORMAT_Y8 &&
|
| + format2.pixel_format != media::PIXEL_FORMAT_Y16));
|
| }
|
| return format1.frame_size.GetCheckedArea().ValueOrDefault(0) <
|
| format2.frame_size.GetCheckedArea().ValueOrDefault(0);
|
| @@ -87,7 +91,12 @@ void ConsolidateCaptureFormats(media::VideoCaptureFormats* formats) {
|
| // anyhow: the actual pixel format is decided at the device level.
|
| for (media::VideoCaptureFormats::iterator it = formats->begin();
|
| it != formats->end(); ++it) {
|
| - it->pixel_format = media::PIXEL_FORMAT_I420;
|
| + // TODO(astojilj) Force I420 for all except Y8 and Y16 in all
|
| + // video_capture_device_factory_->GetDeviceSupportedFormats instead of
|
| + // doing it here?
|
| + if (it->pixel_format != media::PIXEL_FORMAT_Y8 &&
|
| + it->pixel_format != media::PIXEL_FORMAT_Y16)
|
| + it->pixel_format = media::PIXEL_FORMAT_I420;
|
| }
|
| }
|
|
|
|
|