platform/upstream/gstreamer.git
4 years agosplitmux: Add muxer-pad-map property
Jan Schmidt [Wed, 31 Jul 2019 06:17:36 +0000 (16:17 +1000)]
splitmux: Add muxer-pad-map property

Add a property which explicitly maps splitmuxsink pads to the
muxer pads they should connect to, overriding the implicit logic
that tries to match pads but yields arbitrary names.

4 years agosplitmuxsink: In async mode, retain previous muxer pad names.
Jan Schmidt [Thu, 25 Jul 2019 16:21:59 +0000 (02:21 +1000)]
splitmuxsink: In async mode, retain previous muxer pad names.

When running in async-finalize mode, request new pads from the muxer
using the same names as old pads, instead of letting the muxer assign
new ones based on the pad template name.

4 years agosplitmuxsink: Mark split-* signals as action signals. Doc fixes.
Jan Schmidt [Thu, 25 Jul 2019 16:13:31 +0000 (02:13 +1000)]
splitmuxsink: Mark split-* signals as action signals. Doc fixes.

Add the G_SIGNAL_ACTION flag to the split-* signals on splitmuxsink,
and make some improvements to their docstrings

4 years agoqtmux: Fix incompatible type warning with MSVC
Seungha Yang [Thu, 29 Aug 2019 13:11:02 +0000 (22:11 +0900)]
qtmux: Fix incompatible type warning with MSVC

gstqtmux.c(5582): warning C4133: 'function':
  incompatible types - from 'GstVideoMultiviewFlags *' to 'guint *'

4 years agortspsrc: fix git diff indentation
Mathieu Duponchelle [Mon, 2 Sep 2019 14:33:05 +0000 (16:33 +0200)]
rtspsrc: fix git diff indentation

4 years agortspsrc: normalize variable to boolean
Mathieu Duponchelle [Fri, 30 Aug 2019 20:42:58 +0000 (22:42 +0200)]
rtspsrc: normalize variable to boolean

4 years agortspsrc: clip output segment on accurate seeks
Mathieu Duponchelle [Thu, 29 Aug 2019 19:29:34 +0000 (21:29 +0200)]
rtspsrc: clip output segment on accurate seeks

The output segment is only used in ONVIF mode.

The previous behaviour was to output a segment computed from
the Range response sent by the server.

In ONVIF mode, servers will start serving from the appropriate
synchronization point (keyframe), and the Range in response will
start at that position.

This means rtspsrc can now perform truly accurate seeks in that
mode, by clipping the output segment to the values requested in
the seek. The decoder will then discard out of segment buffers
and playback will start without artefacts at the exact requested
position, similar to the behaviour of a demuxer when an accurate
seek is requested.

4 years agovpx: fix macos werror build
Matthew Waters [Fri, 30 Aug 2019 04:00:26 +0000 (14:00 +1000)]
vpx: fix macos werror build

../ext/vpx/gstvpxenc.c:1723:49: error: format specifies type 'long' but the argument has type 'vpx_codec_pts_t' (aka 'long long') [-Werror,-Wformat]
          ", gst frame pts: %" G_GINT64_FORMAT, pkt->data.frame.pts, pts);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Frameworks/GStreamer.framework/Versions/1.0/include/gstreamer-1.0/gst/gstinfo.h:1065:96: note: expanded from macro 'GST_TRACE_OBJECT'
#define GST_TRACE_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE,   obj,  __VA_ARGS__)
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/Library/Frameworks/GStreamer.framework/Versions/1.0/include/gstreamer-1.0/gst/gstinfo.h:646:31: note: expanded from macro 'GST_CAT_LEVEL_LOG'
        (GObject *) (object), __VA_ARGS__);                             \
                              ^~~~~~~~~~~
../ext/vpx/gstvpxenc.c:1723:70: error: format specifies type 'long' but the argument has type 'vpx_codec_pts_t' (aka 'long long') [-Werror,-Wformat]
          ", gst frame pts: %" G_GINT64_FORMAT, pkt->data.frame.pts, pts);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/Library/Frameworks/GStreamer.framework/Versions/1.0/include/gstreamer-1.0/gst/gstinfo.h:1065:96: note: expanded from macro 'GST_TRACE_OBJECT'
#define GST_TRACE_OBJECT(obj,...)       GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE,   obj,  __VA_ARGS__)
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/Library/Frameworks/GStreamer.framework/Versions/1.0/include/gstreamer-1.0/gst/gstinfo.h:646:31: note: expanded from macro 'GST_CAT_LEVEL_LOG'
        (GObject *) (object), __VA_ARGS__);                             \
                              ^~~~~~~~~~~

4 years agoosxvideosink: call superclass in reshape
Matthew Waters [Fri, 30 Aug 2019 03:37:59 +0000 (13:37 +1000)]
osxvideosink: call superclass in reshape

Fixes macos werror build

../sys/osxvideo/cocoawindow.m:437:1: error: method possibly missing a [super reshape] call [-Werror,-Wobjc-missing-super-calls]
}
^

