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

Commit bf697e37 authored by Andreas Huber's avatar Andreas Huber
Browse files

Change OMXCodec::Create to return an sp<MediaSource> instead of an...

Change OMXCodec::Create to return an sp<MediaSource> instead of an sp<OMXCodec>, this is more general and does not sacrifice any functionality as the remaining OMXCodec APIs are not meant to be public anyway.
parent f0fb96c3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -38,12 +38,12 @@ int main() {
        meta->setInt32(kKeyMaxInputSize, maxInputSize);
    }

    sp<OMXCodec> encoder = OMXCodec::Create(
    sp<MediaSource> encoder = OMXCodec::Create(
            client.interface(),
            meta, true /* createEncoder */,
            source);

    sp<OMXCodec> decoder = OMXCodec::Create(
    sp<MediaSource> decoder = OMXCodec::Create(
            client.interface(),
            meta, false /* createEncoder */,
            encoder);
+2 −2
Original line number Diff line number Diff line
@@ -154,7 +154,7 @@ int main(int argc, char **argv) {

    sp<MetaData> meta = source->getFormat();

    sp<OMXCodec> decoder = OMXCodec::Create(
    sp<MediaSource> decoder = OMXCodec::Create(
            client.interface(), meta, false /* createEncoder */, source);

    int width, height;
@@ -173,7 +173,7 @@ int main(int argc, char **argv) {
    enc_meta->setInt32(kKeyWidth, width);
    enc_meta->setInt32(kKeyHeight, height);

    sp<OMXCodec> encoder =
    sp<MediaSource> encoder =
        OMXCodec::Create(
                client.interface(), enc_meta, true /* createEncoder */, decoder);

+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ struct OMXCodec : public MediaSource,
    enum CreationFlags {
        kPreferSoftwareCodecs = 1,
    };
    static sp<OMXCodec> Create(
    static sp<MediaSource> Create(
            const sp<IOMX> &omx,
            const sp<MetaData> &meta, bool createEncoder,
            const sp<MediaSource> &source,
+1 −1
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ void OMXCodec::findMatchingCodecs(
}

// static
sp<OMXCodec> OMXCodec::Create(
sp<MediaSource> OMXCodec::Create(
        const sp<IOMX> &omx,
        const sp<MetaData> &meta, bool createEncoder,
        const sp<MediaSource> &source,