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

Unified Diff: content/browser/renderer_host/media/video_capture_manager.cc

Issue 2398463003: 16 bit capture and GPU&CPU memory buffer support.
Patch Set: fixes. Created 4 years, 2 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
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 f86009aefed82fc268dcaa99a0e31868d7a13577..b3fcd9914688407290e9f316d7b06b03900e73f7 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -60,7 +60,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 Y16 capture format for the same frame rate.
+ // This is workaround for e.g. Realsense R200 IR stream.
+ (format1.frame_rate == format2.frame_rate &&
+ (format2.pixel_format != media::PIXEL_FORMAT_Y16));
}
return format1.frame_size.GetCheckedArea().ValueOrDefault(0) <
format2.frame_size.GetCheckedArea().ValueOrDefault(0);
@@ -88,9 +92,11 @@ void ConsolidateCaptureFormats(media::VideoCaptureFormats* formats) {
formats->erase(last, formats->end());
// Mark all formats as I420, since this is what the renderer side will get
// anyhow: the actual pixel format is decided at the device level.
+ // Don't do this for Y16 format as it is handled separatelly.
for (media::VideoCaptureFormats::iterator it = formats->begin();
it != formats->end(); ++it) {
- it->pixel_format = media::PIXEL_FORMAT_I420;
+ if (it->pixel_format != media::PIXEL_FORMAT_Y16)
+ it->pixel_format = media::PIXEL_FORMAT_I420;
}
}

Powered by Google App Engine
This is Rietveld 408576698