summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-10-26 14:44:29 -0700
committerAndreas Huber <andih@google.com>2011-10-31 08:29:21 -0700
commit8d7bd3c0c920ba70cbf3cc762411902c94c35253 (patch)
treed8f480dc9acdf7a4813679979edadbd6331f897c
parent13ffc7f7c69e2fabf1ef70ebb2ea81489be9bd74 (diff)
downloadandroid_system_media-8d7bd3c0c920ba70cbf3cc762411902c94c35253.tar.gz
android_system_media-8d7bd3c0c920ba70cbf3cc762411902c94c35253.tar.bz2
android_system_media-8d7bd3c0c920ba70cbf3cc762411902c94c35253.zip
Remove MediaPlayer::setVideoSurface legacy.
Change-Id: I95aa181f39b375087b30ac65fea37589108c9f16
-rw-r--r--wilhelm/src/android/MediaPlayer_to_android.cpp3
-rw-r--r--wilhelm/src/android/android_GenericMediaPlayer.cpp21
-rw-r--r--wilhelm/src/android/android_GenericMediaPlayer.h3
-rw-r--r--wilhelm/src/android/android_GenericPlayer.h1
-rw-r--r--wilhelm/src/android/android_StreamPlayer.cpp2
5 files changed, 5 insertions, 25 deletions
diff --git a/wilhelm/src/android/MediaPlayer_to_android.cpp b/wilhelm/src/android/MediaPlayer_to_android.cpp
index 77df09eb..083738d3 100644
--- a/wilhelm/src/android/MediaPlayer_to_android.cpp
+++ b/wilhelm/src/android/MediaPlayer_to_android.cpp
@@ -722,7 +722,8 @@ SLresult android_Player_setNativeWindow(CMediaPlayer *mp, ANativeWindow *nativeW
SL_LOGV("Displaying on ANativeWindow of type NATIVE_WINDOW_SURFACE");
android::sp<android::Surface> nativeSurface(
static_cast<android::Surface *>(nativeWindow));
- mp->mAVPlayer->setVideoSurface(nativeSurface);
+ mp->mAVPlayer->setVideoSurfaceTexture(
+ nativeSurface->getSurfaceTexture());
result = SL_RESULT_SUCCESS;
} break;
case NATIVE_WINDOW_SURFACE_TEXTURE_CLIENT: { // SurfaceTextureClient
diff --git a/wilhelm/src/android/android_GenericMediaPlayer.cpp b/wilhelm/src/android/android_GenericMediaPlayer.cpp
index 91d09726..a56a230a 100644
--- a/wilhelm/src/android/android_GenericMediaPlayer.cpp
+++ b/wilhelm/src/android/android_GenericMediaPlayer.cpp
@@ -177,7 +177,6 @@ GenericMediaPlayer::GenericMediaPlayer(const AudioPlayback_Parameters* params, b
GenericPlayer(params),
mHasVideo(hasVideo),
mSeekTimeMsec(0),
- mVideoSurface(0),
mVideoSurfaceTexture(0),
mPlayer(0),
mPlayerClient(new MediaPlayerNotificationClient(this))
@@ -199,7 +198,7 @@ void GenericMediaPlayer::preDestroy() {
// causes CHECK failure in Nuplayer, but commented out in the subclass preDestroy
// randomly causes a NPE in StagefrightPlayer, heap corruption, or app hang
//player->setDataSource(NULL);
- player->setVideoSurface(NULL);
+ player->setVideoSurfaceTexture(NULL);
player->disconnect();
// release all references to the IMediaPlayer
// FIXME illegal if not on looper
@@ -231,19 +230,6 @@ void GenericMediaPlayer::getPositionMsec(int* msec) {
}
//--------------------------------------------------
-void GenericMediaPlayer::setVideoSurface(const sp<Surface> &surface) {
- SL_LOGV("GenericMediaPlayer::setVideoSurface()");
- // FIXME bug - race condition, should do in looper
- if (mVideoSurface.get() == surface.get()) {
- return;
- }
- if ((mStateFlags & kFlagPrepared) && (mPlayer != 0)) {
- mPlayer->setVideoSurface(surface);
- }
- mVideoSurface = surface;
- mVideoSurfaceTexture = NULL;
-}
-
void GenericMediaPlayer::setVideoSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) {
SL_LOGV("GenericMediaPlayer::setVideoSurfaceTexture()");
// FIXME bug - race condition, should do in looper
@@ -254,7 +240,6 @@ void GenericMediaPlayer::setVideoSurfaceTexture(const sp<ISurfaceTexture> &surfa
mPlayer->setVideoSurfaceTexture(surfaceTexture);
}
mVideoSurfaceTexture = surfaceTexture;
- mVideoSurface = NULL;
}
@@ -267,9 +252,7 @@ void GenericMediaPlayer::onPrepare() {
// Attempt to prepare at most once, and only if there is a MediaPlayer
if (!(mStateFlags & (kFlagPrepared | kFlagPreparedUnsuccessfully)) && (mPlayer != 0)) {
if (mHasVideo) {
- if (mVideoSurface != 0) {
- mPlayer->setVideoSurface(mVideoSurface);
- } else if (mVideoSurfaceTexture != 0) {
+ if (mVideoSurfaceTexture != 0) {
mPlayer->setVideoSurfaceTexture(mVideoSurfaceTexture);
}
}
diff --git a/wilhelm/src/android/android_GenericMediaPlayer.h b/wilhelm/src/android/android_GenericMediaPlayer.h
index c3a9d002..e095dab0 100644
--- a/wilhelm/src/android/android_GenericMediaPlayer.h
+++ b/wilhelm/src/android/android_GenericMediaPlayer.h
@@ -70,7 +70,6 @@ public:
// overridden from GenericPlayer
virtual void getPositionMsec(int* msec); // ANDROID_UNKNOWN_TIME if unknown
- virtual void setVideoSurface(const sp<Surface> &surface);
virtual void setVideoSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture);
protected:
@@ -91,8 +90,6 @@ protected:
const bool mHasVideo; // const allows MediaPlayerNotificationClient::notify to safely access
int32_t mSeekTimeMsec;
- // at most one of mVideoSurface and mVideoSurfaceTexture is non-NULL
- sp<Surface> mVideoSurface;
sp<ISurfaceTexture> mVideoSurfaceTexture;
// only safe to access from within Realize and looper
diff --git a/wilhelm/src/android/android_GenericPlayer.h b/wilhelm/src/android/android_GenericPlayer.h
index b1228c04..cbea27ce 100644
--- a/wilhelm/src/android/android_GenericPlayer.h
+++ b/wilhelm/src/android/android_GenericPlayer.h
@@ -77,7 +77,6 @@ public:
virtual void getDurationMsec(int* msec); //msec != NULL, ANDROID_UNKNOWN_TIME if unknown
virtual void getPositionMsec(int* msec) = 0; //msec != NULL, ANDROID_UNKNOWN_TIME if unknown
- virtual void setVideoSurface(const sp<Surface> &surface) {}
virtual void setVideoSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) {}
void setVolume(float leftVol, float rightVol);
diff --git a/wilhelm/src/android/android_StreamPlayer.cpp b/wilhelm/src/android/android_StreamPlayer.cpp
index a806290c..2c2e0c63 100644
--- a/wilhelm/src/android/android_StreamPlayer.cpp
+++ b/wilhelm/src/android/android_StreamPlayer.cpp
@@ -333,7 +333,7 @@ void StreamPlayer::onStopForDestroy() {
mPlayer->stop();
// causes CHECK failure in Nuplayer
//mPlayer->setDataSource(NULL);
- mPlayer->setVideoSurface(NULL);
+ mPlayer->setVideoSurfaceTexture(NULL);
mPlayer->disconnect();
mPlayer.clear();
{