diff options
author | Gloria Wang <gwang@google.com> | 2011-05-03 15:59:03 -0700 |
---|---|---|
committer | Gloria Wang <gwang@google.com> | 2011-05-03 16:41:17 -0700 |
commit | 7a1e3e81264189e23a1db2b174e1b5a5d4c7d1c3 (patch) | |
tree | d75e0a639df8f389786d9bdf6c6de1f22729b135 /media/libstagefright/include/AwesomePlayer.h | |
parent | 10d227074b5a67a2e738d72888ece4dd24537c66 (diff) | |
download | frameworks_av-7a1e3e81264189e23a1db2b174e1b5a5d4c7d1c3.zip frameworks_av-7a1e3e81264189e23a1db2b174e1b5a5d4c7d1c3.tar.gz frameworks_av-7a1e3e81264189e23a1db2b174e1b5a5d4c7d1c3.tar.bz2 |
Initial CL for the timed text support:
- Add support for MP4 timed text
- Add API for app to turn on/off a text track
- Add timed text metadata(language) in the MediaMetadataRetriever
Change-Id: I0055beba38ac761627dbcc6d581ae9582d68bb94
Diffstat (limited to 'media/libstagefright/include/AwesomePlayer.h')
-rw-r--r-- | media/libstagefright/include/AwesomePlayer.h | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h index 2c17d92..fd3ddf7 100644 --- a/media/libstagefright/include/AwesomePlayer.h +++ b/media/libstagefright/include/AwesomePlayer.h @@ -44,6 +44,8 @@ struct ARTSPController; class DrmManagerClinet; class DecryptHandle; +class TimedTextPlayer; + struct AwesomeRenderer : public RefBase { AwesomeRenderer() {} @@ -99,36 +101,41 @@ struct AwesomePlayer { void postAudioEOS(int64_t delayUs = 0ll); void postAudioSeekComplete(); + status_t setTimedTextTrackIndex(int32_t index); + private: friend struct AwesomeEvent; friend struct PreviewPlayer; enum { - PLAYING = 1, - LOOPING = 2, - FIRST_FRAME = 4, - PREPARING = 8, - PREPARED = 16, - AT_EOS = 32, - PREPARE_CANCELLED = 64, - CACHE_UNDERRUN = 128, - AUDIO_AT_EOS = 256, - VIDEO_AT_EOS = 512, - AUTO_LOOPING = 1024, + PLAYING = 0x01, + LOOPING = 0x02, + FIRST_FRAME = 0x04, + PREPARING = 0x08, + PREPARED = 0x10, + AT_EOS = 0x20, + PREPARE_CANCELLED = 0x40, + CACHE_UNDERRUN = 0x80, + AUDIO_AT_EOS = 0x0100, + VIDEO_AT_EOS = 0x0200, + AUTO_LOOPING = 0x0400, // We are basically done preparing but are currently buffering // sufficient data to begin playback and finish the preparation phase // for good. - PREPARING_CONNECTED = 2048, + PREPARING_CONNECTED = 0x0800, // We're triggering a single video event to display the first frame // after the seekpoint. - SEEK_PREVIEW = 4096, + SEEK_PREVIEW = 0x1000, - AUDIO_RUNNING = 8192, - AUDIOPLAYER_STARTED = 16384, + AUDIO_RUNNING = 0x2000, + AUDIOPLAYER_STARTED = 0x4000, - INCOGNITO = 32768, + INCOGNITO = 0x8000, + + TEXT_RUNNING = 0x10000, + TEXTPLAYER_STARTED = 0x20000, }; mutable Mutex mLock; @@ -222,6 +229,7 @@ private: sp<DecryptHandle> mDecryptHandle; int64_t mLastVideoTimeUs; + TimedTextPlayer *mTextPlayer; status_t setDataSource_l( const char *uri, @@ -244,6 +252,8 @@ private: void setVideoSource(sp<MediaSource> source); status_t initVideoDecoder(uint32_t flags = 0); + void addTextSource(sp<MediaSource> source); + void onStreamDone(); void notifyListener_l(int msg, int ext1 = 0, int ext2 = 0); |