If the dxva.h file comes from the contribs, it doesn't match the system
__MINGW64_VERSION_MAJOR. But we can detect it another way.
Similar to 20227126ef
This was added in libavcodec 60.26.100 [^1]. We require 58.54.100.
[^1]: 8238bc0b5e
(cherry picked from commit ff292b650e) (edited)
- the vaapi had less profiles
- the direct_va doesn't have HEVC EXT
- FF_PROFILE_UNKNOWN was used in more places
It's not supported in FFMpeg 8.0 since 60.40.100.
It used to be used with preallocated packet buffers with
the old encode API, but said API is no more and therefore
there is no reason for this to be public any more.
So deprecate it and use an internal replacement
for the encoders using it as an upper bound for the
size of their headers.
(cherry picked from commit dae7faa075)
avcodec_close() has been discouraged since 2016 [^1].
The internal closing we need under lock is done inside avcodec_free_context().
[^1] 1cc24d7495
(cherry picked from commit cda249f4ff)
p_codec->pix_fmts is deprecated.
It both cases the array was ending with AV_PIX_FMT_NONE.
(cherry picked from commit 5e11c8f387) (edited)
edited:
- 3.0 was using PixelFormat instead of AVPixelFormat
codecs sending 2 fields set the flag, otherwise it's one field.
ticks_per_frame is deprecated and will be removed in the next major API bump.
(cherry picked from commit 47b878be88) (rebased)
rebased:
- the code around is slightly different
The documentation says it's either 1 or 2.
I verified this is the case in FFmpeg 7.1. Only h264dec, mpeg12dec, mpegvideo_parser, vc1 set it.
(cherry picked from commit 2f5c860459) (edited)
edited:
- p_sys is accessed via dec->p_sys on 3.0
Co-authored-by: Steve Lhomme <robux4@ycbcr.xyz>
(cherry picked from commit 3abf93735d) (rebased)
rebased:
- on 3.0 the fmt_in is not a pointer
- the code around is slightly different due to the use of API_CHANNEL_LAYOUT
It was added in db6efa1815e217ed76f39aee8b15ee5c64698537 which
was libavutil 57.23.100 at the time but the minor version was not updated in
that commit so we check 57.24.100.
This is part of FFmpeg 5.1.
db6efa1815
(cherry picked from commit f237155887)
It was added in 548aeb93834b8425c86d1ce60fddc1d41805724d which
was libavcodec 59.23.100 at the time but the minor version was not updated in
that commit so we check 59.24.100.
This is part of FFmpeg 5.1.
548aeb9383
Co-authored-by: François Cartegnie <fcvlcdev@free.fr>
(cherry picked from commit 8fd918b878) (rebased)
rebased:
- on 3.0 fmt_in is not a pointer
It was added in c41899a3770cb4510e15b223fa34d129305b1589 which
was libavutil 57.23.100 at the time but the minor version was not updated in
that commit so we check 57.24.100.
The same check applies for av_channel_layout_copy() added in the same commit.
This is part of FFmpeg 5.1.
086a804806
(cherry picked from commit 195f0c9859) (rebased)
rebased:
- the code around is slightly different
refs #28667
(cherry picked from commit 41778535dc) (edited)
edited:
- on 3.0 the audio check was still using a LIBAVCODEC_VERSION_CHECK check
- the mux/demux checks were already there with different spaces
Also change pi_channels_src to be only AOUT_CHAN_MAX instead of same
size as mapping array.
(cherry picked from commit 0ff86bf8a2) (rebased)
rebased:
- the code around is slightly different
API signature changes introduced depending on a positive define,
then removed later, making it break prior or post removal...
(adapted from commit 503c04fad9)
channels and channel_layout has been deprecated in FFMPEG 5.1 and will be removed eventually
also always create the mapping, as ch_layout is always there
(cherry picked from commit b73dc8841d)
Since mingw-w64 20331109d1c90c19a510408ab119a76004bc41ea
(September 17th), mingw-w64 headers do provide these GUIDs.
(They come from Wine as upstream, from Wine commit
6dfb84f5cbdf30c1dc0775fd4dae821ee8705ad4 from September 10th.)
This change does break building with older mingw-w64 13 git
snapshots though.
This is the same fix as in c81cb6fb98
in the VLC 4.x branch, but adapted to the state of the source
in 3.0.x.
lavc expects a pointer that it will free in avcodec_free_context().
(cherry picked from commit d86c4c87aa)
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
If InitVideoDecCommon() fails, it's already cleaning the decoder,
release the context and freeing p_sys.
We must not do anything and just return the error.
(cherry picked from commit fecebe1588)
So far we did not need it. We should always have the format matching
the one we detected by the decoder. If we don't that means the packetizer
failed to reset the decoder.
(cherry picked from commit c901da645b)
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
(cherry picked from commit 5892a9106a) (edited)
edited:
- in 4.0 p_dec->fmt_in is a (const) pointer
- there's no VLC_ENOTSUP in 3.0
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
This is what is passed in the normal decoding case.
This fixes an issue where 10-bit sources don't play properly as we can't
tell from the Profile 0 is we're decoding in 8-bit or 10-bit.
(cherry picked from commit 1aa624e28d)
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
The container may lie but the size that libavcodec requests is the one it
will use. We need this size to probe the decoder in D3D11. There doesn't
seem to be a way to check the size support in dxva2.
Similar to e4cc2f846b but without setting
an output video_format_t.
(cherry picked from commit 906ffbaa63) (edited)
edited:
- 3.0 uses PixelFormat
- the code to handle b_hardware_only was already merged in 3.0
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>