platform/upstream/gstreamer.git
4 years agoshout2: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:14:17 +0000 (19:14 +0100)]
shout2: Use G_DECLARE_FINAL_TYPE

4 years agoraw1394: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:11:52 +0000 (19:11 +0100)]
raw1394: Use G_DECLARE_FINAL_TYPE

4 years agoqt: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:06:50 +0000 (19:06 +0100)]
qt: Use G_DECLARE_FINAL_TYPE

4 years agopulse: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:00:18 +0000 (19:00 +0100)]
pulse: Use G_DECLARE_FINAL_TYPE

4 years agompg123: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 17:54:33 +0000 (18:54 +0100)]
mpg123: Use G_DECLARE_FINAL_TYPE

4 years agolibpng: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 17:52:57 +0000 (18:52 +0100)]
libpng: Use G_DECLARE_FINAL_TYPE

4 years agolibcaca: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 17:49:53 +0000 (18:49 +0100)]
libcaca: Use G_DECLARE_FINAL_TYPE

4 years agolame: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 17:40:28 +0000 (18:40 +0100)]
lame: Use G_DECLARE_FINAL_TYPE

4 years agojack: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sat, 14 Mar 2020 16:52:38 +0000 (17:52 +0100)]
jack: Use G_DECLARE_FINAL_TYPE

4 years agogtk: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sat, 14 Mar 2020 16:43:50 +0000 (17:43 +0100)]
gtk: Use G_DECLARE_FINAL_TYPE

4 years agogdk_pixbuf: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Fri, 13 Mar 2020 17:47:49 +0000 (18:47 +0100)]
gdk_pixbuf: Use G_DECLARE_FINAL_TYPE

4 years agoflax: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Fri, 13 Mar 2020 17:42:38 +0000 (18:42 +0100)]
flax: Use G_DECLARE_FINAL_TYPE

4 years agodv: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Fri, 13 Mar 2020 17:39:38 +0000 (18:39 +0100)]
dv: Use G_DECLARE_FINAL_TYPE

4 years agocairo: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Thu, 12 Mar 2020 18:24:57 +0000 (19:24 +0100)]
cairo: Use G_DECLARE_FINAL_TYPE

4 years agoaalib: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Thu, 12 Mar 2020 18:20:42 +0000 (19:20 +0100)]
aalib: Use G_DECLARE_FINAL_TYPE

4 years agotests: rtp-payloading: add minimal vp8/vp9 rtp payloading/depayloading test
Tim-Philipp Müller [Thu, 12 Mar 2020 16:55:44 +0000 (16:55 +0000)]
tests: rtp-payloading: add minimal vp8/vp9 rtp payloading/depayloading test

4 years agortpvp8pay, rtpvp9pay: fix caps leak in set_caps()
Stian Selnes [Fri, 19 Oct 2018 14:17:17 +0000 (16:17 +0200)]
rtpvp8pay, rtpvp9pay: fix caps leak in set_caps()

4 years agovideomixer: Don't leak peer caps
Edward Hervey [Thu, 12 Mar 2020 10:22:56 +0000 (11:22 +0100)]
videomixer: Don't leak peer caps

4 years agoimagesequencesrc: Cleanup and add some features
Thibault Saunier [Tue, 11 Feb 2020 19:19:15 +0000 (16:19 -0300)]
imagesequencesrc: Cleanup and add some features

* Implement the GstURIHandlerInterface
* Rework the locking
* Implement backward seeking handling
* Generate documentation

4 years agoAdd an imagesequencesrc element to stream sequence of images
Fabian Orccon [Sun, 10 Apr 2016 02:25:32 +0000 (02:25 +0000)]
Add an imagesequencesrc element to stream sequence of images

See: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/121

4 years agov4l2src: decrease gst_v4l2src_create log verbosity
Gordon Hart [Thu, 5 Mar 2020 16:55:44 +0000 (08:55 -0800)]
v4l2src: decrease gst_v4l2src_create log verbosity

Lower the verbosity of the 'sync' log message emitted
each buffer from gst_v4l2src_create down to LOG(6)
from INFO(4). This brings the logging behavior of
v4l2src closer to the GStreamer guidelines, which
recommend the INFO level be reserved for rare or
one-off messages.

4 years agoqtdemux: Add support for AC4
yychao [Tue, 10 Mar 2020 09:19:46 +0000 (17:19 +0800)]
qtdemux: Add support for AC4

The caps received from qtdemux for AC-4 content are audio/x-gst-fourcc-ac_4

Based on patch by: Savinderjit Kaur

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/413

4 years agoimagefreeze: handle reconfigure events on the srcpad
Matthew Waters [Tue, 10 Mar 2020 10:07:12 +0000 (21:07 +1100)]
imagefreeze: handle reconfigure events on the srcpad

4 years agoimagefreeze: properly ignore setting caps failures
Matthew Waters [Thu, 5 Mar 2020 11:47:16 +0000 (22:47 +1100)]
imagefreeze: properly ignore setting caps failures

Ignore the return value of gst_pad_set_caps() so that setcaps will set a
framerate that is usable.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/705

