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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 DCHECK(thread_checker_.CalledOnValidThread()); | 320 DCHECK(thread_checker_.CalledOnValidThread()); |
321 TRACE_EVENT0("media", "AVDA::Initialize"); | 321 TRACE_EVENT0("media", "AVDA::Initialize"); |
322 | 322 |
323 DVLOG(1) << __FUNCTION__ << ": " << config.AsHumanReadableString(); | 323 DVLOG(1) << __FUNCTION__ << ": " << config.AsHumanReadableString(); |
324 | 324 |
325 if (make_context_current_cb_.is_null() || get_gles2_decoder_cb_.is_null()) { | 325 if (make_context_current_cb_.is_null() || get_gles2_decoder_cb_.is_null()) { |
326 NOTREACHED() << "GL callbacks are required for this VDA"; | 326 NOTREACHED() << "GL callbacks are required for this VDA"; |
327 return false; | 327 return false; |
328 } | 328 } |
329 | 329 |
| 330 if (config.output_mode != Config::OutputMode::ALLOCATE) { |
| 331 NOTREACHED() << "Only ALLOCATE OutputMode is supported by this VDA"; |
| 332 return false; |
| 333 } |
| 334 |
330 DCHECK(client); | 335 DCHECK(client); |
331 client_ = client; | 336 client_ = client; |
332 codec_config_ = new CodecConfig(); | 337 codec_config_ = new CodecConfig(); |
333 codec_config_->codec_ = VideoCodecProfileToVideoCodec(config.profile); | 338 codec_config_->codec_ = VideoCodecProfileToVideoCodec(config.profile); |
334 codec_config_->initial_expected_coded_size_ = | 339 codec_config_->initial_expected_coded_size_ = |
335 config.initial_expected_coded_size; | 340 config.initial_expected_coded_size; |
336 is_encrypted_ = config.is_encrypted; | 341 is_encrypted_ = config.is_encrypted; |
337 | 342 |
338 bool profile_supported = codec_config_->codec_ == media::kCodecVP8 || | 343 bool profile_supported = codec_config_->codec_ == media::kCodecVP8 || |
339 codec_config_->codec_ == media::kCodecVP9 || | 344 codec_config_->codec_ == media::kCodecVP9 || |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) { | 1328 if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) { |
1324 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities:: | 1329 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities:: |
1325 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; | 1330 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; |
1326 } | 1331 } |
1327 } | 1332 } |
1328 | 1333 |
1329 return capabilities; | 1334 return capabilities; |
1330 } | 1335 } |
1331 | 1336 |
1332 } // namespace content | 1337 } // namespace content |
OLD | NEW |