4 years agodocstrings: port ulinks to markdown links
Mathieu Duponchelle [Fri, 23 Aug 2019 16:56:01 +0000 (18:56 +0200)]
docstrings: port ulinks to markdown links

4 years agoreplaygain: fix up doc links to defunct replaygain.org website
Tim-Philipp Müller [Sat, 10 Aug 2019 11:33:46 +0000 (12:33 +0100)]
replaygain: fix up doc links to defunct replaygain.org website

Fixes #624

4 years agosouphttpsrc: Fix incompatible type build warning
Seungha Yang [Wed, 21 Aug 2019 15:18:51 +0000 (00:18 +0900)]
souphttpsrc: Fix incompatible type build warning

gstsouphttpsrc.c(2191): warning C4133:
  '=': incompatible types - from 'guint (__cdecl *)(GType)' to 'GstURIType (__cdecl *)(GType)'

4 years agovpx: bump libvpx requirement to 1.5.0
Tim-Philipp Müller [Mon, 19 Aug 2019 10:07:56 +0000 (11:07 +0100)]
vpx: bump libvpx requirement to 1.5.0

Was released in Nov 2015.

4 years agovpx: avoid confusing meson configure output when checking for vpx versions
Tim-Philipp Müller [Mon, 19 Aug 2019 10:03:00 +0000 (11:03 +0100)]
vpx: avoid confusing meson configure output when checking for vpx versions

Used to print:
|Run-time dependency vpx found: YES 1.7.0
|Message: libvpx provides VP8 encoder interface (vpx_codec_vp8_cx_algo)
|Message: libvpx provides VP8 decoder interface (vpx_codec_vp8_dx_algo)
|Message: libvpx provides VP9 encoder interface (vpx_codec_vp9_cx_algo)
|Message: libvpx provides VP9 decoder interface (vpx_codec_vp9_dx_algo)
|Dependency vpx found: YES (cached)
|Dependency vpx found: NO found '1.7.0' but need: '>=1.8.0'
|Run-time dependency vpx found: NO (tried pkgconfig and cmake)

We can check the version of the found dep in a way that
doesn't produce this confusing output.

4 years agowavparse: Fix push mode ignoring audio with a size smaller than segment buffer
Amr Mahdi [Mon, 19 Aug 2019 07:30:17 +0000 (07:30 +0000)]
wavparse: Fix push mode ignoring audio with a size smaller than segment buffer

In push mode (streaming), if the audio size is smaller than segment buffer size, it would be ignored.
This happens because when the plugin receives an EOS signal while a single audio chunk that is less than the segment buffer size is buffered, it does not
flush this chunk. The fix is to flush the data chunk when it receives an EOS signal and has a single (first) chunk buffered.

How to reproduce:
1. Run gst-launch with tcp source
```
gst-launch-1.0  tcpserversrc port=3000 !  wavparse ignore-length=0 ! audioconvert ! filesink location=bug.wav
```
2. Send a wav file with unspecified data chunk length (0). Attached a test file
```
cat test.wav | nc localhost 3000
```
3. Compare the length of the source file and output file
```
ls -l test.wav bug.wav
-rw-rw-r-- 1 amr amr    0 Aug 15 11:07 bug.wav
-rwxrwxr-x 1 amr amr 3564 Aug 15 11:06 test.wav
```

The expected length of the result of the gst-lauch pipeline should be the same as the test file minus the headers (44), which is ```3564 - 44 = 3520``` but the actual output length is ```0```

After the fix:
```
ls -l test.wav fix.wav
-rw-rw-r-- 1 amr amr 3520 Aug 15 11:09 fix.wav
-rwxrwxr-x 1 amr amr 3564 Aug 15 11:06 test.wav
```

4 years agortpvp8depay: Add property for waiting until the next keyframe after packet loss
Sebastian Dröge [Mon, 12 Aug 2019 15:56:34 +0000 (18:56 +0300)]
rtpvp8depay: Add property for waiting until the next keyframe after packet loss

If VP8 is not encoded with error resilience enabled then any packet loss
causes very bad artefacts when decoding and waiting for the next
keyframe instead improves user experience considerably.

4 years agov4l2: Fix type compatibility issue with glibc 2.30
Nicolas Dufresne [Wed, 7 Aug 2019 02:27:40 +0000 (22:27 -0400)]
v4l2: Fix type compatibility issue with glibc 2.30

From now on, we will use linux/types.h on Linux, and use typedef of the
various flavour of BSD.

Fixes #635

4 years agovalgrind: suppress Cond error coming from gnutls
Mathieu Duponchelle [Wed, 7 Aug 2019 22:29:25 +0000 (18:29 -0400)]
valgrind: suppress Cond error coming from gnutls

taken from https://salsa.debian.org/debian/flatpak/commit/fb4a8dda211c4bc036781f2b0d706266e95ce068

