Commit graph

9481 commits

Author SHA1 Message Date
Mikhail Fludkov 386ca1d378 rtpsession: Fix on-feedback-rtcp race
If there is an external source which is about to timeout and be removed
from the source hashtable and we receive feedback RTCP packet with the
media ssrc of the source, we unlock the session in
rtp_session_process_feedback before emitting 'on-feedback-rtcp' signal
allowing rtcp timer to kick in and grab the lock. It will get rid of
the source and rtp_session_process_feedback will be left with RTPSource
with ref count 0.

The fix is to grab the ref to the RTPSource object in
rtp_session_process_feedback.

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-13 20:33:56 +01:00
Stian Selnes 29f26e8768 rtpsession: Add missing lock around sess->ssrcs iteration
https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-13 19:17:02 +01:00
John-Mark Bell 0a2b55ac3c rtpsession: do not emit RBs for internal senders.
These are the sources we send from, so there is no reason to
report receive statistics for them (as we do not receive on them,
and the remote side has no knowledge of them).

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-13 19:16:59 +01:00
Vivia Nikolaidou 498ebc5503 splitmuxsink: Added caption_%u pad template
For closed-caption-enabled muxers (e.g. qtmux)
2018-05-11 16:39:46 +03:00
Edward Hervey 4253c51c5f qtdemux: Initialize riff library
Avoids debugging message issues. Also just use the main riff header
2018-05-10 13:59:36 +02:00
Seungha Yang 7651036530 qtdemux: Protect _expose_streams() from flush event
Flush during stream change can break autoplugging or the
flush event could be dropped.

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang d72a7c038c qtdemux: Try to expose whenever got new moov or new stream-start
Whenever got new moov or new stream-start,
demux will try to expose new pad by following rule.

Comparing stream-id in the current moov with previous one, then
* If matched stream-id is found from previous one,
  reuse existing pad (most common case)
* Otherwise, expose new pad with new stream-start
* No more used stream will be freed

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang 0bd3459053 qtdemux: Remove duplication of initializing member variables
Most initialization of variables in gst_qtdemux_init() are duplicated in
gst_qtdemux_reset() function.

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang 553607756b qtdemux: Create stream whenever got new moov
Whenever demux got moov, demux will create new stream. Only exception is
duplicated track-id in a moov box. In that case the first stream
will be accepted. This patch is pre-work for rework of moov handling.

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang 96a6aab6a1 qtdemux: Store stream-id to manage streams
In order to figure out stream change such as
track-id change or stream-id change, demux will store
 stream-id per QtDemuxStream structure.

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang b5245be1b1 qtdemux: Use GList to manage QtDemuxStream
* Move to GList from static array
* Logging track-id instead of array index. It's more meaningful.

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang aca8d32437 qtdemux: Adjust the number of args of some functions
To be used with g_list_free_full in the next patch

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang 80f391aa3b qtdemux: Add parentheses in macro
https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Marinus Schraal c2cce8a9fc isomp4: Use full date time if available
The ©day tag contains a full date time, use it for the DATE_TIME tag
instead of just the DATE tag. This overrules the unreliable qt creation
time.

https://bugzilla.gnome.org/show_bug.cgi?id=731029
2018-05-09 15:49:30 +02:00
Jan Schmidt 9cbde904e8 rtspsrc: Fix doc comment markers 2018-05-07 01:40:05 +10:00
Kyrylo Polezhaiev 70a55f90a3 icydemux: avoid timestamp field initialisation for tag event
This field is not used and will be removed in 2.0 API.

https://bugzilla.gnome.org/show_bug.cgi?id=761462
2018-05-07 01:25:25 +10:00
Matej Knopp 61ba778347 dcaparse: do not accept header with invalid channel count
https://bugzilla.gnome.org/show_bug.cgi?id=737928
2018-05-06 11:08:20 +02:00
Anthony Violo 36e49fd6f8 BugFix : Change peak value to normalize audio file with fallback gain
https://bugzilla.gnome.org/show_bug.cgi?id=673970
2018-05-05 16:49:57 +02:00
Tim-Philipp Müller 5b8e775d1c rtpvrawpay: don't use buffer lists if everything fits into one buffer
People might use very large mtu sizes where every payload
fits into a single output packet.

https://bugzilla.gnome.org/show_bug.cgi?id=795758
2018-05-05 16:32:59 +02:00
Olivier Crête c2c7d110e5 flvmux: Don't wake up the muxer unless there is data
https://bugzilla.gnome.org/show_bug.cgi?id=795332
2018-04-26 15:41:54 -04:00
Olivier Crête 11297c3337 flvmux: Save the current position in the output segment
https://bugzilla.gnome.org/show_bug.cgi?id=795332
2018-04-26 15:41:54 -04:00
Olivier Crête 168fae813b flvmux: Wait for caps from both srcs before writing header
Wait for caps on all pads to start writing data even when source is live.

Includes unit test by Havard Graff that simulates it.

