diff options
author | Wei Jia <wjia@google.com> | 2015-05-07 18:08:27 -0700 |
---|---|---|
committer | Wei Jia <wjia@google.com> | 2015-05-11 12:50:00 -0700 |
commit | b6ea1292f8adae45d95c6f37d50c96534219b6d2 (patch) | |
tree | 6e7bb052c951853364226209bf4b3309ff542831 /include | |
parent | d975e98aac096b8b0ed600f39c18630ba234ef7d (diff) | |
download | frameworks_av-b6ea1292f8adae45d95c6f37d50c96534219b6d2.zip frameworks_av-b6ea1292f8adae45d95c6f37d50c96534219b6d2.tar.gz frameworks_av-b6ea1292f8adae45d95c6f37d50c96534219b6d2.tar.bz2 |
MediaSync: support changing surface on the fly.
Bug: 19666434
Change-Id: I5809df2d3bb0dd6b4a982f11d62c4b7a452ed6fb
Diffstat (limited to 'include')
-rw-r--r-- | include/media/stagefright/MediaSync.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/media/stagefright/MediaSync.h b/include/media/stagefright/MediaSync.h index d1d634d..1eef211 100644 --- a/include/media/stagefright/MediaSync.h +++ b/include/media/stagefright/MediaSync.h @@ -169,7 +169,7 @@ private: class OutputListener : public BnProducerListener, public IBinder::DeathRecipient { public: - OutputListener(const sp<MediaSync> &sync); + OutputListener(const sp<MediaSync> &sync, const sp<IGraphicBufferProducer> &output); virtual ~OutputListener(); // From IProducerListener @@ -180,6 +180,7 @@ private: private: sp<MediaSync> mSync; + sp<IGraphicBufferProducer> mOutput; }; // mIsAbandoned is set to true when the input or output dies. @@ -192,6 +193,7 @@ private: size_t mNumOutstandingBuffers; sp<IGraphicBufferConsumer> mInput; sp<IGraphicBufferProducer> mOutput; + int mUsageFlagsFromOutput; sp<AudioTrack> mAudioTrack; uint32_t mNativeSampleRateInHz; @@ -207,6 +209,12 @@ private: // and that could cause problem if the producer of |mInput| only // supports pre-registered buffers. KeyedVector<uint64_t, sp<GraphicBuffer> > mBuffersFromInput; + + // Keep track of buffers sent to |mOutput|. When a new output surface comes + // in, those buffers will be returned to input and old output surface will + // be disconnected immediately. + KeyedVector<uint64_t, sp<GraphicBuffer> > mBuffersSentToOutput; + sp<ALooper> mLooper; float mPlaybackRate; @@ -241,7 +249,7 @@ private: // It gets called from an OutputListener. // During this callback, we detach the buffer from the output, and release // it to the input. A blocked onFrameAvailable call will be allowed to proceed. - void onBufferReleasedByOutput(); + void onBufferReleasedByOutput(sp<IGraphicBufferProducer> &output); // Return |buffer| back to the input. void returnBufferToInput_l(const sp<GraphicBuffer> &buffer, const sp<Fence> &fence); |