diff options
author | Andreas Huber <andih@google.com> | 2013-06-03 08:48:27 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-06-03 08:48:27 -0700 |
commit | 7c684c622110af460025eff85082030947278430 (patch) | |
tree | 3e29ab57fde237f80242d1c479968126d757368f /media/libmedia | |
parent | faca94d1773afb50fb8aa4eb00ca213d7c9d2bec (diff) | |
parent | f9bb8358e454be6dc88403171db7e0e182407f17 (diff) | |
download | frameworks_av-7c684c622110af460025eff85082030947278430.zip frameworks_av-7c684c622110af460025eff85082030947278430.tar.gz frameworks_av-7c684c622110af460025eff85082030947278430.tar.bz2 |
am f9bb8358: am b7319a7e: Update HTTP proxy configuration for all media playback inside stagefright.
* commit 'f9bb8358e454be6dc88403171db7e0e182407f17':
Update HTTP proxy configuration for all media playback inside stagefright.
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/IMediaPlayerService.cpp | 38 | ||||
-rw-r--r-- | media/libmedia/mediaplayer.cpp | 11 |
2 files changed, 49 insertions, 0 deletions
diff --git a/media/libmedia/IMediaPlayerService.cpp b/media/libmedia/IMediaPlayerService.cpp index e1ce5a9..74f574d 100644 --- a/media/libmedia/IMediaPlayerService.cpp +++ b/media/libmedia/IMediaPlayerService.cpp @@ -48,6 +48,7 @@ enum { ADD_BATTERY_DATA, PULL_BATTERY_DATA, LISTEN_FOR_REMOTE_DISPLAY, + UPDATE_PROXY_CONFIG, }; class BpMediaPlayerService: public BpInterface<IMediaPlayerService> @@ -163,6 +164,25 @@ public: remote()->transact(LISTEN_FOR_REMOTE_DISPLAY, data, &reply); return interface_cast<IRemoteDisplay>(reply.readStrongBinder()); } + + virtual status_t updateProxyConfig( + const char *host, int32_t port, const char *exclusionList) { + Parcel data, reply; + + data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); + if (host == NULL) { + data.writeInt32(0); + } else { + data.writeInt32(1); + data.writeCString(host); + data.writeInt32(port); + data.writeCString(exclusionList); + } + + remote()->transact(UPDATE_PROXY_CONFIG, data, &reply); + + return reply.readInt32(); + } }; IMPLEMENT_META_INTERFACE(MediaPlayerService, "android.media.IMediaPlayerService"); @@ -267,6 +287,24 @@ status_t BnMediaPlayerService::onTransact( reply->writeStrongBinder(display->asBinder()); return NO_ERROR; } break; + case UPDATE_PROXY_CONFIG: + { + CHECK_INTERFACE(IMediaPlayerService, data, reply); + + const char *host = NULL; + int32_t port = 0; + const char *exclusionList = NULL; + + if (data.readInt32()) { + host = data.readCString(); + port = data.readInt32(); + exclusionList = data.readCString(); + } + + reply->writeInt32(updateProxyConfig(host, port, exclusionList)); + + return OK; + } default: return BBinder::onTransact(code, data, reply, flags); } diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp index 4a34233..68cbdf5 100644 --- a/media/libmedia/mediaplayer.cpp +++ b/media/libmedia/mediaplayer.cpp @@ -814,4 +814,15 @@ status_t MediaPlayer::setNextMediaPlayer(const sp<MediaPlayer>& next) { return mPlayer->setNextPlayer(next == NULL ? NULL : next->mPlayer); } +status_t MediaPlayer::updateProxyConfig( + const char *host, int32_t port, const char *exclusionList) { + const sp<IMediaPlayerService>& service = getMediaPlayerService(); + + if (service != NULL) { + return service->updateProxyConfig(host, port, exclusionList); + } + + return INVALID_OPERATION; +} + }; // namespace android |