Rename ISurfaceTexture and SurfaceTexture
The C++ class names don't match what the classes do, so rename
ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to
GLConsumer.
Bug 7736700
Change-Id: I08e677faf2ebb418ef131d0a8008e01037db0e50
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index dab2de1..8740c08 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -111,12 +111,12 @@
status_t JMediaCodec::configure(
const sp<AMessage> &format,
- const sp<ISurfaceTexture> &surfaceTexture,
+ const sp<IGraphicBufferProducer> &bufferProducer,
const sp<ICrypto> &crypto,
int flags) {
sp<SurfaceTextureClient> client;
- if (surfaceTexture != NULL) {
- mSurfaceTextureClient = new SurfaceTextureClient(surfaceTexture);
+ if (bufferProducer != NULL) {
+ mSurfaceTextureClient = new SurfaceTextureClient(bufferProducer);
} else {
mSurfaceTextureClient.clear();
}
@@ -382,11 +382,11 @@
return;
}
- sp<ISurfaceTexture> surfaceTexture;
+ sp<IGraphicBufferProducer> bufferProducer;
if (jsurface != NULL) {
sp<Surface> surface(android_view_Surface_getSurface(env, jsurface));
if (surface != NULL) {
- surfaceTexture = surface->getSurfaceTexture();
+ bufferProducer = surface->getSurfaceTexture();
} else {
jniThrowException(
env,
@@ -401,7 +401,7 @@
crypto = JCrypto::GetCrypto(env, jcrypto);
}
- err = codec->configure(format, surfaceTexture, crypto, flags);
+ err = codec->configure(format, bufferProducer, crypto, flags);
throwExceptionAsNecessary(env, err);
}
diff --git a/media/jni/android_media_MediaCodec.h b/media/jni/android_media_MediaCodec.h
index bc9ad50..a9bb9af 100644
--- a/media/jni/android_media_MediaCodec.h
+++ b/media/jni/android_media_MediaCodec.h
@@ -30,7 +30,7 @@
struct AMessage;
struct AString;
struct ICrypto;
-struct ISurfaceTexture;
+struct IGraphicBufferProducer;
struct MediaCodec;
struct SurfaceTextureClient;
@@ -43,7 +43,7 @@
status_t configure(
const sp<AMessage> &format,
- const sp<ISurfaceTexture> &surfaceTexture,
+ const sp<IGraphicBufferProducer> &bufferProducer,
const sp<ICrypto> &crypto,
int flags);
diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp
index ad536f2..5408a1f 100644
--- a/media/jni/android_media_MediaPlayer.cpp
+++ b/media/jni/android_media_MediaPlayer.cpp
@@ -39,7 +39,7 @@
#include "android_os_Parcel.h"
#include "android_util_Binder.h"
#include <binder/Parcel.h>
-#include <gui/ISurfaceTexture.h>
+#include <gui/IGraphicBufferProducer.h>
#include <gui/Surface.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
@@ -236,10 +236,10 @@
process_media_player_call( env, thiz, mp->setDataSource(fd, offset, length), "java/io/IOException", "setDataSourceFD failed." );
}
-static sp<ISurfaceTexture>
+static sp<IGraphicBufferProducer>
getVideoSurfaceTexture(JNIEnv* env, jobject thiz) {
- ISurfaceTexture * const p = (ISurfaceTexture*)env->GetIntField(thiz, fields.surface_texture);
- return sp<ISurfaceTexture>(p);
+ IGraphicBufferProducer * const p = (IGraphicBufferProducer*)env->GetIntField(thiz, fields.surface_texture);
+ return sp<IGraphicBufferProducer>(p);
}
static void
@@ -250,7 +250,7 @@
return;
}
- sp<ISurfaceTexture> old_st = getVideoSurfaceTexture(env, thiz);
+ sp<IGraphicBufferProducer> old_st = getVideoSurfaceTexture(env, thiz);
if (old_st != NULL) {
old_st->decStrong(thiz);
}
@@ -269,7 +269,7 @@
decVideoSurfaceRef(env, thiz);
- sp<ISurfaceTexture> new_st;
+ sp<IGraphicBufferProducer> new_st;
if (jsurface) {
sp<Surface> surface(android_view_Surface_getSurface(env, jsurface));
if (surface != NULL) {
@@ -313,7 +313,7 @@
// Handle the case where the display surface was set before the mp was
// initialized. We try again to make it stick.
- sp<ISurfaceTexture> st = getVideoSurfaceTexture(env, thiz);
+ sp<IGraphicBufferProducer> st = getVideoSurfaceTexture(env, thiz);
mp->setVideoSurfaceTexture(st);
process_media_player_call( env, thiz, mp->prepare(), "java/io/IOException", "Prepare failed." );
@@ -330,7 +330,7 @@
// Handle the case where the display surface was set before the mp was
// initialized. We try again to make it stick.
- sp<ISurfaceTexture> st = getVideoSurfaceTexture(env, thiz);
+ sp<IGraphicBufferProducer> st = getVideoSurfaceTexture(env, thiz);
mp->setVideoSurfaceTexture(st);
process_media_player_call( env, thiz, mp->prepareAsync(), "java/io/IOException", "Prepare Async failed." );