Commit graph

1430 commits

Author SHA1 Message Date
Sebastian Dröge
935c21a9a9 avcfg: Override type of bitrate property from int64 to int
See https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/41#note_142808

The switch to the new ffmpeg property system changed the type of the
bitrate property from int to int64, which potentially breaks many
existing applications at runtime as properties are usually set via
g_object_set().

As such, override the type to int until GStreamer 2.0.
2019-04-09 16:56:20 +03:00
Aaron Boxer
b2cc8a57d4 avviddec: do not add 708 caption meta if already exists
(this is only used for CEA 708 raw data). another element
such as mpegvideoparse may have already added the meta.
2019-04-01 17:11:36 -04:00
Mathieu Duponchelle
be579c426d avvidenc: pass Closed Caption metadata to libav 2019-03-23 00:27:55 +01:00
Tim-Philipp Müller
ef8a1bdd90 avauddec: fix decoding of APE and Cook audio
.. and other formats where ffmpeg gives us multiple
subframes per input frame.

Since we now support non-interleaved audio, we can't
just concat buffers any more. Also, audio metas won't
be combined when buffers are merged, so when we push
out the combined buffer we'll look at the meta describing
only the first subframe and think it covers the whole
frame leading to stutter/gaps in the output.

We could fix this by copying the output data into a new
buffer when we merge buffers, but that's suboptimal, so
let's add some API to GstAudioDecoder to push out subframes
and use that instead.

https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/49
2019-03-04 11:54:15 +00:00
Guillaume Desmottes
1d293764e5 avdemux: fix negative pts if start_time is bigger than the ts
The start time is supposed to be the ts of the first frame.
FFmpeg uses fractions to represent timestamps and the start time may use a
different base than the frame pts. So we may end up having the start
time bigger than the pts because of rounding when converting to gst ts.

See https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/51
for details.
2019-02-21 08:56:34 +01:00
Seungha Yang
a2c88ec9da avcfg: Fix AVOptionRanges leak
It must be freed with av_opt_freep_ranges as documented.
2019-01-13 00:47:07 +09:00
Edward Hervey
9d41d2747b codecmap: Add mapping for Voxware metasound
Allows actually decoding such streams :)
2018-11-08 16:33:57 +01:00
Nirbheek Chauhan
21a18e22e1 avcfg: Ensure that ternary operator always evaluates to int64
When building with MSVC, if the 3rd operator is a double, the entire
expression always promoted double, and is then cast to int64.

When TRUE, this evaluates to (gint64) (gdouble) (INT64_MAX)
which overflows to INT64_MIN on MSVC, but not on C99 compilers.

This causes us to fail the g_return_if_fail inside g_param_spec_int64
when built with MSVC.
2018-10-16 04:29:37 +05:30
Arun Raghavan
ef106350d4 avdemux: Expose IFF container support
This exposes support for the "iff" demuxer. This is a general purpose
format, and the reason to expose this now is to allow reading DSD data
(which is supported via a variant called DSDIFF).

More information at:
  https://wiki.multimedia.cx/index.php?title=IFF
  https://www.loc.gov/preservation/digital/formats/fdd/fdd000245.shtml
2018-10-12 19:23:21 +05:30
Nirbheek Chauhan
26585686b0 meson: Generate a pkgconfig file for gstlibav
This matches all other plugins in the other gstreamer repos. This is
also necessary for generating the correct libtool archive (.la) files
in Cerbero which are needed for static linking on Android and iOS.
2018-10-09 18:14:23 +05:30
Edward Hervey
46cc79c43a avviddec: Remove unneeded check
frame is always valid in this function (but wasn't before the
refactoring from a few months ago).

CID #1439540
2018-09-21 16:01:53 +02:00
Edward Hervey
143aa80cdf avcfg: Simplify code
The existence of 'opt' is checked, the remainder of the code can therefore
rely on it being valid.

CID #1439537
2018-09-21 11:30:58 +02:00
Mathieu Duponchelle
ff3a8f6627 decoders: fix draining
https://bugzilla.gnome.org/show_bug.cgi?id=796900
2018-07-31 19:13:25 +02:00
Georg Ottinger
962d2a78fe avmux: Place pva case after generic case
In the function gst_ffmpeg_formatid_get_codecids() in the if / else if
construct the special case !strcmp (format_name, "pva") should be
handled before the generic case (plugin->audio_codec !=
AV_CODEC_ID_NONE) || (plugin->video_codec != AV_CODEC_ID_NONE)
This patch fixes the ordering.

I stumbled accorss this issue while adding a new format to
gst_ffmpeg_formatid_get_codecids()

https://bugzilla.gnome.org/show_bug.cgi?id=796738
2018-07-26 16:22:30 -04:00
George Kiagiadakis
4596249496 avauddec: add support for decoding in non-interleaved layout
This removes the internal interleave loop and always negotiates
the native output layout of the libav decoder. Users can use
audioconvert to interleave if necessary.