4 years agoimagefreeze: don't fail sending sticky events downstream
Matthew Waters [Thu, 5 Mar 2020 11:45:32 +0000 (22:45 +1100)]
imagefreeze: don't fail sending sticky events downstream

They will be repropagated anyway.

4 years agovideocrop: Add support for Y41B and Y42B
Markus Ebner [Mon, 9 Mar 2020 22:31:09 +0000 (23:31 +0100)]
videocrop: Add support for Y41B and Y42B

4 years agovideocrop: Add support for Y444
Markus Ebner [Mon, 9 Mar 2020 22:25:03 +0000 (23:25 +0100)]
videocrop: Add support for Y444

- Refactored the planar transform method to support all video formats
  that are stored planar, independent of the used subsampling
- Added support for Y444

4 years agovideocrop: Use G_VALUE_INIT to initialize GValues
Markus Ebner [Mon, 9 Mar 2020 22:23:50 +0000 (23:23 +0100)]
videocrop: Use G_VALUE_INIT to initialize GValues

4 years agojpegdec: Configure JPEG chroma-siting for YUV formats
Sebastian Dröge [Fri, 28 Feb 2020 17:35:34 +0000 (19:35 +0200)]
jpegdec: Configure JPEG chroma-siting for YUV formats

4 years agortph26x: Use gst_memory_map() instead of gst_buffer_map() in avc mode
Ognyan Tonchev [Thu, 6 Feb 2020 08:23:24 +0000 (09:23 +0100)]
rtph26x: Use gst_memory_map() instead of gst_buffer_map() in avc mode

gst_buffer_map () results in memcopying when a GstBuffer contains
more than one GstMemory and when AVC (length-prefixed) alignment is used.
This has quite an impact on performance on systems with limited amount of
resources. With this patch the whole GstBuffer will not be mapped at once,
instead each individual GstMemory will be iterated and mapped separately.

4 years agoqmlgl: ensure Qt defines GLsync to fix compile on some platforms
Milian Wolff [Tue, 26 Nov 2019 14:08:20 +0000 (15:08 +0100)]
qmlgl: ensure Qt defines GLsync to fix compile on some platforms

By explictly including QtGui/qopengl.h we force the code path that
defines GLsync in the Qt-specific way. Without that, some platforms
failed to compile the qmlgl plugin, since neither Qt nor gstreamer
defined GLsync then, leading to e.g.:

```
make[4]: Entering directory '/.../gst-plugins-good-1.16.1/ext/qt'
  CXX      libgstqmlgl_la-qtitem.lo
In file included from gstqtgl.h:32,
                 from qtitem.h:27,
                 from qtitem.cc:28:
/.../usr/include/gstreamer-1.0/
gst/gl/gstglfuncs.h:93:17: error: expected identifier before ‘*’ token
   ret (GSTGLAPI *name) args;
                 ^
/.../usr/include/gstreamer-1.0/
gst/gl/glprototypes/sync.h:27:1: note: in expansion of macro
‘GST_GL_EXT_FUNCTION’
 GST_GL_EXT_FUNCTION (GLsync, FenceSync,
 ^~~~~~~~~~~~~~~~~~~
```

4 years agortptwcc: make RTPTWCCManager a GObject
Havard Graff [Mon, 2 Mar 2020 12:50:55 +0000 (13:50 +0100)]
rtptwcc: make RTPTWCCManager a GObject

4 years agortpjitterbuffer: fix stalling when resetting timers
Havard Graff [Wed, 4 Mar 2020 10:17:16 +0000 (11:17 +0100)]
rtpjitterbuffer: fix stalling when resetting timers

When calling gst_rtp_jitter_buffer_reset you pass in a seqnum.

This is considered the starting-point for a new stream.

However, the old behavior would unref this buffer, basically lying to
the thread that is pushing out buffers saying that it can expect
this buffer, when it would never arrive. The resulting effect being no
more buffer pushed out of the jitterbuffer, and it would buffer
incoming data indefinitely.

By instead inserting the buffer in the gap_packets queue, the _reset()
function will take responsibility for using that as the first buffer
of the new stream.

Fixes #703

4 years agosplitmux: Avoid negative DTS
Jan Schmidt [Thu, 20 Feb 2020 15:14:11 +0000 (02:14 +1100)]
splitmux: Avoid negative DTS

In order to concatenate fragments, splitmuxsrc offsets
the start of each fragment PTS to 0 to align it with the
previous file. This means that DTS can go negative for
the first fragment, with really bad results.

Add a fixed offset to outgoing timestamp ranges to
avoid that.

4 years agoqtmux: Remove warning in the log for mono video
Jan Schmidt [Tue, 3 Mar 2020 16:43:51 +0000 (03:43 +1100)]
qtmux: Remove warning in the log for mono video

Vanilla mono video was generating a spurious warning into the debug log
that's just misleading. Handle mono caps explicitly to avoid the warning.

4 years agodeinterlace: add alternate support
Guillaume Desmottes [Mon, 27 Jan 2020 06:59:18 +0000 (12:29 +0530)]
deinterlace: add alternate support

