Commit graph

9453 commits

Author SHA1 Message Date
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
Sebastian Dröge 850e678813 qtdemux: Fix seeking on streams with frame reordering
The samples table is sorted by DTS, not PTS. As such we can only get the
correct result when using a binary search on it, if we search for the
DTS.
Also if we only ever search for the frame, where the following frame is
the first one with a PTS after the search position, we will generally
stop searching too early if frames are reordered.

In forwards playback this is not really a problem (after the decoder
reordered the frames, clipping is happening), in reverse playback
it means that we can output one or more frames too few as we stop too
early and the decoder would never receive it.

https://bugzilla.gnome.org/show_bug.cgi?id=782118
2018-03-20 12:08:28 +02:00
Sebastian Dröge ed2ccb1a60 rtp: Fix compilation with non-C99 compilers
By moving variable declarations out of loop headers.
2018-03-20 12:08:28 +02:00
Tim-Philipp Müller 56577236f8 rtpulpfecdec: fix build with older gcc
As on Ubuntu Trusty.

https://bugzilla.gnome.org/show_bug.cgi?id=794493
2018-03-19 18:39:08 +00:00
Sebastian Dröge 42f5f3d1be splitmuxsink: Allow splitting at exactly the time/bytes threshold
76e458a119 changed the conditions from
"queued > threshold" to "queued >= threshold", which broke hlssink2 and
resulting in too small fragments being created although keyframes would
be at *exactly* the configured threshold.

https://bugzilla.gnome.org/show_bug.cgi?id=794440
2018-03-19 12:23:47 +02:00
Tim-Philipp Müller 47ff21ea3b rtpulpfec: fix unconditional use of __attribute__ ((packed))
Fix compilation with MSVC. We still assume that attribute
is supported by all other relevant compilers, which seems
to be the case since we haven't had any complaints about
similar code in rtpsbcpay.
2018-03-17 20:29:35 +00:00
Tim-Philipp Müller 65ede0b565 rtpulpfec: don't use non-portable notation for 64-bit int constants
Use GLib macro instead, even if it's a bit unwieldy.
2018-03-17 13:04:47 +00:00
Tim-Philipp Müller c21765e88e rtpulpfecdec: don't use __builtin_ctzll unconditionally
Fixes build with MSVC, and possibly other compilers too.
2018-03-17 12:55:57 +00:00
Tim-Philipp Müller b387989bc6 docs: rtpbin: add some Since markers for new properties 2018-03-12 13:21:08 +00:00
Olivier Crête 96261ce220 flvmux: Duration & unit tests
The muxed buffers will not carry the duration of the
incoming buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=793457
2018-03-01 18:25:02 -05:00
Olivier Crête c0bf793c05 flvmux: Set PTS based on running time
https://bugzilla.gnome.org/show_bug.cgi?id=793457
2018-03-01 17:15:02 -05:00
Sebastian Dröge f29fe76d7e rtspsrc: Ignore sendonly/recvonly attributes unless a backchannel is configured
This works around a bug in various ONVIF cameras that implement the
attributes the wrong way around. They still won't work with a
backchannel but at least normal playback will work for the time being.
It restores pre-1.14 behaviour where we would fail to preroll on any SDP
that lists a recvonly stream. For 1.16 a better solution should be
found.

The problem here is that the ONVIF spec has the meaning of the two
attributes the wrong way around in the examples, compared to RFC4566.

https://bugzilla.gnome.org/show_bug.cgi?id=793715
2018-03-01 20:27:10 +02:00
Mathieu Duponchelle 273d2c23d9 Port to latest GstAggregator segment API
The aggregator segment is now exposed on the src pad

https://bugzilla.gnome.org/show_bug.cgi?id=793945
2018-03-01 15:35:24 +01:00
Sebastian Dröge 80d5c43a81 matroskamux: Only mark new clusters as keyframe if they start on a keyframe or we're muxing only audio
Based on a patch by Nicola Murino <nicola.murino@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=792775
2018-02-28 19:21:53 +02:00
Sebastian Dröge 15ae79838c matroskamux: Clip maximum cluster duration to the maximum possible value
Only up to timescale * G_MAXINT16 is possible as cluster duration, which
is already higher than our default value. Using higher values would
cause overflows and broken files.

