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

Unified Diff: content/common/gpu/media/v4l2_video_encode_accelerator.cc

Issue 827443003: Add querying supported formats to V4L2 VEA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nit Created 5 years, 11 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 | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/v4l2_video_encode_accelerator.cc
diff --git a/content/common/gpu/media/v4l2_video_encode_accelerator.cc b/content/common/gpu/media/v4l2_video_encode_accelerator.cc
index d69c97da551c8a5dce5b1e78dc9b0b1c75ad0b80..f18d7576ed610a5a0b93437f7cdcc5ca9b54dd22 100644
--- a/content/common/gpu/media/v4l2_video_encode_accelerator.cc
+++ b/content/common/gpu/media/v4l2_video_encode_accelerator.cc
@@ -284,21 +284,25 @@ std::vector<media::VideoEncodeAccelerator::SupportedProfile>
V4L2VideoEncodeAccelerator::GetSupportedProfiles() {
std::vector<SupportedProfile> profiles;
SupportedProfile profile;
-
- const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
- if (cmd_line->HasSwitch(switches::kEnableWebRtcHWVp8Encoding)) {
- profile.profile = media::VP8PROFILE_ANY;
- profile.max_resolution.SetSize(1920, 1088);
- profile.max_framerate_numerator = 30;
- profile.max_framerate_denominator = 1;
- profiles.push_back(profile);
- }
-
- profile.profile = media::H264PROFILE_MAIN;
profile.max_resolution.SetSize(1920, 1088);
profile.max_framerate_numerator = 30;
profile.max_framerate_denominator = 1;
- profiles.push_back(profile);
+
+ v4l2_fmtdesc fmtdesc;
+ memset(&fmtdesc, 0, sizeof(fmtdesc));
+ fmtdesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ for (; device_->Ioctl(VIDIOC_ENUM_FMT, &fmtdesc) == 0; ++fmtdesc.index) {
+ switch (fmtdesc.pixelformat) {
+ case V4L2_PIX_FMT_H264:
+ profile.profile = media::H264PROFILE_MAIN;
+ profiles.push_back(profile);
+ break;
+ case V4L2_PIX_FMT_VP8:
+ profile.profile = media::VP8PROFILE_ANY;
+ profiles.push_back(profile);
+ break;
+ }
+ }
return profiles;
}
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698