In this mode each field is carried using its own buffer.
Allow deinterlace to negotiate caps with the Interlaced feature and
adjust the algorithm fetching lines.

Fix #620

4 years agodeinterlace: add wrapper to get field lines from history
Guillaume Desmottes [Mon, 3 Feb 2020 07:38:39 +0000 (13:08 +0530)]
deinterlace: add wrapper to get field lines from history

No semantic change so far, will be used to implement alternate support.

4 years agodeinterlace: stop checking line index boundaries
Guillaume Desmottes [Tue, 4 Feb 2020 11:18:21 +0000 (16:48 +0530)]
deinterlace: stop checking line index boundaries

The LINE2() macro already prevents out of bound indexes using CLAMP_HI()
and CLAMP_LOW().

4 years agodeinterlace: fix video info on output frames
Guillaume Desmottes [Mon, 20 Jan 2020 07:00:12 +0000 (12:30 +0530)]
deinterlace: fix video info on output frames

Output frames used to have their interlace mode set to the same one as
the input. This breaks their field and comp heights when deinterlacing
an alternate stream.

4 years agodeinterlace: use output caps to compute buffer size
Guillaume Desmottes [Tue, 14 Jan 2020 09:21:07 +0000 (14:51 +0530)]
deinterlace: use output caps to compute buffer size

In interlace-mode=alternate the input buffers have half the size of the
output ones as each field has its own buffer.

4 years agoflacparse: fix broken reordering of flac metadata
Jennifer Berringer [Sat, 29 Feb 2020 13:10:56 +0000 (08:10 -0500)]
flacparse: fix broken reordering of flac metadata

Each FLAC metadata block starts with a flag denoting whether it is the
last metadata block. The existing flacparse code moves any existing
VORBISCOMMENT block to immediately follow the STREAMINFO block without
changing any block's last-metadata-block flag. If no VORBISCOMMENT block
exists, it created one with the last-metadata-block flag set to true.
This results in gstflacdec sometimes giving bad headers to libflac when
trying to play perfectly valid FLAC files depending on the file's
metadata ordering. Depending on the contents of the other metadata
blocks, current versions of libflac may or may not return
FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER when given this broken
metadata. This is most noticeable with files that have a large cover art
image attached where VORBISCOMMENT is the very last metadata block with
no PADDING afterwards.

This patch changes that behavior so that:

1. For FLAC files that already have a VORBISCOMMENT block, the metadata
   order is preserved.
2. For FLAC files that do not have a VORBISCOMMENT block, the generated
   dummy VORBISCOMMENT is placed immediately after STREAMINFO and
   inherits the last-metadata-block flag from STREAMINFO.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/484

4 years agotests: flvmux: Instead of using the testclock, just send eos event for drain
Yeongjin Jeong [Thu, 27 Feb 2020 05:50:51 +0000 (14:50 +0900)]
tests: flvmux: Instead of using the testclock, just send eos event for drain

When using the testclock for determining clock in test, it is sometimes observed
that the clock entry is not registered in time by the aggregator. So deadlock occurs
between the aggregator and the test thread.

4 years agoqtdemux: Try to infer useful header values for raw audio if the sound sample descript...
Sebastian Dröge [Fri, 28 Feb 2020 12:23:51 +0000 (14:23 +0200)]
qtdemux: Try to infer useful header values for raw audio if the sound sample descriptions contain zero values

4 years agoqtdemux: Also use the enda atom for determining endianess of in32, fl32 and fl64...
Sebastian Dröge [Fri, 28 Feb 2020 12:00:51 +0000 (14:00 +0200)]
qtdemux: Also use the enda atom for determining endianess of in32, fl32 and fl64 formats

Previously it was only used for in24.

4 years agoqtdemux: Fix up header information for various fixed-format raw audio formats
Sebastian Dröge [Fri, 28 Feb 2020 11:59:42 +0000 (13:59 +0200)]
qtdemux: Fix up header information for various fixed-format raw audio formats

Sometimes the headers contain useless, wrong or zero values for e.g. the
sample size with these formats. There's only a single valid value for
them so let's set these instead.

4 years agoqtdemux: Don't print "unhandled type" warnings for various other raw audio fourccs
Sebastian Dröge [Fri, 28 Feb 2020 11:59:06 +0000 (13:59 +0200)]
qtdemux: Don't print "unhandled type" warnings for various other raw audio fourccs

4 years agoqtdemux: Add some more raw audio fourccs to the header instead of duplicating them
Sebastian Dröge [Fri, 28 Feb 2020 11:57:37 +0000 (13:57 +0200)]
qtdemux: Add some more raw audio fourccs to the header instead of duplicating them

4 years agortpjitterbuffer: Don't use glib format modifiers with sscanf
Nirbheek Chauhan [Tue, 25 Feb 2020 15:44:54 +0000 (21:14 +0530)]
rtpjitterbuffer: Don't use glib format modifiers with sscanf

We do not have a way to know the format modifiers to use with string
functions provided by the system. G_GUINT64_FORMAT and other string
modifiers only work for glib string formatting functions. We cannot
use them for string functions provided by the stdlib. See:
https://developer.gnome.org/glib/stable/glib-Basic-Types.html#glib-Basic-Types.description

