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

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: Added blacklist-based disabling 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 ccf2903b0c1328151717ddff1c69c9e3d2ec88e9..5cde668496df374f79b96ff3c576919156527308 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))
Ken Russell (switch to Gerrit) 2013/11/27 00:18:20 It would be better to use an enum for this new arg
Ami GONE FROM CHROMIUM 2013/11/27 01:13:13 It's a PITA but I agree it's an improvement. Done
Ken Russell (switch to Gerrit) 2013/11/27 01:16:37 Thanks.
return false;
if (!make_context_current_.Run()) {
@@ -210,7 +210,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:
@@ -399,23 +399,21 @@ 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)) {
+ 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