Loading media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp +18 −3 Original line number Diff line number Diff line Loading @@ -33,11 +33,25 @@ namespace android { NuPlayer::HTTPLiveSource::HTTPLiveSource(const char *url, uint32_t flags) NuPlayer::HTTPLiveSource::HTTPLiveSource( const char *url, const KeyedVector<String8, String8> *headers) : mURL(url), mFlags(flags), mFlags(0), mEOS(false), mOffset(0) { if (headers) { mExtraHeaders = *headers; ssize_t index = mExtraHeaders.indexOfKey(String8("x-hide-urls-from-log")); if (index >= 0) { mFlags |= kFlagIncognito; mExtraHeaders.removeItemsAt(index); } } } NuPlayer::HTTPLiveSource::~HTTPLiveSource() { Loading @@ -55,7 +69,8 @@ void NuPlayer::HTTPLiveSource::start() { mLiveLooper->registerHandler(mLiveSession); mLiveSession->connect(mURL.c_str()); mLiveSession->connect( mURL.c_str(), mExtraHeaders.isEmpty() ? NULL : &mExtraHeaders); mTSParser = new ATSParser; } Loading media/libmediaplayerservice/nuplayer/HTTPLiveSource.h +9 −5 Original line number Diff line number Diff line Loading @@ -27,11 +27,9 @@ struct ATSParser; struct LiveSession; struct NuPlayer::HTTPLiveSource : public NuPlayer::Source { enum Flags { // Don't log any URLs. kFlagIncognito = 1, }; HTTPLiveSource(const char *url, uint32_t flags = 0); HTTPLiveSource( const char *url, const KeyedVector<String8, String8> *headers); virtual void start(); Loading @@ -49,7 +47,13 @@ protected: virtual ~HTTPLiveSource(); private: enum Flags { // Don't log any URLs. kFlagIncognito = 1, }; AString mURL; KeyedVector<String8, String8> mExtraHeaders; uint32_t mFlags; bool mEOS; off64_t mOffset; Loading media/libmediaplayerservice/nuplayer/NuPlayer.cpp +1 −11 Original line number Diff line number Diff line Loading @@ -72,17 +72,7 @@ void NuPlayer::setDataSource( const char *url, const KeyedVector<String8, String8> *headers) { sp<AMessage> msg = new AMessage(kWhatSetDataSource, id()); uint32_t flags = 0; if (headers) { ssize_t index = headers->indexOfKey(String8("x-hide-urls-from-log")); if (index >= 0) { flags |= HTTPLiveSource::kFlagIncognito; } } msg->setObject("source", new HTTPLiveSource(url, flags)); msg->setObject("source", new HTTPLiveSource(url, headers)); msg->post(); } Loading media/libstagefright/httplive/LiveSession.cpp +21 −2 Original line number Diff line number Diff line Loading @@ -67,9 +67,17 @@ sp<DataSource> LiveSession::getDataSource() { return mDataSource; } void LiveSession::connect(const char *url) { void LiveSession::connect( const char *url, const KeyedVector<String8, String8> *headers) { sp<AMessage> msg = new AMessage(kWhatConnect, id()); msg->setString("url", url); if (headers != NULL) { msg->setPointer( "headers", new KeyedVector<String8, String8>(*headers)); } msg->post(); } Loading Loading @@ -144,6 +152,16 @@ void LiveSession::onConnect(const sp<AMessage> &msg) { AString url; CHECK(msg->findString("url", &url)); KeyedVector<String8, String8> *headers = NULL; if (!msg->findPointer("headers", (void **)&headers)) { mExtraHeaders.clear(); } else { mExtraHeaders = *headers; delete headers; headers = NULL; } if (!(mFlags & kFlagIncognito)) { LOGI("onConnect '%s'", url.c_str()); } else { Loading Loading @@ -210,7 +228,8 @@ status_t LiveSession::fetchFile(const char *url, sp<ABuffer> *out) { } } status_t err = mHTTPDataSource->connect(url); status_t err = mHTTPDataSource->connect( url, mExtraHeaders.isEmpty() ? NULL : &mExtraHeaders); if (err != OK) { return err; Loading media/libstagefright/include/LiveSession.h +8 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <media/stagefright/foundation/AHandler.h> #include <utils/String8.h> namespace android { struct ABuffer; Loading @@ -37,7 +39,10 @@ struct LiveSession : public AHandler { sp<DataSource> getDataSource(); void connect(const char *url); void connect( const char *url, const KeyedVector<String8, String8> *headers = NULL); void disconnect(); // Blocks until seek is complete. Loading Loading @@ -78,6 +83,8 @@ private: sp<HTTPBase> mHTTPDataSource; AString mMasterURL; KeyedVector<String8, String8> mExtraHeaders; Vector<BandwidthItem> mBandwidthItems; KeyedVector<AString, sp<ABuffer> > mAESKeyForURI; Loading Loading
media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp +18 −3 Original line number Diff line number Diff line Loading @@ -33,11 +33,25 @@ namespace android { NuPlayer::HTTPLiveSource::HTTPLiveSource(const char *url, uint32_t flags) NuPlayer::HTTPLiveSource::HTTPLiveSource( const char *url, const KeyedVector<String8, String8> *headers) : mURL(url), mFlags(flags), mFlags(0), mEOS(false), mOffset(0) { if (headers) { mExtraHeaders = *headers; ssize_t index = mExtraHeaders.indexOfKey(String8("x-hide-urls-from-log")); if (index >= 0) { mFlags |= kFlagIncognito; mExtraHeaders.removeItemsAt(index); } } } NuPlayer::HTTPLiveSource::~HTTPLiveSource() { Loading @@ -55,7 +69,8 @@ void NuPlayer::HTTPLiveSource::start() { mLiveLooper->registerHandler(mLiveSession); mLiveSession->connect(mURL.c_str()); mLiveSession->connect( mURL.c_str(), mExtraHeaders.isEmpty() ? NULL : &mExtraHeaders); mTSParser = new ATSParser; } Loading
media/libmediaplayerservice/nuplayer/HTTPLiveSource.h +9 −5 Original line number Diff line number Diff line Loading @@ -27,11 +27,9 @@ struct ATSParser; struct LiveSession; struct NuPlayer::HTTPLiveSource : public NuPlayer::Source { enum Flags { // Don't log any URLs. kFlagIncognito = 1, }; HTTPLiveSource(const char *url, uint32_t flags = 0); HTTPLiveSource( const char *url, const KeyedVector<String8, String8> *headers); virtual void start(); Loading @@ -49,7 +47,13 @@ protected: virtual ~HTTPLiveSource(); private: enum Flags { // Don't log any URLs. kFlagIncognito = 1, }; AString mURL; KeyedVector<String8, String8> mExtraHeaders; uint32_t mFlags; bool mEOS; off64_t mOffset; Loading
media/libmediaplayerservice/nuplayer/NuPlayer.cpp +1 −11 Original line number Diff line number Diff line Loading @@ -72,17 +72,7 @@ void NuPlayer::setDataSource( const char *url, const KeyedVector<String8, String8> *headers) { sp<AMessage> msg = new AMessage(kWhatSetDataSource, id()); uint32_t flags = 0; if (headers) { ssize_t index = headers->indexOfKey(String8("x-hide-urls-from-log")); if (index >= 0) { flags |= HTTPLiveSource::kFlagIncognito; } } msg->setObject("source", new HTTPLiveSource(url, flags)); msg->setObject("source", new HTTPLiveSource(url, headers)); msg->post(); } Loading
media/libstagefright/httplive/LiveSession.cpp +21 −2 Original line number Diff line number Diff line Loading @@ -67,9 +67,17 @@ sp<DataSource> LiveSession::getDataSource() { return mDataSource; } void LiveSession::connect(const char *url) { void LiveSession::connect( const char *url, const KeyedVector<String8, String8> *headers) { sp<AMessage> msg = new AMessage(kWhatConnect, id()); msg->setString("url", url); if (headers != NULL) { msg->setPointer( "headers", new KeyedVector<String8, String8>(*headers)); } msg->post(); } Loading Loading @@ -144,6 +152,16 @@ void LiveSession::onConnect(const sp<AMessage> &msg) { AString url; CHECK(msg->findString("url", &url)); KeyedVector<String8, String8> *headers = NULL; if (!msg->findPointer("headers", (void **)&headers)) { mExtraHeaders.clear(); } else { mExtraHeaders = *headers; delete headers; headers = NULL; } if (!(mFlags & kFlagIncognito)) { LOGI("onConnect '%s'", url.c_str()); } else { Loading Loading @@ -210,7 +228,8 @@ status_t LiveSession::fetchFile(const char *url, sp<ABuffer> *out) { } } status_t err = mHTTPDataSource->connect(url); status_t err = mHTTPDataSource->connect( url, mExtraHeaders.isEmpty() ? NULL : &mExtraHeaders); if (err != OK) { return err; Loading
media/libstagefright/include/LiveSession.h +8 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <media/stagefright/foundation/AHandler.h> #include <utils/String8.h> namespace android { struct ABuffer; Loading @@ -37,7 +39,10 @@ struct LiveSession : public AHandler { sp<DataSource> getDataSource(); void connect(const char *url); void connect( const char *url, const KeyedVector<String8, String8> *headers = NULL); void disconnect(); // Blocks until seek is complete. Loading Loading @@ -78,6 +83,8 @@ private: sp<HTTPBase> mHTTPDataSource; AString mMasterURL; KeyedVector<String8, String8> mExtraHeaders; Vector<BandwidthItem> mBandwidthItems; KeyedVector<AString, sp<ABuffer> > mAESKeyForURI; Loading