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

Commit 72a224df authored by Dongwon Kang's avatar Dongwon Kang
Browse files

MediaExtractorFactory: add a property for debugging/development

Test: build & install & dumpsys media.extractor
Bug: 112766913
Change-Id: I0f24b64105af36fce48e93269ac7056a6cb7adce
parent 6e5d6f6f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ struct ExtractorPlugin : public RefBase {
Mutex MediaExtractorFactory::gPluginMutex;
std::shared_ptr<std::list<sp<ExtractorPlugin>>> MediaExtractorFactory::gPlugins;
bool MediaExtractorFactory::gPluginsRegistered = false;
bool MediaExtractorFactory::gIgnoreVersion = false;

// static
CreatorFunc MediaExtractorFactory::sniff(
@@ -192,7 +193,7 @@ void MediaExtractorFactory::RegisterExtractor(const sp<ExtractorPlugin> &plugin,
    for (auto it = pluginList.begin(); it != pluginList.end(); ++it) {
        if (memcmp(&((*it)->def.extractor_uuid), &plugin->def.extractor_uuid, 16) == 0) {
            // there's already an extractor with the same uuid
            if ((*it)->def.extractor_version < plugin->def.extractor_version) {
            if (gIgnoreVersion || (*it)->def.extractor_version < plugin->def.extractor_version) {
                // this one is newer, replace the old one
                ALOGW("replacing extractor '%s' version %u with version %u",
                        plugin->def.extractor_name,
@@ -307,6 +308,8 @@ void MediaExtractorFactory::UpdateExtractors(const char *newUpdateApkPath) {
        return;
    }

    gIgnoreVersion = property_get_bool("debug.extractor.ignore_version", false);

    std::shared_ptr<std::list<sp<ExtractorPlugin>>> newList(new std::list<sp<ExtractorPlugin>>());

    RegisterExtractorsInSystem("/system/lib"
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ private:
    static Mutex gPluginMutex;
    static std::shared_ptr<std::list<sp<ExtractorPlugin>>> gPlugins;
    static bool gPluginsRegistered;
    static bool gIgnoreVersion;

    static void RegisterExtractorsInApk(
            const char *apkPath, std::list<sp<ExtractorPlugin>> &pluginList);