4 years agomatroska: Provide audio lead-in for some lossy formats
Mart Raudsepp [Wed, 10 Jul 2019 19:07:05 +0000 (22:07 +0300)]
matroska: Provide audio lead-in for some lossy formats

Various audio formats require an audio lead-in to decode it properly.
Most parsers would take care of it, but when a container like matroska is
involved, the demuxer handles the seeking and without its own lead-in
handling would never even pass the lead-in data to the parser.
This commit provides an initial implementation of that for audio/mpeg,
audio/x-ac3 and audio/x-eac3 by calculating the worst case lead-in time
needed from known samplerate, potential lead-in frames need and the
maximum blocksize possible for the format (as we don't parse that out
exactly in matroskademux) and seeking that much earlier in case of
accurate seeks. This is especially important for NLE use-cases with GES.

If accurate seeking to a position that happens to have a video keyframe,
it'll go back to the previous keyframe than needed, but with typical
video files that's the best we can do anyway without falling back to
scanning the clusters, as typically only keyframes are indexed in
Cueing Data.
If the media doesn't have a CUE, then we bisect for the cluster to seek
to with the same modified time as well in case of accurate seeking,
ensuring sufficient lead-in. This code path is typically hit only with
(suboptimal) audio-only matroska files, e.g. when created with ffmpeg,
which doesn't add a CUE for audio-only mkv muxing.

4 years agotest: rtpbin_buffer_list: add a test for invalid packets in buffer list
Antonio Ospite [Mon, 11 Mar 2019 14:15:12 +0000 (15:15 +0100)]
test: rtpbin_buffer_list: add a test for invalid packets in buffer list

Upstream elements can send all kinds of data in a buffer list, so cover
the case of an invalid RTP packet mixed with valid RTP packets.

4 years agotest: rtpbin_buffer_list: add a test for multiplexed RTP and RTCP
Antonio Ospite [Mon, 11 Mar 2019 14:12:03 +0000 (15:12 +0100)]
test: rtpbin_buffer_list: add a test for multiplexed RTP and RTCP

RTP and RTCP packets can be muxed together on the same channel (see
RFC5761) and can arrive in the same buffer list.

The GStreamer rtpsession element support RFC5761, so add a test to cover
this case for buffer lists too.

4 years agotest: rtpbin_buffer_list: add a test for different timestamps in buffer list
Antonio Ospite [Mon, 11 Mar 2019 14:09:27 +0000 (15:09 +0100)]
test: rtpbin_buffer_list: add a test for different timestamps in buffer list

Buffers with different timestamps (e.g. packets belonging to different
frames) can arrive together in the same buffer list,

Add a test to cover this case.

4 years agotest: rtpbin_buffer_list: add function to check timestamp
Antonio Ospite [Tue, 12 Mar 2019 14:24:26 +0000 (15:24 +0100)]
test: rtpbin_buffer_list: add function to check timestamp

4 years agotest: rtpbin_buffer_list: add a test about reordered or duplicated seqnums
Antonio Ospite [Tue, 2 Apr 2019 16:02:19 +0000 (18:02 +0200)]
test: rtpbin_buffer_list: add a test about reordered or duplicated seqnums

4 years agotest: rtpbin_buffer_list: add a test for lange jump in seqnums with recovery
Antonio Ospite [Tue, 2 Apr 2019 15:52:54 +0000 (17:52 +0200)]
test: rtpbin_buffer_list: add a test for lange jump in seqnums with recovery

4 years agotest: rtpbin_buffer_list: add a test for large jump in sequence numbers
Antonio Ospite [Tue, 2 Apr 2019 15:50:35 +0000 (17:50 +0200)]
test: rtpbin_buffer_list: add a test for large jump in sequence numbers

4 years agotest: rtpbin_buffer_list: add a test for wrapping sequence numbers
Antonio Ospite [Tue, 2 Apr 2019 15:47:27 +0000 (17:47 +0200)]
test: rtpbin_buffer_list: add a test for wrapping sequence numbers

4 years agotest: rtpbin_buffer_list: add a test for permissible gap in sequence numbers
Antonio Ospite [Mon, 11 Mar 2019 14:07:08 +0000 (15:07 +0100)]
test: rtpbin_buffer_list: add a test for permissible gap in sequence numbers

4 years agotest: rtpbin_buffer_list: add a test for the case of failed probation
Antonio Ospite [Mon, 11 Mar 2019 14:03:31 +0000 (15:03 +0100)]
test: rtpbin_buffer_list: add a test for the case of failed probation

When a new source fails to pass the probation period (i.e. new packets
have non-consecutive sequence numbers), then no buffer shall be pushed
downstream. Add a test to validate this case.

4 years agotest: rtpbin_buffer_list: add function to check sequence number
Antonio Ospite [Tue, 12 Mar 2019 14:23:16 +0000 (15:23 +0100)]
test: rtpbin_buffer_list: add function to check sequence number

