Commit graph

9581 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
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
Mathieu Duponchelle
36b991f0b3 rtpptdemux: Add ssrc to output caps
It may be useful downstream

https://bugzilla.gnome.org/show_bug.cgi?id=792696
2018-02-21 14:15:22 +01:00
Sebastian Dröge
a65a7ec05b monoscope: Forward the SEGMENT event from the chain function
Otherwise we'll break the event order and forward the SEGMENT event
before sending a CAPS event.
2018-02-18 21:38:13 +01:00
James Stevenson
d64ae7b01a rtspsrc: Fix missing read property of backchannel
Add missing read property code for backchannel

https://bugzilla.gnome.org/show_bug.cgi?id=793507
2018-02-16 12:53:07 +00:00
Sebastian Dröge
7512120e5d rtspsrc: Implement ONVIF backchannel support via TCP 2018-02-16 11:06:27 +02:00
Nirbheek Chauhan
befa41cdf6 rtspsrc: Implement ONVIF backchannel support
Set backchannel=onvif to enable, and use the 'push-backchannel-sample'
action signal with the correct stream id.
2018-02-16 11:06:27 +02:00
Jan Schmidt
d61066e6b5 splitmuxsrc: Improve not-linked handling.
Don't report not-linked unless all pads have
returned not-linked.
2018-02-16 17:02:31 +11:00
Patrick Radizi
364dbb5fc7 rtpjitterbuffer: allow timestamps to move backwards
The original solution for #784002 incorrectly assumed that timestamps
may not move backwards and changed timestamps that did so.

https://bugzilla.gnome.org/show_bug.cgi?id=784002
2018-02-15 10:05:39 +02:00
Tim-Philipp Müller
072c070e6c docs: remove pointless Since: 0.10.x markers 2018-02-15 00:58:38 +00:00
Alban Bedel
4e7ce28623 rtpvorbisdepay: fix unbounded memory usage
All received configurations are parsed and added to a list, this lead
to an unbounded memory usage. As the configuration is resent every
second this quickly lead to a large memory usage.

Add a check to only add the config if it is not already available in
the list. This fix only handle the typical case of a well behaved
stream, a malicious server could still send many useless
configurations to raise the client memory usage.
2018-02-14 18:04:56 +00:00
Edward Hervey
192b447e0b qtdemux: Fix comment typo in previous commit 2018-02-09 11:26:56 +01:00
Edward Hervey
e16be12e37 qtdemux: More 'meta' atom parsing fixes
Turns out everybody is doing it their own way, so peek into the
meta atom itself to figure out which spec it is following
2018-02-09 11:22:38 +01:00
Sebastian Dröge
e7177059e9 qtmux: Add support for muxing svmi atom for stereoscopic video information
https://bugzilla.gnome.org/show_bug.cgi?id=793120
2018-02-09 11:05:02 +02:00
Edward Hervey
4fd8635983 qtdemux: Minor cleanup
Just move variables to the blocks where they are used.

