This makes it consistent with all the other uses of such defines in
the source code, which are tested for their existence rather than the
actual value.
When avcodec is found, it does not really add much value to check for
the avcodec header. avutil is required by it, so checking for that
is not needed either.
For avformat, avcodec is required, therefore checking for
avcodec and avutil headers is not needed there either.
Conditionally including those in avcommon_compat.h does not
seem needed at all, as it won't compile without these headers
anyway.
the `NeAACDecSetConfiguration()` function copies attributes from the given
config object to the actual config held within the decoder context object.
it validates each config attribute before copying it, immediately returning
zero if the attribute is invalid.
we should use the return value to check that our config was successfully
written.
00d1f50eff introduced a regression for PPC
since the `signal()` based detection for altivec in libmpeg2 is not thread
safe unlike our own. here we restore use of our own detection for PPC,
bypassing libmpeg2's unsafe auto-detection otherwise triggered in
`mpeg2_init()`.
fixes#25948.
this:
- enables SSE2 (when available at runtime), which was added 13 years ago
([1]) but we never enabled use of it until now.
- removes use of the MMX/MMXEXT availability testing functions, helping
pave the way towards our goal of purging all MMX/MMXEXT code.
- makes the code cleaner and reduces maintenance burden.
- allows us to pick up use of new SIMD variant additions, if any more are
ever added (unlikely) without having to explicitly add code to enable it.
as pointed out in review, the `mpeg2_init()` call makes a call to
`mpeg2_accel()` with `MPEG2_ACCEL_DETECT` itself, so there is no need to
make such a call ourselves, thus the `mpeg2_init()` call alone is
sufficient. the entire code block can thus be safely removed.
[1]: c80d1dc2f1
a call made to `x264_param_default[_mpeg2]()` triggers cpu feature
detection built into the x262/x264 lib, setting up the default value of the
cpu flags 'param' attribute. the block of code deleted here pointlessly
tried to subsequently remove a certain subset of flags from this where the
vlc detection found those features to not be available.
this dates back to before VLC v1.2 when we had core options that gave users
a means of disabling use of individual SIMD variants - this block of code
would apply such user choices to the use of the x262/x264 lib.
those options were removed in 1081b213dc for
v1.2, but blocks of code like this were left behind. some adjustments to
the cpu detection code were done for v1.3, which touched these code blocks,
but seems to not have involved evaluating their necessity.
without those old options, this block of code is utterly pointless,
achieving nothing.
This fixes building with the very latest nightly version of mingw-w64.
In 7fb7c9f6e4,
the MFVideoFormat_L8 mediatype GUID was added, conflicting with our
own definition with the same name.
Contrary to all other hardware decoders, vaapi can't work with a
hwaccel_context anymore. It requires a hw_device_ctx or a hw_frames_ctx
to work.
This first implementation use a hw_device_ctx and let avcodec handle its
frames pool. It is also possible to handle hw_frames_ctx ourself to get
more controls.
Note: Most of the code could be reused by other va modules if we decide
to a hw_device_ctx.
Fixes#25707
The future vaapi va module will create AVFrame from hwframes_ctx with a
frame->buf[0] set internally by avcodec. If this is the case, don't
override it and use opaque_ref (an user field) to keep the reference on
the VLC picture_t.
frame->buf[0] must be valid but doesn't have to contain data since the
data will be accessed via frame->data[] directly.
Furthermore, all va modules are only setting frame->data[3], therefore,
frame->data[0] was always NULL.
av_init_packet is deprecated in new major version of ffmpeg.
Also use av_packet_free instead of unref.
Use av_packet_clone and AVPacket * in vlc_av_packet_t.
Since 1fa05cf406 and
57323ddadb, flush and release have been
made asynchronous and logger object might have been destroyed while we
use the mediacodec API, leading to crash.
Since ffmpeg 4.4 specifying channel layout or channel number is required
to call `avcodec_send_frame()` without error.
This is new requirement is due to a change in the avcodec internal API
brought by 827d6fe73d2f5472c1c2128eb14fab6a4db29032 (ffmpeg repo). They
now call `av_frame_ref` which needs the channels fields to be valid.
Fixes: #25851
Sidedata AV_PKT_DATA_QUALITY_STATS has been present since 2015 on
version 56.51.100. Also previous coded_frame->pict_type doesn't seem to
be present anymore in ffmpeg master.
The config "advanced" flag was unused and has been removed by
6a7a137f7b.
It has been removed from many add_*() macros, but not all. Remove it
from the remaining macros.