4 years agotest: rtpbin_buffer_list: add test to verify that receiving stats are correct
Antonio Ospite [Wed, 3 Apr 2019 12:46:35 +0000 (14:46 +0200)]
test: rtpbin_buffer_list: add test to verify that receiving stats are correct

Add a test to verify that stats about received packets are correct when
using buffer lists in the rtpsession receive path.

Split get_session_source_stats() in two to be able to get stats from
a GstRtpSession object directly.

4 years agotest: rtpbin_buffer_list: add a test for buffer lists on the recv path
Antonio Ospite [Wed, 27 Feb 2019 15:17:57 +0000 (16:17 +0100)]
test: rtpbin_buffer_list: add a test for buffer lists on the recv path

4 years agortpsession: add support for buffer lists on the recv path
Antonio Ospite [Wed, 27 Feb 2019 16:03:44 +0000 (17:03 +0100)]
rtpsession: add support for buffer lists on the recv path

The send path in rtpsession processes the buffer list along the way,
sharing info and stats between packets in the same list, because it
assumes that all packets in a buffer list are from the same frame.

However, in the receiving path packets can arrive in all sorts of
arrangements:

  - different sources,
  - different frames (different timestamps),
  - different types (multiplexed RTP and RTCP, invalid RTP packets).

so a more general approach should be used to correctly support buffer
lists in the receive path.

It turns out that it's simpler and more robust to process buffers
individually inside the rtpsession element even if they come in a buffer
list, and then reassemble a new buffer list when pushing the buffers
downstream.

This avoids complicating the existing code to make all functions
buffer-list-aware with the risk of introducing regressions,

To support buffer lists in the receive path and reduce the "push
overhead" in the pipeline, a new private field named processed_list is
added to GstRtpSessionPrivate, it is set in the chain_list handler and
used in the process_rtp callback; this is to achieve the following:

  - iterate over the incoming buffer list;
  - process the packets one by one;
  - add the valid ones to a new buffer list;
  - push the new buffer list downstream.

The processed_list field is reset before pushing a buffer list to be on
the safe side in case a single buffer was to be pushed by upstream
at some later point.

NOTE:

The proposed modifications do not change the behavior of the send path.

The process_rtp callback is called in rtpsource.c by the push_rtp
callback (via source_push_rtp) only when the source is not internal.

So even though push_rtp is also called in the send path, it won't end up
using process_rtp in this case because the source would be internal in
the send path.

The reasoning from above may suggest a future refactoring: push_rtp
might be split to better differentiate the send and receive path.

4 years agomatroska: Handle interlaced field order
Doug Nazar [Wed, 7 Aug 2019 14:01:34 +0000 (10:01 -0400)]
matroska: Handle interlaced field order

4 years agowavparse: Fix ignoring of last chunk in push mode
Amr Mahdi [Wed, 7 Aug 2019 12:09:46 +0000 (12:09 +0000)]
wavparse: Fix ignoring of last chunk in push mode

In push mode (streaming), if the last audio payload chunk is less than the segment rate buffer size, it would be ignored since the plugin waits until it has at least segment rate bufer size of audio.

The fix is to introduce a flushing flag that indicates that no more audio will be available so that the plugin can recognize this condition and flush the data is has even if it is less
than the desired segment rate buffer size.

4 years agosouphttpsrc: Log any error returned by soup_session_send()
Robert Tiemann [Tue, 6 Aug 2019 14:27:37 +0000 (16:27 +0200)]
souphttpsrc: Log any error returned by soup_session_send()

4 years agoqtdemux: enlarge the maximal atom size
luke.lin [Wed, 7 Aug 2019 02:42:21 +0000 (11:42 +0900)]
qtdemux: enlarge the maximal atom size

For 8K content, frame size is over 25MB, and cause the negotiation failure.
Enlarge the limitation of QTDEMUX_MAX_ATOM_SIZE to 32MB.

4 years agortspsrc: expose and implement is-live property
Mathieu Duponchelle [Sat, 27 Jul 2019 02:05:01 +0000 (04:05 +0200)]
rtspsrc: expose and implement is-live property

This is useful to support the ONVIF case: when is-live is set to
FALSE and onvif-rate-control is no, the client can control the
rate of delivery and arrange for the server to block and still
keep sending when unblocked, without requiring back and forth
PAUSE / PLAY requests. This enables, amongst other things, fast
frame stepping on the client side.

When is-live is FALSE, we don't use a manager at all. This case
was actually already pretty well handled by the current code. The
standard manager, rtpbin, is simply no longer needed in this case.

Applications can instantiate a downloadbuffer after rtspsrc if
needed.

4 years agortspsrc: reset_time when flush stopping
Mathieu Duponchelle [Sat, 27 Jul 2019 02:03:44 +0000 (04:03 +0200)]
rtspsrc: reset_time when flush stopping

4 years agortspsrc: expose and implement onvif-mode property
Mathieu Duponchelle [Fri, 12 Jul 2019 20:33:08 +0000 (22:33 +0200)]
rtspsrc: expose and implement onvif-mode property

