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

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
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/common/gpu/stream_texture_manager_android.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 920e69afa2fa5074921d467cf2be2400b0d5530b..1f9030822c706f906ef81e0a9197e0071f44f6c5 100644
--- a/content/common/gpu/media/android_video_decode_accelerator.cc
+++ b/content/common/gpu/media/android_video_decode_accelerator.cc
@@ -4,14 +4,10 @@
#include "content/common/gpu/media/android_video_decode_accelerator.h"
-#include <jni.h>
-
-#include "base/android/jni_android.h"
-#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"
@@ -19,9 +15,6 @@
#include "media/video/picture.h"
#include "ui/gl/gl_bindings.h"
-using base::android::MethodID;
-using base::android::ScopedJavaLocalRef;
-
namespace content {
// Helper macros for dealing with failure. If |result| evaluates false, emit
@@ -385,22 +378,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();
}
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/common/gpu/stream_texture_manager_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698