mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +00:00
video: make it possible to always override hardware decoding format
Mostly an obscure option for testing. But --videotoolbox-format can be deprecated, as it becomes redundant. We rely on the libavutil hwcontext implementation to reject invalid pixfmts, or not to blow up if they are incompatible.
This commit is contained in:
parent
23da3ed21a
commit
ac295960b8
@ -43,6 +43,8 @@ Interface changes
|
||||
- the --msg-level option now affects --log-file
|
||||
- drop "audio-out-detected-device" property - this was unavailable on all
|
||||
audio output drivers for quite a while (coreaudio used to provide it)
|
||||
- deprecate --videotoolbox-format (use --hwdec-image-format, which affects
|
||||
most other hwaccels)
|
||||
--- mpv 0.27.0 ---
|
||||
- drop previously deprecated --field-dominance option
|
||||
- drop previously deprecated "osd" command
|
||||
|
@ -835,6 +835,16 @@ Video
|
||||
The old alias ``--hwdec-preload`` has different behavior if the option value
|
||||
is ``no``.
|
||||
|
||||
``--hwdec-image-format=<name>``
|
||||
Set the internal pixel format used by hardware decoding via ``--hwdec``
|
||||
(default ``no``). The special value ``no`` selects an implementation
|
||||
specific standard format. Most decoder implementations support only one
|
||||
format, and will fail to initialize if the format is not supported.
|
||||
|
||||
Some implementations might support multiple formats. In particular,
|
||||
videotoolbox is known to require ``uyvy422`` for good performance on some
|
||||
older hardware.
|
||||
|
||||
``--videotoolbox-format=<name>``
|
||||
Set the internal pixel format used by ``--hwdec=videotoolbox`` on OSX. The
|
||||
choice of the format can influence performance considerably. On the other
|
||||
@ -845,6 +855,9 @@ Video
|
||||
Since mpv 0.25.0, ``no`` is an accepted value, which lets the decoder pick
|
||||
the format on newer FFmpeg versions (will use ``nv12`` on older versions).
|
||||
|
||||
Deprecated. Use ``--hwdec-image-format`` if you really need this. If both
|
||||
are specified, ``--hwdec-image-format`` wins.
|
||||
|
||||
``--panscan=<0.0-1.0>``
|
||||
Enables pan-and-scan functionality (cropping the sides of e.g. a 16:9
|
||||
video to make it fit a 4:3 display without black bands). The range
|
||||
|
@ -443,8 +443,10 @@ const m_option_t mp_opts[] = {
|
||||
OPT_CHOICE_C("hwdec", hwdec_api, 0, mp_hwdec_names),
|
||||
OPT_STRING("hwdec-codecs", hwdec_codecs, 0),
|
||||
#if HAVE_VIDEOTOOLBOX_HWACCEL
|
||||
OPT_IMAGEFORMAT("videotoolbox-format", videotoolbox_format, 0, .min = -1),
|
||||
OPT_IMAGEFORMAT("videotoolbox-format", videotoolbox_format, 0, .min = -1,
|
||||
.deprecation_message = "use --hwdec-image-format instead"),
|
||||
#endif
|
||||
OPT_IMAGEFORMAT("hwdec-image-format", hwdec_image_format, 0, .min = -1),
|
||||
|
||||
// -1 means auto aspect (prefer container size until aspect change)
|
||||
// 0 means square pixels
|
||||
|
@ -292,6 +292,7 @@ typedef struct MPOpts {
|
||||
int hwdec_api;
|
||||
char *hwdec_codecs;
|
||||
int videotoolbox_format;
|
||||
int hwdec_image_format;
|
||||
|
||||
int w32_priority;
|
||||
|
||||
|
@ -807,6 +807,8 @@ static int init_generic_hwaccel(struct dec_video *vd)
|
||||
|
||||
if (hwdec->image_format == IMGFMT_VIDEOTOOLBOX)
|
||||
av_sw_format = imgfmt2pixfmt(vd->opts->videotoolbox_format);
|
||||
if (vd->opts->hwdec_image_format)
|
||||
av_sw_format = imgfmt2pixfmt(vd->opts->hwdec_image_format);
|
||||
|
||||
if (av_sw_format == AV_PIX_FMT_NONE) {
|
||||
MP_VERBOSE(ctx, "Unsupported hw decoding format: %s\n",
|
||||
|
Loading…
Reference in New Issue
Block a user