| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 DCHECK(thread_checker_.CalledOnValidThread()); | 287 DCHECK(thread_checker_.CalledOnValidThread()); |
| 288 TRACE_EVENT0("media", "AVDA::Initialize"); | 288 TRACE_EVENT0("media", "AVDA::Initialize"); |
| 289 | 289 |
| 290 DVLOG(1) << __FUNCTION__ << ": " << config.AsHumanReadableString(); | 290 DVLOG(1) << __FUNCTION__ << ": " << config.AsHumanReadableString(); |
| 291 | 291 |
| 292 if (make_context_current_cb_.is_null() || get_gles2_decoder_cb_.is_null()) { | 292 if (make_context_current_cb_.is_null() || get_gles2_decoder_cb_.is_null()) { |
| 293 NOTREACHED() << "GL callbacks are required for this VDA"; | 293 NOTREACHED() << "GL callbacks are required for this VDA"; |
| 294 return false; | 294 return false; |
| 295 } | 295 } |
| 296 | 296 |
| 297 if (config.output_mode != Config::OutputMode::ALLOCATE) { |
| 298 NOTREACHED() << "Only ALLOCATE OutputMode is supported by this VDA"; |
| 299 return false; |
| 300 } |
| 301 |
| 297 DCHECK(client); | 302 DCHECK(client); |
| 298 client_ = client; | 303 client_ = client; |
| 299 codec_ = VideoCodecProfileToVideoCodec(config.profile); | 304 codec_ = VideoCodecProfileToVideoCodec(config.profile); |
| 300 is_encrypted_ = config.is_encrypted; | 305 is_encrypted_ = config.is_encrypted; |
| 301 | 306 |
| 302 bool profile_supported = codec_ == media::kCodecVP8 || | 307 bool profile_supported = codec_ == media::kCodecVP8 || |
| 303 codec_ == media::kCodecVP9 || | 308 codec_ == media::kCodecVP9 || |
| 304 codec_ == media::kCodecH264; | 309 codec_ == media::kCodecH264; |
| 305 | 310 |
| 306 if (!profile_supported) { | 311 if (!profile_supported) { |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 capabilities.flags = media::VideoDecodeAccelerator::Capabilities:: | 1228 capabilities.flags = media::VideoDecodeAccelerator::Capabilities:: |
| 1224 NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE | | 1229 NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE | |
| 1225 media::VideoDecodeAccelerator::Capabilities:: | 1230 media::VideoDecodeAccelerator::Capabilities:: |
| 1226 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; | 1231 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; |
| 1227 } | 1232 } |
| 1228 | 1233 |
| 1229 return capabilities; | 1234 return capabilities; |
| 1230 } | 1235 } |
| 1231 | 1236 |
| 1232 } // namespace content | 1237 } // namespace content |
| OLD | NEW |