summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive/PlaylistFetcher.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Prevent integer underflows in ID3::IteratorJoshua J. Drake2016-03-221-0/+3
| | | | | | | | | | | If mFrameSize is less than or equal to getHeaderLength(), an integer underflow will occur. This typically leads to a crash reading out of bounds in the following code. Prevent this from happening by validating mFrameSize. Also add NULL checks after references to ID3::Iterator::getData. Bug: 23285887 Change-Id: I35eeda3c5349ebbd9ffb3ea49b79af6a940d1395
* Fix benign unsigned integer overflowsVishwath Mohan2015-11-051-2/+4
| | | | | | Bug: 23110888 Change-Id: I1894a61e94a274795cab7fb23a81f3a611717c1d (cherry picked from 25f191c5cb2ec532e534be646c32806f9f85e196)
* Benign integer overflow in PlaylistFetcherDan Austin2015-11-051-1/+2
| | | | | | | | | There is a benign integer overflow in the loop that finds the smallest first PTS from all streams in the current parser. The loop has been refactored to eliminate the integer overflow. Bug: 25008541 Change-Id: Ie2c0f1d360023cad960e071d810dddb1b5420470
* httplive: Add default implementation in HLS for custom changesSanthosh Behara2015-10-121-1/+3
| | | | | | | | Add getSeqNumberInLiveStreaming() function in PlayListFetcher Make getBandwidthIndex() function to be virtual. Change-Id: I5e2bc7a42e0d4a16d5b5ea5f2ec3d78a7d019ad3
* httplive: refactor for HLS customizationLi Sun2015-10-061-0/+4
| | | | | | Change access modifiers and add overridable methods in HLS stack. Change-Id: Iae8e77246cc6643735af18617717fba713d0038c
* HLS: temporarily blacklist a variant if failed to fetchChong Zhang2015-07-141-0/+7
| | | | | | | | | | | | | | - abort high bandwidth immediately when bandwidth is fluctuating - use short-term bandwidth estimate for downswitch if bandwidth is not stable - discard bandwidth samples that's too old in absolute time - if already underflow, switch to lowest bandwidth to catch up - if error happened during bandwidth switch (likely due to new variant link is broken), switch to lowest bandwidth to catch up bug: 21754330 Change-Id: Ifd16d75e261cefb93b989829bf35a36783142ae0
* Merge "HLS: invoke signalEOS on ATSParser to flush out final samples" into ↵Robert Shih2015-05-111-0/+10
|\ | | | | | | mnc-dev
| * HLS: invoke signalEOS on ATSParser to flush out final samplesRobert Shih2015-05-111-0/+10
| | | | | | | | | | | | | | Also clear EOS status when we reset ATSParser. Bug: 20959760 Change-Id: I730234acf3cdbee08affe0f28b7e8759e11059cb
* | nuplayer: fixes for subtitle pause/resumeChong Zhang2015-05-061-1/+10
|/ | | | | | | | | | - pause after the current block when select track - ignore metadata timestamps as they're too sparse - use smaller range when searching for next segment to prevent resumeUntil from downloading too much data bug: 20500732 Change-Id: Ibda57a39ec86efd96a8dd0db95adeb92d076697a
* HLS: make disconnect faster to prevent ANRChong Zhang2015-04-231-51/+78
| | | | | | | disconnect HTTP connection when we absolutely won't resume bug: 19890444 Change-Id: Idee36b48741f6f8eb1d65bca32156e9e18349c67
* Merge "HLS: reduce number of guessed wrong seq numbers"Chong Zhang2015-04-181-172/+155
|\
| * HLS: reduce number of guessed wrong seq numbersChong Zhang2015-04-171-172/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - account for playlist age in live streaming when calculating segment time - be more conservative on downswitching if bandwidth is unstable - adjust forward or backward if guessed wrong seq number - code refactor bug: 19567254 Change-Id: I0b61cea888fdffd1b3ee2446747ed10152e9e7d7
* | stagefright: make more warnings errorsLajos Molnar2015-04-171-2/+0
|/ | | | Change-Id: I9b1ad60fbfb866dbf9c00843e06553c3eb25c113
* stagefright: initial timed id3 support in hlsRobert Shih2015-04-161-25/+52
| | | | Change-Id: I00a8a786b3f4b74742c34770edd94e937abe20a8
* HLS: traces in LiveSession and PlaylistFetcher for easier debuggingChong Zhang2015-04-081-22/+76
| | | | | bug: 19567254 Change-Id: I4305d37cb74279ccd435f99483231cd1dcf42fc9
* HLS: misc bug fixesChong Zhang2015-04-021-74/+33
| | | | | | | | | | | | | | | | | - fix no target-duration case - fix for audio-only <=> audio/video switching - disable audio-only variants if there is at least one variant with video - fix mpeg2ts PTS wraparound when bandwidth adapting - tweak up/down switch marks bug: 19567254 Change-Id: Ib46144203c56dfc96eccd6ddaa3867e8a4f2c6a9
* HLS: faster switching and pause/resume on low bufferChong Zhang2015-03-271-140/+200
| | | | | | | | | | | | | | | | | | | | | - when upswitching, discard excessive buffering on low bandwidth variant, switch to new variant earlier - when downswitching, report newly found IDR positions continuously, and switch as soon as new fetcher passes playback position. This allows us to skip time-consuming resumeUntil() of old fetcher most of the time - implement pause/resume on low buffering, and notify buffering percentage - buffering parameter tuning, separate pause/resume/ready buffer level and up/down switch buffer level, boost up fetcher buffering significantly bug: 19567254 Change-Id: I750dfcc6f861d78d16a71f501beb86d8129cb048
* HLS: allow pause/resume in the middle of a segmentChong Zhang2015-03-201-71/+283
| | | | | | | | | | | | | | | | | | - when down switching, decide whether to finish current segment based on bandwidth settings, abort current segment if needed. - when switching, pause new fetcher after the first 47K chunk, and go back to resume old fethcer to stop point immediately. - when old fetcher reaches stop point, swap packet sources and resume new fetcher. - mark switching as done as soon as old fecther reaches stop point. This allows us to resume bandwidth monitoring earlier, and do subsequent switches sooner. bug: 19567254 Change-Id: Iba4b5fb9b06541bb1e49592536648f5d4cbc69ab
* HLS: bandwidth estimator changesChong Zhang2015-03-191-26/+35
| | | | | | | | | | | | | | | | - separate bandwidth estimator from HTTPBase, so that we have better control on which samples to use, it also allows bandiwdth history across multiple HTTPBase objects (which we'll use later). - use min buffer duration among the streams to decide whether to download next segment. - maintain constant buffer level, time next download to happen when buffer just goes below kMinBufferedDurationUs. bug: 19567254 Change-Id: I5c481ad1f7ff3f084d57ec68856e12ae6b40ce41
* HLS: some fixes for seek with discontinuity.Chong Zhang2015-03-171-56/+104
| | | | | | | | | | | | | | | | | | | | | | - keep old fetcher when seeking, unless the URI is changing. - when restarting after a seek, check discontinuity seq, and queue format change if it's changed. - add a simple kill switch to abort when stop (or pause for seek). - when seeking, if searching for start time goes into 2nd segment, do not signal time discontinuity or reset first PTS. - use setFormat() to set format in AnotherPacketSource, otherwise video/audio flags are not updated and format are not cleared on discontinuities. - do not start queueing video access unit until first IDR after start bug: 19656539 Change-Id: I79108d26964f59ea00d2eeac8f5f9318747f8541
* HLS: misc changes in LiveSession buffering logicChong Zhang2015-03-101-47/+15
| | | | | | | | | | | | | | | remove unnecessary time discontinuity move fetcher to separate looper so that download won't block LiveSession poll buffering at 1 sec interval in LiveSession, and switch bandwidth if necessary use fixed 100ms threshold for resumeUntil bug: 19567254 Change-Id: I911e5041364f0858b43f2312756e173db5870a1e
* media: switch to new AMessage handlingLajos Molnar2015-03-051-6/+6
| | | | | Bug: 19607784 Change-Id: I94cddcb81f671422ad4982a23dc4acfe57a9f1aa
* am a291dabc: am 6fbcf633: Merge "httplive: Set start time and segment start ↵Robert Shih2015-02-041-0/+7
|\ | | | | | | | | | | | | time in conjunction." into lmp-mr1-dev * commit 'a291dabcab10cafc1749d1d9493d269049502256': httplive: Set start time and segment start time in conjunction.
| * Merge "httplive: Set start time and segment start time in conjunction." into ↵Robert Shih2015-02-041-0/+7
| |\ | | | | | | | | | lmp-mr1-dev
| | * httplive: Set start time and segment start time in conjunction.Robert Shih2015-02-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add comments describing how start time and segment start time are used. Based on AOSP CL https://android-review.googlesource.com/127653 by Joakim Johansson <joakim.c.johansson@sonymobile.com> but uses the lowest segment start time instead of highest. Bug: 18821145 Change-Id: I14cf1186d0daf517a24e8423c3a708b4c9ba06c4
* | | am 9787254f: am 296a0d03: Merge "PlaylistFetcher: clear packet sources when ↵Robert Shih2015-02-021-0/+4
|\ \ \ | |/ / | | | | | | | | | | | | | | | adjusting starting sequence number" into lmp-mr1-dev * commit '9787254f1ef27e86390a31a7ef05d94ff2f65232': PlaylistFetcher: clear packet sources when adjusting starting sequence number
| * | PlaylistFetcher: clear packet sources when adjusting starting sequence numberRobert Shih2015-01-301-0/+4
| |/ | | | | | | | | Bug: 19215971 Change-Id: I4ad29cf0ac24dea330017a1b0159b06922d768ae
* | am ce25d85a: am a93fd2be: stagefright: httplive: Decouple block size from ↵Leena Winterrowd2015-01-291-1/+2
|\ \ | |/ | | | | | | | | | | bandwidth estimate * commit 'ce25d85ad22e6df4b861d17e9e67cb6d0e62c363': stagefright: httplive: Decouple block size from bandwidth estimate
| * stagefright: httplive: Decouple block size from bandwidth estimateLeena Winterrowd2015-01-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A very small block size in PlaylistFetcher can lead to framework overhead and difficulty streaming high bitrate content, but since HTTPBase keeps a constant history of the past 100 HTTP reads, the block size directly affects bandwidth estimation and in turn, switching latency. Add setBandwidthHistorySize() to HTTPBase to allow setting the history size for bandwidth estimation. Call this within LiveSession based on the current block size to ensure that the number of bytes used for estimating bandwidth does not change if the block size is changed in PlaylistFetcher. Since a single TCP/IP packet can contain up to 64k of data, increase the block size in PlaylistFetcher from 2k to lcm(188, 1024) or 47k to avoid inaccuracies in read timings due to up to a comparable 47 reads from the same locally-cached packet instead of from the network. Also make HTTPBase::addBandwidthMeasurement() virtual to allow bandwidth estimation extensions that do not rely on a history list. Bug: 18821145 Change-Id: I5f957be01f5346e74cfb7eeb150ca4b397ad5798
* | resolved conflicts for merge of 59d1d010 to lmp-mr1-dev-plus-aospLajos Molnar2015-01-291-3/+3
|\ \ | |/ | | | | Change-Id: I52e17685b3aa058d6c6b0c023659231fa00a8f71
| * httplive: Dont resume if we have almost fetched till stop timeApurupa Pattapu2015-01-281-3/+3
| | | | | | | | | | | | | | | | | | | | - Use the last enqueued instead of last dequeued time in ResumeUntil. - Set duration in access unit meta as timestamp difference between the last two queued access units. Bug: 18821145 Change-Id: If53ddee1d87775905a6d4f11a6219fe66f498450
* | am 3606efd1: am 9dee2e59: stagefright: httplive: Propagate target duration ↵Leena Winterrowd2015-01-291-0/+5
|\ \ | |/ | | | | | | | | | | to LiveSession * commit '3606efd19a7dee847d3d4db41e8300ba7b451f81': stagefright: httplive: Propagate target duration to LiveSession
| * stagefright: httplive: Propagate target duration to LiveSessionLeena Winterrowd2015-01-281-0/+5
| | | | | | | | | | | | | | | | | | LiveSession's switch-down monitor requires the 'targetDuration' key to evaluate the switching threshold. Ensure that this key is set in the access unit metadata. Bug: 18821145 Change-Id: Ib30f3b4bd8185a77a06abd755822f96644968a21
* | am 2899991e: am 5cf91c50: libstagefright: httplive: Add NULL check for empty ↵Leena Winterrowd2015-01-291-1/+6
|\ \ | |/ | | | | | | | | | | playlist * commit '2899991eb8ca8ebe5da7acd74e0b3bd9743a8724': libstagefright: httplive: Add NULL check for empty playlist
| * libstagefright: httplive: Add NULL check for empty playlistLeena Winterrowd2015-01-281-1/+6
| | | | | | | | | | | | | | | | | | If the source playlist is empty, the playlist meta will be NULL. Check for this case to avoid an invalid dereference. Also flag playlists without the required EXT-X-TARGETDURATION tag as malformed. Bug: 18821145 Change-Id: Idf74d890a89bbc6483a6d4060eb092dc7461be24
* | resolved conflicts for merge of 44a2390b to lmp-mr1-dev-plus-aospLajos Molnar2015-01-291-16/+5
|\ \ | |/ | | | | Change-Id: I39fdc2e8895e1e943749b9a2628656a8fa5bb72b
| * Revert "HLS: QCom enhancements"Lajos Molnar2015-01-281-16/+5
| | | | | | | | | | | | | | | | | | This is to restore patch attributions This reverts commit f580806d893c4631f5324ff0af5c2db68a40ef42. Bug: 18821145 Change-Id: Idc49385fffccfde2a3915388fe3fe4e2b740d787
* | resolved conflicts for merge of 2efb9566 to lmp-mr1-dev-plus-aospNarayan Kamath2014-12-291-5/+16
|\ \ | |/ | | | | Change-Id: I4313941f3561176ce9f6ab055678fb626e570107
| * HLS: QCom enhancementsRobert Shih2014-12-221-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit consists of: http://go/pag/c/188753 Add NULL check for empty playlist http://go/pag/c/188754 Fix deadlock for low duration clips http://go/pag/c/188757 Create a copy of last enqueued metadata http://go/pag/c/188755 Propagate target duration to LiveSession http://go/pag/c/188762 Decouple block size from bandwidth estimate http://go/pag/c/188756 Reduce memcpy calls for chunked content http://go/pag/c/188758 Dont resume if we have almost fetched till stop time Bug: 18821145 Change-Id: I7fd650999c6c50bbadffd65adee9020e669dfe62
* | resolved conflicts for merge of e5ba80c5 to lmp-mr1-dev-plus-aospAndreas Gampe2014-11-271-3/+2
|\ \ | |/ |/| | | Change-Id: Iea12c8a6cabf84584e4a89ad80e298c1f4ea3dd7
| * Stagefright: Fix unused variables, functions, valuesAndreas Gampe2014-11-251-3/+2
| | | | | | | | | | | | | | For build-system CFLAGS clean-up, remove unused functions and variables. Change-Id: Ic3dee56b589ea9a693efa1d72ba394036efff168
* | HLS: fix live lock after missing the boat during configuration changeRobert Shih2014-11-181-0/+20
| | | | | | | | | | Bug:17488643 Change-Id: I4f5de42f86d6c616a67dc803f35c026b35347983
* | Merge "PlaylistFetcher: handle sporadic fetch erros" into lmp-mr1-devRobert Shih2014-11-151-27/+37
|\ \
| * | PlaylistFetcher: handle sporadic fetch errosRobert Shih2014-11-131-27/+37
| | | | | | | | | | | | | | | Bug: 17490472 Change-Id: I2c04e2352f13db762b845f4d35db0a8b851a148c
* | | Merge "PlaylistFetcher: check ts program streams before disabling a/v" into ↵Robert Shih2014-11-131-3/+3
|\ \ \ | | | | | | | | | | | | lmp-mr1-dev
| * | | PlaylistFetcher: check ts program streams before disabling a/vRobert Shih2014-11-121-3/+3
| | |/ | |/| | | | | | | | | | Bug: 14648838 Change-Id: Ibf2b2cbb235f3d80bc33013e2afc053f13b9035f
* | | Merge "PlaylistFetcher: clear mStartup for .aac playlists after seek" into ↵Robert Shih2014-11-111-0/+1
|\ \ \ | |_|/ |/| | | | | lmp-mr1-dev
| * | PlaylistFetcher: clear mStartup for .aac playlists after seekRobert Shih2014-11-071-0/+1
| |/ | | | | | | | | Bug: 18296856 Change-Id: I26beabee338312eb2125b69284052c61aef611f0
* | AnotherPacketSource.cpp: Do not queue discontinity signal buffer resulted ↵Wei Jia2014-11-061-1/+1
|/ | | | | | | | | from seek. This will remove the unnecessary flush for seek. Bug: 17511837 Change-Id: I4b7acfc71a410372f5c630afb94b6a95d09d8974
* NuPlayer HLS: better subtitle togglingRobert Shih2014-09-191-1/+4
| | | | | Bug: 17310061 Change-Id: Iacee1816285425aaad08c32b28591bb0162d5a85