diff options
author | Edwin Wong <edwinwong@google.com> | 2012-09-06 14:07:37 -0700 |
---|---|---|
committer | Edwin Wong <edwinwong@google.com> | 2012-09-11 10:52:18 -0700 |
commit | 8a74c9b8e2627560ae5a92d4261f0de4464490ad (patch) | |
tree | ee9a7123571edba1ff86b8861b48ae85892fae2b | |
parent | 498a274c188f18049053ef5424b52cc4d9314c80 (diff) | |
download | frameworks_av-8a74c9b8e2627560ae5a92d4261f0de4464490ad.zip frameworks_av-8a74c9b8e2627560ae5a92d4261f0de4464490ad.tar.gz frameworks_av-8a74c9b8e2627560ae5a92d4261f0de4464490ad.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
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 6 | ||||
-rw-r--r-- | media/libstagefright/WVMExtractor.cpp | 14 | ||||
-rw-r--r-- | media/libstagefright/include/WVMExtractor.h | 6 |
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(); |