Commit graph

15 commits

Author SHA1 Message Date
Edward Hervey
f7337b7477 ffmpeg: Don't register elements for which we have no caps
We would previously register a whole bunch of encoder/decoder for which the caps
were ... "unknown/unknown".

Add a function to quickly check (without generating caps) whether a given
AVCodecID has a known mapping (which can include the {video|audio}/x-gst-av-*
ones) without generating the caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6237>
2024-07-25 12:14:50 +00:00
Seungha Yang
75d8dbc556 avauddec: Fix crash on stop()
GstFFMpegAudDec.context can be nullptr if decoder got closed
without opening new context. Note that we don't need to clear
AVCodecContext.extradata there since avcodec_free_context()
will do clear the data if needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7180>
2024-07-16 20:49:13 +09:00
Sebastian Dröge
73d0cac16c libav: Update AVCodecContext lifetime to work properly with ffmpeg 7
avcodec_close() is deprecated and it's not supported anymore to re-open
a codec, so we only ever allocate the codec in set_format() now and
always free it after usage.

As part of this, also fix various memory leaks in related code paths.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6505>
2024-07-08 14:31:39 +00:00
Edward Hervey
a1cbe351ec musepack: Prefer using FFmpeg musepack decoder/demuxer
* Bump the rank of the musepack v7/v8 FFmpeg demuxers to SECONDARY
* Bump the rank of the musepack v7/v8 FFmpeg audio decoders to SECONDARY
* Demote the rank of the musepackdec element to MARGINAL

This is for two reasons:
* The musepack library is no longer maintained, whereas the FFmpeg
  implementation can/will receive fixes
* The `musepackdec` implementation was a all-in-one "parsing and decoding" blob
  which doesn't play nicely with decodebin3 and others

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3033

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6074>
2024-02-09 12:15:14 +00:00
Edward Hervey
978b75b18a avauddec: Use proper version guard
Just like we do with avviddec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5931>
2024-01-17 17:24:49 +01:00
L. E. Segovia
f2c9d9baa1 libav: Port frame counting to frame_num
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5186>
2024-01-17 08:39:13 +00:00
L. E. Segovia
bbf6b4e634 libav: Port channel layout and counting to AVChannelLayout
Fixes #2833

Co-authored-by: Edward Hervey <edward@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5186>
2024-01-17 08:39:13 +00:00
Sebastian Dröge
236465e5d4 ffmpeg: avauddec/avviddec: Free packet side data after usage
As we don't use proper refcounting with AVPacket we have to manage this
ourselves.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2006

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4076>
2023-02-28 12:01:57 +00:00
Guillaume Desmottes
f7e1505a5e libav: avaudec: display flow return name instead of value
More convenient to read in logs. gstavviddec already does it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3700>
2023-01-09 13:25:05 +01:00
Sebastian Dröge
925715c734 av{aud,vid}dec: Report decoding errors to the base class
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1889>
2022-12-01 13:40:53 +00:00
Mathieu Duponchelle
235be306fd avauddec: address regression with WMA files ..
By outputting lead-in samples that FFmpeg now would like us to ignore,
and discarding trailing samples that it would now like us to output.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1474

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1348
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3117>
2022-10-06 01:03:10 +00:00
Tim-Philipp Müller
237b063843 avauddec: fix unnecessary reconfiguration if the audio layout isn't specified
It would constantly want to renegotiate (and spam the debug log) even
though the channel layout hasn't actually changed. We use the same
fallback in gst_ffmpegauddec_negotiate() already.

This happens with WMA files for example.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3103>
2022-10-01 09:28:40 +00:00
Carlos Rafael Giani
492dc666df avauddec: Add clipping meta support for gapless playback
Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1028>
2022-03-14 10:32:15 +02:00
Xi Ruoyao
6ea56e7fd3 gst-libav: fix build with ffmpeg-5.0.0
Latest ffmpeg has removed avcodec_get_context_defaults(), and its
documentation says a new AVCodecContext should be allocated for this
purpose.  The pointer returned by avcodec_find_decoder() is now
const-qualified so we also need to adjust for it.  And, AVCOL_RANGE_MPEG
is now rejected with strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1531>
2022-01-17 18:11:32 +08:00
Thibault Saunier
7a371e75b7 Move files from gst-libav into the "subprojects/gst-libav/" subdir 2021-09-24 16:15:08 -03:00
Renamed from ext/libav/gstavauddec.c (Browse further)