Based on the investigation by Nicola Murino <nicola.murino@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=792775
2018-02-28 19:20:23 +02:00
Sebastian Dröge fc37bf70c5 matroska-mux: Refuse caps changes after starting to write headers
Matroska does not support changing the stream type and stream properties
after the headers were started to be written, and for example H264
codec_data changes can't be supported.

https://bugzilla.gnome.org/show_bug.cgi?id=782949
2018-02-28 10:38:29 +02:00
Tim-Philipp Müller 7b74816f07 rtp: fix another debug log printf format warning on 32-bit systems
rtpulpfeccommon.c:432:27: error: format ‘%lx’ expects argument of type
‘long unsigned int’, but argument 10 has type ‘guint64 {aka long long unsigned int}’

https://bugzilla.gnome.org/show_bug.cgi?id=793732
2018-02-27 13:13:49 +00:00
Mathieu Duponchelle d2b51bd727 rtpptdemux: provide example usage for ignored-payload-types 2018-02-26 17:02:52 +01:00
Mathieu Duponchelle 55ecde7ee5 rtpbin, rtpptdemux: Add missing Since markers 2018-02-26 16:53:08 +01:00
Mathieu Duponchelle 3a754d51e0 FEC elements: document, remove irrelevant properties
The ulpfecenc "mux-seq" and "ssrc" properties were initially added
because the element did more than implement ULPFEC. As it was
decided that FLEXFEC would be implemented in a separate element,
both properties are now unneeded and confusing.

Change the default for the ulpfecenc multi-packet property,
as it is expected that most users of this element will be protecting video
streams.

Change the default property for the rtpredenc allow-no-red-blocks
property, as it should also be its default mode of operation.

https://bugzilla.gnome.org/show_bug.cgi?id=793843
2018-02-26 16:41:12 +01:00
Mathieu Duponchelle efb4ee1919 rtpgstdepay: do not warn when caps were not yet received
It is expected that when connecting to a stream that has
already started, the caps will only arrive at the interval
specified on rtpgstpay, we shouldn't be warning as this is
a normal mode of operation.

https://bugzilla.gnome.org/show_bug.cgi?id=793798
2018-02-24 20:06:54 +01:00
Arnaud Bonatti e3a3d4fb76 rtpulpfec: fix debug log printf format warning on 32-bit platforms
https://bugzilla.gnome.org/show_bug.cgi?id=793732
2018-02-23 10:02:23 +00:00
Tim-Philipp Müller 427033591c docs: hook up new RTP FEC elements
https://bugzilla.gnome.org/show_bug.cgi?id=792696
2018-02-22 15:56:49 +00:00
Tim-Philipp Müller 51177004d3 rtp: dist new header files
Fixes make distcheck
2018-02-21 20:45:31 +00:00
Tim-Philipp Müller 3789afd491 rtp: fec: fix build with gstreamer debug log system disabled 2018-02-21 19:01:15 +00:00
Mathieu Duponchelle 359b0a86f1 rtpptdemux: do no assume sink caps are non NULL 2018-02-21 19:59:04 +01:00
Mathieu Duponchelle fdf64195ac rtpbin: Expose FEC support signals
Also slightly refactor complete_session_src

https://bugzilla.gnome.org/show_bug.cgi?id=792696
2018-02-21 14:15:22 +01:00
Mikhail Fludkov d5ad50bd61 rtp: Implement ULPFEC (RFC 5109)
We expose a set of new elements:

* ULPFEC encoder / decoder
* A storage element, which should be placed before jitterbuffers,
  and is used to store packets in order to attempt reconstruction
  after the jitterbuffer has sent PacketLost events
* RED encoder / decoder (RFC 2198), these are necessary to
  use FEC in webrtc, as browsers will propose and expect ulpfec
  packets to be wrapped in red packets

With contributions from:

Mathieu Duponchelle <mathieu@centricular.com>
Sebastian Dröge <sebastian@centricular.com>

https://bugzilla.gnome.org/show_bug.cgi?id=792696
2018-02-21 14:15:22 +01:00
Mathieu Duponchelle 82d0950254 rtpptdemux: Add ignored-payload-types property
Packets with these payload types will be dropped. A use case
for this is FEC, where we want FEC packets to go through the
jitterbuffer, but not be output by rtpbin.

https://bugzilla.gnome.org/show_bug.cgi?id=792696
2018-02-21 14:15:22 +01:00