summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorEdwin Wong <edwinwong@google.com>2012-09-06 14:07:37 -0700
committerEdwin Wong <edwinwong@google.com>2012-09-11 10:52:18 -0700
commitac1b71664dbdba1379f00fad2dcc3baa5f734d6b (patch)
treeae159f46eecbf8200daae56e490fe1bf06735a51 /media/libstagefright
parent488044714727d86fd1bd40ec0d01b9fd670631c9 (diff)
downloadframeworks_av-ac1b71664dbdba1379f00fad2dcc3baa5f734d6b.zip
frameworks_av-ac1b71664dbdba1379f00fad2dcc3baa5f734d6b.tar.gz
frameworks_av-ac1b71664dbdba1379f00fad2dcc3baa5f734d6b.tar.bz2
Add getError and setError to propagate error code from WVMMediaExtractor up to player.
The two virtual functions provides a path for the player(AwesomePlayer) to retrieve the last error from WVMMediaExtractor container. Change-Id: Iee8d4a3eccf82af95eb3d4d465f069daced4aa1a related-to-bug: 7073630
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/AwesomePlayer.cpp6
-rw-r--r--media/libstagefright/WVMExtractor.cpp14
-rw-r--r--media/libstagefright/include/WVMExtractor.h6
3 files changed, 25 insertions, 1 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 04f78eb..9f069ae 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -451,7 +451,11 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
}
if (!haveAudio && !haveVideo) {
- return UNKNOWN_ERROR;
+ if (mWVMExtractor != NULL) {
+ return mWVMExtractor->getError();
+ } else {
+ return UNKNOWN_ERROR;
+ }
}
mExtractorFlags = extractor->flags();
diff --git a/media/libstagefright/WVMExtractor.cpp b/media/libstagefright/WVMExtractor.cpp
index d94fc65..31b2bcf 100644
--- a/media/libstagefright/WVMExtractor.cpp
+++ b/media/libstagefright/WVMExtractor.cpp
@@ -148,6 +148,20 @@ void WVMExtractor::setUID(uid_t uid) {
}
}
+status_t WVMExtractor::getError() {
+ if (mImpl == NULL) {
+ return UNKNOWN_ERROR;
+ }
+
+ return mImpl->getError();
+}
+
+void WVMExtractor::setError(status_t err) {
+ if (mImpl != NULL) {
+ mImpl->setError(err);
+ }
+}
+
bool SniffWVM(
const sp<DataSource> &source, String8 *mimeType, float *confidence,
sp<AMessage> *) {
diff --git a/media/libstagefright/include/WVMExtractor.h b/media/libstagefright/include/WVMExtractor.h
index c43c801..8e62946 100644
--- a/media/libstagefright/include/WVMExtractor.h
+++ b/media/libstagefright/include/WVMExtractor.h
@@ -33,9 +33,11 @@ public:
virtual ~WVMLoadableExtractor() {}
virtual int64_t getCachedDurationUs(status_t *finalStatus) = 0;
+ virtual status_t getError() = 0;
virtual status_t getEstimatedBandwidthKbps(int32_t *kbps) = 0;
virtual void setAdaptiveStreamingMode(bool adaptive) = 0;
virtual void setCryptoPluginMode(bool cryptoPluginMode) = 0;
+ virtual void setError(status_t err) = 0;
virtual void setUID(uid_t uid) = 0;
};
@@ -76,6 +78,10 @@ public:
static bool getVendorLibHandle();
+ status_t getError();
+
+ void setError(status_t err);
+
protected:
virtual ~WVMExtractor();