From 1d15ab58bf8239069ef343de6cb21aabf3ef7d78 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Wed, 4 Mar 2015 16:46:34 -0800 Subject: media: switch to new AMessage handling Bug: 19607784 Change-Id: I94cddcb81f671422ad4982a23dc4acfe57a9f1aa --- media/libstagefright/httplive/LiveSession.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'media/libstagefright/httplive/LiveSession.cpp') 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 msg = new AMessage(kWhatSwapped, id()); + sp 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 *format) { void LiveSession::connectAsync( const char *url, const KeyedVector *headers) { - sp msg = new AMessage(kWhatConnect, id()); + sp msg = new AMessage(kWhatConnect, this); msg->setString("url", url); if (headers != NULL) { @@ -362,7 +362,7 @@ void LiveSession::connectAsync( } status_t LiveSession::disconnect() { - sp msg = new AMessage(kWhatDisconnect, id()); + sp msg = new AMessage(kWhatDisconnect, this); sp response; status_t err = msg->postAndAwaitResponse(&response); @@ -371,7 +371,7 @@ status_t LiveSession::disconnect() { } status_t LiveSession::seekTo(int64_t timeUs) { - sp msg = new AMessage(kWhatSeek, id()); + sp msg = new AMessage(kWhatSeek, this); msg->setInt64("timeUs", timeUs); sp response; @@ -757,7 +757,7 @@ void LiveSession::finishDisconnect() { mFetcherInfos.valueAt(i).mFetcher->stopAsync(); } - sp msg = new AMessage(kWhatFinishDisconnect2, id()); + sp msg = new AMessage(kWhatFinishDisconnect2, this); mContinuationCounter = mFetcherInfos.size(); mContinuation = msg; @@ -790,7 +790,7 @@ sp LiveSession::addFetcher(const char *uri) { return NULL; } - sp notify = new AMessage(kWhatFetcherNotify, id()); + sp 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 msg = new AMessage(kWhatChangeConfiguration, id()); + sp msg = new AMessage(kWhatChangeConfiguration, this); msg->setInt32("bandwidthIndex", mCurBandwidthIndex); msg->setInt32("pickTrack", select); msg->post(); @@ -1273,9 +1273,9 @@ void LiveSession::changeConfiguration( sp 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 &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 msg = new AMessage(kWhatCheckBandwidth, id()); + sp 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(); } -- cgit v1.1