am ef89cc14: Merge "Multi-repository checkin, goes with https://android-git.corp.google.com/g/111038" into honeycomb-mr2

* commit 'ef89cc14957ab631346564801841190346632ac9':
  Multi-repository checkin, goes with https://android-git.corp.google.com/g/111038
This commit is contained in:
Jeffrey Tinker
2011-05-23 18:15:47 -07:00
committed by Android Git Automerger
2 changed files with 19 additions and 19 deletions

View File

@ -45,8 +45,7 @@ namespace android {
static Mutex gWVMutex; static Mutex gWVMutex;
WVMExtractor::WVMExtractor(const sp<DataSource> &source) WVMExtractor::WVMExtractor(const sp<DataSource> &source)
: mDataSource(source), : mDataSource(source) {
mUseAdaptiveStreaming(false) {
{ {
Mutex::Autolock autoLock(gWVMutex); Mutex::Autolock autoLock(gWVMutex);
if (gVendorLibHandle == NULL) { 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 getInstanceFunc =
(GetInstanceFunc) dlsym(gVendorLibHandle, (GetInstanceFunc) dlsym(gVendorLibHandle,
"_ZN7android11GetInstanceENS_2spINS_10DataSourceEEE"); "_ZN7android11GetInstanceENS_2spINS_10DataSourceEEE");
if (getInstanceFunc) { if (getInstanceFunc) {
LOGD("Calling GetInstanceFunc");
mImpl = (*getInstanceFunc)(source); mImpl = (*getInstanceFunc)(source);
CHECK(mImpl != NULL); CHECK(mImpl != NULL);
} else { } else {
@ -102,19 +100,17 @@ sp<MetaData> WVMExtractor::getMetaData() {
} }
int64_t WVMExtractor::getCachedDurationUs(status_t *finalStatus) { int64_t WVMExtractor::getCachedDurationUs(status_t *finalStatus) {
// TODO: Fill this with life. if (mImpl == NULL) {
*finalStatus = OK;
return 0; return 0;
} }
void WVMExtractor::setAdaptiveStreamingMode(bool adaptive) { return mImpl->getCachedDurationUs(finalStatus);
mUseAdaptiveStreaming = adaptive;
} }
bool WVMExtractor::getAdaptiveStreamingMode() const { void WVMExtractor::setAdaptiveStreamingMode(bool adaptive) {
return mUseAdaptiveStreaming; if (mImpl != NULL) {
mImpl->setAdaptiveStreamingMode(adaptive);
}
} }
} //namespace android } //namespace android

View File

@ -25,6 +25,15 @@ namespace android {
class DataSource; 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 { class WVMExtractor : public MediaExtractor {
public: public:
WVMExtractor(const sp<DataSource> &source); WVMExtractor(const sp<DataSource> &source);
@ -49,20 +58,15 @@ public:
// is used. // is used.
void setAdaptiveStreamingMode(bool adaptive); void setAdaptiveStreamingMode(bool adaptive);
// Retrieve the adaptive streaming mode used by the WV component.
bool getAdaptiveStreamingMode() const;
protected: protected:
virtual ~WVMExtractor(); virtual ~WVMExtractor();
private: private:
sp<DataSource> mDataSource; sp<DataSource> mDataSource;
sp<MediaExtractor> mImpl; sp<WVMLoadableExtractor> mImpl;
bool mUseAdaptiveStreaming;
WVMExtractor(const WVMExtractor &); WVMExtractor(const WVMExtractor &);
WVMExtractor &operator=(const WVMExtractor &); WVMExtractor &operator=(const WVMExtractor &);
}; };
} // namespace android } // namespace android