diff options
author | Lajos Molnar <lajos@google.com> | 2015-03-04 16:46:34 -0800 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2015-03-05 17:49:50 -0800 |
commit | 1d15ab58bf8239069ef343de6cb21aabf3ef7d78 (patch) | |
tree | d4b3266c9baf5e6dee214fc6562391101e198be7 /media/libstagefright/httplive | |
parent | 5804a76ac5f9f3c311f1bbbcc5ebdc8f8568ae14 (diff) | |
download | frameworks_av-1d15ab58bf8239069ef343de6cb21aabf3ef7d78.zip frameworks_av-1d15ab58bf8239069ef343de6cb21aabf3ef7d78.tar.gz frameworks_av-1d15ab58bf8239069ef343de6cb21aabf3ef7d78.tar.bz2 |
media: switch to new AMessage handling
Bug: 19607784
Change-Id: I94cddcb81f671422ad4982a23dc4acfe57a9f1aa
Diffstat (limited to 'media/libstagefright/httplive')
-rw-r--r-- | media/libstagefright/httplive/LiveSession.cpp | 26 | ||||
-rw-r--r-- | media/libstagefright/httplive/PlaylistFetcher.cpp | 12 |
2 files changed, 19 insertions, 19 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp index d0f3bc2..dcac765 100644 --- a/media/libstagefright/httplive/LiveSession.cpp +++ b/media/libstagefright/httplive/LiveSession.cpp @@ -244,7 +244,7 @@ status_t LiveSession::dequeueAccessUnit( Mutex::Autolock lock(mSwapMutex); if (switchGeneration == mSwitchGeneration) { swapPacketSource(stream); - sp<AMessage> msg = new AMessage(kWhatSwapped, id()); + sp<AMessage> msg = new AMessage(kWhatSwapped, this); msg->setInt32("stream", stream); msg->setInt32("switchGeneration", switchGeneration); msg->post(); @@ -349,7 +349,7 @@ status_t LiveSession::getStreamFormat(StreamType stream, sp<AMessage> *format) { void LiveSession::connectAsync( const char *url, const KeyedVector<String8, String8> *headers) { - sp<AMessage> msg = new AMessage(kWhatConnect, id()); + sp<AMessage> msg = new AMessage(kWhatConnect, this); msg->setString("url", url); if (headers != NULL) { @@ -362,7 +362,7 @@ void LiveSession::connectAsync( } status_t LiveSession::disconnect() { - sp<AMessage> msg = new AMessage(kWhatDisconnect, id()); + sp<AMessage> msg = new AMessage(kWhatDisconnect, this); sp<AMessage> response; status_t err = msg->postAndAwaitResponse(&response); @@ -371,7 +371,7 @@ status_t LiveSession::disconnect() { } status_t LiveSession::seekTo(int64_t timeUs) { - sp<AMessage> msg = new AMessage(kWhatSeek, id()); + sp<AMessage> msg = new AMessage(kWhatSeek, this); msg->setInt64("timeUs", timeUs); sp<AMessage> response; @@ -757,7 +757,7 @@ void LiveSession::finishDisconnect() { mFetcherInfos.valueAt(i).mFetcher->stopAsync(); } - sp<AMessage> msg = new AMessage(kWhatFinishDisconnect2, id()); + sp<AMessage> msg = new AMessage(kWhatFinishDisconnect2, this); mContinuationCounter = mFetcherInfos.size(); mContinuation = msg; @@ -790,7 +790,7 @@ sp<PlaylistFetcher> LiveSession::addFetcher(const char *uri) { return NULL; } - sp<AMessage> notify = new AMessage(kWhatFetcherNotify, id()); + sp<AMessage> notify = new AMessage(kWhatFetcherNotify, this); notify->setString("uri", uri); notify->setInt32("switchGeneration", mSwitchGeneration); @@ -1185,7 +1185,7 @@ status_t LiveSession::selectTrack(size_t index, bool select) { ++mSubtitleGeneration; status_t err = mPlaylist->selectTrack(index, select); if (err == OK) { - sp<AMessage> msg = new AMessage(kWhatChangeConfiguration, id()); + sp<AMessage> msg = new AMessage(kWhatChangeConfiguration, this); msg->setInt32("bandwidthIndex", mCurBandwidthIndex); msg->setInt32("pickTrack", select); msg->post(); @@ -1273,9 +1273,9 @@ void LiveSession::changeConfiguration( sp<AMessage> msg; if (timeUs < 0ll) { // skip onChangeConfiguration2 (decoder destruction) if not seeking. - msg = new AMessage(kWhatChangeConfiguration3, id()); + msg = new AMessage(kWhatChangeConfiguration3, this); } else { - msg = new AMessage(kWhatChangeConfiguration2, id()); + msg = new AMessage(kWhatChangeConfiguration2, this); } msg->setInt32("streamMask", streamMask); msg->setInt32("resumeMask", resumeMask); @@ -1372,7 +1372,7 @@ void LiveSession::onChangeConfiguration2(const sp<AMessage> &msg) { notify->setInt32("changedMask", changedMask); msg->setWhat(kWhatChangeConfiguration3); - msg->setTarget(id()); + msg->setTarget(this); notify->setMessage("reply", msg); notify->post(); @@ -1644,7 +1644,7 @@ void LiveSession::onCheckSwitchDown() { int64_t targetDurationUs = targetDuration * 1000000ll; if (bufferedDurationUs < targetDurationUs / 3) { - (new AMessage(kWhatSwitchDown, id()))->post(); + (new AMessage(kWhatSwitchDown, this))->post(); break; } } @@ -1689,7 +1689,7 @@ void LiveSession::tryToFinishBandwidthSwitch() { } void LiveSession::scheduleCheckBandwidthEvent() { - sp<AMessage> msg = new AMessage(kWhatCheckBandwidth, id()); + sp<AMessage> msg = new AMessage(kWhatCheckBandwidth, this); msg->setInt32("generation", mCheckBandwidthGeneration); msg->post(10000000ll); } @@ -1772,7 +1772,7 @@ void LiveSession::postPrepared(status_t err) { mInPreparationPhase = false; - mSwitchDownMonitor = new AMessage(kWhatCheckSwitchDown, id()); + mSwitchDownMonitor = new AMessage(kWhatCheckSwitchDown, this); mSwitchDownMonitor->post(); } diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp index 1227600..4ccbf76 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.cpp +++ b/media/libstagefright/httplive/PlaylistFetcher.cpp @@ -325,7 +325,7 @@ void PlaylistFetcher::postMonitorQueue(int64_t delayUs, int64_t minDelayUs) { ALOGV("Need to refresh playlist in %" PRId64 , maxDelayUs); delayUs = maxDelayUs; } - sp<AMessage> msg = new AMessage(kWhatMonitorQueue, id()); + sp<AMessage> msg = new AMessage(kWhatMonitorQueue, this); msg->setInt32("generation", mMonitorQueueGeneration); msg->post(delayUs); } @@ -342,7 +342,7 @@ void PlaylistFetcher::startAsync( int64_t segmentStartTimeUs, int32_t startDiscontinuitySeq, bool adaptive) { - sp<AMessage> msg = new AMessage(kWhatStart, id()); + sp<AMessage> msg = new AMessage(kWhatStart, this); uint32_t streamTypeMask = 0ul; @@ -370,17 +370,17 @@ void PlaylistFetcher::startAsync( } void PlaylistFetcher::pauseAsync() { - (new AMessage(kWhatPause, id()))->post(); + (new AMessage(kWhatPause, this))->post(); } void PlaylistFetcher::stopAsync(bool clear) { - sp<AMessage> msg = new AMessage(kWhatStop, id()); + sp<AMessage> msg = new AMessage(kWhatStop, this); msg->setInt32("clear", clear); msg->post(); } void PlaylistFetcher::resumeUntilAsync(const sp<AMessage> ¶ms) { - AMessage* msg = new AMessage(kWhatResumeUntil, id()); + AMessage* msg = new AMessage(kWhatResumeUntil, this); msg->setMessage("params", params); msg->post(); } @@ -671,7 +671,7 @@ void PlaylistFetcher::onMonitorQueue() { // delay the next download slightly; hopefully this gives other concurrent fetchers // a better chance to run. // onDownloadNext(); - sp<AMessage> msg = new AMessage(kWhatDownloadNext, id()); + sp<AMessage> msg = new AMessage(kWhatDownloadNext, this); msg->setInt32("generation", mMonitorQueueGeneration); msg->post(1000l); } else { |