summaryrefslogtreecommitdiff
path: root/libavcodec/mediacodecdec_common.c
diff options
context:
space:
mode:
authorZhao Zhili <zhilizhao@tencent.com>2022-10-20 14:35:32 +0000
committerZhao Zhili <zhilizhao@tencent.com>2022-11-21 23:55:57 +0800
commit3a5944696768e3b5680ae78d9d84ba9846050e61 (patch)
tree35e61b15349b1305fd0dc4071d3eaf85ca063b84 /libavcodec/mediacodecdec_common.c
parent2697f23f4e866a81ddcfca0c99a56ed14f93dc07 (diff)
avcodec/mediacodec: add ANativeWindow support
ANativeWindow can be used without JVM.
Diffstat (limited to 'libavcodec/mediacodecdec_common.c')
-rw-r--r--libavcodec/mediacodecdec_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c
index ae82efaa0a..80089439ea 100644
--- a/libavcodec/mediacodecdec_common.c
+++ b/libavcodec/mediacodecdec_common.c
@@ -589,14 +589,14 @@ int ff_mediacodec_dec_init(AVCodecContext *avctx, MediaCodecDecContext *s,
if (device_ctx->type == AV_HWDEVICE_TYPE_MEDIACODEC) {
if (device_ctx->hwctx) {
AVMediaCodecDeviceContext *mediacodec_ctx = (AVMediaCodecDeviceContext *)device_ctx->hwctx;
- s->surface = ff_mediacodec_surface_ref(mediacodec_ctx->surface, avctx);
+ s->surface = ff_mediacodec_surface_ref(mediacodec_ctx->surface, mediacodec_ctx->native_window, avctx);
av_log(avctx, AV_LOG_INFO, "Using surface %p\n", s->surface);
}
}
}
if (!s->surface && user_ctx && user_ctx->surface) {
- s->surface = ff_mediacodec_surface_ref(user_ctx->surface, avctx);
+ s->surface = ff_mediacodec_surface_ref(user_ctx->surface, NULL, avctx);
av_log(avctx, AV_LOG_INFO, "Using surface %p\n", s->surface);
}
}