Loading media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp +10 −4 Original line number Diff line number Diff line Loading @@ -106,16 +106,17 @@ NuPlayer::Decoder::~Decoder() { releaseAndResetMediaBuffers(); } sp<AMessage> NuPlayer::Decoder::getStats() const { sp<AMessage> NuPlayer::Decoder::getStats() { Mutex::Autolock autolock(mStatsLock); mStats->setInt64("frames-total", mNumFramesTotal); mStats->setInt64("frames-dropped-input", mNumInputFramesDropped); mStats->setInt64("frames-dropped-output", mNumOutputFramesDropped); mStats->setFloat("frame-rate-total", mFrameRateTotal); // i'm mutexed right now. // make our own copy, so we aren't victim to any later changes. sp<AMessage> copiedStats = mStats->dup(); return copiedStats; } Loading Loading @@ -362,13 +363,17 @@ void NuPlayer::Decoder::onConfigure(const sp<AMessage> &format) { CHECK_EQ((status_t)OK, mCodec->getOutputFormat(&mOutputFormat)); CHECK_EQ((status_t)OK, mCodec->getInputFormat(&mInputFormat)); { Mutex::Autolock autolock(mStatsLock); mStats->setString("mime", mime.c_str()); mStats->setString("component-name", mComponentName.c_str()); } if (!mIsAudio) { int32_t width, height; if (mOutputFormat->findInt32("width", &width) && mOutputFormat->findInt32("height", &height)) { Mutex::Autolock autolock(mStatsLock); mStats->setInt32("width", width); mStats->setInt32("height", height); } Loading Loading @@ -799,6 +804,7 @@ void NuPlayer::Decoder::handleOutputFormatChange(const sp<AMessage> &format) { int32_t width, height; if (format->findInt32("width", &width) && format->findInt32("height", &height)) { Mutex::Autolock autolock(mStatsLock); mStats->setInt32("width", width); mStats->setInt32("height", height); } Loading media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ struct NuPlayer::Decoder : public DecoderBase { const sp<Surface> &surface = NULL, const sp<CCDecoder> &ccDecoder = NULL); virtual sp<AMessage> getStats() const; virtual sp<AMessage> getStats(); // sets the output surface of video decoders. virtual status_t setVideoSurface(const sp<Surface> &surface); Loading media/libmediaplayerservice/nuplayer/NuPlayerDecoderBase.h +2 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ struct NuPlayer::DecoderBase : public AHandler { void signalResume(bool notifyComplete); void initiateShutdown(); virtual sp<AMessage> getStats() const { virtual sp<AMessage> getStats() { return mStats; } Loading Loading @@ -88,6 +88,7 @@ protected: int32_t mBufferGeneration; bool mPaused; sp<AMessage> mStats; Mutex mStatsLock; private: enum { Loading Loading
media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp +10 −4 Original line number Diff line number Diff line Loading @@ -106,16 +106,17 @@ NuPlayer::Decoder::~Decoder() { releaseAndResetMediaBuffers(); } sp<AMessage> NuPlayer::Decoder::getStats() const { sp<AMessage> NuPlayer::Decoder::getStats() { Mutex::Autolock autolock(mStatsLock); mStats->setInt64("frames-total", mNumFramesTotal); mStats->setInt64("frames-dropped-input", mNumInputFramesDropped); mStats->setInt64("frames-dropped-output", mNumOutputFramesDropped); mStats->setFloat("frame-rate-total", mFrameRateTotal); // i'm mutexed right now. // make our own copy, so we aren't victim to any later changes. sp<AMessage> copiedStats = mStats->dup(); return copiedStats; } Loading Loading @@ -362,13 +363,17 @@ void NuPlayer::Decoder::onConfigure(const sp<AMessage> &format) { CHECK_EQ((status_t)OK, mCodec->getOutputFormat(&mOutputFormat)); CHECK_EQ((status_t)OK, mCodec->getInputFormat(&mInputFormat)); { Mutex::Autolock autolock(mStatsLock); mStats->setString("mime", mime.c_str()); mStats->setString("component-name", mComponentName.c_str()); } if (!mIsAudio) { int32_t width, height; if (mOutputFormat->findInt32("width", &width) && mOutputFormat->findInt32("height", &height)) { Mutex::Autolock autolock(mStatsLock); mStats->setInt32("width", width); mStats->setInt32("height", height); } Loading Loading @@ -799,6 +804,7 @@ void NuPlayer::Decoder::handleOutputFormatChange(const sp<AMessage> &format) { int32_t width, height; if (format->findInt32("width", &width) && format->findInt32("height", &height)) { Mutex::Autolock autolock(mStatsLock); mStats->setInt32("width", width); mStats->setInt32("height", height); } Loading
media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h +1 −1 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ struct NuPlayer::Decoder : public DecoderBase { const sp<Surface> &surface = NULL, const sp<CCDecoder> &ccDecoder = NULL); virtual sp<AMessage> getStats() const; virtual sp<AMessage> getStats(); // sets the output surface of video decoders. virtual status_t setVideoSurface(const sp<Surface> &surface); Loading
media/libmediaplayerservice/nuplayer/NuPlayerDecoderBase.h +2 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ struct NuPlayer::DecoderBase : public AHandler { void signalResume(bool notifyComplete); void initiateShutdown(); virtual sp<AMessage> getStats() const { virtual sp<AMessage> getStats() { return mStats; } Loading Loading @@ -88,6 +88,7 @@ protected: int32_t mBufferGeneration; bool mPaused; sp<AMessage> mStats; Mutex mStatsLock; private: enum { Loading