diff options
author | Andreas Huber <andih@google.com> | 2011-02-24 14:49:10 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-02-24 14:49:10 -0800 |
commit | 827b55c5f3409b68ef57816208220d8804693e44 (patch) | |
tree | 65876f2b881d52f6a3fec94564a0baf0d0802627 /media/libmediaplayerservice | |
parent | 72feaa5df1f7b15b18e30592653dc511dc0b8c51 (diff) | |
parent | 7314fa17093d514199fedcb55ac41136a1b31cb3 (diff) | |
download | frameworks_av-827b55c5f3409b68ef57816208220d8804693e44.zip frameworks_av-827b55c5f3409b68ef57816208220d8804693e44.tar.gz frameworks_av-827b55c5f3409b68ef57816208220d8804693e44.tar.bz2 |
Merge "Suppress the logging of URLs when in incognito mode."
Diffstat (limited to 'media/libmediaplayerservice')
4 files changed, 22 insertions, 5 deletions
diff --git a/media/libmediaplayerservice/StagefrightPlayer.cpp b/media/libmediaplayerservice/StagefrightPlayer.cpp index fdb4754..e277121 100644 --- a/media/libmediaplayerservice/StagefrightPlayer.cpp +++ b/media/libmediaplayerservice/StagefrightPlayer.cpp @@ -33,7 +33,6 @@ status_t StagefrightPlayer::initCheck() { status_t StagefrightPlayer::setDataSource( const char *url, const KeyedVector<String8, String8> *headers) { - LOGI("setDataSource('%s')", url); return mPlayer->setDataSource(url, headers); } diff --git a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp index 6bf6dd3..b3314be 100644 --- a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp +++ b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp @@ -33,8 +33,9 @@ namespace android { -NuPlayer::HTTPLiveSource::HTTPLiveSource(const char *url) +NuPlayer::HTTPLiveSource::HTTPLiveSource(const char *url, uint32_t flags) : mURL(url), + mFlags(flags), mEOS(false), mOffset(0) { } @@ -49,7 +50,9 @@ void NuPlayer::HTTPLiveSource::start() { mLiveLooper->setName("http live"); mLiveLooper->start(); - mLiveSession = new LiveSession; + mLiveSession = new LiveSession( + (mFlags & kFlagIncognito) ? LiveSession::kFlagIncognito : 0); + mLiveLooper->registerHandler(mLiveSession); mLiveSession->connect(mURL.c_str()); diff --git a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h index f3f539a..a8ce7f4 100644 --- a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h +++ b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h @@ -27,7 +27,11 @@ struct ATSParser; struct LiveSession; struct NuPlayer::HTTPLiveSource : public NuPlayer::Source { - HTTPLiveSource(const char *url); + enum Flags { + // Don't log any URLs. + kFlagIncognito = 1, + }; + HTTPLiveSource(const char *url, uint32_t flags = 0); virtual void start(); @@ -46,6 +50,7 @@ protected: private: AString mURL; + uint32_t mFlags; bool mEOS; off64_t mOffset; sp<ALooper> mLiveLooper; diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 48b517e..474c056 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -72,7 +72,17 @@ void NuPlayer::setDataSource( const char *url, const KeyedVector<String8, String8> *headers) { sp<AMessage> msg = new AMessage(kWhatSetDataSource, id()); - msg->setObject("source", new HTTPLiveSource(url)); + 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->post(); } |