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

Commit bea455c8 authored by Colin Cross's avatar Colin Cross
Browse files

libstagefright: dynamically load libstagefright_chromium_http

dlopen libstagefright_chromium_http to allow it to be on the platform
side of the pdk without getting overwritten during a pdk fusion build.

Change-Id: I391e81d98beab165c3313bc8a71bb370ebb8584d
parent fea3699c
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -97,12 +97,12 @@ LOCAL_STATIC_LIBRARIES := \
        libstagefright_id3 \
        libFLAC \

ifneq ($(TARGET_BUILD_PDK), true)
LOCAL_STATIC_LIBRARIES += \
	libstagefright_chromium_http
LOCAL_SHARED_LIBRARIES += \
        libchromium_net
LOCAL_SRC_FILES += \
        chromium_http_stub.cpp
LOCAL_CPPFLAGS += -DCHROMIUM_AVAILABLE=1

ifneq ($(TARGET_BUILD_PDK), true)
LOCAL_REQUIRED_MODULES := libstagefright_chromium_http
endif

LOCAL_SHARED_LIBRARIES += libstlport
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#include "include/AMRExtractor.h"

#if CHROMIUM_AVAILABLE
#include "include/DataUriSource.h"
#include "include/chromium_http_stub.h"
#endif

#include "include/MP3Extractor.h"
@@ -173,7 +173,7 @@ sp<DataSource> DataSource::CreateFromURI(

# if CHROMIUM_AVAILABLE
    } else if (!strncasecmp("data:", uri, 5)) {
        source = new DataUriSource(uri);
        source = createDataUriSource(uri);
#endif
    } else {
        // Assume it's a filename.
+5 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include "include/HTTPBase.h"

#if CHROMIUM_AVAILABLE
#include "include/ChromiumHTTPDataSource.h"
#include "include/chromium_http_stub.h"
#endif

#include <media/stagefright/foundation/ADebug.h>
@@ -46,7 +46,10 @@ HTTPBase::HTTPBase()
// static
sp<HTTPBase> HTTPBase::Create(uint32_t flags) {
#if CHROMIUM_AVAILABLE
        return new ChromiumHTTPDataSource(flags);
        HTTPBase *dataSource = createChromiumHTTPDataSource(flags);
        if (dataSource) {
           return dataSource;
        }
#endif
    {
        TRESPASS();
+14 −3
Original line number Diff line number Diff line
@@ -6,7 +6,8 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES:=       \
        DataUriSource.cpp \
        ChromiumHTTPDataSource.cpp \
        support.cpp
        support.cpp \
        chromium_http_stub.cpp

LOCAL_C_INCLUDES:= \
        $(TOP)/frameworks/av/media/libstagefright \
@@ -16,10 +17,20 @@ LOCAL_C_INCLUDES:= \

LOCAL_CFLAGS += -Wno-multichar

LOCAL_SHARED_LIBRARIES += libstlport
LOCAL_SHARED_LIBRARIES += \
        libstlport \
        libchromium_net \
        libutils \
        libcutils \
        libstagefright_foundation \
        libstagefright \
        libdrmframework

include external/stlport/libstlport.mk

LOCAL_MODULE:= libstagefright_chromium_http

include $(BUILD_STATIC_LIBRARY)
LOCAL_MODULE_TAGS := optional

include $(BUILD_SHARED_LIBRARY)
endif
+33 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <dlfcn.h>

#include <include/chromium_http_stub.h>
#include <include/ChromiumHTTPDataSource.h>
#include <include/DataUriSource.h>

namespace android {

HTTPBase *createChromiumHTTPDataSource(uint32_t flags) {
    return new ChromiumHTTPDataSource(flags);
}

DataSource *createDataUriSource(const char *uri) {
    return new DataUriSource(uri);
}

}
Loading