Refactor the code for parsing and generating the Range, taking
advantage of existing API in GstRtspTimeRange.

Only use the TCP protocol in that mode, as per the specification.

Generate an accurate segment when in that mode, and signal to the
depayloader that it should not generate its own segment, through
the "onvif-mode" field in the caps, see
<https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/merge_requests/328>
for more information.

Translate trickmode seek flags to their ONVIF representation

Expose an onvif-rate-control property

4 years agortspsrc: improve handling of rate in seeks
Mathieu Duponchelle [Mon, 1 Jul 2019 18:38:20 +0000 (20:38 +0200)]
rtspsrc: improve handling of rate in seeks

4 years agortpfunnel: forward correct segment when switching pad
Mathieu Duponchelle [Wed, 31 Jul 2019 19:55:16 +0000 (21:55 +0200)]
rtpfunnel: forward correct segment when switching pad

Forwarding a single segment event from the pad that first gets
chained is incorrect: when that first event was sent by an element
such as x264enc, with its offset start, we end pushing out of segment
buffers for the other pad(s).

Instead, everytime the active pad changes, forward the appropriate
segment event.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1028

4 years agortspsrc: Use new GstRTSPMessage API to set message body from a buffer directly
Sebastian Dröge [Mon, 5 Aug 2019 16:35:36 +0000 (19:35 +0300)]
rtspsrc: Use new GstRTSPMessage API to set message body from a buffer directly

4 years agortpsource: fix receiver source stats to consider previously queued packets
Antonio Ospite [Thu, 4 Apr 2019 11:17:34 +0000 (13:17 +0200)]
rtpsource: fix receiver source stats to consider previously queued packets

When it is not clear yet if a packet relative to a source should be
pushed, the packet is put into a queue, this happens in two cases:

  - the source is still in probation;
  - there is a large jump in seqnum, and it is not clear what
    the cause is, future packets will help making a guess.

In either case stats about received packets are not updated at all; and
even if they were, when init_seq() is called it resets all receiver
stats, effectively loosing any possible stat about previously received
packets.

Fix this by taking into account the queued packets and update the stats
when calling init_seq().

4 years agortpsource: clarify meaning of the octets-sent and octets-received stats
Antonio Ospite [Tue, 9 Apr 2019 08:46:39 +0000 (10:46 +0200)]
rtpsource: clarify meaning of the octets-sent and octets-received stats

The octets-send and octets-received stats count the payload bytes
excluding RTP and lower level headers, clarify that in the
documentation.

4 years agortpsource: expose field bytes_received in RTPSourceStats
Antonio Ospite [Thu, 4 Apr 2019 11:16:36 +0000 (13:16 +0200)]
rtpsource: expose field bytes_received in RTPSourceStats

Since commit c971d1a9a (rtpsource: refactor bitrate estimation,
2010-03-02) bytes_received filed in RTPSourceStats is set but then never
used again, expose it so that it can be used  by user code to verify how
many bytes have been received.

4 years agortpmanager: consider UDP and IP headers in bandwidth calculation
Antonio Ospite [Fri, 21 Jun 2019 15:46:36 +0000 (17:46 +0200)]
rtpmanager: consider UDP and IP headers in bandwidth calculation

According to RFC3550 lower-level headers should be considered for
bandwidth calculation.

See https://tools.ietf.org/html/rfc3550#section-6.2 paragraph 4:

  Bandwidth calculations for control and data traffic include
  lower-layer transport and network protocols (e.g., UDP and IP) since
  that is what the resource reservation system would need to know.

Fix the source data to accommodate that.

Assume UDPv4 over IP for now, this is a simplification but it's good
enough for now.

While at it define a constant and use that instead of a magic number.

NOTE: this change basically reverts the logic of commit 529f443a6
(rtpsource: use payload size to estimate bitrate, 2010-03-02)

4 years agoqtdemux: Use empty-array safe way to cleanup GPtrArray
Seungha Yang [Thu, 1 Aug 2019 06:02:23 +0000 (15:02 +0900)]
qtdemux: Use empty-array safe way to cleanup GPtrArray

Fix assertion fail
GLib-CRITICAL **: g_ptr_array_remove_range: assertion 'index_ < rarray->len' failed

4 years agortpmp4vpay: config-interval -1 send at idr
Marc Leeman [Thu, 1 Aug 2019 14:28:04 +0000 (14:28 +0000)]
rtpmp4vpay: config-interval -1 send at idr

adjust/port from rtph264pay and allow sending the configuration data at
every IDR

The payloader was stripping the configuration data when the
config-interval was set to 0. The code was written in such a way !(a >
0) that it stripped the config when it was set at -1 (send config_data
as soon as possible).

This resulted in some MPEG4 streams where no GOP/VOP-I was detected to
be sent out without configuration.

