diff options
author | Andreas Huber <andih@google.com> | 2011-10-25 13:45:00 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2011-10-28 09:39:23 -0700 |
commit | 3901e5d87573447db33fb9930871a1f5266a9b2c (patch) | |
tree | 2ed377c9705a41c95cbc6ea29d683cd646ff2dc8 | |
parent | 841fa37451fb74f3d5978a15aab606bbb67e8c39 (diff) | |
download | frameworks_av-3901e5d87573447db33fb9930871a1f5266a9b2c.zip frameworks_av-3901e5d87573447db33fb9930871a1f5266a9b2c.tar.gz frameworks_av-3901e5d87573447db33fb9930871a1f5266a9b2c.tar.bz2 |
Remove surface legacy APIs and code.
All surfaces are now supported through surface textures.
Change-Id: I95dd823e7099c0c32a48a1121624149dcc29d9c6
-rw-r--r-- | cmds/stagefright/stream.cpp | 2 | ||||
-rw-r--r-- | include/media/IMediaPlayer.h | 1 | ||||
-rw-r--r-- | include/media/MediaPlayerInterface.h | 3 | ||||
-rw-r--r-- | include/media/mediaplayer.h | 1 | ||||
-rw-r--r-- | media/libmedia/IMediaPlayer.cpp | 17 | ||||
-rw-r--r-- | media/libmedia/mediaplayer.cpp | 8 | ||||
-rw-r--r-- | media/libmediaplayerservice/MediaPlayerService.cpp | 8 | ||||
-rw-r--r-- | media/libmediaplayerservice/MediaPlayerService.h | 1 | ||||
-rw-r--r-- | media/libmediaplayerservice/MidiFile.h | 1 | ||||
-rw-r--r-- | media/libmediaplayerservice/StagefrightPlayer.cpp | 6 | ||||
-rw-r--r-- | media/libmediaplayerservice/StagefrightPlayer.h | 1 | ||||
-rw-r--r-- | media/libmediaplayerservice/TestPlayerStub.h | 3 | ||||
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 6 | ||||
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayer.h | 1 | ||||
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp | 6 | ||||
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerDriver.h | 1 | ||||
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 9 | ||||
-rw-r--r-- | media/libstagefright/include/AwesomePlayer.h | 2 |
18 files changed, 1 insertions, 76 deletions
diff --git a/cmds/stagefright/stream.cpp b/cmds/stagefright/stream.cpp index 2378345..bd430d1 100644 --- a/cmds/stagefright/stream.cpp +++ b/cmds/stagefright/stream.cpp @@ -360,7 +360,7 @@ int main(int argc, char **argv) { service->create(getpid(), client, 0); if (player != NULL && player->setDataSource(source) == NO_ERROR) { - player->setVideoSurface(surface); + player->setVideoSurfaceTexture(surface->getSurfaceTexture()); player->start(); client->waitForEOS(); diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h index 0e2cdf7..e905903 100644 --- a/include/media/IMediaPlayer.h +++ b/include/media/IMediaPlayer.h @@ -40,7 +40,6 @@ public: const KeyedVector<String8, String8>* headers) = 0; virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; virtual status_t setDataSource(const sp<IStreamSource>& source) = 0; - virtual status_t setVideoSurface(const sp<Surface>& surface) = 0; virtual status_t setVideoSurfaceTexture( const sp<ISurfaceTexture>& surfaceTexture) = 0; virtual status_t prepareAsync() = 0; diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h index 4328d3c..80f43a3 100644 --- a/include/media/MediaPlayerInterface.h +++ b/include/media/MediaPlayerInterface.h @@ -117,9 +117,6 @@ public: return INVALID_OPERATION; } - // pass the buffered Surface to the media player service - virtual status_t setVideoSurface(const sp<Surface>& surface) = 0; - // pass the buffered ISurfaceTexture to the media player service virtual status_t setVideoSurfaceTexture( const sp<ISurfaceTexture>& surfaceTexture) = 0; diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h index 08835fb..e6a0cc5 100644 --- a/include/media/mediaplayer.h +++ b/include/media/mediaplayer.h @@ -170,7 +170,6 @@ public: status_t setDataSource(int fd, int64_t offset, int64_t length); status_t setDataSource(const sp<IStreamSource> &source); - status_t setVideoSurface(const sp<Surface>& surface); status_t setVideoSurfaceTexture( const sp<ISurfaceTexture>& surfaceTexture); status_t setListener(const sp<MediaPlayerListener>& listener); diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp index 50a41ca..9c1e6b7 100644 --- a/media/libmedia/IMediaPlayer.cpp +++ b/media/libmedia/IMediaPlayer.cpp @@ -35,7 +35,6 @@ enum { SET_DATA_SOURCE_URL, SET_DATA_SOURCE_FD, SET_DATA_SOURCE_STREAM, - SET_VIDEO_SURFACE, PREPARE_ASYNC, START, STOP, @@ -112,16 +111,6 @@ public: return reply.readInt32(); } - // pass the buffered Surface to the media player service - status_t setVideoSurface(const sp<Surface>& surface) - { - Parcel data, reply; - data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor()); - Surface::writeToParcel(surface, &data); - remote()->transact(SET_VIDEO_SURFACE, data, &reply); - return reply.readInt32(); - } - // pass the buffered ISurfaceTexture to the media player service status_t setVideoSurfaceTexture(const sp<ISurfaceTexture>& surfaceTexture) { @@ -345,12 +334,6 @@ status_t BnMediaPlayer::onTransact( reply->writeInt32(setDataSource(source)); return NO_ERROR; } - case SET_VIDEO_SURFACE: { - CHECK_INTERFACE(IMediaPlayer, data, reply); - sp<Surface> surface = Surface::readFromParcel(data); - reply->writeInt32(setVideoSurface(surface)); - return NO_ERROR; - } break; case SET_VIDEO_SURFACETEXTURE: { CHECK_INTERFACE(IMediaPlayer, data, reply); sp<ISurfaceTexture> surfaceTexture = diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp index f72300b..c2e1ddf 100644 --- a/media/libmedia/mediaplayer.cpp +++ b/media/libmedia/mediaplayer.cpp @@ -219,14 +219,6 @@ status_t MediaPlayer::getMetadata(bool update_only, bool apply_filter, Parcel *m return mPlayer->getMetadata(update_only, apply_filter, metadata); } -status_t MediaPlayer::setVideoSurface(const sp<Surface>& surface) -{ - LOGV("setVideoSurface"); - Mutex::Autolock _l(mLock); - if (mPlayer == 0) return NO_INIT; - return mPlayer->setVideoSurface(surface); -} - status_t MediaPlayer::setVideoSurfaceTexture( const sp<ISurfaceTexture>& surfaceTexture) { diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp index b655358..e8d0f0c 100644 --- a/media/libmediaplayerservice/MediaPlayerService.cpp +++ b/media/libmediaplayerservice/MediaPlayerService.cpp @@ -788,14 +788,6 @@ status_t MediaPlayerService::Client::setDataSource( return mStatus; } -status_t MediaPlayerService::Client::setVideoSurface(const sp<Surface>& surface) -{ - LOGV("[%d] setVideoSurface(%p)", mConnId, surface.get()); - sp<MediaPlayerBase> p = getPlayer(); - if (p == 0) return UNKNOWN_ERROR; - return p->setVideoSurface(surface); -} - void MediaPlayerService::Client::disconnectNativeWindow() { if (mConnectedWindow != NULL) { status_t err = native_window_api_disconnect(mConnectedWindow.get(), diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h index 62214ba..04d9e28 100644 --- a/media/libmediaplayerservice/MediaPlayerService.h +++ b/media/libmediaplayerservice/MediaPlayerService.h @@ -248,7 +248,6 @@ private: // IMediaPlayer interface virtual void disconnect(); - virtual status_t setVideoSurface(const sp<Surface>& surface); virtual status_t setVideoSurfaceTexture( const sp<ISurfaceTexture>& surfaceTexture); virtual status_t prepareAsync(); diff --git a/media/libmediaplayerservice/MidiFile.h b/media/libmediaplayerservice/MidiFile.h index b35696f..3469389 100644 --- a/media/libmediaplayerservice/MidiFile.h +++ b/media/libmediaplayerservice/MidiFile.h @@ -35,7 +35,6 @@ public: const char* path, const KeyedVector<String8, String8> *headers); virtual status_t setDataSource(int fd, int64_t offset, int64_t length); - virtual status_t setVideoSurface(const sp<Surface>& surface) { return UNKNOWN_ERROR; } virtual status_t setVideoSurfaceTexture( const sp<ISurfaceTexture>& surfaceTexture) { return UNKNOWN_ERROR; } diff --git a/media/libmediaplayerservice/StagefrightPlayer.cpp b/media/libmediaplayerservice/StagefrightPlayer.cpp index cd4b1ef..598d573 100644 --- a/media/libmediaplayerservice/StagefrightPlayer.cpp +++ b/media/libmediaplayerservice/StagefrightPlayer.cpp @@ -69,12 +69,6 @@ status_t StagefrightPlayer::setDataSource(const sp<IStreamSource> &source) { return mPlayer->setDataSource(source); } -status_t StagefrightPlayer::setVideoSurface(const sp<Surface> &surface) { - LOGV("setVideoSurface"); - - return mPlayer->setSurface(surface); -} - status_t StagefrightPlayer::setVideoSurfaceTexture( const sp<ISurfaceTexture> &surfaceTexture) { LOGV("setVideoSurfaceTexture"); diff --git a/media/libmediaplayerservice/StagefrightPlayer.h b/media/libmediaplayerservice/StagefrightPlayer.h index cbc6d49..e89e18a 100644 --- a/media/libmediaplayerservice/StagefrightPlayer.h +++ b/media/libmediaplayerservice/StagefrightPlayer.h @@ -40,7 +40,6 @@ public: virtual status_t setDataSource(const sp<IStreamSource> &source); - virtual status_t setVideoSurface(const sp<Surface> &surface); virtual status_t setVideoSurfaceTexture( const sp<ISurfaceTexture> &surfaceTexture); virtual status_t prepare(); diff --git a/media/libmediaplayerservice/TestPlayerStub.h b/media/libmediaplayerservice/TestPlayerStub.h index 802a11b..91ffa7d 100644 --- a/media/libmediaplayerservice/TestPlayerStub.h +++ b/media/libmediaplayerservice/TestPlayerStub.h @@ -75,9 +75,6 @@ class TestPlayerStub : public MediaPlayerInterface { // All the methods below wrap the mPlayer instance. - virtual status_t setVideoSurface(const android::sp<android::Surface>& s) { - return mPlayer->setVideoSurface(s); - } virtual status_t setVideoSurfaceTexture( const android::sp<android::ISurfaceTexture>& st) { return mPlayer->setVideoSurfaceTexture(st); diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 7cdb76c..249dc4e 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -99,12 +99,6 @@ void NuPlayer::setDataSource( msg->post(); } -void NuPlayer::setVideoSurface(const sp<Surface> &surface) { - sp<AMessage> msg = new AMessage(kWhatSetVideoNativeWindow, id()); - msg->setObject("native-window", new NativeWindowWrapper(surface)); - msg->post(); -} - void NuPlayer::setVideoSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) { sp<AMessage> msg = new AMessage(kWhatSetVideoNativeWindow, id()); sp<SurfaceTextureClient> surfaceTextureClient(surfaceTexture != NULL ? diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.h b/media/libmediaplayerservice/nuplayer/NuPlayer.h index f90759d..f23deea 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.h @@ -42,7 +42,6 @@ struct NuPlayer : public AHandler { void setDataSource( const char *url, const KeyedVector<String8, String8> *headers); - void setVideoSurface(const sp<Surface> &surface); void setVideoSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture); void setAudioSink(const sp<MediaPlayerBase::AudioSink> &sink); void start(); diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp index 452ba99..5aa99bf 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp @@ -89,12 +89,6 @@ status_t NuPlayerDriver::setDataSource(const sp<IStreamSource> &source) { return OK; } -status_t NuPlayerDriver::setVideoSurface(const sp<Surface> &surface) { - mPlayer->setVideoSurface(surface); - - return OK; -} - status_t NuPlayerDriver::setVideoSurfaceTexture( const sp<ISurfaceTexture> &surfaceTexture) { mPlayer->setVideoSurfaceTexture(surfaceTexture); diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h index aaa3de0..4a0026c 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h @@ -37,7 +37,6 @@ struct NuPlayerDriver : public MediaPlayerInterface { virtual status_t setDataSource(const sp<IStreamSource> &source); - virtual status_t setVideoSurface(const sp<Surface> &surface); virtual status_t setVideoSurfaceTexture( const sp<ISurfaceTexture> &surfaceTexture); virtual status_t prepare(); diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index f37e75b..7d9d7ed 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -1139,18 +1139,9 @@ bool AwesomePlayer::isPlaying() const { return (mFlags & PLAYING) || (mFlags & CACHE_UNDERRUN); } -status_t AwesomePlayer::setSurface(const sp<Surface> &surface) { - Mutex::Autolock autoLock(mLock); - - mSurface = surface; - return setNativeWindow_l(surface); -} - status_t AwesomePlayer::setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) { Mutex::Autolock autoLock(mLock); - mSurface.clear(); - status_t err; if (surfaceTexture != NULL) { err = setNativeWindow_l(new SurfaceTextureClient(surfaceTexture)); diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h index 7d6bcad..c13d6cb 100644 --- a/media/libstagefright/include/AwesomePlayer.h +++ b/media/libstagefright/include/AwesomePlayer.h @@ -81,7 +81,6 @@ struct AwesomePlayer { bool isPlaying() const; - status_t setSurface(const sp<Surface> &surface); status_t setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture); void setAudioSink(const sp<MediaPlayerBase::AudioSink> &audioSink); status_t setLooping(bool shouldLoop); @@ -154,7 +153,6 @@ private: bool mUIDValid; uid_t mUID; - sp<Surface> mSurface; sp<ANativeWindow> mNativeWindow; sp<MediaPlayerBase::AudioSink> mAudioSink; |