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

gugelfrei
Dongwon Kang 6 years ago committed by Android (Google) Code Review
commit 84b25f1fb9

@ -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"

@ -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);

Loading…
Cancel
Save