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

Commit 867f39f2 authored by Chong Zhang's avatar Chong Zhang Committed by android-build-merger
Browse files

Merge "stagefright: add a property to choose hw codecs in thumbnailer" am:...

Merge "stagefright: add a property to choose hw codecs in thumbnailer" am: e91c3893 am: 081c7fb2
am: c76a037b

Change-Id: I3ea5522ac05c8a272d22a9c3e576c96076304dfd
parents 9d05e8b3 c76a037b
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <inttypes.h>

#include <utils/Log.h>
#include <cutils/properties.h>

#include "include/FrameDecoder.h"
#include "include/StagefrightMetadataRetriever.h"
@@ -205,11 +206,14 @@ sp<IMemory> StagefrightMetadataRetriever::getImageInternal(
        trackMeta->setCString(kKeyMIMEType, mime);
    }

    bool preferhw = property_get_bool(
            "media.stagefright.thumbnail.prefer_hw_codecs", false);
    uint32_t flags = preferhw ? 0 : MediaCodecList::kPreferSoftwareCodecs;
    Vector<AString> matchingCodecs;
    MediaCodecList::findMatchingCodecs(
            mime,
            false, /* encoder */
            MediaCodecList::kPreferSoftwareCodecs,
            flags,
            &matchingCodecs);

    for (size_t i = 0; i < matchingCodecs.size(); ++i) {
@@ -326,11 +330,14 @@ status_t StagefrightMetadataRetriever::getFrameInternal(
    const char *mime;
    CHECK(trackMeta->findCString(kKeyMIMEType, &mime));

    bool preferhw = property_get_bool(
            "media.stagefright.thumbnail.prefer_hw_codecs", false);
    uint32_t flags = preferhw ? 0 : MediaCodecList::kPreferSoftwareCodecs;
    Vector<AString> matchingCodecs;
    MediaCodecList::findMatchingCodecs(
            mime,
            false, /* encoder */
            MediaCodecList::kPreferSoftwareCodecs,
            flags,
            &matchingCodecs);

    for (size_t i = 0; i < matchingCodecs.size(); ++i) {