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

Commit c728a42d authored by Dongwon Kang's avatar Dongwon Kang
Browse files

extractor: load extractors on boot, not on request.

Test: build + dumpsys media.extractor
Bug: 131106476
Change-Id: Idbea788340c4849f1286727c159a8eb43d6a7bb0
parent 673236b3
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -71,8 +71,6 @@ sp<IMediaExtractor> MediaExtractorFactory::CreateFromService(

    ALOGV("MediaExtractorFactory::CreateFromService %s", mime);

    UpdateExtractors();

    // initialize source decryption if needed
    source->DrmInitialization(nullptr /* mime */);

@@ -270,7 +268,7 @@ static bool compareFunc(const sp<ExtractorPlugin>& first, const sp<ExtractorPlug
static std::unordered_set<std::string> gSupportedExtensions;

// static
void MediaExtractorFactory::UpdateExtractors() {
void MediaExtractorFactory::LoadExtractors() {
    Mutex::Autolock autoLock(gPluginMutex);

    if (gPluginsRegistered) {
+1 −2
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ public:
            const sp<DataSource> &source, const char *mime = NULL);
    static status_t dump(int fd, const Vector<String16>& args);
    static std::unordered_set<std::string> getSupportedTypes();
    static void LoadExtractors();

private:
    static Mutex gPluginMutex;
@@ -53,8 +54,6 @@ private:
    static void *sniff(const sp<DataSource> &source,
            float *confidence, void **meta, FreeMetaFunc *freeMeta,
            sp<ExtractorPlugin> &plugin, uint32_t *creatorVersion);

    static void UpdateExtractors();
};

}  // namespace android
+3 −1
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@
namespace android {

MediaExtractorService::MediaExtractorService()
        : BnMediaExtractorService() { }
        : BnMediaExtractorService() {
    MediaExtractorFactory::LoadExtractors();
}

sp<IMediaExtractor> MediaExtractorService::makeExtractor(
        const sp<IDataSource> &remoteSource, const char *mime) {