```
../gst/rtpmanager/gstrtpjitterbuffer.c: In function 'gst_jitter_buffer_sink_parse_caps':
../gst/rtpmanager/gstrtpjitterbuffer.c:1523:32: error: unknown conversion type character 'l' in format [-Werror=format=]
           || sscanf (mediaclk, "direct=%" G_GUINT64_FORMAT, &clock_offset) != 1)
                                ^~~~~~~~~~
In file included from /home/nirbheek/cerbero/build/dist/windows_x86/include/glib-2.0/glib/gtypes.h:32,
                 from /home/nirbheek/cerbero/build/dist/windows_x86/include/glib-2.0/glib/galloca.h:32,
                 from /home/nirbheek/cerbero/build/dist/windows_x86/include/glib-2.0/glib.h:30,
                 from /home/nirbheek/cerbero/build/dist/windows_x86/include/gstreamer-1.0/gst/gst.h:27,
                 from /home/nirbheek/cerbero/build/dist/windows_x86/include/gstreamer-1.0/gst/rtp/gstrtpbuffer.h:27,
                 from ../gst/rtpmanager/gstrtpjitterbuffer.c:108:
/home/nirbheek/cerbero/build/dist/windows_x86/lib/glib-2.0/include/glibconfig.h:69:28: note: format string is defined here
 #define G_GUINT64_FORMAT "llu"
                            ^
../gst/rtpmanager/gstrtpjitterbuffer.c:1523:32: error: too many arguments for format [-Werror=format-extra-args]
           || sscanf (mediaclk, "direct=%" G_GUINT64_FORMAT, &clock_offset) != 1)
                                ^~~~~~~~~~
```

See also: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/379

4 years agoqtmux: Add support for 8k resolutions in prefill mode with ProRes
Sebastian Dröge [Mon, 24 Feb 2020 13:25:07 +0000 (15:25 +0200)]
qtmux: Add support for 8k resolutions in prefill mode with ProRes

4 years agortpjitterbuffer: Include string.h for memcpy() / memset()
Sebastian Dröge [Tue, 25 Feb 2020 09:06:43 +0000 (11:06 +0200)]
rtpjitterbuffer: Include string.h for memcpy() / memset()

Usually something else is pulling it in somehow already, but not on
Windows.

4 years agortpsession: fix crash when no extension-header present for twcc
Håvard Graff [Mon, 24 Feb 2020 13:06:27 +0000 (13:06 +0000)]
rtpsession: fix crash when no extension-header present for twcc

4 years agomatroska-mux: Fix incorrect rounding of timestamps
Johan Bjäreholt [Fri, 21 Feb 2020 08:34:30 +0000 (09:34 +0100)]
matroska-mux: Fix incorrect rounding of timestamps

Previously we saved the buffer_timestamp straight into
mux->cluster_time. Since the cluster time saved into the file does not
have as high precision as GstClockTime depending on the timecodescale
the rounding of relative_timestamp was invalid as mux->cluster_time
which it was calculated relative to was not equal to the cluster time
written to the matroska file.

Example of "mkvinfo -v" of how it looks before and after this change in
an scenario where previously timestamps got out of order because of this
issue.

