summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/include
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2012-10-24 13:43:32 -0700
committerMarco Nelissen <marcone@google.com>2012-10-24 13:43:32 -0700
commitf76ca8f6aaa56146b388239c034bd53f19b9abf2 (patch)
tree0b4ed233946655deb42c72be60afb7c8ddfbbcee /media/libstagefright/include
parentfeb1a72faade5e55bb01c06ec64749b2de172642 (diff)
downloadframeworks_av-f76ca8f6aaa56146b388239c034bd53f19b9abf2.zip
frameworks_av-f76ca8f6aaa56146b388239c034bd53f19b9abf2.tar.gz
frameworks_av-f76ca8f6aaa56146b388239c034bd53f19b9abf2.tar.bz2
Make ThrottledSource more usable
Add reconnectAtOffset(), DrmInitialization() and getDrmInfo(). Also rearrange the code a bit so all the methods that just call through to the wrapped DataSource are in the header. Change-Id: If25b674df317b0f6da5d36241c694e32abb0a01c
Diffstat (limited to 'media/libstagefright/include')
-rw-r--r--media/libstagefright/include/ThrottledSource.h36
1 files changed, 31 insertions, 5 deletions
diff --git a/media/libstagefright/include/ThrottledSource.h b/media/libstagefright/include/ThrottledSource.h
index 7fe7c06..673268b 100644
--- a/media/libstagefright/include/ThrottledSource.h
+++ b/media/libstagefright/include/ThrottledSource.h
@@ -28,18 +28,44 @@ struct ThrottledSource : public DataSource {
const sp<DataSource> &source,
int32_t bandwidthLimitBytesPerSecond);
- virtual status_t initCheck() const;
-
+ // implementation of readAt() that sleeps to achieve the desired max throughput
virtual ssize_t readAt(off64_t offset, void *data, size_t size);
- virtual status_t getSize(off64_t *size);
- virtual uint32_t flags();
+ // returns an empty string to prevent callers from using the Uri to construct a new datasource
+ virtual String8 getUri() {
+ return String8();
+ }
+
+ // following methods all call through to the wrapped DataSource's methods
+
+ status_t initCheck() const {
+ return mSource->initCheck();
+ }
+
+ virtual status_t getSize(off64_t *size) {
+ return mSource->getSize(size);
+ }
+
+ virtual uint32_t flags() {
+ return mSource->flags();
+ }
+
+ virtual status_t reconnectAtOffset(off64_t offset) {
+ return mSource->reconnectAtOffset(offset);
+ }
+
+ virtual sp<DecryptHandle> DrmInitialization(const char *mime = NULL) {
+ return mSource->DrmInitialization(mime);
+ }
+
+ virtual void getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client) {
+ mSource->getDrmInfo(handle, client);
+ };
virtual String8 getMIMEType() const {
return mSource->getMIMEType();
}
-
private:
Mutex mLock;