https://bugzilla.gnome.org/show_bug.cgi?id=794722
2018-04-26 15:41:54 -04:00
Xavier Claessens edd9c8f6b8 Meson: Generate pc file for all plugins in good
https://bugzilla.gnome.org/show_bug.cgi?id=794568
2018-04-25 11:07:06 +01:00
Edward Hervey 90244da780 qtmux: Read caption from input buffer
And not from unallocated output buffer GstMapInfo

CID #1435131
2018-04-25 10:37:40 +02:00
Edward Hervey 7378f1b4fd isomp4: qtmux: Add Closed Caption support
Supports CEA 608 and CEA 708 CC streams

Also supports usage in "Robust Prefill" mode if the incoming caption
stream is constant (i.e. there is one incoming CC buffer for each
video frame).

https://bugzilla.gnome.org/show_bug.cgi?id=606643
2018-04-23 15:58:10 +02:00
Edward Hervey 76e32ef414 isomp4: Make 'gmhd' atom usage more generic
Only the 'gmin' atom is required. Any other entry within it are
optional.

https://bugzilla.gnome.org/show_bug.cgi?id=606643
2018-04-23 15:58:10 +02:00
Mathieu Duponchelle 90f5ae8f45 ulpfecdec: output perfect seqnums
ULP FEC, as defined in RFC 5109, has the protected and protection
packets sharing the same ssrc, and a different payload type, and
implies rewriting the seqnums of the protected stream when encoding
the protection packets. This has the unfortunate drawback of not
being able to tell whether a lost packet was a protection packet.

rtpbasedepayload relies on gaps in the seqnums to set the DISCONT
flag on buffers it outputs. Before that commit, this created two
problems:

* The protection packets don't make it as far as the depayloader,
  which means it will mark buffers as DISCONT every time the previous
  packets were protected

* While we could work around the previous issue by looking at
  the protection packets ignored and dropped in rtpptdemux, we
  would still mark buffers as DISCONT when a FEC packet was lost,
  as we cannot know that it was indeed a FEC packet, even though
  this should have no impact on the decoding of the stream

With this commit, we consider that when using ULPFEC, gaps in
the seqnums are not a reliable indicator of whether buffers should
be marked as DISCONT or not, and thus rewrite the seqnums on
the decoding side as well to form a perfect sequence, this
obviously doesn't prevent the jitterbuffer from doing its job
as the ulpfec decoder is downstream from it.

https://bugzilla.gnome.org/show_bug.cgi?id=794909
2018-04-19 18:17:39 +02:00
Sebastian Dröge 6d92fcd043 Revert "rtspsrc: Fix up sendonly/recvonly attribute handling"
This reverts commit af273b4de9.

While RFC 3264 (SDP) says that sendonly/recvonly are from the point of view of
the requester, the actual RTSP RFCs (RFC 2326 / 7826) disagree and say
the opposite, just like the ONVIF standard.

Let's follow those RFCs as we're doing RTSP here, and add a property at
a later time if needed to switch to the SDP RFC behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=793964
2018-04-17 17:58:01 +03:00
Sebastian Dröge 336a97157c flacparse: Drain the parser when a CAPS event is received
After a CAPS event, in theory a new stream can start and it might start
with the FLAC headers again. We can't detect FLAC headers in the middle
of the stream, so we drain the parser to be able to detect either FLAC
headers after the CAPS event or the continuation of the previous stream.

This fixes for example

gst-launch-1.0 audiotestsrc num-buffers=200 ! flacenc ! c. \
    audiotestsrc num-buffers=200 freq=880 ! flacenc ! c. \
    concat name=c ! rtpgstpay ! udpsink host=127.0.0.1 port=5000

gst-launch-1.0 udpsrc multicast-group=127.0.0.1 port=5000 \
    caps=application/x-rtp,media=application,clock-rate=90000,encoding-name=X-GST ! \
    rtpgstdepay ! flacparse ! flacdec ! audioconvert ! pulsesin
2018-04-16 21:29:57 +03:00
Mathieu Duponchelle fc9db36a1f flvmux: unref return of aggregator_pad_peek_buffer
We ended up leaking every single buffer going through the
muxer, which is far from ideal
2018-04-13 23:01:20 +02:00
Mathieu Duponchelle ee99cd7037 qtmux: Fix leak
gst_qt_mux_can_renegotiate () gets called everywhere following
that pattern:

return gst_qt_mux_can_renegotiate (ref(self));

This means the reference must be released both in the success
and failure cases, it was only done in the success case.
2018-04-13 22:49:43 +02:00
Mathieu Duponchelle acb6090e47 flvmux: aggregate should not push EOS itself
Instead it is expected to return GST_FLOW_EOS, and let the
base class handle that.
2018-04-13 22:44:14 +02:00
Alicia Boya García a5e93b7062 matroskademux: Add comment about Opus clipping
https://bugzilla.gnome.org/show_bug.cgi?id=793523
2018-04-13 09:50:35 +01:00
Sebastian Dröge c84f4e0491 monoscope: Only fixate pixel-aspect-ratio if the field exists 2018-04-11 21:42:16 +02:00
Vivia Nikolaidou 7d7c90bf5c splitmuxsink: Don't send fragment-opened-closed message if the reference ctx is NULL
It can happen during teardown that the reference context becomes NULL.
In that case, trying to send the fragment-opened-closed message would
lead to a crash.
2018-04-11 17:59:21 +03:00
Sebastian Dröge 6d7242925b splitmuxsink: Run gst_iterator_foreach() as long as it returns GST_ITERATOR_RESYNC
CID 1434160
2018-04-11 09:21:19 +02:00
Edward Hervey 2662f58cc9 qtdemux: Fix comparision for extra caption atom
We want to make sure we have *enough* data for the potential 2nd
caption atom.

