Loading include/media/stagefright/SurfaceMediaSource.h +5 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,9 @@ public: // To be called before start() status_t setMaxAcquiredBufferCount(size_t count); // To be called before start() status_t setUseAbsoluteTimestamps(); protected: // Implementation of the BufferQueue::ConsumerListener interface. These Loading Loading @@ -212,6 +215,8 @@ private: size_t mMaxAcquiredBufferCount; bool mUseAbsoluteTimestamps; // mFrameAvailableCondition condition used to indicate whether there // is a frame available for dequeuing Condition mFrameAvailableCondition; Loading media/libstagefright/SurfaceMediaSource.cpp +10 −3 Original line number Diff line number Diff line Loading @@ -46,8 +46,8 @@ SurfaceMediaSource::SurfaceMediaSource(uint32_t bufferWidth, uint32_t bufferHeig mNumFramesReceived(0), mNumFramesEncoded(0), mFirstFrameTimestamp(0), mMaxAcquiredBufferCount(4) // XXX double-check the default { mMaxAcquiredBufferCount(4), // XXX double-check the default mUseAbsoluteTimestamps(false) { ALOGV("SurfaceMediaSource"); if (bufferWidth == 0 || bufferHeight == 0) { Loading Loading @@ -188,6 +188,13 @@ status_t SurfaceMediaSource::setMaxAcquiredBufferCount(size_t count) { return OK; } status_t SurfaceMediaSource::setUseAbsoluteTimestamps() { ALOGV("setUseAbsoluteTimestamps"); Mutex::Autolock lock(mMutex); mUseAbsoluteTimestamps = true; return OK; } status_t SurfaceMediaSource::stop() { Loading Loading @@ -298,7 +305,7 @@ status_t SurfaceMediaSource::read( MediaBuffer **buffer, } // check for the timing of this buffer if (mNumFramesReceived == 0) { if (mNumFramesReceived == 0 && !mUseAbsoluteTimestamps) { mFirstFrameTimestamp = item.mTimestamp; // Initial delay if (mStartTimeNs > 0) { Loading Loading
include/media/stagefright/SurfaceMediaSource.h +5 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,9 @@ public: // To be called before start() status_t setMaxAcquiredBufferCount(size_t count); // To be called before start() status_t setUseAbsoluteTimestamps(); protected: // Implementation of the BufferQueue::ConsumerListener interface. These Loading Loading @@ -212,6 +215,8 @@ private: size_t mMaxAcquiredBufferCount; bool mUseAbsoluteTimestamps; // mFrameAvailableCondition condition used to indicate whether there // is a frame available for dequeuing Condition mFrameAvailableCondition; Loading
media/libstagefright/SurfaceMediaSource.cpp +10 −3 Original line number Diff line number Diff line Loading @@ -46,8 +46,8 @@ SurfaceMediaSource::SurfaceMediaSource(uint32_t bufferWidth, uint32_t bufferHeig mNumFramesReceived(0), mNumFramesEncoded(0), mFirstFrameTimestamp(0), mMaxAcquiredBufferCount(4) // XXX double-check the default { mMaxAcquiredBufferCount(4), // XXX double-check the default mUseAbsoluteTimestamps(false) { ALOGV("SurfaceMediaSource"); if (bufferWidth == 0 || bufferHeight == 0) { Loading Loading @@ -188,6 +188,13 @@ status_t SurfaceMediaSource::setMaxAcquiredBufferCount(size_t count) { return OK; } status_t SurfaceMediaSource::setUseAbsoluteTimestamps() { ALOGV("setUseAbsoluteTimestamps"); Mutex::Autolock lock(mMutex); mUseAbsoluteTimestamps = true; return OK; } status_t SurfaceMediaSource::stop() { Loading Loading @@ -298,7 +305,7 @@ status_t SurfaceMediaSource::read( MediaBuffer **buffer, } // check for the timing of this buffer if (mNumFramesReceived == 0) { if (mNumFramesReceived == 0 && !mUseAbsoluteTimestamps) { mFirstFrameTimestamp = item.mTimestamp; // Initial delay if (mStartTimeNs > 0) { Loading