Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: content/common/gpu/media/android_video_decode_accelerator.cc

Issue 74563002: AndroidVideoEncodeAccelerator is born! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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, &timestamp, &eos);
+ NoWaitTimeOut(), &buf_index, &offset, &size, &timestamp, &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() {

Powered by Google App Engine
This is Rietveld 408576698