diff options
author | Andreas Huber <andih@google.com> | 2010-08-23 11:28:34 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-08-23 11:28:34 -0700 |
commit | 1b543242102ef3c28145c6ad50ee8e8ce2fb26d3 (patch) | |
tree | 74b55d34f52ad26a931de1ba7d0229f01d9e7ead /media/libstagefright/include/ARTSPController.h | |
parent | 482482401095d5fc98f89b4a3ce43d41c00fffd7 (diff) | |
download | frameworks_av-1b543242102ef3c28145c6ad50ee8e8ce2fb26d3.zip frameworks_av-1b543242102ef3c28145c6ad50ee8e8ce2fb26d3.tar.gz frameworks_av-1b543242102ef3c28145c6ad50ee8e8ce2fb26d3.tar.bz2 |
Better handling of rtsp connection and disconnection.
Change-Id: Ib126af6c14c5a212a51a5ee3c4a0a7d1860ad167
Diffstat (limited to 'media/libstagefright/include/ARTSPController.h')
-rw-r--r-- | media/libstagefright/include/ARTSPController.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/media/libstagefright/include/ARTSPController.h b/media/libstagefright/include/ARTSPController.h index 55efd41..2542e4e 100644 --- a/media/libstagefright/include/ARTSPController.h +++ b/media/libstagefright/include/ARTSPController.h @@ -19,6 +19,7 @@ #define A_RTSP_CONTROLLER_H_ #include <media/stagefright/foundation/ABase.h> +#include <media/stagefright/foundation/AHandlerReflector.h> #include <media/stagefright/MediaExtractor.h> namespace android { @@ -38,12 +39,32 @@ struct ARTSPController : public MediaExtractor { virtual sp<MetaData> getTrackMetaData( size_t index, uint32_t flags); + void onMessageReceived(const sp<AMessage> &msg); + protected: virtual ~ARTSPController(); private: + enum { + kWhatConnectDone = 'cdon', + kWhatDisconnectDone = 'ddon', + }; + + enum State { + DISCONNECTED, + CONNECTED, + CONNECTING, + }; + + Mutex mLock; + Condition mCondition; + + State mState; + status_t mConnectionResult; + sp<ALooper> mLooper; sp<MyHandler> mHandler; + sp<AHandlerReflector<ARTSPController> > mReflector; DISALLOW_EVIL_CONSTRUCTORS(ARTSPController); }; |