| Index: content/common/gpu/media/android_video_decode_accelerator.cc
|
| diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc
|
| index 15d9d44fdd560f5dd3a8d985386723480843728b..87a06f7eee9b5b16b357058f03b68aef5c7336ad 100644
|
| --- a/content/common/gpu/media/android_video_decode_accelerator.cc
|
| +++ b/content/common/gpu/media/android_video_decode_accelerator.cc
|
| @@ -104,7 +104,10 @@ bool AndroidVideoDecodeAccelerator::Initialize(
|
|
|
| surface_texture_ = new gfx::SurfaceTextureBridge(surface_texture_id_);
|
|
|
| - ConfigureMediaCodec();
|
| + if (!ConfigureMediaCodec()) {
|
| + LOG(ERROR) << "Failed to create MediaCodec instance.";
|
| + return false;
|
| + }
|
|
|
| base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
|
| &AndroidVideoDecodeAccelerator::NotifyInitializeDone,
|
| @@ -376,10 +379,12 @@ void AndroidVideoDecodeAccelerator::Flush() {
|
| Decode(media::BitstreamBuffer(-1, base::SharedMemoryHandle(), 0));
|
| }
|
|
|
| -void AndroidVideoDecodeAccelerator::ConfigureMediaCodec() {
|
| +bool AndroidVideoDecodeAccelerator::ConfigureMediaCodec() {
|
| DCHECK(surface_texture_.get());
|
| + media_codec_.reset(media::VideoCodecBridge::Create(codec_));
|
|
|
| - media_codec_.reset(new media::VideoCodecBridge(codec_));
|
| + if (!media_codec_)
|
| + return false;
|
|
|
| gfx::ScopedJavaSurface surface(surface_texture_.get());
|
| // VDA does not pass the container indicated resolution in the initialization
|
| @@ -388,6 +393,7 @@ void AndroidVideoDecodeAccelerator::ConfigureMediaCodec() {
|
| media_codec_->Start(
|
| codec_, gfx::Size(1280, 720), surface.j_surface().obj());
|
| media_codec_->GetOutputBuffers();
|
| + return true;
|
| }
|
|
|
| void AndroidVideoDecodeAccelerator::Reset() {
|
|
|