OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <libdrm/drm_fourcc.h> | 5 #include <libdrm/drm_fourcc.h> |
6 #include <linux/videodev2.h> | 6 #include <linux/videodev2.h> |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 &profile.max_resolution); | 295 &profile.max_resolution); |
296 for (int media_profile = min_profile; media_profile <= max_profile; | 296 for (int media_profile = min_profile; media_profile <= max_profile; |
297 ++media_profile) { | 297 ++media_profile) { |
298 profile.profile = static_cast<media::VideoCodecProfile>(media_profile); | 298 profile.profile = static_cast<media::VideoCodecProfile>(media_profile); |
299 profiles.push_back(profile); | 299 profiles.push_back(profile); |
300 } | 300 } |
301 } | 301 } |
302 return profiles; | 302 return profiles; |
303 } | 303 } |
304 | 304 |
| 305 bool V4L2Device::SupportsDecodeProfileForV4L2PixelFormats( |
| 306 media::VideoCodecProfile profile, |
| 307 const size_t num_formats, |
| 308 const uint32_t pixelformats[]) { |
| 309 // Get all supported profiles by this device, taking into account only fourccs |
| 310 // in pixelformats. |
| 311 const auto supported_profiles = |
| 312 GetSupportedDecodeProfiles(num_formats, pixelformats); |
| 313 |
| 314 // Try to find requested profile among the returned supported_profiles. |
| 315 const auto iter = std::find_if( |
| 316 supported_profiles.begin(), supported_profiles.end(), |
| 317 [profile](const media::VideoDecodeAccelerator::SupportedProfile& p) { |
| 318 return profile == p.profile; |
| 319 }); |
| 320 |
| 321 return iter != supported_profiles.end(); |
| 322 } |
| 323 |
305 } // namespace content | 324 } // namespace content |
OLD | NEW |