Loading include/media/stagefright/MediaSync.h +8 −5 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,7 @@ class GraphicBuffer; class IGraphicBufferConsumer; class IGraphicBufferConsumer; class IGraphicBufferProducer; class IGraphicBufferProducer; struct MediaClock; struct MediaClock; struct VideoFrameScheduler; // MediaSync manages media playback and its synchronization to a media clock // MediaSync manages media playback and its synchronization to a media clock // source. It can be also used for video-only playback. // source. It can be also used for video-only playback. Loading Loading @@ -132,10 +133,9 @@ protected: private: private: enum { enum { kWhatDrainVideo = 'dVid', kWhatDrainVideo = 'dVid', kWhatCheckFrameAvailable = 'cFrA', }; }; static const int MAX_OUTSTANDING_BUFFERS = 2; // This is a thin wrapper class that lets us listen to // This is a thin wrapper class that lets us listen to // IConsumerListener::onFrameAvailable from mInput. // IConsumerListener::onFrameAvailable from mInput. class InputListener : public BnConsumerListener, class InputListener : public BnConsumerListener, Loading Loading @@ -194,6 +194,7 @@ private: sp<IGraphicBufferConsumer> mInput; sp<IGraphicBufferConsumer> mInput; sp<IGraphicBufferProducer> mOutput; sp<IGraphicBufferProducer> mOutput; int mUsageFlagsFromOutput; int mUsageFlagsFromOutput; uint32_t mMaxAcquiredBufferCount; // max acquired buffer count sp<AudioTrack> mAudioTrack; sp<AudioTrack> mAudioTrack; uint32_t mNativeSampleRateInHz; uint32_t mNativeSampleRateInHz; Loading @@ -202,6 +203,7 @@ private: int64_t mNextBufferItemMediaUs; int64_t mNextBufferItemMediaUs; List<BufferItem> mBufferItems; List<BufferItem> mBufferItems; sp<VideoFrameScheduler> mFrameScheduler; // Keep track of buffers received from |mInput|. This is needed because // Keep track of buffers received from |mInput|. This is needed because // it's possible the consumer of |mOutput| could return a different // it's possible the consumer of |mOutput| could return a different Loading Loading @@ -242,8 +244,9 @@ private: // onBufferReleasedByOutput releases a buffer back to the input. // onBufferReleasedByOutput releases a buffer back to the input. void onFrameAvailableFromInput(); void onFrameAvailableFromInput(); // Send |bufferItem| to the output for rendering. // Send |bufferItem| to the output for rendering. If this is not the only void renderOneBufferItem_l(const BufferItem &bufferItem); // buffer sent for rendering, check for any dropped frames in |checkInUs| us. void renderOneBufferItem_l(const BufferItem &bufferItem, int64_t checkInUs); // This implements the onBufferReleased callback from IProducerListener. // This implements the onBufferReleased callback from IProducerListener. // It gets called from an OutputListener. // It gets called from an OutputListener. Loading media/libmediaplayerservice/VideoFrameScheduler.h→include/media/stagefright/VideoFrameScheduler.h +5 −1 Original line number Original line Diff line number Diff line Loading @@ -39,6 +39,9 @@ struct VideoFrameScheduler : public RefBase { // returns the vsync period for the main display // returns the vsync period for the main display nsecs_t getVsyncPeriod(); nsecs_t getVsyncPeriod(); // returns the current frames-per-second, or 0.f if not primed float getFrameRate(); void release(); void release(); static const size_t kHistorySize = 8; static const size_t kHistorySize = 8; Loading @@ -54,8 +57,9 @@ private: void reset(float fps = -1); void reset(float fps = -1); // keep current estimate, but restart phase // keep current estimate, but restart phase void restart(); void restart(); // returns period // returns period or 0 if not yet primed nsecs_t addSample(nsecs_t time); nsecs_t addSample(nsecs_t time); nsecs_t getPeriod() const; private: private: nsecs_t mPeriod; nsecs_t mPeriod; Loading media/libmediaplayerservice/Android.mk +0 −1 Original line number Original line Diff line number Diff line Loading @@ -21,7 +21,6 @@ LOCAL_SRC_FILES:= \ StagefrightPlayer.cpp \ StagefrightPlayer.cpp \ StagefrightRecorder.cpp \ StagefrightRecorder.cpp \ TestPlayerStub.cpp \ TestPlayerStub.cpp \ VideoFrameScheduler.cpp \ LOCAL_SHARED_LIBRARIES := \ LOCAL_SHARED_LIBRARIES := \ libbinder \ libbinder \ Loading media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -29,8 +29,7 @@ #include <media/stagefright/MediaErrors.h> #include <media/stagefright/MediaErrors.h> #include <media/stagefright/MetaData.h> #include <media/stagefright/MetaData.h> #include <media/stagefright/Utils.h> #include <media/stagefright/Utils.h> #include <media/stagefright/VideoFrameScheduler.h> #include <VideoFrameScheduler.h> #include <inttypes.h> #include <inttypes.h> Loading media/libstagefright/Android.mk +1 −0 Original line number Original line Diff line number Diff line Loading @@ -64,6 +64,7 @@ LOCAL_SRC_FILES:= \ TimedEventQueue.cpp \ TimedEventQueue.cpp \ Utils.cpp \ Utils.cpp \ VBRISeeker.cpp \ VBRISeeker.cpp \ VideoFrameScheduler.cpp \ WAVExtractor.cpp \ WAVExtractor.cpp \ WVMExtractor.cpp \ WVMExtractor.cpp \ XINGSeeker.cpp \ XINGSeeker.cpp \ Loading Loading
include/media/stagefright/MediaSync.h +8 −5 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,7 @@ class GraphicBuffer; class IGraphicBufferConsumer; class IGraphicBufferConsumer; class IGraphicBufferProducer; class IGraphicBufferProducer; struct MediaClock; struct MediaClock; struct VideoFrameScheduler; // MediaSync manages media playback and its synchronization to a media clock // MediaSync manages media playback and its synchronization to a media clock // source. It can be also used for video-only playback. // source. It can be also used for video-only playback. Loading Loading @@ -132,10 +133,9 @@ protected: private: private: enum { enum { kWhatDrainVideo = 'dVid', kWhatDrainVideo = 'dVid', kWhatCheckFrameAvailable = 'cFrA', }; }; static const int MAX_OUTSTANDING_BUFFERS = 2; // This is a thin wrapper class that lets us listen to // This is a thin wrapper class that lets us listen to // IConsumerListener::onFrameAvailable from mInput. // IConsumerListener::onFrameAvailable from mInput. class InputListener : public BnConsumerListener, class InputListener : public BnConsumerListener, Loading Loading @@ -194,6 +194,7 @@ private: sp<IGraphicBufferConsumer> mInput; sp<IGraphicBufferConsumer> mInput; sp<IGraphicBufferProducer> mOutput; sp<IGraphicBufferProducer> mOutput; int mUsageFlagsFromOutput; int mUsageFlagsFromOutput; uint32_t mMaxAcquiredBufferCount; // max acquired buffer count sp<AudioTrack> mAudioTrack; sp<AudioTrack> mAudioTrack; uint32_t mNativeSampleRateInHz; uint32_t mNativeSampleRateInHz; Loading @@ -202,6 +203,7 @@ private: int64_t mNextBufferItemMediaUs; int64_t mNextBufferItemMediaUs; List<BufferItem> mBufferItems; List<BufferItem> mBufferItems; sp<VideoFrameScheduler> mFrameScheduler; // Keep track of buffers received from |mInput|. This is needed because // Keep track of buffers received from |mInput|. This is needed because // it's possible the consumer of |mOutput| could return a different // it's possible the consumer of |mOutput| could return a different Loading Loading @@ -242,8 +244,9 @@ private: // onBufferReleasedByOutput releases a buffer back to the input. // onBufferReleasedByOutput releases a buffer back to the input. void onFrameAvailableFromInput(); void onFrameAvailableFromInput(); // Send |bufferItem| to the output for rendering. // Send |bufferItem| to the output for rendering. If this is not the only void renderOneBufferItem_l(const BufferItem &bufferItem); // buffer sent for rendering, check for any dropped frames in |checkInUs| us. void renderOneBufferItem_l(const BufferItem &bufferItem, int64_t checkInUs); // This implements the onBufferReleased callback from IProducerListener. // This implements the onBufferReleased callback from IProducerListener. // It gets called from an OutputListener. // It gets called from an OutputListener. Loading
media/libmediaplayerservice/VideoFrameScheduler.h→include/media/stagefright/VideoFrameScheduler.h +5 −1 Original line number Original line Diff line number Diff line Loading @@ -39,6 +39,9 @@ struct VideoFrameScheduler : public RefBase { // returns the vsync period for the main display // returns the vsync period for the main display nsecs_t getVsyncPeriod(); nsecs_t getVsyncPeriod(); // returns the current frames-per-second, or 0.f if not primed float getFrameRate(); void release(); void release(); static const size_t kHistorySize = 8; static const size_t kHistorySize = 8; Loading @@ -54,8 +57,9 @@ private: void reset(float fps = -1); void reset(float fps = -1); // keep current estimate, but restart phase // keep current estimate, but restart phase void restart(); void restart(); // returns period // returns period or 0 if not yet primed nsecs_t addSample(nsecs_t time); nsecs_t addSample(nsecs_t time); nsecs_t getPeriod() const; private: private: nsecs_t mPeriod; nsecs_t mPeriod; Loading
media/libmediaplayerservice/Android.mk +0 −1 Original line number Original line Diff line number Diff line Loading @@ -21,7 +21,6 @@ LOCAL_SRC_FILES:= \ StagefrightPlayer.cpp \ StagefrightPlayer.cpp \ StagefrightRecorder.cpp \ StagefrightRecorder.cpp \ TestPlayerStub.cpp \ TestPlayerStub.cpp \ VideoFrameScheduler.cpp \ LOCAL_SHARED_LIBRARIES := \ LOCAL_SHARED_LIBRARIES := \ libbinder \ libbinder \ Loading
media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -29,8 +29,7 @@ #include <media/stagefright/MediaErrors.h> #include <media/stagefright/MediaErrors.h> #include <media/stagefright/MetaData.h> #include <media/stagefright/MetaData.h> #include <media/stagefright/Utils.h> #include <media/stagefright/Utils.h> #include <media/stagefright/VideoFrameScheduler.h> #include <VideoFrameScheduler.h> #include <inttypes.h> #include <inttypes.h> Loading
media/libstagefright/Android.mk +1 −0 Original line number Original line Diff line number Diff line Loading @@ -64,6 +64,7 @@ LOCAL_SRC_FILES:= \ TimedEventQueue.cpp \ TimedEventQueue.cpp \ Utils.cpp \ Utils.cpp \ VBRISeeker.cpp \ VBRISeeker.cpp \ VideoFrameScheduler.cpp \ WAVExtractor.cpp \ WAVExtractor.cpp \ WVMExtractor.cpp \ WVMExtractor.cpp \ XINGSeeker.cpp \ XINGSeeker.cpp \ Loading