summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJeffrey Tinker <jtinker@google.com>2011-05-24 12:57:22 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-05-24 12:57:22 -0700
commit68cb8cfaaf4d01125397ff3bea30603bdc5001d4 (patch)
treeb30b92f6a6e4c546f929718a2c8c70d49233e6f4 /media
parent9eff287f4f59d6a0c9ca1d5dd8a7bb6e64acf5a4 (diff)
parent62bcf26ee0ac7e7460a35800520de363c898ec33 (diff)
downloadframeworks_av-68cb8cfaaf4d01125397ff3bea30603bdc5001d4.zip
frameworks_av-68cb8cfaaf4d01125397ff3bea30603bdc5001d4.tar.gz
frameworks_av-68cb8cfaaf4d01125397ff3bea30603bdc5001d4.tar.bz2
am c41a17de: am 6e5cdca1: am ef89cc14: Merge "Multi-repository checkin, goes with https://android-git.corp.google.com/g/111038" into honeycomb-mr2
* commit 'c41a17de2b2e80f246adeef4962073916dcfff0b': Multi-repository checkin, goes with https://android-git.corp.google.com/g/111038
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/WVMExtractor.cpp22
-rw-r--r--media/libstagefright/include/WVMExtractor.h16
2 files changed, 19 insertions, 19 deletions
diff --git a/media/libstagefright/WVMExtractor.cpp b/media/libstagefright/WVMExtractor.cpp
index 83a1eaa..26eda0c 100644
--- a/media/libstagefright/WVMExtractor.cpp
+++ b/media/libstagefright/WVMExtractor.cpp
@@ -45,8 +45,7 @@ namespace android {
static Mutex gWVMutex;
WVMExtractor::WVMExtractor(const sp<DataSource> &source)
- : mDataSource(source),
- mUseAdaptiveStreaming(false) {
+ : mDataSource(source) {
{
Mutex::Autolock autoLock(gWVMutex);
if (gVendorLibHandle == NULL) {
@@ -59,13 +58,12 @@ WVMExtractor::WVMExtractor(const sp<DataSource> &source)
}
}
- typedef MediaExtractor *(*GetInstanceFunc)(sp<DataSource>);
+ typedef WVMLoadableExtractor *(*GetInstanceFunc)(sp<DataSource>);
GetInstanceFunc getInstanceFunc =
(GetInstanceFunc) dlsym(gVendorLibHandle,
"_ZN7android11GetInstanceENS_2spINS_10DataSourceEEE");
if (getInstanceFunc) {
- LOGD("Calling GetInstanceFunc");
mImpl = (*getInstanceFunc)(source);
CHECK(mImpl != NULL);
} else {
@@ -102,19 +100,17 @@ sp<MetaData> WVMExtractor::getMetaData() {
}
int64_t WVMExtractor::getCachedDurationUs(status_t *finalStatus) {
- // TODO: Fill this with life.
-
- *finalStatus = OK;
+ if (mImpl == NULL) {
+ return 0;
+ }
- return 0;
+ return mImpl->getCachedDurationUs(finalStatus);
}
void WVMExtractor::setAdaptiveStreamingMode(bool adaptive) {
- mUseAdaptiveStreaming = adaptive;
-}
-
-bool WVMExtractor::getAdaptiveStreamingMode() const {
- return mUseAdaptiveStreaming;
+ if (mImpl != NULL) {
+ mImpl->setAdaptiveStreamingMode(adaptive);
+ }
}
} //namespace android
diff --git a/media/libstagefright/include/WVMExtractor.h b/media/libstagefright/include/WVMExtractor.h
index 62e5aa5..deecd25 100644
--- a/media/libstagefright/include/WVMExtractor.h
+++ b/media/libstagefright/include/WVMExtractor.h
@@ -25,6 +25,15 @@ namespace android {
class DataSource;
+class WVMLoadableExtractor : public MediaExtractor {
+public:
+ WVMLoadableExtractor() {}
+ virtual ~WVMLoadableExtractor() {}
+
+ virtual int64_t getCachedDurationUs(status_t *finalStatus) = 0;
+ virtual void setAdaptiveStreamingMode(bool adaptive) = 0;
+};
+
class WVMExtractor : public MediaExtractor {
public:
WVMExtractor(const sp<DataSource> &source);
@@ -49,20 +58,15 @@ public:
// is used.
void setAdaptiveStreamingMode(bool adaptive);
- // Retrieve the adaptive streaming mode used by the WV component.
- bool getAdaptiveStreamingMode() const;
-
protected:
virtual ~WVMExtractor();
private:
sp<DataSource> mDataSource;
- sp<MediaExtractor> mImpl;
- bool mUseAdaptiveStreaming;
+ sp<WVMLoadableExtractor> mImpl;
WVMExtractor(const WVMExtractor &);
WVMExtractor &operator=(const WVMExtractor &);
-
};
} // namespace android