4 years agomatroskademux: Ignore crc32 element while peeking at cluster.
Doug Nazar [Sat, 27 Jul 2019 18:21:34 +0000 (14:21 -0400)]
matroskademux: Ignore crc32 element while peeking at cluster.

4 years agogtkglsink: fix crash when widget is resized after element destruction
Guillaume Desmottes [Thu, 25 Jul 2019 15:51:26 +0000 (21:21 +0530)]
gtkglsink: fix crash when widget is resized after element destruction

Prevent _size_changed_cb() to be called after gtkglsink has been finalized.

Fix #632

4 years agoqtdemux: fix reverse playback EOS conditions
Mathieu Duponchelle [Fri, 26 Jul 2019 00:45:51 +0000 (02:45 +0200)]
qtdemux: fix reverse playback EOS conditions

In reverse playback, we don't want to rely on the position of the current
keyframe to decide a stream is EOS: the last GOP we push will start with
a keyframe, which position is likely to be outside of the segment.

Instead, let the normal seek_to_previous_keyframe mechanism do its job,
it works just fine.

4 years agoqtdemux: fix key unit seek corner case
Mathieu Duponchelle [Mon, 22 Jul 2019 23:42:02 +0000 (01:42 +0200)]
qtdemux: fix key unit seek corner case

If a key unit seek is performed with a time position that matches
the offset of a keyframe, but not its actual PTS, we need to
adjust the segment nevertheless.

For example consider the following case:

* stream starts with a keyframe at 0 nanosecond, lasting 40 milliseconds
* user does a key unit seek at 20 milliseconds
* we don't adjust the segment as the time position is "over" a keyframe
* we push a segment that starts at 20 milliseconds
* we push a buffer with PTS == 0
* an element downstream (eg rtponviftimestamp) tries to calculate the
  stream time of the buffer, fails to do so and drops it

4 years agojpegdec: Don't dereference NULL input state if we have no caps in TIME segments
Sebastian Dröge [Thu, 25 Jul 2019 12:08:54 +0000 (15:08 +0300)]
jpegdec: Don't dereference NULL input state if we have no caps in TIME segments

Simply assume that the JPEG frame is not going to be interlaced instead
of crashing.

5 years agortp: opuspay: fix memory leak in gst_rtp_opus_pay_setcaps.
Knut Andre Tidemann [Mon, 22 Jul 2019 08:28:50 +0000 (10:28 +0200)]
rtp: opuspay: fix memory leak in gst_rtp_opus_pay_setcaps.

The src caps were never dereferenced, causing a memory leak.

5 years agoqtdemux: implement support for trickmode interval
Mathieu Duponchelle [Fri, 12 Jul 2019 18:51:44 +0000 (20:51 +0200)]
qtdemux: implement support for trickmode interval

When the seek event contains a (newly-added) trickmode interval,
and TRICKMODE_KEY_UNITS was requested, only let through keyframes
separated with the required interval

5 years agomeson: Don't generate doc cache when no plugins are enabled
Nirbheek Chauhan [Wed, 17 Jul 2019 13:42:19 +0000 (19:12 +0530)]
meson: Don't generate doc cache when no plugins are enabled

Fixes gst-build with -Dauto-features=disabled

5 years agomatroska: Port to color_{primaries,transfer,matrix}_to_iso
Seungha Yang [Mon, 15 Jul 2019 14:24:05 +0000 (23:24 +0900)]
matroska: Port to color_{primaries,transfer,matrix}_to_iso

... and remove duplicated code.

5 years agosplitmuxsink: add the ability to mux auxilliary video streams
Jan Schmidt [Sat, 25 May 2019 12:08:05 +0000 (22:08 +1000)]
splitmuxsink: add the ability to mux auxilliary video streams

The primary video stream is used to select fragment cut points
at keyframe boundaries. Auxilliary video streams may be
broken up at any packet - so fragments may not start with a keyframe
for those streams.

5 years agosplitmuxsrc: Add video_%d pad template.
Jan Schmidt [Tue, 11 Jun 2019 13:17:30 +0000 (23:17 +1000)]
splitmuxsrc: Add video_%d pad template.

splitmuxsrc actually supports multiple video pads. Make that clear,
especially since it was already creating pads named "video_0" etc.

5 years agoqtdemux: fix conditions for end of segment in reverse playback
Mathieu Duponchelle [Tue, 9 Jul 2019 21:12:45 +0000 (23:12 +0200)]
qtdemux: fix conditions for end of segment in reverse playback

The time_position field of the stream is offset by the media_start
of its QtDemuxSegment compared to the start of the GstSegment of
the demuxer, take it into account when making comparisons.

5 years agomatroskademux: Fix mismatched transfer characteristic
Seungha Yang [Tue, 9 Jul 2019 14:06:12 +0000 (23:06 +0900)]
matroskademux: Fix mismatched transfer characteristic

TransferCharacteristics(18) should be ARIB STD-B67 (HLG)
See https://www.webmproject.org/docs/container/#TransferCharacteristics

Also map more color primaries indexes which have been handled by matroska-mux.

