diff options
author | Chris Watkins <watk@google.com> | 2015-03-20 13:06:33 -0700 |
---|---|---|
committer | Chris Watkins <watk@google.com> | 2015-04-15 17:12:22 -0700 |
commit | 99f31604136d66ae10e20669fb6b5716f342bde0 (patch) | |
tree | 20e64f4f26533b37b087ce8656b1040b8189e24f /include/media/stagefright/DataSource.h | |
parent | 2f33dbc6ca08d45efea2df775c158e2a11e07ab6 (diff) | |
download | frameworks_av-99f31604136d66ae10e20669fb6b5716f342bde0.zip frameworks_av-99f31604136d66ae10e20669fb6b5716f342bde0.tar.gz frameworks_av-99f31604136d66ae10e20669fb6b5716f342bde0.tar.bz2 |
Unhide the android.media.[Media]DataSource interface.
This allows apps to implement MediaDataSource, which is modeled on
stagefright's DataSource, to supply media data to the framework. This
was already implemented for MediaExtractor, but it was renamed from
DataSource.
MediaExtractor, MediaPlayer and MediaMetadataRetriever each have a new
overload: #setDataSource(android.media.MediaDataSource)
Only NuPlayer supports this new data source.
The change introduces:
* IDataSource: The binder interface for DataSource.
* JMediaDataSource: The native counterpart to the java interface. It
implements IDataSource.
* CallbackDataSource: A stagefright DataSource that wraps an
IDataSource.
Change-Id: Ib3c944b49cc8a792c8eb9c85e5015c07f298ebc1
Diffstat (limited to 'include/media/stagefright/DataSource.h')
-rw-r--r-- | include/media/stagefright/DataSource.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h index 3630263..997fe95 100644 --- a/include/media/stagefright/DataSource.h +++ b/include/media/stagefright/DataSource.h @@ -32,6 +32,7 @@ namespace android { struct AMessage; struct AString; +struct IDataSource; struct IMediaHTTPService; class String8; struct HTTPBase; @@ -53,11 +54,15 @@ public: HTTPBase *httpSource = NULL); static sp<DataSource> CreateMediaHTTP(const sp<IMediaHTTPService> &httpService); + static sp<DataSource> CreateFromIDataSource(const sp<IDataSource> &source); DataSource() {} virtual status_t initCheck() const = 0; + // Returns the number of bytes read, or -1 on failure. It's not an error if + // this returns zero; it just means the given offset is equal to, or + // beyond, the end of the source. virtual ssize_t readAt(off64_t offset, void *data, size_t size) = 0; // Convenience methods: |