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

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 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
« no previous file with comments | « content/common/gpu/media/DEPS ('k') | content/common/gpu/media/android_video_encode_accelerator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c0ca5176da4aca94a150dc6b976162a0001d81a0 100644
--- a/content/common/gpu/media/android_video_decode_accelerator.cc
+++ b/content/common/gpu/media/android_video_decode_accelerator.cc
@@ -84,8 +84,10 @@ bool AndroidVideoDecodeAccelerator::Initialize(
}
// Only consider using MediaCodec if it's likely backed by hardware.
- if (media::VideoCodecBridge::IsKnownUnaccelerated(codec_))
+ if (media::VideoCodecBridge::IsKnownUnaccelerated(
+ codec_, media::MEDIA_CODEC_DECODER)) {
return false;
+ }
if (!make_context_current_.Run()) {
LOG(ERROR) << "Failed to make this decoder's GL context current.";
@@ -210,7 +212,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 +401,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() {
« no previous file with comments | « content/common/gpu/media/DEPS ('k') | content/common/gpu/media/android_video_encode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698