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

Commit 84b25f1f authored by Dongwon Kang's avatar Dongwon Kang Committed by Android (Google) Code Review
Browse files

Merge "MediaExtractorFactory: add a property for debugging/development"

parents 4e577edb 72a224df
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(
@@ -193,7 +194,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,
@@ -308,6 +309,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
@@ -40,6 +40,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);