diff options
author | Gloria Wang <gwang@google.com> | 2011-04-13 15:36:14 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-04-13 15:36:14 -0700 |
commit | e2e3f479fe160e8ba00321ada2c61d4bcaf5be4d (patch) | |
tree | 94fc63d71587345d69aad352d07c570fe2f0db1d /include | |
parent | 53e1c0497b720d0e4f00dd7ca61838b865d41add (diff) | |
parent | b483c4724846c0b8d4e82afcbb7c17f671bae81c (diff) | |
download | frameworks_av-e2e3f479fe160e8ba00321ada2c61d4bcaf5be4d.zip frameworks_av-e2e3f479fe160e8ba00321ada2c61d4bcaf5be4d.tar.gz frameworks_av-e2e3f479fe160e8ba00321ada2c61d4bcaf5be4d.tar.bz2 |
Merge "- Add another parameter in notify() to be able to send timed text sample through listener during video playback. - Add OnTimedTextListener in the MediaPlayer For feature request 800939."
Diffstat (limited to 'include')
-rw-r--r-- | include/media/IMediaPlayerClient.h | 2 | ||||
-rw-r--r-- | include/media/MediaPlayerInterface.h | 8 | ||||
-rw-r--r-- | include/media/mediaplayer.h | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/include/media/IMediaPlayerClient.h b/include/media/IMediaPlayerClient.h index eee6c97..daec1c7 100644 --- a/include/media/IMediaPlayerClient.h +++ b/include/media/IMediaPlayerClient.h @@ -28,7 +28,7 @@ class IMediaPlayerClient: public IInterface public: DECLARE_META_INTERFACE(MediaPlayerClient); - virtual void notify(int msg, int ext1, int ext2) = 0; + virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h index 447942b..e1b6dd6 100644 --- a/include/media/MediaPlayerInterface.h +++ b/include/media/MediaPlayerInterface.h @@ -55,7 +55,8 @@ enum player_type { // callback mechanism for passing messages to MediaPlayer object -typedef void (*notify_callback_f)(void* cookie, int msg, int ext1, int ext2); +typedef void (*notify_callback_f)(void* cookie, + int msg, int ext1, int ext2, const Parcel *obj); // abstract base class - use MediaPlayerInterface class MediaPlayerBase : public RefBase @@ -159,9 +160,10 @@ public: mCookie = cookie; mNotify = notifyFunc; } - void sendEvent(int msg, int ext1=0, int ext2=0) { + void sendEvent(int msg, int ext1=0, int ext2=0, + const Parcel *obj=NULL) { Mutex::Autolock autoLock(mNotifyLock); - if (mNotify) mNotify(mCookie, msg, ext1, ext2); + if (mNotify) mNotify(mCookie, msg, ext1, ext2, obj); } private: diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h index 528eeb9..748e489 100644 --- a/include/media/mediaplayer.h +++ b/include/media/mediaplayer.h @@ -37,6 +37,7 @@ enum media_event_type { MEDIA_BUFFERING_UPDATE = 3, MEDIA_SEEK_COMPLETE = 4, MEDIA_SET_VIDEO_SIZE = 5, + MEDIA_TIMED_TEXT = 99, MEDIA_ERROR = 100, MEDIA_INFO = 200, }; @@ -129,7 +130,7 @@ enum media_player_states { class MediaPlayerListener: virtual public RefBase { public: - virtual void notify(int msg, int ext1, int ext2) = 0; + virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; }; class MediaPlayer : public BnMediaPlayerClient, @@ -166,7 +167,7 @@ public: status_t setLooping(int loop); bool isLooping(); status_t setVolume(float leftVolume, float rightVolume); - void notify(int msg, int ext1, int ext2); + void notify(int msg, int ext1, int ext2, const Parcel *obj = NULL); static sp<IMemory> decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat); static sp<IMemory> decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat); status_t invoke(const Parcel& request, Parcel *reply); |