summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive/LiveSession.h
Commit message (Collapse)AuthorAgeFilesLines
* httplive: Add default implementation in HLS for custom changesSanthosh Behara2015-10-121-1/+1
| | | | | | | | Add getSeqNumberInLiveStreaming() function in PlayListFetcher Make getBandwidthIndex() function to be virtual. Change-Id: I5e2bc7a42e0d4a16d5b5ea5f2ec3d78a7d019ad3
* httplive: refactor for HLS customizationLi Sun2015-10-061-8/+15
| | | | | | 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/+5
| | | | | | | | | | | | | | - 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
* HLS: make disconnect faster to prevent ANRChong Zhang2015-04-231-30/+3
| | | | | | | disconnect HTTP connection when we absolutely won't resume bug: 19890444 Change-Id: Idee36b48741f6f8eb1d65bca32156e9e18349c67
* HLS: remove no more than 10% of bandwidth history at a timeChong Zhang2015-04-211-4/+8
| | | | | | | | | | | | | | | | | | - fix a 'possible video time jump' after seek, don't update renderer anchor time for 0-sized audio buffers - fix another 'possible video time jump' caused by some states not reset in mStreams - bandwidth estimator changes to not remove more than 10% of total transfer duration at a time to avoid jumping up too quickly bug: 20267388 related-to-bug: 19864613 related-to-bug: 20138395 Change-Id: I8812332cd1e26bf562acfaf086fd679a3549debc
* stagefright: warnings be gone, some are now errors, use clangLajos Molnar2015-04-171-1/+1
| | | | Change-Id: I81f438ae444f04c12ae27ae4ef6d073033de172c
* stagefright: initial timed id3 support in hlsRobert Shih2015-04-161-0/+15
| | | | Change-Id: I00a8a786b3f4b74742c34770edd94e937abe20a8
* HLS: parse stream resolution and set maxWidth/maxHeightChong Zhang2015-04-141-0/+2
| | | | | | bug: 20160436 Change-Id: Ic3adb84d3c65cc65f62fc509a99d09602db862a1
* Merge "HLS: allow down switch during prepare"Chong Zhang2015-04-101-1/+1
|\
| * HLS: allow down switch during prepareChong Zhang2015-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | to avoid having to immediately down switch (and pause) after playback starts. do not count "discard" packet when estimating duration. bug: 19567254 Change-Id: I0cdd37a06ca800dd81a91cca5eb9b46a1eab7b20
* | stagefright: LiveSession: delay consuming reply ID for seekLajos Molnar2015-04-081-1/+1
|/ | | | | | | Only consume reply ID when actually handling the seek. Bug: 20123914 Change-Id: I2112ee1b89f8193b487ea2b0b3b7050ba3413864
* HLS: traces in LiveSession and PlaylistFetcher for easier debuggingChong Zhang2015-04-081-0/+1
| | | | | bug: 19567254 Change-Id: I4305d37cb74279ccd435f99483231cd1dcf42fc9
* HLS: misc bug fixesChong Zhang2015-04-021-1/+3
| | | | | | | | | | | | | | | | | - 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
* fix build break in clangChong Zhang2015-03-301-6/+6
| | | | Change-Id: Iff2ca5d1e800d30943de12191bfe6c43d6a2c7f6
* HLS: faster switching and pause/resume on low bufferChong Zhang2015-03-271-11/+39
| | | | | | | | | | | | | | | | | | | | | - 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-24/+20
| | | | | | | | | | | | | | | | | | - 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-5/+5
| | | | | | | | | | | | | | | | - 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
* Merge "HLS: misc changes in LiveSession buffering logic"Chong Zhang2015-03-101-16/+18
|\
| * HLS: misc changes in LiveSession buffering logicChong Zhang2015-03-101-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | stagefright: don't use ALooperRoster mutex for reply handlingLajos Molnar2015-03-101-2/+3
|/ | | | | | | | Change replyID-s from uint32_t to an object Move reply handling into the loopers (to reuse a common mutex) Bug: 19607784 Change-Id: Iaa035b846c424c5687ed17ce1079b325e86c54be
* Fix mismatched type tag clang warning.Dan Albert2015-02-191-1/+0
| | | | | | | Parcel is a struct, not a class. However, Parcel isn't used in this file, so just kill it. Change-Id: I575cae8b3c5dd13dd9b03fccfe7423e1f17f62f5
* stagefright: httplive: Decouple block size from bandwidth estimateLeena Winterrowd2015-01-281-0/+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
* Revert "HLS: QCom enhancements"Lajos Molnar2015-01-281-2/+0
| | | | | | | | | This is to restore patch attributions This reverts commit f580806d893c4631f5324ff0af5c2db68a40ef42. Bug: 18821145 Change-Id: Idc49385fffccfde2a3915388fe3fe4e2b740d787
* HLS: QCom enhancementsRobert Shih2014-12-221-0/+2
| | | | | | | | | | | | | | | 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
* NuPlayer HTTPLiveSource: impl getSelectedTrackRobert Shih2014-11-061-0/+2
| | | | | Bug: 17514665 Change-Id: I81c62553f2c5acb4d2436a9d8f04c10fdbe315d0
* NuPlayer HLS: better subtitle togglingRobert Shih2014-09-191-0/+2
| | | | | Bug: 17310061 Change-Id: Iacee1816285425aaad08c32b28591bb0162d5a85
* LiveSession: reliable switchRobert Shih2014-09-121-1/+1
| | | | | Bug: 17142706 Change-Id: I9cd6c068178d62c294496e8ab0b0a3763354964f
* LiveSession: re-buffer on under run to avoid stutterRobert Shih2014-09-121-0/+2
| | | | | Bug: 13742725 Change-Id: I7dad8876e18084c3c060d08190fa8a72fc2f5bad
* Merge "LiveSession: added onSwitchDown" into lmp-devRobert Shih2014-09-121-0/+5
|\
| * LiveSession: added onSwitchDownRobert Shih2014-09-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | additionally in this change - AnotherPacketSource: added getEstimatedDurationUs that avoids looping through buffered access units in most cases; this method is called by LiveSession before triggering onSwitchDown. Also fix the original getBufferedDurationUs to accumulate durations across discontinuities. Bug: 13742612 Change-Id: I135932ea0c74671b7019a3c7054844926c18bc14
* | LiveSession: raise upwards adaptation constraintRobert Shih2014-09-101-1/+1
|/ | | | | | | | | | | Adjust bandwidth more conservatively when considering an upwards adaptation. Also fixed an issue with kWhatCheckBandwidth messages being accumulated across switch generations; this causes onCheckBandwidth to be fired at a high frequency and LiveSession to be too sensitive to network glitches. Bug: 13743153 Change-Id: I1dec99cb5d123c6675abe0847fd12aab5178eefd
* httplive: timestamp reporting, track selectionRobert Shih2014-08-051-3/+21
| | | | | | | Bug: 15153976 Bug: 15763638 Bug: 16351654 Change-Id: I4462276d4b7342647286a0ca4be11692ce52ff6d
* refactor getTrackInfo()Chong Zhang2014-06-131-1/+2
| | | | | | | | | | | | | (this is in preparation for supporting other cc source) - split into two methods: getTrackCount() and getTrackInfo() - move track info parcelling to NuPlayer - parcel in the mime type of the subtitle format Bug: 15470448 Change-Id: If00724d8c3a2b2319cb9c5f29d3fe76347bfe947
* am 49b2e310: am a1f0c62c: am 43ca783e: httplive: block-by-block fetch, ↵Robert Shih2014-03-191-1/+1
|\ | | | | | | | | | | | | decrypt, and parse ts files. * commit '49b2e310f62c590a1af9f921cd8a134cdf589263': httplive: block-by-block fetch, decrypt, and parse ts files.
| * httplive: block-by-block fetch, decrypt, and parse ts files.Robert Shih2014-03-191-1/+1
| | | | | | | | Bug: 12060952 Change-Id: I695345081fe23961b9d0ef6db264885f914703ec
| * httplive: clear access units before returning from seekTo.Robert Shih2014-03-111-0/+2
| | | | | | | | | | Bug: 12060952 Change-Id: I6a69a718c082501003ee9b78a948a2f8bbfbb14e
| * LiveSession: Use the actual, possibly redirected url as base in the M3UMartin Storsjo2014-03-061-1/+2
| | | | | | | | | | | | | | | | This fixes playback of HLS streams where the M3U playlists use relative paths and the main playlist is opened via a redirect. Bug: 13174301 Change-Id: I787e1c050daddc566be4c8e3f84803d3f91eec46
| * Initial HLS seamless switch implementation.Robert Shih2014-03-061-0/+36
| | | | | | | | | | Bug: 11854054 Change-Id: I75fc2a258111295039ac13cc37e407df25891dd2
| * LiveSession refactorRobert Shih2014-03-061-4/+24
| | | | | | | | | | Bug: 11854054 Change-Id: Ia91dce109835e042f72934376d4838b4cc72cb10
| * LiveSession: Add support for block-by-block fetchFile.Robert Shih2014-03-061-1/+17
| | | | | | | | | | Bug: 11854054 Change-Id: I4025ba7fab8fab2e0c720f73894e908fd98a43d8
* | httplive: clear access units before returning from seekTo.Robert Shih2014-03-071-0/+2
| | | | | | | | Change-Id: I6a69a718c082501003ee9b78a948a2f8bbfbb14e
* | Initial HLS seamless switch implementation.Robert Shih2014-02-281-0/+36
| | | | | | | | | | Bug: 11854054 Change-Id: I75fc2a258111295039ac13cc37e407df25891dd2
* | Merge "LiveSession refactor"Robert Shih2014-02-211-4/+24
|\ \
| * | LiveSession refactorRobert Shih2014-02-201-4/+24
| | | | | | | | | | | | Change-Id: Ia91dce109835e042f72934376d4838b4cc72cb10
* | | resolved conflicts for merge of aa0390b7 to masterMarco Nelissen2014-02-201-1/+2
|\ \ \ | |/ / |/| | | | | Change-Id: Ide9dfb5df75cac7c363a3c7fdbd8fabdc326a495
| * | LiveSession: Use the actual, possibly redirected url as base in the M3UMartin Storsjo2014-01-101-1/+2
| |/ | | | | | | | | | | | | This fixes playback of HLS streams where the M3U playlists use relative paths and the main playlist is opened via a redirect. Change-Id: I787e1c050daddc566be4c8e3f84803d3f91eec46
* | LiveSession: Add support for block-by-block fetchFile.Robert Shih2014-02-131-1/+17
| | | | | | | | Change-Id: I4025ba7fab8fab2e0c720f73894e908fd98a43d8
* | Remove no longer needed http proxy handling code, it's obsolete nowAndreas Huber2014-02-051-5/+1
| | | | | | | | | | | | | | | | since we started to use java's HTTPConnection instead of the native implementation. Also remove other remnants of the previous http implementation, such as accounting for the http user's uid. Change-Id: I60bfd31381ea40d2220db587ec5c433093b60034
* | FINAL ATTEMPT: HTTP services are now provided from JAVA and made available ↵Andreas Huber2014-02-041-1/+6
|/ | | | | | to media code Change-Id: I9f74a86e70422187c9cf0ca1318a29019700192d
* MediaPlayer: add listener for raw track dataChong Zhang2013-08-191-1/+8
| | | | | | Bug: 10326117 Change-Id: I2c0bdf8adc67b11f8dc633423bee66897548f181