Notice the timestamp of the SimpleBlock right before and right after the
Cluster now being in order. The consequence of this however is that the
cluster timestamp is not necessarily the same as the timestamp of the
first buffer in the cluster however (in case it's rounded up).

Before

| + SimpleBlock (track number 1, 1 frame(s), timecode 126.922s = 00:02:06.922)
|  + Frame with size 432
| + SimpleBlock (track number 2, 1 frame(s), timecode 126.933s = 00:02:06.933)
|  + Frame with size 329
| + SimpleBlock (track number 2, 1 frame(s), timecode 126.955s = 00:02:06.955)
|  + Frame with size 333
|+ Cluster
| + Cluster timecode: 126.954s
| + Cluster previous size: 97344
| + SimpleBlock (key, track number 1, 1 frame(s), timecode 126.954s = 00:02:06.954)
|  + Frame with size 61239
| + SimpleBlock (track number 2, 1 frame(s), timecode 126.975s = 00:02:06.975)
|  + Frame with size 338

After

| + SimpleBlock (track number 1, 1 frame(s), timecode 135.456s = 00:02:15.456)
|  + Frame with size 2260
| + SimpleBlock (track number 2, 1 frame(s), timecode 135.468s = 00:02:15.468)
|  + Frame with size 332
| + SimpleBlock (track number 2, 1 frame(s), timecode 135.490s = 00:02:15.490)
|  + Frame with size 335
|+ Cluster
| + Cluster timecode: 135.489s
| + Cluster previous size: 158758
| + SimpleBlock (key, track number 1, 1 frame(s), timecode 135.490s = 00:02:15.490)
|  + Frame with size 88070
| + SimpleBlock (track number 2, 1 frame(s), timecode 135.511s = 00:02:15.511)
|  + Frame with size 336

4 years agosouphttpsrc: Fix cookies property
Jake Barnes [Wed, 19 Feb 2020 04:59:19 +0000 (15:59 +1100)]
souphttpsrc: Fix cookies property

Disable session sharing and cookie jar when cookies property is set.

The cookie jar actually replaces or removes any existing Cookie header
set on the message, so the cookies property was effectively being
ignored. There doesn't appear to be a way to inject the cookies into the
jar without having to specify matching domains etc., so it's not
possible to simulate the old behaviour of unconditionally sending the
cookies with all messages, besides simply disabling the cookie jar.

4 years agortspsrc: remove useless function calls
Stefano Buora [Thu, 20 Feb 2020 08:06:10 +0000 (09:06 +0100)]
rtspsrc: remove useless function calls

Comparing gst_rtspsrc_loop_interleaved and gst_rtspsrc_loop_udp, and investigating on timeout issues, it sounds like a piece of code has been originally copied from udp to the interleaved one. The timeout variable is never used inside the interleaved one. No side effect has been seen in the removed function calls.

The debug message removed is pointless as the timeout used is "src->tcp_timeout" that is fixed.

The presence of the two timeout drove my team in investigating if the reference to the tcp_timeout was correct (it is). Hence we removed the misleading reference to the local timeout variable.

4 years agortpbin: fix typo setting max-dropout/misorder-time
Matthew Waters [Thu, 20 Feb 2020 02:43:13 +0000 (13:43 +1100)]
rtpbin: fix typo setting max-dropout/misorder-time

we were setting the max-dropout-time to the value of the
max-misorder-time which by default has a factor of 30 difference in
value.

4 years agoqtdemux: Parse VP Codec Configuration Box
Seungha Yang [Wed, 19 Feb 2020 11:27:54 +0000 (20:27 +0900)]
qtdemux: Parse VP Codec Configuration Box

The VP Codec Configuration Box (vpcC) contains vp9 profile and
colorimetry information. Especially the profile information might
be useful for downstream to select capable decoder element.

4 years agotests: flvmux: Add test for rollover timestamp
Yeongjin Jeong [Tue, 18 Feb 2020 09:36:36 +0000 (18:36 +0900)]
tests: flvmux: Add test for rollover timestamp

The timestamps that exceed uint32 maximum value should be handled to rollover.

4 years agoflvmux: Support rollover in timestamp
Yeongjin Jeong [Tue, 18 Feb 2020 05:58:00 +0000 (14:58 +0900)]
flvmux: Support rollover in timestamp

For live streams, if we keep the stream for a long time, the timestamp
will be larger than max_uint32. In that case, timestamp should be handled
as a rollover timestamp rather than a backward timestamp.

4 years agortpjitterbuffer: don't use the timer-object after JBUF_UNLOCK
Havard Graff [Mon, 17 Feb 2020 14:03:28 +0000 (15:03 +0100)]
rtpjitterbuffer: don't use the timer-object after JBUF_UNLOCK

It could have been freed (rtp_timer_free) in the meantime.

4 years agortpmanager: Google Transport-Wide Congestion Control RTP Extension
Havard Graff [Sat, 29 Jun 2019 16:06:11 +0000 (18:06 +0200)]
rtpmanager: Google Transport-Wide Congestion Control RTP Extension

Generating and parsing the RTCP-messages described in:
https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01

4 years agortpfunnel: various cleanups
Håvard Graff [Fri, 14 Feb 2020 10:08:05 +0000 (10:08 +0000)]
rtpfunnel: various cleanups

* Organize GstRtpFunnelPad and GstRtpFunnel separately
* Use G_GNUC_UNUSED instead of (void) casts
* Don't call an event "caps"
* Use semicolons after GST_END_TEST (helps gst-indent)

4 years agoqtdemux: Merge sample tables for raw audio streams with one container sample per...
Sebastian Dröge [Wed, 29 Jan 2020 21:51:45 +0000 (23:51 +0200)]
qtdemux: Merge sample tables for raw audio streams with one container sample per audio sample

Instead of having chunks with one sample per raw audio sample, have
chunks with a single sample that contains lots of raw audio samples. If
necessary these are still split again later when reading the stream.

With this we are allocating a lot less memory for the parsed sample
tables and can play files that previously triggered our limit of 200MB
for the sample table. For example, one file here would previously
allocate 3.5GB for the sample table and now only allocates 70KB.

4 years agoqtdemux: Add a minimum buffer size for raw audio to not output one buffer per frame
Sebastian Dröge [Mon, 13 Jan 2020 09:55:42 +0000 (11:55 +0200)]
qtdemux: Add a minimum buffer size for raw audio to not output one buffer per frame

Outputting 48000 buffers per second is not a good idea performance-wise.
If a container sample is less than 1024 raw audio frames, combine
multiple samples to get at least 1024 raw audio samples as long as
they're stored contiguous in the file.

For the other direction, if a container sample contains more than 4096
samples there is already code for splitting them up.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=692750

4 years agortspsrc: fix requested range
Mathieu Duponchelle [Tue, 11 Feb 2020 20:52:41 +0000 (21:52 +0100)]
rtspsrc: fix requested range

When the server replies with a range "now-", it is presumed to
be a "live" stream and we should request a similar range.

This was the case prior to my refactoring to make use of
gst_rtsp_range_to_string in 5f1a732bc7b76a6f1b8aa5f26b6e76fbca0261c7,
this commit restores the behaviour for that case.

4 years agortpptdemux: set payload to caps inside gst_rtp_pt_demux_get_caps
Mikhail Fludkov [Thu, 13 Jul 2017 11:49:07 +0000 (13:49 +0200)]
rtpptdemux: set payload to caps inside gst_rtp_pt_demux_get_caps

Refactoring to remove duplicate code and add test

4 years agortpptdemux: Fix debug to use GST_DEBUG_OBJECT
Stian Selnes [Thu, 16 Mar 2017 19:57:54 +0000 (20:57 +0100)]
rtpptdemux: Fix debug to use GST_DEBUG_OBJECT

4 years agortpbin: use max-streams on rtpssrcdemux
Mikhail Fludkov [Wed, 14 Sep 2016 14:49:26 +0000 (16:49 +0200)]
rtpbin: use max-streams on rtpssrcdemux

The proper way of capping on max-streams is to do it in rtpssrcdemux.
This patch uses the newly introduced property on rtpssrcdemux. Previous
behavior would not prevent rtpssrcdemux spawning new pads for every new
ssrc and potentialy causing performance trouble during teardown.

4 years agortpssrcdemux: Handle RTCP APP packets
John Bassett [Wed, 18 Jan 2017 14:32:03 +0000 (14:32 +0000)]
rtpssrcdemux: Handle RTCP APP packets

Fix crash when processing RTCP APP packets.

4 years agortpssrcdemux: Bad RTP/RTCP packet is not fatal
John Bassett [Thu, 12 Jan 2017 16:05:59 +0000 (16:05 +0000)]
rtpssrcdemux: Bad RTP/RTCP packet is not fatal

When used for processing bundled media streams within rtpbin the rtpssrcdemux element may
receive bad RTP and RTCP packets, these should not be treated as a fatal error.

4 years agortpssrcdemux: introduce max-streams property
Mikhail Fludkov [Wed, 14 Sep 2016 14:41:02 +0000 (16:41 +0200)]
rtpssrcdemux: introduce max-streams property

The property is useful against atacks when the sender changes SSRC for
every RTP packet. The property with the same name introduced in rtpbin
was not enough, because we still can end up with thousands of pads
allocated in rtpssrcdemux.

4 years agortpssrcdemux: fix test warnings
Havard Graff [Mon, 10 Feb 2020 13:22:47 +0000 (14:22 +0100)]
rtpssrcdemux: fix test warnings

4 years agortspsrc: Fix for segmentation fault when handling set/get_parameter requests
Alexander Lapajne [Fri, 7 Feb 2020 09:03:49 +0000 (10:03 +0100)]
rtspsrc: Fix for segmentation fault when handling set/get_parameter requests

gstrtspsrc uses a queue, set_get_param_q, to store set param and get
param requests. The requests are put on the queue by calling
get_parameters() and set_parameter(). A thread which executs in
gst_rtspsrc_thread() then pops requests from the queue and processes
them. The crash occured because the queue became empty and a NULL
request object was then used. The reason that the queue became empty
is that it was popped even when the thread was NOT processing a get
parameter or set parameter command. The fix is to make sure that the
queue is ONLY popped when the command being processed is a set
parameter or get parameter command.

4 years agortpsession: Add test for packet rate maths
Olivier Crête [Fri, 27 Sep 2019 20:52:06 +0000 (16:52 -0400)]
rtpsession: Add test for packet rate maths

4 years agortpstats: Base the packet rate average on the packet rate itself
olivier.crete@collabora.com [Tue, 10 Sep 2019 18:03:02 +0000 (19:03 +0100)]
rtpstats: Base the packet rate average on the packet rate itself

Do this so that the average update speed is in time instead of varying
based on the actual packet arrival rate.

4 years agortpstats: Don't save the ts & seqnum if the avg is not updated
olivier.crete@collabora.com [Tue, 10 Sep 2019 17:59:02 +0000 (18:59 +0100)]
rtpstats: Don't save the ts & seqnum if the avg is not updated

This makes it update correctly when you have more than one packet per
frame.

4 years agov4l2: map GST_VIDEO_FORMAT_BGR15
Guillaume Desmottes [Wed, 5 Feb 2020 07:18:45 +0000 (12:48 +0530)]
v4l2: map GST_VIDEO_FORMAT_BGR15

The GstVideoFormat to v4l2 conversion was missing for BGR15.

4 years agov4l2: fix crash on invalid caps
Guillaume Desmottes [Wed, 5 Feb 2020 06:30:00 +0000 (12:00 +0530)]
v4l2: fix crash on invalid caps

gst_v4l2_object_set_format_full() was returning FALSE without setting
an error. Caller code (gst_v4l2src_fixate()) was then derefing a
NULL pointer when trying to handle the error.

4 years agosplitmuxsink: Include actual sink element in the fragment-opened/closed messages
Sebastian Dröge [Mon, 27 Jan 2020 14:00:30 +0000 (16:00 +0200)]
splitmuxsink: Include actual sink element in the fragment-opened/closed messages

If not configuring the sinks via the "location" property this can be
useful to know for which sink the fragment was actually opened/closed,
especially if finalization of the fragments is happening asynchronously.

4 years agortpjitterbuffer: fix scaling from RTP-time to NTP-time
Juergen Werner [Wed, 29 Jan 2020 11:05:07 +0000 (12:05 +0100)]
rtpjitterbuffer: fix scaling from RTP-time to NTP-time

The scaling was inverse.

4 years agortprtxsend: allow generic input caps
Mathieu Duponchelle [Mon, 27 Jan 2020 22:59:05 +0000 (23:59 +0100)]
rtprtxsend: allow generic input caps

When connected to an upstream rtpfunnel element, payload-type,
ssrc and clock-rate will not be present in the received caps.

rtprtxsend can already deal with only the clock rate being
present there, a new property is exposed to allow users to
provide a payload-type -> clock-rate map, this enables the
use of the max-size-time property for bundled streams.

4 years agovp8enc/vp8enc: set 1 for the default value of VP8E_SET_STATIC_THRESHOLD
Julien Isorce [Mon, 27 Jan 2020 23:17:27 +0000 (15:17 -0800)]
vp8enc/vp8enc: set 1 for the default value of VP8E_SET_STATIC_THRESHOLD

In Google webrtc, the setting VP8E_SET_STATIC_THRESHOLD is set to 1
(except when the content is known to be static very often in which
case it is set to 100, i.e. when sharing screen with Google Hangouts).

The cpu usage drops a lot when using 1 for above setting because it
allows the encoder to skip static/low content blocks. The current
0 default value uses too much cpu and confuses the user regarding
the cpu usage expectations. User expects vp8enc to use low cpu by
default.

Documentation of VP8E_SET_STATIC_THRESHOLD:
  https://github.com/webmproject/libvpx/blob/master/vpx/vp8cx.h#L188

chromium/webrtc:
  https://chromium.googlesource.com/external/webrtc/+/b484ec0082948ae086c2ba4142b4d2bf8bc4dd4b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc#822

Closes #58

4 years agojpegdec: Check return value of gst_buffer_map()
Nicolas Dufresne [Mon, 27 Jan 2020 22:16:02 +0000 (17:16 -0500)]
jpegdec: Check return value of gst_buffer_map()

Without this check, the element will crash instead of returning an
error.

4 years agosplitmuxsink: Check the correct sink class for the existence of the "location" property
Sebastian Dröge [Mon, 27 Jan 2020 13:52:42 +0000 (15:52 +0200)]
splitmuxsink: Check the correct sink class for the existence of the "location" property

4 years agoqtdemux: Always prefer information from v1/v2 sound sample description over sample...
Sebastian Dröge [Mon, 13 Jan 2020 09:58:12 +0000 (11:58 +0200)]
qtdemux: Always prefer information from v1/v2 sound sample description over sample description entry

ffmpeg is doing the same and various files in the wild have bogus
information in the sample description if the same information is also
duplicated afterwards in the v1/v2 sound sample desription.

Previously we only did this for non-raw audio due to
  https://bugzilla.gnome.org/show_bug.cgi?id=374914
but this specific file is already worked around differently. It still
works after this change.

Also remove ad-hoc GST_READ_DOUBLE_BE re-implementation and move the
switch for legacy audio formats after reading all the sample
descriptions as we want to override the values from there.

4 years agoavimux: Add support for >2 raw audio channels
Sebastian Dröge [Mon, 13 Jan 2020 18:02:58 +0000 (20:02 +0200)]
avimux: Add support for >2 raw audio channels

For this case write a WAVEFORMATEXTENSIBLE header and also reorder the
raw audio channels to the AVI channel order if needed.

4 years agowavenc: Fix writing of the channel mask with >2 channels
Sebastian Dröge [Mon, 13 Jan 2020 18:07:01 +0000 (20:07 +0200)]
wavenc: Fix writing of the channel mask with >2 channels

The channel position is an enum but the conversion code assumed it's a
mask. Convert accordingly.

4 years agortph265pay: TID for NALU type 48 was always set to 7
Kristofer Björkström [Fri, 10 Jan 2020 15:30:33 +0000 (16:30 +0100)]
rtph265pay: TID for NALU type 48 was always set to 7

A typo bug: | instead of & resulted in TID alwasy being set to 7
for the aggregated NALU of type 48

4 years agoimagefreeze: Add support for replacing the output buffer
Sebastian Dröge [Fri, 10 Jan 2020 12:54:26 +0000 (14:54 +0200)]
imagefreeze: Add support for replacing the output buffer

By default imagefreeze will still reject new buffers after the first one
and immediately return GST_FLOW_EOS but the new allow-replace property
allows to change this.

Whenever updating the buffer we now also keep track of the configured
caps of the buffer and from the source pad task negotiate correctly
based on the potentially updated caps.

Only the very first time negotiation of a framerate with downstream is
performed, afterwards only the caps themselves apart from the framerate
are updated.

4 years agoqtdemux: Fix race on pad reconnection
Alicia Boya García [Thu, 9 Jan 2020 18:43:02 +0000 (18:43 +0000)]
qtdemux: Fix race on pad reconnection

Elements emitting frames through several srcpads should use a
flow combiner to aggregate the chain returns and therefore only return
GST_FLOW_NOT_LINKED to upstream when all the downstream pads have
received GST_FLOW_NOT_LINKED.

In addition to that, in order to handle pads being relinked downstream,
the flow combiner should be reset in response to RECONFIGURE events.
This ensures that a both srcpads process a chain operation before a
GST_FLOW_NOT_LINKED can be propagated upstream (which would usually stop
the pipeline).

Otherwise, in a configuration with two srcpads, only one linked at a
time, after the relink the element could chain data through the now
unlinked pad and the flow combiner would resolve as GST_FLOW_NOT_LINKED
(stopping the pipeline) just because the now linked pad has not been
chained yet to update the flow combiner.

This patch adds handling of RECONFIGURE events to qtdemux. Also, since
this event handling causes the flow combiner to be used from a thread
other than the qtdemux streaming thread, usages of the flow combiner
has been guarded by the object lock.

4 years agosplitmuxsink: Fix assertion failure on set_property()
Seungha Yang [Mon, 6 Jan 2020 16:20:24 +0000 (01:20 +0900)]
splitmuxsink: Fix assertion failure on set_property()

GValue might have null object.

(gst-inspect-1.0:10304): GStreamer-CRITICAL ...
    gst_object_ref_sink: assertion 'object != NULL' failed

4 years agovideocrop: allow properties to be animated by GstController
Daniel Molkentin [Fri, 3 Jan 2020 14:16:02 +0000 (15:16 +0100)]
videocrop: allow properties to be animated by GstController

4 years agortspsrc: improved handling of control concatenation with base
Aaron Boxer [Tue, 24 Dec 2019 13:24:51 +0000 (08:24 -0500)]
rtspsrc: improved handling of control concatenation with base

Also, `control_url` variable has been renamed to `control_path`,
as it is actually a path.

4 years agortspsrc: append aggregate control string to base URL before query string
Aaron Boxer [Fri, 6 Dec 2019 17:34:15 +0000 (12:34 -0500)]
rtspsrc: append aggregate control string to base URL before query string

Appending control string to end of query changes meaning of query string
Fixes #650

4 years agoaasink & cacasink: add filter aatv & cacatv
Eric Marks [Sat, 28 Dec 2019 23:01:19 +0000 (23:01 +0000)]
aasink & cacasink: add filter aatv & cacatv

Add transform filter capabilities to aasink and cacasink in the form of new elements aatv and cacatv.

4 years agoalpha: Cleanup using G_DECLARE_FINAL_TYPE
Niels De Graef [Thu, 6 Jun 2019 09:03:34 +0000 (11:03 +0200)]
alpha: Cleanup using G_DECLARE_FINAL_TYPE

We started depending on GLib 2.44, so we can clean up all the GObject
boilerplate macros.

4 years agogood: use of g_value_dup_string
Stéphane Cerveau [Wed, 18 Dec 2019 15:07:18 +0000 (16:07 +0100)]
good: use of g_value_dup_string

Use helper method to get string from GValue.

4 years agortpbin: fix shutdown crash in rtpbin
Havard Graff [Thu, 19 Dec 2019 22:48:09 +0000 (23:48 +0100)]
rtpbin: fix shutdown crash in rtpbin

The key is to make sure the jitterbuffer is set to NULL *before* the
ptdemux.

The race that existed would basically happen when ptdemux had reached
READY, and the jitterbuffer would then push a buffer, triggering a new
pad with a new payloadtype being added and ghosted to the rtpbin itself.

However, the srcpad of the ptdemux would now be inactive, and all the
sticky-event pushed on it would be swallowed, not allowing any to reach
the ghost-pad. Then the buffer in-flight would come to the ghostpad,
and we would assert that a buffer arrived before the necessary
events.

By simply re-ordering the state-changes, we ensure that there will be
no buffer racing into the ptdemux while its state is being changed,
and the problem disappears completely.

Notice also that there is not point in disconnecting the signals on the
ptdemux before this point, since we need the push-thread to settle
down before we can do this in a non-racy way.

4 years agortspsrc: avoid seek DISCONT when only rate changes in same direction
Aaron Boxer [Thu, 12 Sep 2019 20:22:10 +0000 (14:22 -0600)]
rtspsrc: avoid seek DISCONT when only rate changes in same direction

Not setting DISCONT avoids a noticable delay when seeking
with only rate changing, in the same direction as current
rate.

4 years agortspsrc: Remove deprecated GTimeVal
Olivier Crête [Tue, 10 Dec 2019 23:13:11 +0000 (18:13 -0500)]
rtspsrc: Remove deprecated GTimeVal

GTimeVal won't work past 2038

4 years agoosxaudio: Remove deprecated GTimeVal
Olivier Crête [Tue, 10 Dec 2019 22:13:45 +0000 (17:13 -0500)]
osxaudio: Remove deprecated GTimeVal