Merge "Revert "media: lazy MediaCodec.release()"" into rvc-dev

This commit is contained in:
Wonsik Kim
2020-03-10 21:50:56 +00:00
committed by Android (Google) Code Review
2 changed files with 2 additions and 13 deletions

View File

@@ -242,13 +242,6 @@ void JMediaCodec::release() {
}); });
} }
void JMediaCodec::releaseAsync() {
if (mCodec != NULL) {
mCodec->releaseAsync();
}
mInitStatus = NO_INIT;
}
JMediaCodec::~JMediaCodec() { JMediaCodec::~JMediaCodec() {
if (mLooper != NULL) { if (mLooper != NULL) {
/* MediaCodec and looper should have been released explicitly already /* MediaCodec and looper should have been released explicitly already
@@ -1131,10 +1124,7 @@ static sp<JMediaCodec> getMediaCodec(JNIEnv *env, jobject thiz) {
} }
static void android_media_MediaCodec_release(JNIEnv *env, jobject thiz) { static void android_media_MediaCodec_release(JNIEnv *env, jobject thiz) {
sp<JMediaCodec> codec = getMediaCodec(env, thiz); setMediaCodec(env, thiz, NULL);
if (codec != NULL) {
codec->releaseAsync();
}
} }
static void throwCodecException(JNIEnv *env, status_t err, int32_t actionCode, const char *msg) { static void throwCodecException(JNIEnv *env, status_t err, int32_t actionCode, const char *msg) {
@@ -2807,7 +2797,7 @@ static void android_media_MediaCodec_native_setup(
static void android_media_MediaCodec_native_finalize( static void android_media_MediaCodec_native_finalize(
JNIEnv *env, jobject thiz) { JNIEnv *env, jobject thiz) {
setMediaCodec(env, thiz, NULL); android_media_MediaCodec_release(env, thiz);
} }
// MediaCodec.LinearBlock // MediaCodec.LinearBlock

View File

@@ -61,7 +61,6 @@ struct JMediaCodec : public AHandler {
void registerSelf(); void registerSelf();
void release(); void release();
void releaseAsync();
status_t enableOnFrameRenderedListener(jboolean enable); status_t enableOnFrameRenderedListener(jboolean enable);