diff options
author | Insun Kang <insun@google.com> | 2012-02-16 20:28:27 +0900 |
---|---|---|
committer | Insun Kang <insun@google.com> | 2012-03-15 08:36:52 +0900 |
commit | f9d660a5e0196240add5daf0199f128d471e592c (patch) | |
tree | f67d9d6c7d7e22e8cedefaae1bf0e7a4872deda5 /media/libstagefright/timedtext/TimedTextSRTSource.cpp | |
parent | dfaf549e3e310bc22444f4404b19f4907b24c286 (diff) | |
download | frameworks_av-f9d660a5e0196240add5daf0199f128d471e592c.zip frameworks_av-f9d660a5e0196240add5daf0199f128d471e592c.tar.gz frameworks_av-f9d660a5e0196240add5daf0199f128d471e592c.tar.bz2 |
Defines MediaPlayer APIs to support multiple audio/video/timedtext
tracks.
o Newly introduced APIs are (MediaPlayer):
getTrackInfo() / addExternalSource() / enableTrack() / disableTrack().
o Timed text tracks are supported only, for now.
o TODOs:
- Define the audio/video behavior for enableTrack and disableTrack.
- Refactoring AwesomePlayer / TimedTextDriver so that all types of
track index can be managed in the correct order and be ready for
supporting audio/video tracks.
(MediaExtractor and MediaSource for text file might be necessary.)
Change-Id: Idb85e1b3f2ed49a64f377d05472dd6663ce94e07
Diffstat (limited to 'media/libstagefright/timedtext/TimedTextSRTSource.cpp')
-rw-r--r-- | media/libstagefright/timedtext/TimedTextSRTSource.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/media/libstagefright/timedtext/TimedTextSRTSource.cpp b/media/libstagefright/timedtext/TimedTextSRTSource.cpp index 3752d34..c44a99b 100644 --- a/media/libstagefright/timedtext/TimedTextSRTSource.cpp +++ b/media/libstagefright/timedtext/TimedTextSRTSource.cpp @@ -21,8 +21,10 @@ #include <binder/Parcel.h> #include <media/stagefright/foundation/AString.h> #include <media/stagefright/DataSource.h> +#include <media/stagefright/MediaDefs.h> // for MEDIA_MIMETYPE_xxx #include <media/stagefright/MediaErrors.h> #include <media/stagefright/MediaSource.h> +#include <media/stagefright/MetaData.h> #include "TimedTextSRTSource.h" #include "TextDescriptions.h" @@ -31,6 +33,7 @@ namespace android { TimedTextSRTSource::TimedTextSRTSource(const sp<DataSource>& dataSource) : mSource(dataSource), + mMetaData(new MetaData), mIndex(0) { } @@ -42,10 +45,14 @@ status_t TimedTextSRTSource::start() { if (err != OK) { reset(); } + // TODO: Need to detect the language, because SRT doesn't give language + // information explicitly. + mMetaData->setCString(kKeyMediaLanguage, ""); return err; } void TimedTextSRTSource::reset() { + mMetaData->clear(); mTextVector.clear(); mIndex = 0; } @@ -272,4 +279,8 @@ status_t TimedTextSRTSource::extractAndAppendLocalDescriptions( return OK; } +sp<MetaData> TimedTextSRTSource::getFormat() { + return mMetaData; +} + } // namespace android |