diff options
author | Andreas Huber <andih@google.com> | 2010-11-18 11:03:48 -0800 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-11-18 12:45:12 -0800 |
commit | 7d23aa2a8354046ae0390eb5ad492346af5bce0f (patch) | |
tree | bca61c738bda9d21f15ab9a22e49388210e5a6b2 /media/libstagefright/include | |
parent | 14d32754d3a9c1ccf49188c489f224800cd747a7 (diff) | |
download | frameworks_av-7d23aa2a8354046ae0390eb5ad492346af5bce0f.zip frameworks_av-7d23aa2a8354046ae0390eb5ad492346af5bce0f.tar.gz frameworks_av-7d23aa2a8354046ae0390eb5ad492346af5bce0f.tar.bz2 |
Support for "chunked" HTTP transfer encoding.
Change-Id: I2f20d2d9ec0fa0c840b429049b0385289a30e774
related-to-bug: 3205131
Diffstat (limited to 'media/libstagefright/include')
-rw-r--r-- | media/libstagefright/include/HTTPStream.h | 8 | ||||
-rw-r--r-- | media/libstagefright/include/NuHTTPDataSource.h | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/media/libstagefright/include/HTTPStream.h b/media/libstagefright/include/HTTPStream.h index 35b0865..793798f 100644 --- a/media/libstagefright/include/HTTPStream.h +++ b/media/libstagefright/include/HTTPStream.h @@ -55,6 +55,10 @@ public: // Pass a negative value to disable the timeout. void setReceiveTimeout(int seconds); + // Receive a line of data terminated by CRLF, line will be '\0' terminated + // _excluding_ the termianting CRLF. + status_t receive_line(char *line, size_t size); + private: enum State { READY, @@ -68,10 +72,6 @@ private: KeyedVector<string, string> mHeaders; - // Receive a line of data terminated by CRLF, line will be '\0' terminated - // _excluding_ the termianting CRLF. - status_t receive_line(char *line, size_t size); - HTTPStream(const HTTPStream &); HTTPStream &operator=(const HTTPStream &); }; diff --git a/media/libstagefright/include/NuHTTPDataSource.h b/media/libstagefright/include/NuHTTPDataSource.h index 0b840bd..c42691f 100644 --- a/media/libstagefright/include/NuHTTPDataSource.h +++ b/media/libstagefright/include/NuHTTPDataSource.h @@ -64,6 +64,11 @@ private: off_t mOffset; off_t mContentLength; bool mContentLengthValid; + bool mHasChunkedTransferEncoding; + + // The number of data bytes in the current chunk before any subsequent + // chunk header (or -1 if no more chunks). + ssize_t mChunkDataBytesLeft; List<BandwidthEntry> mBandwidthHistory; size_t mNumBandwidthHistoryItems; @@ -81,6 +86,9 @@ private: const String8 &headers, off_t offset); + // Read up to "size" bytes of data, respect transfer encoding. + ssize_t internalRead(void *data, size_t size); + void applyTimeoutResponse(); void addBandwidthMeasurement_l(size_t numBytes, int64_t delayUs); |