| 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 b7e9326ab7c5142c9b1d13c730d2472a7c73eed0..03a0579b956c0efe8a045c38c520dba9773fa3f6 100644
|
| --- a/content/common/gpu/media/android_video_decode_accelerator.cc
|
| +++ b/content/common/gpu/media/android_video_decode_accelerator.cc
|
| @@ -84,7 +84,7 @@ bool AndroidVideoDecodeAccelerator::Initialize(
|
| }
|
|
|
| // Only consider using MediaCodec if it's likely backed by hardware.
|
| - if (media::VideoCodecBridge::IsKnownUnaccelerated(codec_))
|
| + if (media::VideoCodecBridge::IsKnownUnaccelerated(codec_, false))
|
| return false;
|
|
|
| if (!make_context_current_.Run()) {
|
| @@ -211,7 +211,7 @@ void AndroidVideoDecodeAccelerator::DequeueOutput() {
|
| size_t size = 0;
|
|
|
| media::MediaCodecStatus status = media_codec_->DequeueOutputBuffer(
|
| - NoWaitTimeOut(), &buf_index, &offset, &size, ×tamp, &eos);
|
| + NoWaitTimeOut(), &buf_index, &offset, &size, ×tamp, &eos, NULL);
|
| switch (status) {
|
| case media::MEDIA_CODEC_DEQUEUE_OUTPUT_AGAIN_LATER:
|
| case media::MEDIA_CODEC_ERROR:
|
| @@ -400,23 +400,20 @@ void AndroidVideoDecodeAccelerator::Flush() {
|
|
|
| bool AndroidVideoDecodeAccelerator::ConfigureMediaCodec() {
|
| DCHECK(surface_texture_.get());
|
| - media_codec_.reset(media::VideoCodecBridge::Create(codec_, false));
|
| -
|
| - if (!media_codec_)
|
| - return false;
|
|
|
| gfx::ScopedJavaSurface surface(surface_texture_.get());
|
| +
|
| // Pass a dummy 320x240 canvas size and let the codec signal the real size
|
| // when it's known from the bitstream.
|
| - if (!media_codec_->Start(
|
| - codec_, gfx::Size(320, 240), surface.j_surface().obj(), NULL)) {
|
| - return false;
|
| - }
|
| + media_codec_.reset(media::VideoCodecBridge::CreateDecoder(
|
| + codec_, false, gfx::Size(320, 240), surface.j_surface().obj(), NULL));
|
| + if (!media_codec_) return false;
|
| +
|
| io_timer_.Start(FROM_HERE,
|
| DecodePollDelay(),
|
| this,
|
| &AndroidVideoDecodeAccelerator::DoIOTask);
|
| - return media_codec_->GetOutputBuffers();
|
| + return true;
|
| }
|
|
|
| void AndroidVideoDecodeAccelerator::Reset() {
|
|
|