summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive/LiveSession.h
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2014-02-06 14:01:30 -0800
committerRobert Shih <robertshih@google.com>2014-02-13 15:10:28 -0800
commit8dd1c202aea703ed8beacaaa0dad5ae9c76a0863 (patch)
tree938ae62ab517c71b842a099a1396fc48cbe3e0e5 /media/libstagefright/httplive/LiveSession.h
parent1dd3da08445ac96e64a1ca72ba0c11876cc4d631 (diff)
downloadframeworks_av-8dd1c202aea703ed8beacaaa0dad5ae9c76a0863.zip
frameworks_av-8dd1c202aea703ed8beacaaa0dad5ae9c76a0863.tar.gz
frameworks_av-8dd1c202aea703ed8beacaaa0dad5ae9c76a0863.tar.bz2
LiveSession: Add support for block-by-block fetchFile.
Change-Id: I4025ba7fab8fab2e0c720f73894e908fd98a43d8
Diffstat (limited to 'media/libstagefright/httplive/LiveSession.h')
-rw-r--r--media/libstagefright/httplive/LiveSession.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/media/libstagefright/httplive/LiveSession.h b/media/libstagefright/httplive/LiveSession.h
index ee10e70..00569be 100644
--- a/media/libstagefright/httplive/LiveSession.h
+++ b/media/libstagefright/httplive/LiveSession.h
@@ -146,9 +146,25 @@ private:
status_t onSeek(const sp<AMessage> &msg);
void onFinishDisconnect2();
+ // If given a non-zero block_size (default 0), it is used to cap the number of
+ // bytes read in from the DataSource. If given a non-NULL buffer, new content
+ // is read into the end.
+ //
+ // The DataSource we read from is responsible for signaling error or EOF to help us
+ // break out of the read loop. The DataSource can be returned to the caller, so
+ // that the caller can reuse it for subsequent fetches (within the initially
+ // requested range).
+ //
+ // For reused HTTP sources, the caller must download a file sequentially without
+ // any overlaps or gaps to prevent reconnection.
status_t fetchFile(
const char *url, sp<ABuffer> *out,
- int64_t range_offset = 0, int64_t range_length = -1);
+ /* request/open a file starting at range_offset for range_length bytes */
+ int64_t range_offset = 0, int64_t range_length = -1,
+ /* download block size */
+ uint32_t block_size = 0,
+ /* reuse DataSource if doing partial fetch */
+ sp<DataSource> *source = NULL);
sp<M3UParser> fetchPlaylist(
const char *url, uint8_t *curPlaylistHash, bool *unchanged);