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

Commit 64d6c687 authored by Edwin Wong's avatar Edwin Wong Committed by Android (Google) Code Review
Browse files

Merge "Add getError and setError to propagate error code from...

Merge "Add getError and setError to propagate error code from WVMMediaExtractor up to player." into jb-mr1-dev
parents b063cb62 8a74c9b8
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();