5 years agov4l2: Remove misleading comments
Seungha Yang [Tue, 9 Jul 2019 10:49:57 +0000 (19:49 +0900)]
v4l2: Remove misleading comments

gst_pad_template_new() does not take ownership of the caps

5 years agortp session: Add test for collision loopback detection
Olivier Crête [Wed, 23 Jan 2019 23:27:06 +0000 (18:27 -0500)]
rtp session: Add test for collision loopback detection

Ignore further collisions if the remote SSRC change with ours, it's
probably because someone is sending us back the packets we send out.

5 years agortpsession tests: Add test for third-party collision detection
Olivier Crête [Wed, 23 Jan 2019 23:14:23 +0000 (18:14 -0500)]
rtpsession tests: Add test for third-party collision detection

Add tests to validate the code that ignores the same packets coming
from 2 different sources (an third-party collision).

5 years agortpsession: Add test for collision on incoming packets
Olivier Crête [Wed, 23 Jan 2019 22:19:15 +0000 (17:19 -0500)]
rtpsession: Add test for collision on incoming packets

Make sure that the collision is properly detected on incoming packets.

5 years agortpsession test: Verify that on-ssrc-collision message is emitted
Olivier Crête [Wed, 23 Jan 2019 22:09:27 +0000 (17:09 -0500)]
rtpsession test: Verify that on-ssrc-collision message is emitted

5 years agortpsession: Also send conflict event when sending packet
Olivier Crête [Wed, 23 Jan 2019 21:58:22 +0000 (16:58 -0500)]
rtpsession: Also send conflict event when sending packet

If the conflict is detected when sending a packet, then also send an
upstream event to tell the source to reconfigure itself.

Also ignore the collision if we see more than one collision from the same
remote source to avoid problems on loops.

5 years agov4l2transform: set right buffer count.
Song Bing [Mon, 15 Apr 2019 23:32:03 +0000 (16:32 -0700)]
v4l2transform: set right buffer count.

Set right buffer count to avoid one buffer.

5 years agortph265pay: Also immediately send packet if it is a suffix NAL
Olivier Crête [Thu, 27 Jun 2019 23:47:41 +0000 (19:47 -0400)]
rtph265pay: Also immediately send packet if it is a suffix NAL

Immediately send packet if it contains any suffix NAL, this is required
in case they come after the VCL nal to not have to wait until the next frame.

5 years agortph265pay: Don't drop second byte of NAL header
Olivier Crête [Thu, 27 Jun 2019 23:46:01 +0000 (19:46 -0400)]
rtph265pay: Don't drop second byte of NAL header

At least keep 2 bytes per NAL even if the second one is 0, the
second byte of the NAL header could very well be 0.

5 years agortph26xpay: Avoid print when there is no bundle at end of packet
Olivier Crête [Wed, 26 Jun 2019 20:42:44 +0000 (16:42 -0400)]
rtph26xpay: Avoid print when there is no bundle at end of packet

5 years agortph26xpay: Wait until there is a VCL or suffix NAL to send
Olivier Crête [Wed, 26 Jun 2019 20:25:01 +0000 (16:25 -0400)]
rtph26xpay: Wait until there is a VCL or suffix NAL to send

With unit tests.

5 years agortph265pay test: Add unit tests for aggregation
Olivier Crête [Wed, 19 Jun 2019 21:16:03 +0000 (17:16 -0400)]
rtph265pay test: Add unit tests for aggregation

5 years agortph265pay: Implement Aggregation packets
Olivier Crête [Tue, 18 Jun 2019 23:07:38 +0000 (19:07 -0400)]
rtph265pay: Implement Aggregation packets

Align with rtph264pay

5 years agortph264pay test: Add unit tests for aggregation
Olivier Crête [Tue, 18 Jun 2019 19:03:09 +0000 (15:03 -0400)]
rtph264pay test: Add unit tests for aggregation

5 years agortph264pay: Report latency when in maximal aggregation mode
Olivier Crête [Tue, 18 Jun 2019 17:45:15 +0000 (13:45 -0400)]
rtph264pay: Report latency when in maximal aggregation mode

5 years agortph264pay: Default to not adding latency when aggregating
Olivier Crête [Mon, 17 Jun 2019 15:31:53 +0000 (11:31 -0400)]
rtph264pay: Default to not adding latency when aggregating

Send the bundle as soon as there is one VCL unit in the packet at
the end of an incoming buffer.

The DELTA_UNIT flag is not reliable, so ignore it.

5 years agortp-payloading test: Fix working to 1.0 buffers instead of groups
Olivier Crête [Fri, 14 Jun 2019 20:54:23 +0000 (16:54 -0400)]
rtp-payloading test: Fix working to 1.0 buffers instead of groups

5 years agortph265pay: Replace fragmentation while-loop with for-loop
Olivier Crête [Thu, 13 Jun 2019 22:07:35 +0000 (18:07 -0400)]
rtph265pay: Replace fragmentation while-loop with for-loop

