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

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

Issue 12388038: Android: Remove Surface cruft (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months 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 920e69afa2fa5074921d467cf2be2400b0d5530b..1d83f9334f993296a873ca8a10c21ce3eefeaaf6 100644
--- a/content/common/gpu/media/android_video_decode_accelerator.cc
+++ b/content/common/gpu/media/android_video_decode_accelerator.cc
@@ -7,11 +7,10 @@
#include <jni.h>
#include "base/android/jni_android.h"
no sievers 2013/03/04 22:56:40 Ok, the jni includes and the 'using base::android:
-#include "base/android/scoped_java_ref.h"
#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop.h"
-#include "content/common/android/surface_callback.h"
+#include "content/common/android/scoped_java_surface.h"
#include "content/common/gpu/gpu_channel.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "media/base/bitstream_buffer.h"
@@ -20,7 +19,6 @@
#include "ui/gl/gl_bindings.h"
using base::android::MethodID;
-using base::android::ScopedJavaLocalRef;
namespace content {
@@ -385,22 +383,12 @@ void AndroidVideoDecodeAccelerator::ConfigureMediaCodec() {
media_codec_.reset(new media::MediaCodecBridge(codec_));
- JNIEnv* env = base::android::AttachCurrentThread();
- CHECK(env);
- ScopedJavaLocalRef<jclass> cls(
- base::android::GetClass(env, "android/view/Surface"));
- jmethodID constructor = MethodID::Get<MethodID::TYPE_INSTANCE>(
- env, cls.obj(), "<init>", "(Landroid/graphics/SurfaceTexture;)V");
- ScopedJavaLocalRef<jobject> j_surface(
- env, env->NewObject(
- cls.obj(), constructor,
- surface_texture_->j_surface_texture().obj()));
-
+ ScopedJavaSurface surface(surface_texture_.get());
// VDA does not pass the container indicated resolution in the initialization
// phase. Here, we set 720p by default.
// TODO(dwkang): find out a way to remove the following hard-coded value.
- media_codec_->StartVideo(codec_, gfx::Size(1280, 720), j_surface.obj());
- content::ReleaseSurface(j_surface.obj());
+ media_codec_->StartVideo(
+ codec_, gfx::Size(1280, 720), surface.j_surface().obj());
media_codec_->GetOutputBuffers();
}

Powered by Google App Engine
This is Rietveld 408576698