| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/common/gpu/media/android_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 DCHECK(thread_checker_.CalledOnValidThread()); | 288 DCHECK(thread_checker_.CalledOnValidThread()); |
| 289 TRACE_EVENT0("media", "AVDA::Initialize"); | 289 TRACE_EVENT0("media", "AVDA::Initialize"); |
| 290 | 290 |
| 291 DVLOG(1) << __FUNCTION__ << ": " << config.AsHumanReadableString(); | 291 DVLOG(1) << __FUNCTION__ << ": " << config.AsHumanReadableString(); |
| 292 | 292 |
| 293 if (make_context_current_cb_.is_null() || get_gles2_decoder_cb_.is_null()) { | 293 if (make_context_current_cb_.is_null() || get_gles2_decoder_cb_.is_null()) { |
| 294 NOTREACHED() << "GL callbacks are required for this VDA"; | 294 NOTREACHED() << "GL callbacks are required for this VDA"; |
| 295 return false; | 295 return false; |
| 296 } | 296 } |
| 297 | 297 |
| 298 if (config.output_mode != Config::OutputMode::ALLOCATE) { |
| 299 NOTREACHED() << "Only ALLOCATE OutputMode is supported by this VDA"; |
| 300 return false; |
| 301 } |
| 302 |
| 298 DCHECK(client); | 303 DCHECK(client); |
| 299 client_ = client; | 304 client_ = client; |
| 300 codec_ = VideoCodecProfileToVideoCodec(config.profile); | 305 codec_ = VideoCodecProfileToVideoCodec(config.profile); |
| 301 is_encrypted_ = config.is_encrypted; | 306 is_encrypted_ = config.is_encrypted; |
| 302 | 307 |
| 303 bool profile_supported = codec_ == media::kCodecVP8 || | 308 bool profile_supported = codec_ == media::kCodecVP8 || |
| 304 codec_ == media::kCodecVP9 || | 309 codec_ == media::kCodecVP9 || |
| 305 codec_ == media::kCodecH264; | 310 codec_ == media::kCodecH264; |
| 306 | 311 |
| 307 if (!profile_supported) { | 312 if (!profile_supported) { |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1208 capabilities.flags = media::VideoDecodeAccelerator::Capabilities:: | 1213 capabilities.flags = media::VideoDecodeAccelerator::Capabilities:: |
| 1209 NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE | | 1214 NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE | |
| 1210 media::VideoDecodeAccelerator::Capabilities:: | 1215 media::VideoDecodeAccelerator::Capabilities:: |
| 1211 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; | 1216 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; |
| 1212 } | 1217 } |
| 1213 | 1218 |
| 1214 return capabilities; | 1219 return capabilities; |
| 1215 } | 1220 } |
| 1216 | 1221 |
| 1217 } // namespace content | 1222 } // namespace content |
| OLD | NEW |