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

Commit 1b8d64c9 authored by Surajit Podder's avatar Surajit Podder Committed by Gerrit - the friendly Code Review server
Browse files

frameworks/av: Integrate STAProxy for NuPlayer httpstreaming

Added support to integrate STAProxy
support in httpstreaming through NuPlayer

Change-Id: I544d8c2620a8da0fbfc7e4a15f64641145d77ccf
parent 6eb6ffa4
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.