Align with rtph264pay

5 years agortph265pay: Rename payload_len to max_fragment_size
Olivier Crête [Thu, 13 Jun 2019 21:42:05 +0000 (17:42 -0400)]
rtph265pay: Rename payload_len to max_fragment_size

Align to rtph264pay

5 years agortph265pay: Clean up _payload_nal
Olivier Crête [Thu, 13 Jun 2019 21:30:08 +0000 (17:30 -0400)]
rtph265pay: Clean up _payload_nal

Move determining whether we need to fragment at all into the
fragmenter.

Align with rtph264pay

5 years agortph265pay: Extract sending fragments into _payload_nal_fragment
Olivier Crête [Thu, 13 Jun 2019 21:23:26 +0000 (17:23 -0400)]
rtph265pay: Extract sending fragments into _payload_nal_fragment

Align with rtph264pay

5 years agortph265pay: Extract sending a single packet into _payload_nal_single
Olivier Crête [Thu, 13 Jun 2019 20:22:57 +0000 (16:22 -0400)]
rtph265pay: Extract sending a single packet into _payload_nal_single

Align with rtph264pay

5 years agortph265pay: Define and use FU_A_TYPE_ID
Olivier Crête [Thu, 13 Jun 2019 20:14:31 +0000 (16:14 -0400)]
rtph265pay: Define and use FU_A_TYPE_ID

Align with rtph264pay

5 years agortph265pay: Use snake_case variables
Olivier Crête [Thu, 13 Jun 2019 20:08:37 +0000 (16:08 -0400)]
rtph265pay: Use snake_case variables

Align with rtph264pay

5 years agortph265pay: Clean up whitespace and syntax
Olivier Crête [Thu, 13 Jun 2019 20:04:39 +0000 (16:04 -0400)]
rtph265pay: Clean up whitespace and syntax

Align with rtph264pay

5 years agortph264pay: Support STAP-A bundling
Jan Alexander Steffens (heftig) [Tue, 3 Jul 2018 17:39:25 +0000 (19:39 +0200)]
rtph264pay: Support STAP-A bundling

Add a new property "do-aggregate"* to the H.264 RTP payloader which
enables STAP-A aggregation as per [RFC-6184][1]. With aggregation enabled,
packets are bundled instead of sent immediately, up until the MTU size.
Bundles also end at access unit boundaries or when packets have to be
fragmented.

*: The property-name is kept generic since it might apply more widely,
   e.g. STAP-B or MTAP.
[1]: https://tools.ietf.org/html/rfc6184#section-5.7

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

5 years agortph264pay: Fix delta-unit/discont handling when injecting SPS/PPS
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 16:15:39 +0000 (17:15 +0100)]
rtph264pay: Fix delta-unit/discont handling when injecting SPS/PPS

Apply the wanted delta-unit and discont to the first packet; following
packets for this frame are always delta units and not discont.

5 years agortph264pay: Replace fragmentation while-loop with for-loop
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 18:03:45 +0000 (19:03 +0100)]
rtph264pay: Replace fragmentation while-loop with for-loop

5 years agortph264pay: Calculate the right max_fragments
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 17:57:38 +0000 (18:57 +0100)]
rtph264pay: Calculate the right max_fragments

5 years agortph264pay: Rename payload_len to max_fragment_size
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 17:36:35 +0000 (18:36 +0100)]
rtph264pay: Rename payload_len to max_fragment_size

5 years agortph264pay: Clean up _payload_nal_fragment
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 17:34:40 +0000 (18:34 +0100)]
rtph264pay: Clean up _payload_nal_fragment

5 years agortph264pay: Clean up _payload_nal
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 17:06:19 +0000 (18:06 +0100)]
rtph264pay: Clean up _payload_nal

Move determining whether we need to fragment at all into the fragmenter.

5 years agortph264pay: Clean up _payload_nal_single
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 17:04:13 +0000 (18:04 +0100)]
rtph264pay: Clean up _payload_nal_single

5 years agortph264pay: Extract sending fragments into _payload_nal_fragment
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 16:55:23 +0000 (17:55 +0100)]
rtph264pay: Extract sending fragments into _payload_nal_fragment

5 years agortph264pay: Extract sending a single packet into _payload_nal_single
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 16:49:52 +0000 (17:49 +0100)]
rtph264pay: Extract sending a single packet into _payload_nal_single

5 years agortph264pay: Define and use FU_A_TYPE_ID
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 16:10:03 +0000 (17:10 +0100)]
rtph264pay: Define and use FU_A_TYPE_ID

5 years agortph264pay: Use snake_case variables
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 16:07:06 +0000 (17:07 +0100)]
rtph264pay: Use snake_case variables

5 years agortph264pay: Clean up whitespace and syntax
Jan Alexander Steffens (heftig) [Mon, 5 Nov 2018 16:04:14 +0000 (17:04 +0100)]
rtph264pay: Clean up whitespace and syntax