summaryrefslogtreecommitdiffstats
path: root/content/common/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'content/common/gpu')
-rw-r--r--content/common/gpu/gpu_channel.cc5
-rw-r--r--content/common/gpu/gpu_channel.h3
-rw-r--r--content/common/gpu/gpu_messages.h5
-rw-r--r--content/common/gpu/media/android_video_decode_accelerator.cc25
-rw-r--r--content/common/gpu/stream_texture_manager_android.cc4
-rw-r--r--content/common/gpu/stream_texture_manager_android.h3
6 files changed, 10 insertions, 35 deletions
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 71ac691..62d85e9 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -912,10 +912,9 @@ void GpuChannel::OnRegisterStreamTextureProxy(
}
void GpuChannel::OnEstablishStreamTexture(
- int32 stream_id, SurfaceTexturePeer::SurfaceTextureTarget type,
- int32 primary_id, int32 secondary_id) {
+ int32 stream_id, int32 primary_id, int32 secondary_id) {
stream_texture_manager_->EstablishStreamTexture(
- stream_id, type, primary_id, secondary_id);
+ stream_id, primary_id, secondary_id);
}
#endif
diff --git a/content/common/gpu/gpu_channel.h b/content/common/gpu/gpu_channel.h
index 4e87588..8f21b35 100644
--- a/content/common/gpu/gpu_channel.h
+++ b/content/common/gpu/gpu_channel.h
@@ -177,8 +177,7 @@ class GpuChannel : public IPC::Listener,
// Create a java surface texture object and send it to the renderer process
// through binder thread.
void OnEstablishStreamTexture(
- int32 stream_id, SurfaceTexturePeer::SurfaceTextureTarget type,
- int32 primary_id, int32 secondary_id);
+ int32 stream_id, int32 primary_id, int32 secondary_id);
#endif
// Collect rendering stats.
diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h
index 687340c..07db342 100644
--- a/content/common/gpu/gpu_messages.h
+++ b/content/common/gpu/gpu_messages.h
@@ -106,7 +106,6 @@ IPC_STRUCT_BEGIN(GpuStreamTextureMsg_MatrixChanged_Params)
IPC_STRUCT_MEMBER(float, m32)
IPC_STRUCT_MEMBER(float, m33)
IPC_STRUCT_END()
-IPC_ENUM_TRAITS(content::SurfaceTexturePeer::SurfaceTextureTarget)
#endif
IPC_STRUCT_TRAITS_BEGIN(content::DxDiagNode)
@@ -438,10 +437,8 @@ IPC_SYNC_MESSAGE_CONTROL2_1(GpuChannelMsg_RegisterStreamTextureProxy,
// Tells the GPU process create and send the java surface texture object to
// the renderer process through the binder thread.
-IPC_MESSAGE_CONTROL4(GpuChannelMsg_EstablishStreamTexture,
+IPC_MESSAGE_CONTROL3(GpuChannelMsg_EstablishStreamTexture,
int32, /* stream_id */
- content::SurfaceTexturePeer::SurfaceTextureTarget,
- /* type */
int32, /* primary_id */
int32 /* secondary_id */)
#endif
diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc
index 920e69a..1f90308 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();
}
diff --git a/content/common/gpu/stream_texture_manager_android.cc b/content/common/gpu/stream_texture_manager_android.cc
index e073fbc..6eb7a10 100644
--- a/content/common/gpu/stream_texture_manager_android.cc
+++ b/content/common/gpu/stream_texture_manager_android.cc
@@ -119,15 +119,13 @@ void StreamTextureManagerAndroid::RegisterStreamTextureProxy(
}
void StreamTextureManagerAndroid::EstablishStreamTexture(
- int32 stream_id, SurfaceTexturePeer::SurfaceTextureTarget type,
- int32 primary_id, int32 secondary_id) {
+ int32 stream_id, int32 primary_id, int32 secondary_id) {
StreamTextureAndroid* stream_texture = textures_.Lookup(stream_id);
base::ProcessHandle process = channel_->renderer_pid();
if (stream_texture) {
SurfaceTexturePeer::GetInstance()->EstablishSurfaceTexturePeer(
process,
- type,
stream_texture->surface_texture_bridge(),
primary_id,
secondary_id);
diff --git a/content/common/gpu/stream_texture_manager_android.h b/content/common/gpu/stream_texture_manager_android.h
index 342ff40..e514fc9 100644
--- a/content/common/gpu/stream_texture_manager_android.h
+++ b/content/common/gpu/stream_texture_manager_android.h
@@ -40,8 +40,7 @@ class StreamTextureManagerAndroid : public gpu::StreamTextureManager {
void RegisterStreamTextureProxy(
int32 stream_id, const gfx::Size& initial_size, int32 route_id);
void EstablishStreamTexture(
- int32 stream_id, content::SurfaceTexturePeer::SurfaceTextureTarget type,
- int32 primary_id, int32 secondary_id);
+ int32 stream_id, int32 primary_id, int32 secondary_id);
// Send new transform matrix.
void SendMatrixChanged(int route_id,