Loading media/libmediaplayerservice/HDCP.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ HDCP::HDCP() } HDCP::~HDCP() { Mutex::Autolock autoLock(mLock); if (mHDCPModule != NULL) { delete mHDCPModule; mHDCPModule = NULL; Loading @@ -63,6 +65,8 @@ HDCP::~HDCP() { } status_t HDCP::setObserver(const sp<IHDCPObserver> &observer) { Mutex::Autolock autoLock(mLock); if (mHDCPModule == NULL) { return NO_INIT; } Loading @@ -73,6 +77,8 @@ status_t HDCP::setObserver(const sp<IHDCPObserver> &observer) { } status_t HDCP::initAsync(const char *host, unsigned port) { Mutex::Autolock autoLock(mLock); if (mHDCPModule == NULL) { return NO_INIT; } Loading @@ -81,6 +87,8 @@ status_t HDCP::initAsync(const char *host, unsigned port) { } status_t HDCP::shutdownAsync() { Mutex::Autolock autoLock(mLock); if (mHDCPModule == NULL) { return NO_INIT; } Loading @@ -91,6 +99,8 @@ status_t HDCP::shutdownAsync() { status_t HDCP::encrypt( const void *inData, size_t size, uint32_t streamCTR, uint64_t *outInputCTR, void *outData) { Mutex::Autolock autoLock(mLock); if (mHDCPModule == NULL) { *outInputCTR = 0; Loading @@ -106,6 +116,8 @@ void HDCP::ObserveWrapper(void *me, int msg, int ext1, int ext2) { } void HDCP::observe(int msg, int ext1, int ext2) { Mutex::Autolock autoLock(mLock); if (mObserver != NULL) { mObserver->notify(msg, ext1, ext2, NULL /* obj */); } Loading media/libmediaplayerservice/HDCP.h +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #define HDCP_H_ #include <media/IHDCP.h> #include <utils/Mutex.h> namespace android { Loading @@ -35,6 +36,8 @@ struct HDCP : public BnHDCP { uint64_t *outInputCTR, void *outData); private: Mutex mLock; void *mLibHandle; HDCPModule *mHDCPModule; sp<IHDCPObserver> mObserver; Loading media/libstagefright/SurfaceMediaSource.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,7 @@ status_t SurfaceMediaSource::stop() mStopped = true; mFrameAvailableCondition.signal(); mMediaBuffersAvailableCondition.signal(); return mBufferQueue->consumerDisconnect(); } Loading media/libstagefright/wifi-display/source/PlaybackSession.cpp +22 −19 Original line number Diff line number Diff line Loading @@ -153,6 +153,8 @@ void WifiDisplaySource::PlaybackSession::Track::setPacketizerTrackIndex(size_t i } status_t WifiDisplaySource::PlaybackSession::Track::start() { ALOGV("Track::start isAudio=%d", mIsAudio); if (mStarted) { return INVALID_OPERATION; } Loading @@ -171,6 +173,8 @@ status_t WifiDisplaySource::PlaybackSession::Track::start() { } status_t WifiDisplaySource::PlaybackSession::Track::stop() { ALOGV("Track::stop isAudio=%d", mIsAudio); if (!mStarted) { return INVALID_OPERATION; } Loading Loading @@ -217,6 +221,7 @@ WifiDisplaySource::PlaybackSession::PlaybackSession( mNotify(notify), mInterfaceAddr(interfaceAddr), mHDCP(hdcp), mWeAreDead(false), mLastLifesignUs(), mVideoTrackIndex(-1), mTSQueue(new ABuffer(12 + kMaxNumTSPacketsPerRTPPacket * 188)), Loading Loading @@ -531,6 +536,10 @@ status_t WifiDisplaySource::PlaybackSession::destroy() { void WifiDisplaySource::PlaybackSession::onMessageReceived( const sp<AMessage> &msg) { if (mWeAreDead) { return; } switch (msg->what()) { case kWhatRTPNotify: case kWhatRTCPNotify: Loading Loading @@ -590,10 +599,7 @@ void WifiDisplaySource::PlaybackSession::onMessageReceived( } #endif // Inform WifiDisplaySource of our premature death (wish). sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", kWhatSessionDead); notify->post(); notifySessionDead(); break; } Loading Loading @@ -714,12 +720,7 @@ void WifiDisplaySource::PlaybackSession::onMessageReceived( status_t err = packetizeQueuedAccessUnits(); if (err != OK) { // Inform WifiDisplaySource of our premature death // (wish). sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", kWhatSessionDead); notify->post(); notifySessionDead(); break; } } Loading @@ -736,11 +737,7 @@ void WifiDisplaySource::PlaybackSession::onMessageReceived( status_t err = packetizeAccessUnit(trackIndex, accessUnit); if (err != OK) { // Inform WifiDisplaySource of our premature death // (wish). sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", kWhatSessionDead); notify->post(); notifySessionDead(); } break; } else if (what == Converter::kWhatEOS) { Loading Loading @@ -768,10 +765,7 @@ void WifiDisplaySource::PlaybackSession::onMessageReceived( ALOGE("converter signaled error %d", err); // Inform WifiDisplaySource of our premature death (wish). sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", kWhatSessionDead); notify->post(); notifySessionDead(); } break; } Loading Loading @@ -1482,5 +1476,14 @@ status_t WifiDisplaySource::PlaybackSession::packetizeQueuedAccessUnits() { return OK; } void WifiDisplaySource::PlaybackSession::notifySessionDead() { // Inform WifiDisplaySource of our premature death (wish). sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", kWhatSessionDead); notify->post(); mWeAreDead = true; } } // namespace android media/libstagefright/wifi-display/source/PlaybackSession.h +3 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ private: sp<AMessage> mNotify; in_addr mInterfaceAddr; sp<IHDCP> mHDCP; bool mWeAreDead; int64_t mLastLifesignUs; Loading Loading @@ -205,6 +206,8 @@ private: status_t packetizeQueuedAccessUnits(); void notifySessionDead(); DISALLOW_EVIL_CONSTRUCTORS(PlaybackSession); }; Loading Loading
media/libmediaplayerservice/HDCP.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ HDCP::HDCP() } HDCP::~HDCP() { Mutex::Autolock autoLock(mLock); if (mHDCPModule != NULL) { delete mHDCPModule; mHDCPModule = NULL; Loading @@ -63,6 +65,8 @@ HDCP::~HDCP() { } status_t HDCP::setObserver(const sp<IHDCPObserver> &observer) { Mutex::Autolock autoLock(mLock); if (mHDCPModule == NULL) { return NO_INIT; } Loading @@ -73,6 +77,8 @@ status_t HDCP::setObserver(const sp<IHDCPObserver> &observer) { } status_t HDCP::initAsync(const char *host, unsigned port) { Mutex::Autolock autoLock(mLock); if (mHDCPModule == NULL) { return NO_INIT; } Loading @@ -81,6 +87,8 @@ status_t HDCP::initAsync(const char *host, unsigned port) { } status_t HDCP::shutdownAsync() { Mutex::Autolock autoLock(mLock); if (mHDCPModule == NULL) { return NO_INIT; } Loading @@ -91,6 +99,8 @@ status_t HDCP::shutdownAsync() { status_t HDCP::encrypt( const void *inData, size_t size, uint32_t streamCTR, uint64_t *outInputCTR, void *outData) { Mutex::Autolock autoLock(mLock); if (mHDCPModule == NULL) { *outInputCTR = 0; Loading @@ -106,6 +116,8 @@ void HDCP::ObserveWrapper(void *me, int msg, int ext1, int ext2) { } void HDCP::observe(int msg, int ext1, int ext2) { Mutex::Autolock autoLock(mLock); if (mObserver != NULL) { mObserver->notify(msg, ext1, ext2, NULL /* obj */); } Loading
media/libmediaplayerservice/HDCP.h +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #define HDCP_H_ #include <media/IHDCP.h> #include <utils/Mutex.h> namespace android { Loading @@ -35,6 +36,8 @@ struct HDCP : public BnHDCP { uint64_t *outInputCTR, void *outData); private: Mutex mLock; void *mLibHandle; HDCPModule *mHDCPModule; sp<IHDCPObserver> mObserver; Loading
media/libstagefright/SurfaceMediaSource.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,7 @@ status_t SurfaceMediaSource::stop() mStopped = true; mFrameAvailableCondition.signal(); mMediaBuffersAvailableCondition.signal(); return mBufferQueue->consumerDisconnect(); } Loading
media/libstagefright/wifi-display/source/PlaybackSession.cpp +22 −19 Original line number Diff line number Diff line Loading @@ -153,6 +153,8 @@ void WifiDisplaySource::PlaybackSession::Track::setPacketizerTrackIndex(size_t i } status_t WifiDisplaySource::PlaybackSession::Track::start() { ALOGV("Track::start isAudio=%d", mIsAudio); if (mStarted) { return INVALID_OPERATION; } Loading @@ -171,6 +173,8 @@ status_t WifiDisplaySource::PlaybackSession::Track::start() { } status_t WifiDisplaySource::PlaybackSession::Track::stop() { ALOGV("Track::stop isAudio=%d", mIsAudio); if (!mStarted) { return INVALID_OPERATION; } Loading Loading @@ -217,6 +221,7 @@ WifiDisplaySource::PlaybackSession::PlaybackSession( mNotify(notify), mInterfaceAddr(interfaceAddr), mHDCP(hdcp), mWeAreDead(false), mLastLifesignUs(), mVideoTrackIndex(-1), mTSQueue(new ABuffer(12 + kMaxNumTSPacketsPerRTPPacket * 188)), Loading Loading @@ -531,6 +536,10 @@ status_t WifiDisplaySource::PlaybackSession::destroy() { void WifiDisplaySource::PlaybackSession::onMessageReceived( const sp<AMessage> &msg) { if (mWeAreDead) { return; } switch (msg->what()) { case kWhatRTPNotify: case kWhatRTCPNotify: Loading Loading @@ -590,10 +599,7 @@ void WifiDisplaySource::PlaybackSession::onMessageReceived( } #endif // Inform WifiDisplaySource of our premature death (wish). sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", kWhatSessionDead); notify->post(); notifySessionDead(); break; } Loading Loading @@ -714,12 +720,7 @@ void WifiDisplaySource::PlaybackSession::onMessageReceived( status_t err = packetizeQueuedAccessUnits(); if (err != OK) { // Inform WifiDisplaySource of our premature death // (wish). sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", kWhatSessionDead); notify->post(); notifySessionDead(); break; } } Loading @@ -736,11 +737,7 @@ void WifiDisplaySource::PlaybackSession::onMessageReceived( status_t err = packetizeAccessUnit(trackIndex, accessUnit); if (err != OK) { // Inform WifiDisplaySource of our premature death // (wish). sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", kWhatSessionDead); notify->post(); notifySessionDead(); } break; } else if (what == Converter::kWhatEOS) { Loading Loading @@ -768,10 +765,7 @@ void WifiDisplaySource::PlaybackSession::onMessageReceived( ALOGE("converter signaled error %d", err); // Inform WifiDisplaySource of our premature death (wish). sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", kWhatSessionDead); notify->post(); notifySessionDead(); } break; } Loading Loading @@ -1482,5 +1476,14 @@ status_t WifiDisplaySource::PlaybackSession::packetizeQueuedAccessUnits() { return OK; } void WifiDisplaySource::PlaybackSession::notifySessionDead() { // Inform WifiDisplaySource of our premature death (wish). sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", kWhatSessionDead); notify->post(); mWeAreDead = true; } } // namespace android
media/libstagefright/wifi-display/source/PlaybackSession.h +3 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ private: sp<AMessage> mNotify; in_addr mInterfaceAddr; sp<IHDCP> mHDCP; bool mWeAreDead; int64_t mLastLifesignUs; Loading Loading @@ -205,6 +206,8 @@ private: status_t packetizeQueuedAccessUnits(); void notifySessionDead(); DISALLOW_EVIL_CONSTRUCTORS(PlaybackSession); }; Loading