Chromium Code Reviews| Index: media/gpu/android_video_decode_accelerator.cc |
| diff --git a/media/gpu/android_video_decode_accelerator.cc b/media/gpu/android_video_decode_accelerator.cc |
| index 55eb7384b1f4486e15c99fd70a30b5ef22048ef8..f7851da8ec568a94f7efa2675b5207c98946f983 100644 |
| --- a/media/gpu/android_video_decode_accelerator.cc |
| +++ b/media/gpu/android_video_decode_accelerator.cc |
| @@ -380,10 +380,15 @@ bool AndroidVideoDecodeAccelerator::Initialize(const Config& config, |
| codec_config_->codec_ != kCodecHEVC && |
| #endif |
| codec_config_->codec_ != kCodecH264) { |
| - LOG(ERROR) << "Unsupported profile: " << config.profile; |
| + DLOG(ERROR) << "Unsupported profile: " << config.profile; |
| return false; |
| } |
| + if (codec_config_->codec_ == kCodecH264) { |
| + codec_config_->csd0_ = config.sps; |
| + codec_config_->csd1_ = config.pps; |
|
dcheng
2016/10/12 05:57:13
Is there anything interesting for the GPU to valid
|
| + } |
| + |
| // Only use MediaCodec for VP8/9 if it's likely backed by hardware |
| // or if the stream is encrypted. |
| if (IsMediaCodecSoftwareDecodingForbidden() && |
| @@ -397,7 +402,7 @@ bool AndroidVideoDecodeAccelerator::Initialize(const Config& config, |
| auto gles_decoder = get_gles2_decoder_cb_.Run(); |
| if (!gles_decoder) { |
| - LOG(ERROR) << "Failed to get gles2 decoder instance."; |
| + DLOG(ERROR) << "Failed to get gles2 decoder instance."; |
| return false; |
| } |
| @@ -1043,8 +1048,8 @@ AndroidVideoDecodeAccelerator::ConfigureMediaCodecOnAnyThread( |
| std::unique_ptr<VideoCodecBridge> codec(VideoCodecBridge::CreateDecoder( |
| codec_config->codec_, codec_config->needs_protected_surface_, |
| codec_config->initial_expected_coded_size_, |
| - codec_config->surface_.j_surface().obj(), media_crypto, true, |
| - require_software_codec)); |
| + codec_config->surface_.j_surface().obj(), media_crypto, |
| + codec_config->csd0_, codec_config->csd1_, true, require_software_codec)); |
| return codec; |
| } |