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

Commit 768a2537 authored by Lajos Molnar's avatar Lajos Molnar
Browse files

stagefright: add flags to NuMediaExtractor::getTrackFormat

This is to allow passing mpeg-2 stream headers.

Bug: 28671284
Change-Id: I63abecad58ae346fa12d33896bbd8c970194d7e3
parent 0dc8be97
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -44,6 +44,11 @@ struct NuMediaExtractor : public RefBase {
        SAMPLE_FLAG_ENCRYPTED   = 2,
        SAMPLE_FLAG_ENCRYPTED   = 2,
    };
    };


    // identical to IMediaExtractor::GetTrackMetaDataFlags
    enum GetTrackFormatFlags {
        kIncludeExtensiveMetaData = 1, // reads sample table and possibly stream headers
    };

    NuMediaExtractor();
    NuMediaExtractor();


    status_t setDataSource(
    status_t setDataSource(
@@ -56,7 +61,7 @@ struct NuMediaExtractor : public RefBase {
    status_t setDataSource(const sp<DataSource> &datasource);
    status_t setDataSource(const sp<DataSource> &datasource);


    size_t countTracks() const;
    size_t countTracks() const;
    status_t getTrackFormat(size_t index, sp<AMessage> *format) const;
    status_t getTrackFormat(size_t index, sp<AMessage> *format, uint32_t flags = 0) const;


    status_t getFileFormat(sp<AMessage> *format) const;
    status_t getFileFormat(sp<AMessage> *format) const;


+2 −2
Original line number Original line Diff line number Diff line
@@ -232,7 +232,7 @@ size_t NuMediaExtractor::countTracks() const {
}
}


status_t NuMediaExtractor::getTrackFormat(
status_t NuMediaExtractor::getTrackFormat(
        size_t index, sp<AMessage> *format) const {
        size_t index, sp<AMessage> *format, uint32_t flags) const {
    Mutex::Autolock autoLock(mLock);
    Mutex::Autolock autoLock(mLock);


    *format = NULL;
    *format = NULL;
@@ -245,7 +245,7 @@ status_t NuMediaExtractor::getTrackFormat(
        return -ERANGE;
        return -ERANGE;
    }
    }


    sp<MetaData> meta = mImpl->getTrackMetaData(index);
    sp<MetaData> meta = mImpl->getTrackMetaData(index, flags);
    // Extractors either support trackID-s or not, so either all tracks have trackIDs or none.
    // Extractors either support trackID-s or not, so either all tracks have trackIDs or none.
    // Generate trackID if missing.
    // Generate trackID if missing.
    int32_t trackID;
    int32_t trackID;