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

Unified Diff: content/renderer/media/media_stream_video_capturer_source.cc

Issue 311363002: Accept up to 60fps frame rate in MediaStreamVideoCapturerSource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_video_capturer_source.cc
diff --git a/content/renderer/media/media_stream_video_capturer_source.cc b/content/renderer/media/media_stream_video_capturer_source.cc
index 25bb59deee3a027f8e6e0cd56c511fef69ace7f2..f4555afb4f011cb1f42f18cddb49d05907b37556 100644
--- a/content/renderer/media/media_stream_video_capturer_source.cc
+++ b/content/renderer/media/media_stream_video_capturer_source.cc
@@ -14,20 +14,21 @@
namespace {
-struct SourceVideoFormat {
+struct SourceVideoResolution {
int width;
int height;
- int frame_rate;
};
-// List of formats used if the source doesn't support capability enumeration.
-const SourceVideoFormat kVideoFormats[] = {{1920, 1080, 30},
- {1280, 720, 30},
- {960, 720, 30},
- {640, 480, 30},
- {640, 360, 30},
- {320, 240, 30},
- {320, 180, 30}};
+// Resolutions used if the source doesn't support capability enumeration.
+const SourceVideoResolution kVideoResolutions[] = {{1920, 1080},
+ {1280, 720},
+ {960, 720},
+ {640, 480},
+ {640, 360},
+ {320, 240},
+ {320, 180}};
+// Frame rates for sources with no support for capability enumeration.
+const int kVideoFrameRates[] = {30, 60};
} // namespace
@@ -190,11 +191,12 @@ void VideoCapturerDelegate::OnDeviceSupportedFormatsEnumerated(
// The capture device doesn't seem to support capability enumeration,
// compose a fallback list of capabilities.
media::VideoCaptureFormats default_formats;
- for (size_t i = 0; i < arraysize(kVideoFormats); ++i) {
- default_formats.push_back(media::VideoCaptureFormat(
- gfx::Size(kVideoFormats[i].width, kVideoFormats[i].height),
- kVideoFormats[i].frame_rate,
- media::PIXEL_FORMAT_I420));
+ for (size_t i = 0; i < arraysize(kVideoResolutions); ++i) {
+ for (size_t j = 0; j < arraysize(kVideoFrameRates); ++j) {
+ default_formats.push_back(media::VideoCaptureFormat(
+ gfx::Size(kVideoResolutions[i].width, kVideoResolutions[i].height),
+ kVideoFrameRates[j], media::PIXEL_FORMAT_I420));
+ }
}
source_formats_callback_.Run(default_formats);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698