1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-19 05:49:09 +02:00
FFmpeg/libavutil
Zhao Zhili 1263b0a6ca avutil/hwcontext_mediacodec: fix backward compatibility
AVMediaCodecDeviceContext without surface or native_window is
useless, it shouldn't be created at all. Such dummy AVHWDeviceContext
is allowed before, and it's used by mpv player. Creating a ANativeWindow
automatically breaks such usecases.

So disable creating a ANativeWindow by default. It can be enabled
via the create_window flag, or by set the AVDictionary of
av_hwdevice_ctx_create(). The downside is that

ffmpeg -hwaccel mediacodec -i input.mp4 \
	-c:a copy -c:v hevc_mediacodec output.mp4

use ByteBuffer mode which isn't as efficient as before. The upside
is libavfilter works now, which should be less surprise.

To enable create_window on ffmpeg command line, use
ffmpeg -hwaccel mediacodec \
	-init_hw_device mediacodec=mediacodec,create_window=1 \
	-i input.mp4 -c:a copy -c:v hevc_mediacodec output.mp4

Users should know what it is to enable create_window. It should
be OK to take sometime to figure out the option. And there are comments
inside hwcontext_mediacodec.h to help user figure it out.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-26 23:31:37 +08:00
..
2021-04-27 10:43:13 -03:00
2022-09-13 16:50:43 -03:00
2022-02-24 12:56:49 +01:00
2022-10-17 09:55:19 +02:00
2022-11-06 08:26:50 +01:00
2022-02-24 12:56:49 +01:00
2021-04-27 10:43:13 -03:00
2021-07-22 14:34:31 +02:00
2021-07-22 14:34:31 +02:00
2021-07-22 14:34:31 +02:00
2022-10-17 09:56:47 +02:00
2021-07-22 14:34:31 +02:00
2022-02-24 12:56:49 +01:00
2021-07-21 16:35:27 +02:00
2021-07-21 16:35:27 +02:00
2021-10-02 17:13:57 +02:00
2021-07-22 14:34:31 +02:00
2022-10-17 09:51:47 +02:00
2021-04-27 10:43:13 -03:00
2021-07-22 14:34:31 +02:00
2022-12-07 10:22:02 +01:00
2022-03-15 09:42:29 -03:00
2021-07-22 14:34:31 +02:00
2021-07-22 14:34:31 +02:00
2021-07-22 14:34:31 +02:00
2022-09-13 16:50:43 -03:00
2021-07-22 14:34:31 +02:00
2022-10-17 09:51:47 +02:00
2022-11-25 15:54:33 +01:00
2022-11-24 15:58:35 +01:00
2021-11-19 16:47:28 +01:00