Loading include/media/IRemoteDisplay.h +3 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,9 @@ class IRemoteDisplay : public IInterface public: DECLARE_META_INTERFACE(RemoteDisplay); virtual status_t pause() = 0; virtual status_t resume() = 0; // Disconnects the remote display and stops listening for new connections. virtual status_t dispose() = 0; }; Loading media/libmedia/IRemoteDisplay.cpp +31 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ namespace android { enum { DISPOSE = IBinder::FIRST_CALL_TRANSACTION, PAUSE, RESUME, }; class BpRemoteDisplay: public BpInterface<IRemoteDisplay> Loading @@ -33,6 +35,20 @@ public: { } virtual status_t pause() { Parcel data, reply; data.writeInterfaceToken(IRemoteDisplay::getInterfaceDescriptor()); remote()->transact(PAUSE, data, &reply); return reply.readInt32(); } virtual status_t resume() { Parcel data, reply; data.writeInterfaceToken(IRemoteDisplay::getInterfaceDescriptor()); remote()->transact(RESUME, data, &reply); return reply.readInt32(); } status_t dispose() { Parcel data, reply; Loading @@ -55,6 +71,21 @@ status_t BnRemoteDisplay::onTransact( reply->writeInt32(dispose()); return NO_ERROR; } case PAUSE: { CHECK_INTERFACE(IRemoteDisplay, data, reply); reply->writeInt32(pause()); return OK; } case RESUME: { CHECK_INTERFACE(IRemoteDisplay, data, reply); reply->writeInt32(resume()); return OK; } default: return BBinder::onTransact(code, data, reply, flags); } Loading media/libmediaplayerservice/RemoteDisplay.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,14 @@ RemoteDisplay::RemoteDisplay( RemoteDisplay::~RemoteDisplay() { } status_t RemoteDisplay::pause() { return mSource->pause(); } status_t RemoteDisplay::resume() { return mSource->resume(); } status_t RemoteDisplay::dispose() { mSource->stop(); Loading media/libmediaplayerservice/RemoteDisplay.h +2 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ struct WifiDisplaySource; struct RemoteDisplay : public BnRemoteDisplay { RemoteDisplay(const sp<IRemoteDisplayClient> &client, const char *iface); virtual status_t pause(); virtual status_t resume(); virtual status_t dispose(); protected: Loading media/libstagefright/wifi-display/source/MediaPuller.cpp +32 −2 Original line number Diff line number Diff line Loading @@ -34,7 +34,8 @@ MediaPuller::MediaPuller( : mSource(source), mNotify(notify), mPullGeneration(0), mIsAudio(false) { mIsAudio(false), mPaused(false) { sp<MetaData> meta = source->getFormat(); const char *mime; CHECK(meta->findCString(kKeyMIMEType, &mime)); Loading Loading @@ -71,6 +72,14 @@ void MediaPuller::stopAsync(const sp<AMessage> ¬ify) { msg->post(); } void MediaPuller::pause() { (new AMessage(kWhatPause, id()))->post(); } void MediaPuller::resume() { (new AMessage(kWhatResume, id()))->post(); } void MediaPuller::onMessageReceived(const sp<AMessage> &msg) { switch (msg->what()) { case kWhatStart: Loading @@ -95,7 +104,6 @@ void MediaPuller::onMessageReceived(const sp<AMessage> &msg) { uint32_t replyID; CHECK(msg->senderAwaitsResponse(&replyID)); response->postReply(replyID); break; } Loading Loading @@ -130,6 +138,16 @@ void MediaPuller::onMessageReceived(const sp<AMessage> &msg) { MediaBuffer *mbuf; status_t err = mSource->read(&mbuf); if (mPaused) { if (err == OK) { mbuf->release(); mbuf = NULL; } schedulePull(); break; } if (err != OK) { if (err == ERROR_END_OF_STREAM) { ALOGI("stream ended."); Loading Loading @@ -176,6 +194,18 @@ void MediaPuller::onMessageReceived(const sp<AMessage> &msg) { break; } case kWhatPause: { mPaused = true; break; } case kWhatResume: { mPaused = false; break; } default: TRESPASS(); } Loading Loading
include/media/IRemoteDisplay.h +3 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,9 @@ class IRemoteDisplay : public IInterface public: DECLARE_META_INTERFACE(RemoteDisplay); virtual status_t pause() = 0; virtual status_t resume() = 0; // Disconnects the remote display and stops listening for new connections. virtual status_t dispose() = 0; }; Loading
media/libmedia/IRemoteDisplay.cpp +31 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ namespace android { enum { DISPOSE = IBinder::FIRST_CALL_TRANSACTION, PAUSE, RESUME, }; class BpRemoteDisplay: public BpInterface<IRemoteDisplay> Loading @@ -33,6 +35,20 @@ public: { } virtual status_t pause() { Parcel data, reply; data.writeInterfaceToken(IRemoteDisplay::getInterfaceDescriptor()); remote()->transact(PAUSE, data, &reply); return reply.readInt32(); } virtual status_t resume() { Parcel data, reply; data.writeInterfaceToken(IRemoteDisplay::getInterfaceDescriptor()); remote()->transact(RESUME, data, &reply); return reply.readInt32(); } status_t dispose() { Parcel data, reply; Loading @@ -55,6 +71,21 @@ status_t BnRemoteDisplay::onTransact( reply->writeInt32(dispose()); return NO_ERROR; } case PAUSE: { CHECK_INTERFACE(IRemoteDisplay, data, reply); reply->writeInt32(pause()); return OK; } case RESUME: { CHECK_INTERFACE(IRemoteDisplay, data, reply); reply->writeInt32(resume()); return OK; } default: return BBinder::onTransact(code, data, reply, flags); } Loading
media/libmediaplayerservice/RemoteDisplay.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,14 @@ RemoteDisplay::RemoteDisplay( RemoteDisplay::~RemoteDisplay() { } status_t RemoteDisplay::pause() { return mSource->pause(); } status_t RemoteDisplay::resume() { return mSource->resume(); } status_t RemoteDisplay::dispose() { mSource->stop(); Loading
media/libmediaplayerservice/RemoteDisplay.h +2 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ struct WifiDisplaySource; struct RemoteDisplay : public BnRemoteDisplay { RemoteDisplay(const sp<IRemoteDisplayClient> &client, const char *iface); virtual status_t pause(); virtual status_t resume(); virtual status_t dispose(); protected: Loading
media/libstagefright/wifi-display/source/MediaPuller.cpp +32 −2 Original line number Diff line number Diff line Loading @@ -34,7 +34,8 @@ MediaPuller::MediaPuller( : mSource(source), mNotify(notify), mPullGeneration(0), mIsAudio(false) { mIsAudio(false), mPaused(false) { sp<MetaData> meta = source->getFormat(); const char *mime; CHECK(meta->findCString(kKeyMIMEType, &mime)); Loading Loading @@ -71,6 +72,14 @@ void MediaPuller::stopAsync(const sp<AMessage> ¬ify) { msg->post(); } void MediaPuller::pause() { (new AMessage(kWhatPause, id()))->post(); } void MediaPuller::resume() { (new AMessage(kWhatResume, id()))->post(); } void MediaPuller::onMessageReceived(const sp<AMessage> &msg) { switch (msg->what()) { case kWhatStart: Loading @@ -95,7 +104,6 @@ void MediaPuller::onMessageReceived(const sp<AMessage> &msg) { uint32_t replyID; CHECK(msg->senderAwaitsResponse(&replyID)); response->postReply(replyID); break; } Loading Loading @@ -130,6 +138,16 @@ void MediaPuller::onMessageReceived(const sp<AMessage> &msg) { MediaBuffer *mbuf; status_t err = mSource->read(&mbuf); if (mPaused) { if (err == OK) { mbuf->release(); mbuf = NULL; } schedulePull(); break; } if (err != OK) { if (err == ERROR_END_OF_STREAM) { ALOGI("stream ended."); Loading Loading @@ -176,6 +194,18 @@ void MediaPuller::onMessageReceived(const sp<AMessage> &msg) { break; } case kWhatPause: { mPaused = true; break; } case kWhatResume: { mPaused = false; break; } default: TRESPASS(); } Loading