Special care has been taken to leave the encoder unaffected by
the changes in avcodecmap, since GstAudioEncoder doesn't support
the non-interleaved layout yet.

https://bugzilla.gnome.org/show_bug.cgi?id=705977
2018-07-23 16:16:10 +03:00
Seungha Yang
db82350245 libav: Fix symbol redefine build error
https://bugzilla.gnome.org/show_bug.cgi?id=796827
2018-07-19 12:21:01 +01:00
Tim-Philipp Müller
c881f831c3 Remove obsolete #if 0-ed code 2018-07-18 15:44:23 +01:00
Tim-Philipp Müller
6aa62114c5 Remove swscale plugin code
This has been disabled for 5.5 years, time to remove it.
2018-07-17 00:57:34 +01:00
Edward Hervey
a3c72b2148 avcfg: Properly initalize GValue
.. to the expected property value type.
2018-07-16 08:44:45 +02:00
Mathieu Duponchelle
ad1f3a914b avcfg: actually remove call to g_object_getv
(Sorry about that)
2018-07-13 18:03:27 +02:00
Mathieu Duponchelle
dd37a553ac av*dec: Ignore decoding errors
We were ignoring these before the port to 4.0, interpreting them
as GST_FLOW_ERROR / GST_ELEMENT_ERROR causes check failures.

We should start using GST_*_DECODER_ERROR in latter commits,
for now simply restore the previous behaviour.
2018-07-13 17:24:07 +02:00
Mathieu Duponchelle
70d9f923dc avcfg: use g_object_get_property, not g_object_getv
I simply confused those two, we didn't need g_object_getv
here anyway.
2018-07-13 17:21:25 +02:00
Mathieu Duponchelle
c34dd9bb1a avcfg: ignore some generic properties
We expose profile, level and colorimetry / colorspaces through
caps.

https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:28 +02:00
Mathieu Duponchelle
9c0dd8ef60 avcfg: add skip support to overrides system
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:28 +02:00
Mathieu Duponchelle
e1d0d73fc0 auddec: fix luck-based sinkpad access
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:28 +02:00
Mathieu Duponchelle
8b6516d5c5 Remove obsolete scale and resample sources
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:28 +02:00
Mathieu Duponchelle
8f1543838b avvidenc: port to send_frame / receive_packet
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
be9b6969cb avviddec: fix invalid alignment calculations.
avcodec_align_dimensions2 uses context->pix_fmt to make its
calculations, we thus need to make sure it is adequately set
when calling it.

Fixes:

gst-launch-1.0 videotestsrc ! video/x-raw, width=1920, height=1080 \
! avenc_mpeg4 ! avdec_mpeg4 ! xvimagesink

This showed invalid writes under valgrind, then segfault.

https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
8562f10969 avaudenc: port to send_frame / receive_packet
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
3e8709d21a avmux: fix remaining warnings
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
066acfa922 avauddec: fix remaining warnings
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
6243197c82 avauddec: port to new decoding API
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
8f3bc07e09 avaudenc: further cleanup
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
59b9e66542 avaudenc: install options generically
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
965cd81603 avviddec: fix signed/unsigned comparisons
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
d191fb2e50 avvidec: port to new decoding API
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
c214205430 gstav: stop calling deprecated registration methods
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
1035d6c820 auddec: stop using deprecated getters
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
2ec542f7c2 av_oformat_next (deprecated) -> av_muxer_iterate
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
bc7160dd47 av_iformat_next (deprecated) -> av_demuxer_iterate
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
d059922f56 avauddec: remove obsolete version check
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
e4bf6147a0 av_codec_next (deprecated) -> av_codec_iterate
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
37b58e0753 avdemux: port to AVCodecParameters
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:27 +02:00
Mathieu Duponchelle
4116117873 avmux: port to AVCodecParameters
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:26 +02:00
Mathieu Duponchelle
4f28ea23eb Remove all uses of AVPicture
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:26 +02:00
Mathieu Duponchelle
9cc57a74d8 avaudenc: remove obsolete setting of rc_strategy
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:26 +02:00
Mathieu Duponchelle
1e4529ced2 Refactor avcfg / avvidenc
We were previously installing hardcoded properties for all
video encoders, refactor to instead use FFmpeg's AVOption API.

avvidenc still exposes a few properties related to the pass
mechanism: while the AVOption API allows specifying both passes
as flags at the same time, this is not practical in GStreamer's
context, where passes need to be run separately using a stats file.

https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:26 +02:00
Nicolas Dufresne
d8dfa4657b avviddec: Stop using deperated EDGE API
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:26 +02:00
Nicolas Dufresne
aa724e2f14 Use AV_ namespace for all CODEC_ macro
The remaining use of CODEC_ are codec flags that has been moved into the
new codec private properties or have been deperated. Will be fixed in
later patches.

https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:26 +02:00
Nicolas Dufresne
7b3e41e20b Use AV_ namespace for INPUT_BUFFER_PADDING_SIZE
https://bugzilla.gnome.org/show_bug.cgi?id=792900
2018-07-13 00:53:26 +02:00