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

Commit f9f60879 authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "An HTTP datasource for stagefright using the chromium code."

parents 0984ba25 5f5719e4
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ LOCAL_SRC_FILES:= \
        ESDS.cpp                          \
        FileSource.cpp                    \
        FLACExtractor.cpp                 \
        HTTPBase.cpp                      \
        HTTPStream.cpp                    \
        JPEGSource.cpp                    \
        MP3Extractor.cpp                  \
@@ -75,7 +76,12 @@ LOCAL_SHARED_LIBRARIES := \
        libdrmframework  \
        libcrypto        \
        libssl           \
        libgui
        libgui           \
        liblog           \
        libicuuc         \
        libicui18n       \
        libz             \
        libdl            \

LOCAL_STATIC_LIBRARIES := \
        libstagefright_color_conversion \
@@ -100,6 +106,14 @@ LOCAL_STATIC_LIBRARIES := \
        libstagefright_id3 \
        libstagefright_g711dec \
        libFLAC \
        libstagefright_chromium_http \
        libchromium_net         \
        libwebcore              \

ifneq ($(TARGET_SIMULATOR),true)
LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
endif

LOCAL_SHARED_LIBRARIES += \
        libstagefright_amrnb_common \
+4 −2
Original line number Diff line number Diff line
@@ -1597,8 +1597,10 @@ status_t AwesomePlayer::finishSetDataSource_l() {

    if (!strncasecmp("http://", mUri.string(), 7)
            || !strncasecmp("https://", mUri.string(), 8)) {
        mConnectingDataSource = new NuHTTPDataSource(
                (mFlags & INCOGNITO) ? NuHTTPDataSource::kFlagIncognito : 0);
        mConnectingDataSource = HTTPBase::Create(
                (mFlags & INCOGNITO)
                    ? HTTPBase::kFlagIncognito
                    : 0);

        mLock.unlock();
        status_t err = mConnectingDataSource->connect(mUri, &mUriHeaders);
+2 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include "include/OggExtractor.h"
#include "include/MPEG2TSExtractor.h"
#include "include/NuCachedSource2.h"
#include "include/NuHTTPDataSource.h"
#include "include/HTTPBase.h"
#include "include/DRMExtractor.h"
#include "include/FLACExtractor.h"
#include "include/AACExtractor.h"
@@ -127,7 +127,7 @@ sp<DataSource> DataSource::CreateFromURI(
        source = new FileSource(uri + 7);
    } else if (!strncasecmp("http://", uri, 7)
            || !strncasecmp("https://", uri, 8)) {
        sp<NuHTTPDataSource> httpSource = new NuHTTPDataSource;
        sp<HTTPBase> httpSource = HTTPBase::Create();
        if (httpSource->connect(uri, headers) != OK) {
            return NULL;
        }
+39 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2011 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 "include/HTTPBase.h"

#include "include/ChromiumHTTPDataSource.h"
#include "include/NuHTTPDataSource.h"

#include <cutils/properties.h>

namespace android {

HTTPBase::HTTPBase() {}

// static
sp<HTTPBase> HTTPBase::Create(uint32_t flags) {
    char value[PROPERTY_VALUE_MAX];
    if (!property_get("media.stagefright.use-chromium", value, NULL)
            || (strcasecmp("false", value) && strcmp("0", value))) {
        return new ChromiumHTTPDataSource(flags);
    } else {
        return new NuHTTPDataSource(flags);
    }
}

}  // namespace android
+25 −0
Original line number Diff line number Diff line
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES:=       \
        ChromiumHTTPDataSource.cpp        \
        support.cpp                     \

LOCAL_C_INCLUDES:= \
        $(JNI_H_INCLUDE) \
        frameworks/base/media/libstagefright \
        $(TOP)/frameworks/base/include/media/stagefright/openmax \
        external/chromium \
        external/chromium/android

LOCAL_CFLAGS += -Wno-multichar

ifneq ($(TARGET_SIMULATOR),true)
LOCAL_SHARED_LIBRARIES += libstlport
include external/stlport/libstlport.mk
endif

LOCAL_MODULE:= libstagefright_chromium_http

include $(BUILD_STATIC_LIBRARY)
Loading