Skip to content

Commit 26f70db

Browse files
theandi666Android (Google) Code Review
authored andcommitted
Merge "Remove surface legacy APIs and code." into ics-mr1
2 parents 99015a2 + 95be245 commit 26f70db

File tree

19 files changed

+1
-77
lines changed

19 files changed

+1
-77
lines changed

cmds/stagefright/stream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ int main(int argc, char **argv) {
360360
service->create(getpid(), client, 0);
361361

362362
if (player != NULL && player->setDataSource(source) == NO_ERROR) {
363-
player->setVideoSurface(surface);
363+
player->setVideoSurfaceTexture(surface->getSurfaceTexture());
364364
player->start();
365365

366366
client->waitForEOS();

include/media/IMediaPlayer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class IMediaPlayer: public IInterface
4040
const KeyedVector<String8, String8>* headers) = 0;
4141
virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0;
4242
virtual status_t setDataSource(const sp<IStreamSource>& source) = 0;
43-
virtual status_t setVideoSurface(const sp<Surface>& surface) = 0;
4443
virtual status_t setVideoSurfaceTexture(
4544
const sp<ISurfaceTexture>& surfaceTexture) = 0;
4645
virtual status_t prepareAsync() = 0;

include/media/MediaPlayerInterface.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ class MediaPlayerBase : public RefBase
117117
return INVALID_OPERATION;
118118
}
119119

120-
// pass the buffered Surface to the media player service
121-
virtual status_t setVideoSurface(const sp<Surface>& surface) = 0;
122-
123120
// pass the buffered ISurfaceTexture to the media player service
124121
virtual status_t setVideoSurfaceTexture(
125122
const sp<ISurfaceTexture>& surfaceTexture) = 0;

include/media/mediaplayer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ class MediaPlayer : public BnMediaPlayerClient,
170170

171171
status_t setDataSource(int fd, int64_t offset, int64_t length);
172172
status_t setDataSource(const sp<IStreamSource> &source);
173-
status_t setVideoSurface(const sp<Surface>& surface);
174173
status_t setVideoSurfaceTexture(
175174
const sp<ISurfaceTexture>& surfaceTexture);
176175
status_t setListener(const sp<MediaPlayerListener>& listener);

media/libmedia/IMediaPlayer.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ enum {
3535
SET_DATA_SOURCE_URL,
3636
SET_DATA_SOURCE_FD,
3737
SET_DATA_SOURCE_STREAM,
38-
SET_VIDEO_SURFACE,
3938
PREPARE_ASYNC,
4039
START,
4140
STOP,
@@ -112,16 +111,6 @@ class BpMediaPlayer: public BpInterface<IMediaPlayer>
112111
return reply.readInt32();
113112
}
114113

115-
// pass the buffered Surface to the media player service
116-
status_t setVideoSurface(const sp<Surface>& surface)
117-
{
118-
Parcel data, reply;
119-
data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor());
120-
Surface::writeToParcel(surface, &data);
121-
remote()->transact(SET_VIDEO_SURFACE, data, &reply);
122-
return reply.readInt32();
123-
}
124-
125114
// pass the buffered ISurfaceTexture to the media player service
126115
status_t setVideoSurfaceTexture(const sp<ISurfaceTexture>& surfaceTexture)
127116
{
@@ -345,12 +334,6 @@ status_t BnMediaPlayer::onTransact(
345334
reply->writeInt32(setDataSource(source));
346335
return NO_ERROR;
347336
}
348-
case SET_VIDEO_SURFACE: {
349-
CHECK_INTERFACE(IMediaPlayer, data, reply);
350-
sp<Surface> surface = Surface::readFromParcel(data);
351-
reply->writeInt32(setVideoSurface(surface));
352-
return NO_ERROR;
353-
} break;
354337
case SET_VIDEO_SURFACETEXTURE: {
355338
CHECK_INTERFACE(IMediaPlayer, data, reply);
356339
sp<ISurfaceTexture> surfaceTexture =

media/libmedia/mediaplayer.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,6 @@ status_t MediaPlayer::getMetadata(bool update_only, bool apply_filter, Parcel *m
219219
return mPlayer->getMetadata(update_only, apply_filter, metadata);
220220
}
221221

222-
status_t MediaPlayer::setVideoSurface(const sp<Surface>& surface)
223-
{
224-
LOGV("setVideoSurface");
225-
Mutex::Autolock _l(mLock);
226-
if (mPlayer == 0) return NO_INIT;
227-
return mPlayer->setVideoSurface(surface);
228-
}
229-
230222
status_t MediaPlayer::setVideoSurfaceTexture(
231223
const sp<ISurfaceTexture>& surfaceTexture)
232224
{

media/libmediaplayerservice/MediaPlayerService.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -788,14 +788,6 @@ status_t MediaPlayerService::Client::setDataSource(
788788
return mStatus;
789789
}
790790

791-
status_t MediaPlayerService::Client::setVideoSurface(const sp<Surface>& surface)
792-
{
793-
LOGV("[%d] setVideoSurface(%p)", mConnId, surface.get());
794-
sp<MediaPlayerBase> p = getPlayer();
795-
if (p == 0) return UNKNOWN_ERROR;
796-
return p->setVideoSurface(surface);
797-
}
798-
799791
void MediaPlayerService::Client::disconnectNativeWindow() {
800792
if (mConnectedWindow != NULL) {
801793
status_t err = native_window_api_disconnect(mConnectedWindow.get(),

media/libmediaplayerservice/MediaPlayerService.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ class MediaPlayerService : public BnMediaPlayerService
248248

249249
// IMediaPlayer interface
250250
virtual void disconnect();
251-
virtual status_t setVideoSurface(const sp<Surface>& surface);
252251
virtual status_t setVideoSurfaceTexture(
253252
const sp<ISurfaceTexture>& surfaceTexture);
254253
virtual status_t prepareAsync();

media/libmediaplayerservice/MidiFile.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class MidiFile : public MediaPlayerInterface {
3535
const char* path, const KeyedVector<String8, String8> *headers);
3636

3737
virtual status_t setDataSource(int fd, int64_t offset, int64_t length);
38-
virtual status_t setVideoSurface(const sp<Surface>& surface) { return UNKNOWN_ERROR; }
3938
virtual status_t setVideoSurfaceTexture(
4039
const sp<ISurfaceTexture>& surfaceTexture)
4140
{ return UNKNOWN_ERROR; }

media/libmediaplayerservice/StagefrightPlayer.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ status_t StagefrightPlayer::setDataSource(const sp<IStreamSource> &source) {
6969
return mPlayer->setDataSource(source);
7070
}
7171

72-
status_t StagefrightPlayer::setVideoSurface(const sp<Surface> &surface) {
73-
LOGV("setVideoSurface");
74-
75-
return mPlayer->setSurface(surface);
76-
}
77-
7872
status_t StagefrightPlayer::setVideoSurfaceTexture(
7973
const sp<ISurfaceTexture> &surfaceTexture) {
8074
LOGV("setVideoSurfaceTexture");

0 commit comments

Comments
 (0)