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

Commit 04b735af authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "frameworks/av: Integrate STAProxy for NuPlayer httpstreaming"

parents eac84f1d 1b8d64c9
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@

#include "ESDS.h"
#include <media/stagefright/Utils.h>
#include "ExtendedUtils.h"

namespace android {

@@ -237,6 +238,21 @@ void NuPlayer::setDataSourceAsync(
        source = new RTSPSource(
                notify, httpService, url, headers, mUIDValid, mUID, true);
    } else {
        // Set Proxy for progressive download usecase
        if (headers) {
            KeyedVector<String8, String8> mUriHeaders = *headers;
            int32_t port;
            if (ExtendedUtils::ShellProp::getSTAProxyConfig(port)) {
                String8 portString = String8("127.0.0.1");
                portString.appendFormat(":%d",port);
                ALOGV("getSTAProxyConfig Proxy IPportString %s", portString.string());
                mUriHeaders.add(String8("use-proxy"), portString);
            } else {
                ALOGE("getSTAProxyConfig failed or disabled");
            }
        } else {
            ALOGE("Not try to set proxy as headers are NULL");
        }
        sp<GenericSource> genericSource =
                new GenericSource(notify, mUIDValid, mUID);
        // Don't set FLAG_SECURE on mSourceFlags here for widevine.