| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 max_resolution->SetSize(frame_size.stepwise.max_width, | 235 max_resolution->SetSize(frame_size.stepwise.max_width, |
| 236 frame_size.stepwise.max_height); | 236 frame_size.stepwise.max_height); |
| 237 min_resolution->SetSize(frame_size.stepwise.min_width, | 237 min_resolution->SetSize(frame_size.stepwise.min_width, |
| 238 frame_size.stepwise.min_height); | 238 frame_size.stepwise.min_height); |
| 239 break; | 239 break; |
| 240 } | 240 } |
| 241 } | 241 } |
| 242 if (max_resolution->IsEmpty()) { | 242 if (max_resolution->IsEmpty()) { |
| 243 max_resolution->SetSize(1920, 1088); | 243 max_resolution->SetSize(1920, 1088); |
| 244 LOG(ERROR) << "GetSupportedResolution failed to get maximum resolution for " | 244 LOG(ERROR) << "GetSupportedResolution failed to get maximum resolution for " |
| 245 << "fourcc " << std::hex << pixelformat << ", fall back to " | 245 << "fourcc " << std::hex << pixelformat |
| 246 << max_resolution->ToString(); | 246 << ", fall back to " << max_resolution->ToString(); |
| 247 } | 247 } |
| 248 if (min_resolution->IsEmpty()) { | 248 if (min_resolution->IsEmpty()) { |
| 249 min_resolution->SetSize(16, 16); | 249 min_resolution->SetSize(16, 16); |
| 250 LOG(ERROR) << "GetSupportedResolution failed to get minimum resolution for " | 250 LOG(ERROR) << "GetSupportedResolution failed to get minimum resolution for " |
| 251 << "fourcc " << std::hex << pixelformat << ", fall back to " | 251 << "fourcc " << std::hex << pixelformat |
| 252 << min_resolution->ToString(); | 252 << ", fall back to " << min_resolution->ToString(); |
| 253 } | 253 } |
| 254 } | 254 } |
| 255 | 255 |
| 256 media::VideoDecodeAccelerator::SupportedProfiles | 256 media::VideoDecodeAccelerator::SupportedProfiles |
| 257 V4L2Device::GetSupportedDecodeProfiles(const size_t num_formats, | 257 V4L2Device::GetSupportedDecodeProfiles(const size_t num_formats, |
| 258 const uint32_t pixelformats[]) { | 258 const uint32_t pixelformats[]) { |
| 259 DCHECK_EQ(type_, kDecoder); | 259 DCHECK_EQ(type_, kDecoder); |
| 260 media::VideoDecodeAccelerator::SupportedProfiles profiles; | 260 media::VideoDecodeAccelerator::SupportedProfiles profiles; |
| 261 media::VideoDecodeAccelerator::SupportedProfile profile; | 261 media::VideoDecodeAccelerator::SupportedProfile profile; |
| 262 v4l2_fmtdesc fmtdesc; | 262 v4l2_fmtdesc fmtdesc; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 const auto iter = std::find_if( | 312 const auto iter = std::find_if( |
| 313 supported_profiles.begin(), supported_profiles.end(), | 313 supported_profiles.begin(), supported_profiles.end(), |
| 314 [profile](const media::VideoDecodeAccelerator::SupportedProfile& p) { | 314 [profile](const media::VideoDecodeAccelerator::SupportedProfile& p) { |
| 315 return profile == p.profile; | 315 return profile == p.profile; |
| 316 }); | 316 }); |
| 317 | 317 |
| 318 return iter != supported_profiles.end(); | 318 return iter != supported_profiles.end(); |
| 319 } | 319 } |
| 320 | 320 |
| 321 } // namespace media | 321 } // namespace media |
| OLD | NEW |