Chromium Code Reviews| 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..431519e418f26c83c7605166ec84ffb1413dc796 100644 |
| --- a/content/common/gpu/media/v4l2_video_encode_accelerator.cc |
| +++ b/content/common/gpu/media/v4l2_video_encode_accelerator.cc |
| @@ -284,21 +284,28 @@ 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; |
| + break; |
| + case V4L2_PIX_FMT_VP8: |
| + profile.profile = media::VP8PROFILE_ANY; |
| + break; |
| + default: |
| + profile.profile = media::VIDEO_CODEC_PROFILE_UNKNOWN; |
| + break; |
| + } |
| + if (profile.profile != media::VIDEO_CODEC_PROFILE_UNKNOWN) |
| + profiles.push_back(profile); |
|
Pawel Osciak
2015/01/01 14:14:37
I'd move this into the switch cases. You won't nee
|
| + } |
| return profiles; |
| } |