diff options
author | Zhao Zhili <zhilizhao@tencent.com> | 2022-10-20 14:35:32 +0000 |
---|---|---|
committer | Zhao Zhili <zhilizhao@tencent.com> | 2022-11-21 23:55:57 +0800 |
commit | 3a5944696768e3b5680ae78d9d84ba9846050e61 (patch) | |
tree | 35e61b15349b1305fd0dc4071d3eaf85ca063b84 /libavcodec/mediacodecdec_common.c | |
parent | 2697f23f4e866a81ddcfca0c99a56ed14f93dc07 (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.c | 4 |
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); } } |