diff options
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/IMediaPlayerClient.cpp | 12 | ||||
-rw-r--r-- | media/libmedia/mediaplayer.cpp | 7 |
2 files changed, 15 insertions, 4 deletions
diff --git a/media/libmedia/IMediaPlayerClient.cpp b/media/libmedia/IMediaPlayerClient.cpp index bf51829..1f135c4 100644 --- a/media/libmedia/IMediaPlayerClient.cpp +++ b/media/libmedia/IMediaPlayerClient.cpp @@ -35,13 +35,16 @@ public: { } - virtual void notify(int msg, int ext1, int ext2) + virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) { Parcel data, reply; data.writeInterfaceToken(IMediaPlayerClient::getInterfaceDescriptor()); data.writeInt32(msg); data.writeInt32(ext1); data.writeInt32(ext2); + if (obj && obj->dataSize() > 0) { + data.appendFrom(const_cast<Parcel *>(obj), 0, obj->dataSize()); + } remote()->transact(NOTIFY, data, &reply, IBinder::FLAG_ONEWAY); } }; @@ -59,7 +62,12 @@ status_t BnMediaPlayerClient::onTransact( int msg = data.readInt32(); int ext1 = data.readInt32(); int ext2 = data.readInt32(); - notify(msg, ext1, ext2); + Parcel obj; + if (data.dataAvail() > 0) { + obj.appendFrom(const_cast<Parcel *>(&data), data.dataPosition(), data.dataAvail()); + } + + notify(msg, ext1, ext2, &obj); return NO_ERROR; } break; default: diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp index 0ee0249..e80e742 100644 --- a/media/libmedia/mediaplayer.cpp +++ b/media/libmedia/mediaplayer.cpp @@ -551,7 +551,7 @@ status_t MediaPlayer::attachAuxEffect(int effectId) return mPlayer->attachAuxEffect(effectId); } -void MediaPlayer::notify(int msg, int ext1, int ext2) +void MediaPlayer::notify(int msg, int ext1, int ext2, const Parcel *obj) { LOGV("message received msg=%d, ext1=%d, ext2=%d", msg, ext1, ext2); bool send = true; @@ -641,6 +641,9 @@ void MediaPlayer::notify(int msg, int ext1, int ext2) mVideoWidth = ext1; mVideoHeight = ext2; break; + case MEDIA_TIMED_TEXT: + LOGV("Received timed text message"); + break; default: LOGV("unrecognized message: (%d, %d, %d)", msg, ext1, ext2); break; @@ -653,7 +656,7 @@ void MediaPlayer::notify(int msg, int ext1, int ext2) if ((listener != 0) && send) { Mutex::Autolock _l(mNotifyLock); LOGV("callback application"); - listener->notify(msg, ext1, ext2); + listener->notify(msg, ext1, ext2, obj); LOGV("back from callback"); } } |