Loading media/jni/android_media_MediaCodec.cpp +12 −11 Original line number Diff line number Diff line Loading @@ -211,9 +211,9 @@ void JMediaCodec::registerSelf() { } void JMediaCodec::release() { std::call_once(mReleaseFlag, [this] { if (mCodec != NULL) { mCodec->release(); mCodec.clear(); mInitStatus = NO_INIT; } Loading @@ -222,10 +222,11 @@ void JMediaCodec::release() { mLooper->stop(); mLooper.clear(); } }); } JMediaCodec::~JMediaCodec() { if (mCodec != NULL || mLooper != NULL) { if (mLooper != NULL) { /* MediaCodec and looper should have been released explicitly already * in setMediaCodec() (see comments in setMediaCodec()). * Loading media/jni/android_media_MediaCodec.h +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ #ifndef _ANDROID_MEDIA_MEDIACODEC_H_ #define _ANDROID_MEDIA_MEDIACODEC_H_ #include <mutex> #include "jni.h" #include <media/MediaAnalyticsItem.h> Loading Loading @@ -156,6 +158,7 @@ private: sp<ALooper> mLooper; sp<MediaCodec> mCodec; AString mNameAtCreation; std::once_flag mReleaseFlag; sp<AMessage> mCallbackNotification; sp<AMessage> mOnFrameRenderedNotification; Loading Loading
media/jni/android_media_MediaCodec.cpp +12 −11 Original line number Diff line number Diff line Loading @@ -211,9 +211,9 @@ void JMediaCodec::registerSelf() { } void JMediaCodec::release() { std::call_once(mReleaseFlag, [this] { if (mCodec != NULL) { mCodec->release(); mCodec.clear(); mInitStatus = NO_INIT; } Loading @@ -222,10 +222,11 @@ void JMediaCodec::release() { mLooper->stop(); mLooper.clear(); } }); } JMediaCodec::~JMediaCodec() { if (mCodec != NULL || mLooper != NULL) { if (mLooper != NULL) { /* MediaCodec and looper should have been released explicitly already * in setMediaCodec() (see comments in setMediaCodec()). * Loading
media/jni/android_media_MediaCodec.h +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ #ifndef _ANDROID_MEDIA_MEDIACODEC_H_ #define _ANDROID_MEDIA_MEDIACODEC_H_ #include <mutex> #include "jni.h" #include <media/MediaAnalyticsItem.h> Loading Loading @@ -156,6 +158,7 @@ private: sp<ALooper> mLooper; sp<MediaCodec> mCodec; AString mNameAtCreation; std::once_flag mReleaseFlag; sp<AMessage> mCallbackNotification; sp<AMessage> mOnFrameRenderedNotification; Loading