CID #1434161
2018-04-11 08:51:32 +02:00
Edward Hervey 8213fc2edf qtdemux: Handle bogus caption samples
Corrupted files could potentially have multiple cdat/cdt2 atoms in
a sample entry, which is unclear how to handle.

Ignore repeated ones.

CID #1434162
CID #1434159
2018-04-11 08:45:06 +02:00
Sebastian Dröge 21eb9b49be monoscope: Fixate pixel-aspect-ratio too and make sure the final caps are completely fixated
Otherwise e.g. this fails with assertions:
gst-launch-1.0 audiotestsrc ! audioconvert ! monoscope ! videoconvert ! \
    videoscale ! video/x-raw,width=800,height=600 ! ximagesink
2018-04-10 21:17:30 +02:00
Edward Hervey 7229bfd068 qtmux: Add comments and doc about prefill mode 2018-04-09 15:25:50 +02:00
Edward Hervey cc0c27850a qtmux: Refactor pad re-negotiation code
It was similar for all pads

https://bugzilla.gnome.org/show_bug.cgi?id=606643
2018-04-09 15:25:50 +02:00
Edward Hervey 2869edeea2 qtdemux: Detect and expose CEA 608/708 Closed Caption tracks
https://bugzilla.gnome.org/show_bug.cgi?id=606643
2018-04-09 15:25:50 +02:00
Mathieu Duponchelle 8270cbacb4 rtxsend: fix wrong memory layout assumption
The code responsible for creating retransmitted buffers
assumed the stored buffer had been created with
rtp_buffer_new_allocate when copying the extension data,
which isn't necessarily the case, for example when
the rtp buffers come from a udpsrc.

https://bugzilla.gnome.org/show_bug.cgi?id=794958
2018-04-06 20:25:04 +02:00
Mathieu Duponchelle 4f8b34ab85 rtpbin: new signal "get-storage"
Similar to the get-session and get-internal-session signals,
we expose a get-storage signal in addition to the
get-internal-storage signal to give access to the actual
element for applications that need to set properties on the
element, in particular "size-time"

https://bugzilla.gnome.org/show_bug.cgi?id=794910
2018-04-06 20:21:43 +02:00
Sebastian Dröge 0f1770f2bd splitmuxsink: Add new reset-muxer property
With this the muxer is not set to NULL after each segment but instead
only flush events are sent to it to reset the EOS state.

As a result, the muxer will keep stream state and e.g. mpegtsmux will
keep the packet continuity counter continuous between segments as needed
by hlssink2.

https://bugzilla.gnome.org/show_bug.cgi?id=794816
2018-04-03 14:37:44 +03:00
Mathieu Duponchelle 893d39cef7 rtspsrc: reject segment seeks
https://bugzilla.gnome.org/show_bug.cgi?id=784681
2018-03-26 21:13:12 +02:00
Edward Hervey d7038b9bb0 qtdemux: Handle variant of vorbis in mp4
Comes from gpac apparently. The codec_data uses the same packing
mechanism as matroska.

https://bugzilla.gnome.org/show_bug.cgi?id=738244
2018-03-22 15:22:33 +01:00
Edward Hervey 60bc77cc35 qtdemux: Check sample count is valid in PIFF parsing
The value stored in cenc_aux_sample_count wasn't in sync with the
parsing code that followed which checks whether all entries are
valid and present.

Only write the actual sample count when we know for sure.

CID #1427087
2018-03-22 15:22:24 +01:00
Petr Kulhavy 738eb0d8ed udpsrc: switch to using a buffer pool
This exposes a new property, mtu, which is used to determine the
initial size of buffers from the buffer pool. If received data
exceeds this, the element gracefully handles that in a manner similar
to what we had previously: a large memory gets filled and reallocated
at the next call to "fill".

The default size is set to 1500, which should cover most use cases.

With contributions from Mathieu Duponchelle <mathieu@centricular.com>

https://bugzilla.gnome.org/show_bug.cgi?id=772841
2018-03-21 17:47:27 -04:00
Petr Kulhavy 589019d8f5 udpsrc: optimize GstUdpSrc object for cache performance
Optimize GstUdpSrc for cache performance.

Move the hot properties, which are used by the read function, to the top:
@used_socket, @addr, @cancellable, @skip_first_bytes, @timeout,
@retrieve_sender_address.

Remove the unused property @ttl.

Where needed reorder so that holes are avoided (the 64-bit @timeout)

https://bugzilla.gnome.org/show_bug.cgi?id=772841
2018-03-21 17:47:26 -04:00