Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a74c9b8 authored by Edwin Wong's avatar Edwin Wong
Browse files

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
parent 498a274c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -451,8 +451,12 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
    }

    if (!haveAudio && !haveVideo) {
        if (mWVMExtractor != NULL) {
            return mWVMExtractor->getError();
        } else {
            return UNKNOWN_ERROR;
        }
    }

    mExtractorFlags = extractor->flags();

+14 −0
Original line number Diff line number Diff line
@@ -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> *) {
+6 −0
Original line number Diff line number Diff line
@@ -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();