summaryrefslogtreecommitdiffstats
path: root/include/media/stagefright/timedtext
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2012-04-11 17:56:22 -0700
committerJames Dong <jdong@google.com>2012-04-16 12:08:10 -0700
commiteec46abb88dcc50621fd2d3f17a6b8d24fd07a19 (patch)
tree0b3e4cfec4f7f76a99bc82907c205253fb7c2ebe /include/media/stagefright/timedtext
parent25736fd247ba757feefe15d3071f7e747c64fea4 (diff)
downloadframeworks_av-eec46abb88dcc50621fd2d3f17a6b8d24fd07a19.zip
frameworks_av-eec46abb88dcc50621fd2d3f17a6b8d24fd07a19.tar.gz
frameworks_av-eec46abb88dcc50621fd2d3f17a6b8d24fd07a19.tar.bz2
Fix for multiple audio/timed track feature implementation - part one
o getTrackInfo now returns all tracks, rather than just the timed text tracks. o the index of the track info is kept to the same as the track index if the track is not from an external source o correctly maps the selectTrack() and unselectTrack() calls to the right track index o TODO: 1) note that the selectTrack() and unselectTrack() only works for timed text track at present; 2) the lock is timed text specific o related-to-bug: 6110705 Change-Id: Ib1feeef2184bc992930ace0d1197b6c00a2636d7
Diffstat (limited to 'include/media/stagefright/timedtext')
-rw-r--r--include/media/stagefright/timedtext/TimedTextDriver.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/include/media/stagefright/timedtext/TimedTextDriver.h b/include/media/stagefright/timedtext/TimedTextDriver.h
index e3ca536..1c5fd36 100644
--- a/include/media/stagefright/timedtext/TimedTextDriver.h
+++ b/include/media/stagefright/timedtext/TimedTextDriver.h
@@ -40,18 +40,24 @@ public:
status_t start();
status_t pause();
- status_t selectTrack(int32_t index);
- status_t unselectTrack(int32_t index);
+ status_t selectTrack(size_t index);
+ status_t unselectTrack(size_t index);
status_t seekToAsync(int64_t timeUs);
- status_t addInBandTextSource(const sp<MediaSource>& source);
- status_t addOutOfBandTextSource(const char *uri, const char *mimeType);
+ status_t addInBandTextSource(
+ size_t trackIndex, const sp<MediaSource>& source);
+
+ status_t addOutOfBandTextSource(
+ size_t trackIndex, const char *uri, const char *mimeType);
+
// Caller owns the file desriptor and caller is responsible for closing it.
status_t addOutOfBandTextSource(
- int fd, off64_t offset, off64_t length, const char *mimeType);
+ size_t trackIndex, int fd, off64_t offset,
+ off64_t length, const char *mimeType);
- void getTrackInfo(Parcel *parcel);
+ void getExternalTrackInfo(Parcel *parcel);
+ size_t countExternalTracks() const;
private:
Mutex mLock;
@@ -68,13 +74,17 @@ private:
// Variables to be guarded by mLock.
State mState;
- int32_t mCurrentTrackIndex;
- Vector<sp<TimedTextSource> > mTextSourceVector;
+ size_t mCurrentTrackIndex;
+ KeyedVector<size_t, sp<TimedTextSource> > mTextSourceVector;
+ Vector<bool> mTextSourceTypeVector;
+
// -- End of variables to be guarded by mLock
- status_t selectTrack_l(int32_t index);
+ status_t selectTrack_l(size_t index);
+
status_t createOutOfBandTextSource(
- const char *mimeType, const sp<DataSource>& dataSource);
+ size_t trackIndex, const char* mimeType,
+ const sp<DataSource>& dataSource);
DISALLOW_EVIL_CONSTRUCTORS(TimedTextDriver);
};