That function is massive, could do with some splitting up for
readability :(
2018-02-09 09:00:46 +01:00
Edward Hervey
357d77cf55 qtdemux: Cope with difference between QTFF and ISO BMFF specs
The 'meta' atom is defined differently in QTFF and BMFF, so try
to guess which spec the current stream applies to by looking
at the major file type.
2018-02-09 09:00:46 +01:00
Edward Hervey
b415358c7e isomp4: Make 'hdlr' atom dump more flexible
The smallest possible is 24 (and not 25) bytes.

The last "name" field can according to QTFF specifications not be present
at all. The parser will handle this fine and so will the rest of
the qtdemux code.
2018-02-09 09:00:46 +01:00
Edward Hervey
8239c67799 Update ORC files 2018-02-09 09:00:46 +01:00
Justin Kim
ad8a6cb639 qtmux: send stream warning when refusing video caps
If codec_data is changed, the stream is no longer valid.
Rather than keeping running when refusing new caps,
this patch send a warning  to the bus.

Also fix up splitmuxsink to ignore this warning while changing caps.

https://bugzilla.gnome.org/show_bug.cgi?id=790000
2018-02-01 10:12:46 +00:00
Justin Kim
dabeed52a9 rtph264depay: update output caps regardless format
`codec_data` should be transfered if any information of
SPS/PPS is changed.

https://bugzilla.gnome.org/show_bug.cgi?id=790000
2018-02-01 10:09:20 +00:00
Edward Hervey
0c56a80333 isomp4: Add gmhd/gmin debugging
* gmhd is a container, mark it as such so we can see/dump
  what is contained within
* Add dumping for the Base Media Information atom (gmin)
2018-01-31 19:12:48 +01:00
Philippe Normand
cbb9c31228 interleave: fix memory leak of GAP buffers
https://bugzilla.gnome.org/show_bug.cgi?id=793067
2018-01-31 15:16:46 +00:00
Edward Hervey
0511c4c225 qtdemux_dump: Demote verbose logging to TRACE level 2018-01-31 11:38:35 +01:00
Edward Hervey
40be9f4f85 qtdemux: Re-enable full debug logging of stsz entries
No idea why it was disabled (was the case since 2007)
2018-01-31 11:23:07 +01:00
Seungha Yang
75241cfa6b qtdemux: Remove white space at end of line
https://bugzilla.gnome.org/show_bug.cgi?id=791483
2018-01-29 18:42:47 +00:00
Seungha Yang
1551759cec qtdemux: Apply qtdemux debug category to gstisoff
.. instead of the use of default debug category.
And, make new header to declare the debug category

https://bugzilla.gnome.org/show_bug.cgi?id=791483
2018-01-29 18:40:02 +00:00
Tim-Philipp Müller
ddd4fe680f splitmuxsrc: properly set total duration on outgoing segment
We would accidentally pass through the duration value from the
demuxer from a single fragment, which causes problems when
feeding the stream from splitmuxsrc to rtsp-server. Streaming
would stop after one fragment due to that.

https://bugzilla.gnome.org/show_bug.cgi?id=792861
2018-01-29 11:29:24 +00:00
Tim-Philipp Müller
07ae64118d splitmuxsrc: don't respond to duration query with CLOCK_TIME_NONE
total_duration is initialised to CLOCK_TIME_NONE, not 0, so check
for that as well in order not to return an invalid duration to
a duration query. Doesn't fix anything particular observed in
practice, just seemed inconsistent.
2018-01-29 11:29:24 +00:00
Alicia Boya García
ac46d5c2a3 qtdemux: Add more prose to the comment of gst_qtdemux_find_sample()
https://bugzilla.gnome.org/show_bug.cgi?id=792910
2018-01-25 20:40:46 +00:00
Tim-Philipp Müller
a5b5451d93 multifilesrc: fix up uri handler a little
Fix path escaping when creating URI from location in get_uri().

Return FALSE with an error when URI can't be parsed in set_uri().

https://bugzilla.gnome.org/show_bug.cgi?id=783581
2018-01-23 18:38:26 +00:00
Dimitrios Katsaros
dccfaf2e91 multifilesrc: implement uri handler
With this patch we can now provide a set of files
created by multifilesink as a source for uri elements.

e.g. gst-launch-1.0 playbin uri=multifile://img%25d.ppm

Note that for the %d pattern you need to replace % with %25.
This is to be compliant with URL naming standards.

https://bugzilla.gnome.org/show_bug.cgi?id=783581
2018-01-23 18:05:49 +00:00
Vivia Nikolaidou
379059b1c7 qtmux: Make sure timecode uses the same timescale as video
Don't blindly derive it from the frame rate, but try to get the per-pad
configured timescale first (if it exists)

https://bugzilla.gnome.org/show_bug.cgi?id=792680
2018-01-23 16:40:36 +02:00
Sebastian Dröge
c71cd08d0e qtmux: Allow configuring trak timescale per pad/trak
It generally makes not much sense to configure it for all pads/traks at
once as this value is usually different for each of them. As such, add a
new property on the pads in addition to the existing property on the
whole muxer.

https://bugzilla.gnome.org/show_bug.cgi?id=792649
2018-01-23 16:40:23 +02:00
Tim-Philipp Müller
f459438278 Update for renamed aggregator pad API
https://bugzilla.gnome.org/show_bug.cgi?id=791204
2018-01-23 09:46:32 +00:00
Sebastian Dröge
af273b4de9 rtspsrc: Fix up sendonly/recvonly attribute handling
We can't handle recvonly streams, sendonly streams are perfectly fine.

The direction is the one from the point of view of the SDP offerer
(i.e. the RTSP server), and a recvonly stream would be one where the
server expects us to send media.

RFC 3264, section 5.1:
   If the offerer wishes to only send media on a stream to its peer, it
   MUST mark the stream as sendonly with the "a=sendonly" attribute.

This is mixed up in the ONVIF streaming specification examples, but
actual implementations and conformance tools seem to not care at all
about the attributes.

https://bugzilla.gnome.org/show_bug.cgi?id=792376
2018-01-22 12:24:18 +02:00
Jan Alexander Steffens (heftig)
e273e5f7a6 aacparse: When parsing raw input, accept frames of any size
Raw AAC streams might have very small frames, e.g. 6 byte frames
when encoding silence. These frames are then smaller than aacparse's
default min_frame_size of 10 bytes (ADTS_MAX_SIZE).

When passthrough is disabled or aacparse has to output ADTS, GstBaseParse
will concatenate these short frames to the following frame before
handling them to aacparse, which processes each input buffer as a single
frame, producing bad output.

To avoid this problem, set the min_frame_size to 1 when receiving a raw
stream.

https://bugzilla.gnome.org/show_bug.cgi?id=792644
2018-01-18 19:09:19 +00:00
Mathieu Duponchelle
03dc22951b rtpbin: fix leak of elements requested by signals
When the signal returns a floating reference, as its return type
is transfer full, we need to sink it ourselves before passing
it to gst_bin_add (which is transfer floating).

This allows us to unref it in bin_remove_element later on, and
thus to also release the reference we now own if the signal
returns a non-floating reference as well.

As we now still hold a reference to the element when removing it,
we also need to lock its state and setting it to NULL before
unreffing it

Also update the request_aux_sender test.

https://bugzilla.gnome.org/show_bug.cgi?id=792543
2018-01-18 15:26:43 +01:00
Tim-Philipp Müller
dfb27b44bc multifilesink: document unit of "max-file-duration" property 2018-01-16 13:19:29 +00:00
Florent Thiéry
7c5e39f7a7 udpsrc: fix typo in documentation
https://bugzilla.gnome.org/show_bug.cgi?id=792458
2018-01-12 18:21:06 +00:00
Tim Allen
db07fc7e85 rtp: add L8 audio support 2017-12-24 13:19:56 +01:00
Mark Nauwelaerts
f3c3f8fb38 udpsrc: fix typo in multicast join error message 2017-12-23 12:48:20 +01:00
Mark Nauwelaerts
aad0faaf59 rtspsrc: also proxy multicast-iface property to RTCP udpsrc 2017-12-23 12:48:20 +01:00
Sebastian Rasmussen
5091b5f39f multiudpsink: don't try to set IPV6_TCLASS on IPV4 sockets
Avoids ERROR log message.

https://bugzilla.gnome.org/show_bug.cgi?id=757449
2017-12-23 12:45:17 +01:00
Vincent Penquerc'h
8b814f6351 flv: flvmux ported to the GstAggregator
This makes it possible to create a flv file from a live source and not stop
when there are packet drops.

https://bugzilla.gnome.org/show_bug.cgi?id=782920
2017-12-20 15:34:11 -05:00
Olivier Crête
6ea569841d multiudpsink: Call gst_base_sink_wait_preroll on unlock
This means that packets will not be lost on fast pause/playing cycles.

Also refactor the code a little to simplify it.

https://bugzilla.gnome.org/show_bug.cgi?id=774945
2017-12-19 16:47:52 -05:00
Olivier Crête
0a15d1782b multiudpsink: Remove unused variable 2017-12-19 15:50:14 -05:00
Edward Hervey
9a7dd45e57 rtspsrc: Fix two leaks
* gst_event_new_stream_start() does not take ownership of the stream_id

* the pipeline_request_id string that is created was not being freed
2017-12-19 11:57:52 +01:00
Nicolas Dufresne
3a17f52ca3 videocrop: Add GstVideoCropMeta support
If downstream supports this meta, it will add or update it from
the GstBuffer in-place rather then copying.

https://bugzilla.gnome.org/show_bug.cgi?id=791453
2017-12-17 15:39:53 -05:00
Sean DuBois
de8f080a5c Add AV1 to matroska plugin
https://bugzilla.gnome.org/show_bug.cgi?id=784160
2017-12-15 18:00:31 +01:00
fengalin
3464aac3c9 matroska: fix memory leaks due to toc related updates
https://bugzilla.gnome.org/show_bug.cgi?id=790686
2017-12-15 16:14:43 +02:00
fengalin
a6702a76d5 matroska: re-activate and update TOC support
TOC support in mastroskamux has been deactivated for a couple of years. This commit updates it to recent GstToc evolutions and introduces toc unit tests for both matroska-mux and matroska-demux.

There are two UIDs for Chapters in Matroska's specifications:
- The ChapterUID is a mandatory unsigned integer which internally refers to a given chapter. Except for title & language which use dedicated fields, this UID can also be used to add tags to the Chapter. The tags come in a separate section of the container.
- The ChapterStringUID is an optional UTF-8 string which also uniquely refers to a chapter but from an external perspective. It can act as a "WebVTT cue identifier" which "can be used to reference a specific cue, for example from script or CSS".

During muxing, the ChapterUID is generated and checked for unicity, while the ChapterStringUID receives the user defined UID. In order to be able to refer to chapters from the tags section, we maintain an internal Toc tree with the generated ChapterUID.

When demuxing, the ChapterStringUIDs (if available) are assigned to the GstTocEntries UIDs and an internal toc mimicking the toc is used to keep track of the ChapterUIDs and match the tags with the appropriate GstTocEntries.

https://bugzilla.gnome.org/show_bug.cgi?id=790686
2017-12-15 16:14:43 +02:00
Edward Hervey
6e21faffe7 qtdemux: Push a GAP event if there's a second *or more*
And not "more than a second"
2017-12-13 12:06:49 +01:00
Edward Hervey
2e45926a96 qtdemux: Don't push GAP event if first buffer is within 1s
If we saw empty segments, we previously unconditionally pushed a
GAP event downstream regardless of the duration of that empty
segment.

In order to avoid issues with initial negotiation of downstream elements
(which would negotiate to something before receiving any data due to
that initial GAP event), check if there's at least a second of difference
(like we do for other GAP-related checks in qtdemux) before
deciding to push a GAP event downstream.
2017-12-13 11:35:37 +01:00
Edward Hervey
5c341f0980 qtdemux: Don't set pared=True on underspecified audio/mpeg
This *really* needs to go through a parser to figure out what the
exact content type is.
2017-12-13 10:21:17 +01:00
Michael Catanzaro
d9235cdb49 equalizer: Fix -Wincompatible-pointer-types warning
This is caused by the new type propagation for g_object_ref.

https://bugzilla.gnome.org/show_bug.cgi?id=791494
2017-12-11 21:57:25 +00:00
John Nikolaides
91dfc20a04 splitmuxsink: added a "split now" action signal
Now, the video file can be split at an arbitrary time chosen by the user.

https://bugzilla.gnome.org/show_bug.cgi?id=787922
2017-12-08 21:16:15 +02:00
Alvaro Margulis
66f253ed9b multiudpsink: fix bind address leak
https://bugzilla.gnome.org/show_bug.cgi?id=790986
2017-12-08 00:31:32 +00:00
Tim-Philipp Müller
d4c04cb079 Revert "flacparse: fix header rewriting being ignored"
This caused broken metadata and also looks a bit dodgy.
Revert until we can figure out a solution that works for
all cases and doesn't break anything.

This reverts commit adeee44b07.

https://bugzilla.gnome.org/show_bug.cgi?id=727802
https://bugzilla.gnome.org/show_bug.cgi?id=785558
2017-12-07 11:17:32 +00:00
Matt Staples
ea1b10e4ca rtspsrc: Add a signal to allow outgoing messages to be modified or dropped
This feature allows applications to implement extensions to the RTSP
protocol, such as those defined in the ONVIF Streaming Specification.

https://bugzilla.gnome.org/show_bug.cgi?id=762884
2017-12-06 10:46:01 +02:00
Haakon Sporsheim
3c0d006c03 rtpsession: Handle zero length feedback packets
https://bugzilla.gnome.org/show_bug.cgi?id=791074
2017-12-02 13:58:34 +00:00
Florian Zwoch
b4ca81591c qtdemux: fix debug log for 'hvcC' codec_data
https://bugzilla.gnome.org/show_bug.cgi?id=784749
2017-12-02 13:46:29 +00:00
Sebastian Dröge
b02350bd62 flacparse: Request at least the full header size when parsing headers
Otherwise baseparse will incrementally send us bigger buffers until the
full header size is reached, which is not only pointless but also means
that baseparse will reallocate and copy into a bigger buffer for every
input buffers. In pull mode that's done in 64kb increments, in push mode
usually in much smaller increments, causing a lot of overhead for
example when parsing high-quality coverart.
2017-11-29 17:28:25 +02:00
Edward Hervey
10bc8fdfd2 rtspsrc: Do more checks for seekability
When receiving a seek event, check whether we can actually seek based
on the information the server provided.

Also add more documentation on what the seekable field means
2017-11-24 15:39:38 +01:00
Jan Schmidt
a260eb80fb qtmux: Always update reserved-duration-remaining
If a reserved-max-duration is set, we should always track
and update the reserved-duration-remaining estimate, even
if we're not sending periodic moov updates downstream for
full robust muxing.
2017-11-25 00:56:11 +11:00
Jan Schmidt
76e458a119 splitmuxsink: Use muxer reserved space properties if present.
If the use-robust-muxing property is set, check if the
assigned muxer has reserved-max-duration and
reserved-duration-remaining properties, and if so set
the configured maximum duration to the reserved-max-duration
property, and monitor the remaining space to start
a new file if the reserved header space is about to run out -
even though it never ought to.
2017-11-25 00:56:11 +11:00
Jan Schmidt
3a813a0dcc splitmux: Fix file switch-on-caps-change.
Switching to a new fragment because the input caps have
changed didn't properly end the previous file. Use the normal
EOS sequence to ensure that happens. Add a test that it works.
2017-11-24 16:56:03 +11:00
Tim-Philipp Müller
c8ff205089 rtph265depay: don't insert SPS/PPS inline for hvc1 output
Only for byte-stream or hev1. For hvc1 the SPS/PPS are in the
caps as codec_data field and in this case they shouldn't be in
the stream data as well. The output caps should be updated with
the new codec_data if needed, for hvc1.
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
8da79ca824 rtph265depay: store negotiated output format as enum
We keep the boolean byte_stream around since it's nicer for
readability and most of the code just cares about byte_stream
or not. This is useful for future-proofing the code for when
we add support for hev1 output as well.
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
46861027b9 rtph265depay: add support for hvc1 as output format 2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
b84201bf81 rtph265pay: don't add trailing zeros to VPS/PPS/SPS
This would happen if input is byte-stream with four-byte
sync markers instead of three-byte ones. The code that
scans for sync markers will place the start of the NALU
on the third-last byte of the NALU sync marker, which
means that any additional zeros may be counted as belonging
to the previous NALU instead of being part of the next sync
marker. Fix that so we don't send VPS/SPS/PPS with trailing
zeros in this case.

See https://bugzilla.gnome.org/show_bug.cgi?id=732758
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
311b9895ba rtph265depay: assemble AUs into downstream-allocated memory
When merging NALs into AUs, use downstream-provided allocator
to allocate memory and copy NALs directly into that memory when
assembling them.
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
2d0ea4d381 rtph265depay: try to negotiate an allocator with downstream 2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
528b7e01f1 rtph265depay: simplify buffer accumulation control flow
There is no difference between pushing out a buffer directly
with gst_rtp_base_depayload_push() and returning it from the
process function. The base class will just call _depayload_push()
on the returned buffer as well.

So instead of marshalling buffers through three layers and back,
just push them from one place in handle_nal() and always return
NULL from the process vfunc. This simplifies the code a little.

Also rename _push_fragmentation_unit() to _finish_fragmentation_unit()
for clarity. Push sounds like it means being pushed out, whereas
it might just be pushed into an adapter.

This change has the side-effect that multiple NALs in a single STAP
(such as SPS/PPS) may no longer be pushed out as a single buffer if
we output NALs in byte-stream format (i.e. not aggregate AUs), but
that shouldn't really make any difference to anyone.
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
289882497a rtph265depay: fix crash with empty sprops-parameters
https://bugzilla.gnome.org/show_bug.cgi?id=780040
2017-11-23 09:36:15 +01:00