summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/timedtext/TimedTextSRTSource.h
diff options
context:
space:
mode:
authorInsun Kang <insun@google.com>2012-07-10 21:18:22 +0900
committerInsun Kang <insun@google.com>2012-07-20 11:49:01 +0900
commita3c9d82d0f898d30982840b48d1f00fd0d831e19 (patch)
treef11bc23bc6447b3b6b4410f733424db3cdecac04 /media/libstagefright/timedtext/TimedTextSRTSource.h
parentea682976030a3930f6ee49b33b7e21abfc68174a (diff)
downloadframeworks_av-a3c9d82d0f898d30982840b48d1f00fd0d831e19.zip
frameworks_av-a3c9d82d0f898d30982840b48d1f00fd0d831e19.tar.gz
frameworks_av-a3c9d82d0f898d30982840b48d1f00fd0d831e19.tar.bz2
Bugfix: Seek on SRT external track
o Need to return closest upcoming subtitle when seeking time is within gap ranges. o Manually cherry-picked from GTV change. (commit e026a83dc88888b42da77eca739b8f09a0cd6dae) related-to-bug: 6796228 Change-Id: I02b7718a432d6b2f5575fa1a1a42bda6f04aa25b
Diffstat (limited to 'media/libstagefright/timedtext/TimedTextSRTSource.h')
-rw-r--r--media/libstagefright/timedtext/TimedTextSRTSource.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/media/libstagefright/timedtext/TimedTextSRTSource.h b/media/libstagefright/timedtext/TimedTextSRTSource.h
index 9eeab39..598c200 100644
--- a/media/libstagefright/timedtext/TimedTextSRTSource.h
+++ b/media/libstagefright/timedtext/TimedTextSRTSource.h
@@ -70,6 +70,25 @@ private:
status_t extractAndAppendLocalDescriptions(
int64_t timeUs, const AString &text, Parcel *parcel);
+ // Compares the time range of the subtitle at index to the given timeUs.
+ // The time range of the subtitle to match with given timeUs is extended to
+ // [endTimeUs of the previous subtitle, endTimeUs of current subtitle).
+ //
+ // This compare function is used to find a next subtitle when read() is
+ // called with seek options. Note that timeUs within gap ranges, such as
+ // [200, 300) in the below example, will be matched to the closest future
+ // subtitle, [300, 400).
+ //
+ // For instance, assuming there are 3 subtitles in mTextVector,
+ // 0: [100, 200) ----> [0, 200)
+ // 1: [300, 400) ----> [200, 400)
+ // 2: [500, 600) ----> [400, 600)
+ // If the 'index' parameter contains 1, this function
+ // returns 0, if timeUs is in [200, 400)
+ // returns -1, if timeUs >= 400,
+ // returns 1, if timeUs < 200.
+ int compareExtendedRangeAndTime(size_t index, int64_t timeUs);
+
DISALLOW_EVIL_CONSTRUCTORS(TimedTextSRTSource);
};