Commit graph

10001 commits

Author SHA1 Message Date
Mikhail Fludkov 57b0522cd7 rtpptdemux: set payload to caps inside gst_rtp_pt_demux_get_caps
Refactoring to remove duplicate code and add test
2020-02-11 18:39:22 +00:00
Stian Selnes 629b71ac9c rtpptdemux: Fix debug to use GST_DEBUG_OBJECT 2020-02-11 18:39:22 +00:00
Mikhail Fludkov 851a2b7925 rtpbin: use max-streams on rtpssrcdemux
The proper way of capping on max-streams is to do it in rtpssrcdemux.
This patch uses the newly introduced property on rtpssrcdemux. Previous
behavior would not prevent rtpssrcdemux spawning new pads for every new
ssrc and potentialy causing performance trouble during teardown.
2020-02-11 15:12:07 +01:00
John Bassett 16d750bc01 rtpssrcdemux: Handle RTCP APP packets
Fix crash when processing RTCP APP packets.
2020-02-11 15:12:07 +01:00
John Bassett 5800950a2d rtpssrcdemux: Bad RTP/RTCP packet is not fatal
When used for processing bundled media streams within rtpbin the rtpssrcdemux element may
receive bad RTP and RTCP packets, these should not be treated as a fatal error.
2020-02-11 15:10:12 +01:00
Mikhail Fludkov 35596e7fac rtpssrcdemux: introduce max-streams property
The property is useful against atacks when the sender changes SSRC for
every RTP packet. The property with the same name introduced in rtpbin
was not enough, because we still can end up with thousands of pads
allocated in rtpssrcdemux.
2020-02-11 15:10:12 +01:00
Alexander Lapajne 54c4ba82f8 rtspsrc: Fix for segmentation fault when handling set/get_parameter requests
gstrtspsrc uses a queue, set_get_param_q, to store set param and get
param requests. The requests are put on the queue by calling
get_parameters() and set_parameter(). A thread which executs in
gst_rtspsrc_thread() then pops requests from the queue and processes
them. The crash occured because the queue became empty and a NULL
request object was then used. The reason that the queue became empty
is that it was popped even when the thread was NOT processing a get
parameter or set parameter command. The fix is to make sure that the
queue is ONLY popped when the command being processed is a set
parameter or get parameter command.
2020-02-10 09:43:17 +01:00
Olivier Crête c00796eaa5 rtpsession: Add test for packet rate maths 2020-02-06 14:01:38 -05:00
olivier.crete@collabora.com 774ddb15b8 rtpstats: Base the packet rate average on the packet rate itself
Do this so that the average update speed is in time instead of varying
based on the actual packet arrival rate.
2020-02-06 14:00:48 -05:00
olivier.crete@collabora.com a637ec3da8 rtpstats: Don't save the ts & seqnum if the avg is not updated
This makes it update correctly when you have more than one packet per
frame.
2020-02-06 14:00:48 -05:00
Sebastian Dröge f6e383b749 splitmuxsink: Include actual sink element in the fragment-opened/closed messages
If not configuring the sinks via the "location" property this can be
useful to know for which sink the fragment was actually opened/closed,
especially if finalization of the fragments is happening asynchronously.
2020-01-29 13:30:00 +00:00
Juergen Werner 755dba4561 rtpjitterbuffer: fix scaling from RTP-time to NTP-time
The scaling was inverse.
2020-01-29 12:05:07 +01:00
Mathieu Duponchelle a245e85fb1 rtprtxsend: allow generic input caps
When connected to an upstream rtpfunnel element, payload-type,
ssrc and clock-rate will not be present in the received caps.

rtprtxsend can already deal with only the clock rate being
present there, a new property is exposed to allow users to
provide a payload-type -> clock-rate map, this enables the
use of the max-size-time property for bundled streams.
2020-01-28 15:44:13 +00:00
Sebastian Dröge eb0b676fae splitmuxsink: Check the correct sink class for the existence of the "location" property 2020-01-27 15:53:40 +02:00
Sebastian Dröge 5877d945a4 qtdemux: Always prefer information from v1/v2 sound sample description over sample description entry
ffmpeg is doing the same and various files in the wild have bogus
information in the sample description if the same information is also
duplicated afterwards in the v1/v2 sound sample desription.

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

Also remove ad-hoc GST_READ_DOUBLE_BE re-implementation and move the
switch for legacy audio formats after reading all the sample
descriptions as we want to override the values from there.
2020-01-27 14:14:50 +02:00
Sebastian Dröge c4f6ce789d avimux: Add support for >2 raw audio channels
For this case write a WAVEFORMATEXTENSIBLE header and also reorder the
raw audio channels to the AVI channel order if needed.
2020-01-19 12:09:38 +00:00
Sebastian Dröge 451fc5c112 wavenc: Fix writing of the channel mask with >2 channels
The channel position is an enum but the conversion code assumed it's a
mask. Convert accordingly.
2020-01-13 19:50:06 +00:00
Kristofer Björkström 9c86414279 rtph265pay: TID for NALU type 48 was always set to 7
A typo bug: | instead of & resulted in TID alwasy being set to 7
for the aggregated NALU of type 48
2020-01-13 15:41:30 +01:00
Sebastian Dröge c17d5e36ad imagefreeze: Add support for replacing the output buffer
By default imagefreeze will still reject new buffers after the first one
and immediately return GST_FLOW_EOS but the new allow-replace property
allows to change this.

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

Only the very first time negotiation of a framerate with downstream is
performed, afterwards only the caps themselves apart from the framerate
are updated.
2020-01-11 08:04:43 +00:00
Alicia Boya García 8dd42666e3 qtdemux: Fix race on pad reconnection
Elements emitting frames through several srcpads should use a
flow combiner to aggregate the chain returns and therefore only return
GST_FLOW_NOT_LINKED to upstream when all the downstream pads have
received GST_FLOW_NOT_LINKED.

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

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

This patch adds handling of RECONFIGURE events to qtdemux. Also, since
this event handling causes the flow combiner to be used from a thread
other than the qtdemux streaming thread, usages of the flow combiner
has been guarded by the object lock.
2020-01-09 18:43:02 +00:00
Seungha Yang 8445685a21 splitmuxsink: Fix assertion failure on set_property()
GValue might have null object.

(gst-inspect-1.0:10304): GStreamer-CRITICAL ...
    gst_object_ref_sink: assertion 'object != NULL' failed
2020-01-07 01:24:01 +09:00
Daniel Molkentin bb1ce82e39 videocrop: allow properties to be animated by GstController 2020-01-03 15:16:02 +01:00
Aaron Boxer 09d4514814 rtspsrc: improved handling of control concatenation with base
Also, `control_url` variable has been renamed to `control_path`,
as it is actually a path.
2019-12-30 16:52:45 +00:00
Aaron Boxer ed6b5a3a63 rtspsrc: append aggregate control string to base URL before query string
Appending control string to end of query changes meaning of query string
Fixes #650
2019-12-30 16:52:45 +00:00
Niels De Graef acab06b2e8 alpha: Cleanup using G_DECLARE_FINAL_TYPE
We started depending on GLib 2.44, so we can clean up all the GObject
boilerplate macros.
2019-12-28 04:05:13 +00:00
Stéphane Cerveau b928517f1e good: use of g_value_dup_string
Use helper method to get string from GValue.
2019-12-20 09:30:26 +00:00
Havard Graff 8b96d8ee8d rtpbin: fix shutdown crash in rtpbin
The key is to make sure the jitterbuffer is set to NULL *before* the
ptdemux.

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

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

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

Notice also that there is not point in disconnecting the signals on the
ptdemux before this point, since we need the push-thread to settle
down before we can do this in a non-racy way.
2019-12-20 08:27:07 +00:00
Aaron Boxer 4155c59cc4 rtspsrc: avoid seek DISCONT when only rate changes in same direction
Not setting DISCONT avoids a noticable delay when seeking
with only rate changing, in the same direction as current
rate.
2019-12-19 05:54:38 +00:00
Olivier Crête 9db1d740e8 rtspsrc: Remove deprecated GTimeVal
GTimeVal won't work past 2038
2019-12-18 19:48:34 +00:00
Sebastian Dröge 04806a75bd avimux: Add support for S24LE and S32LE raw audio
avidemux already handles this correctly.
2019-12-18 11:16:30 +00:00
Sebastian Dröge 4dbaff424f avimux: Allow muxing v210 video into AVI
avidemux already handles this.
2019-12-18 10:20:25 +00:00
Vivia Nikolaidou 7cbc351e05 flvdemux: Don't replace video codec data when we receive a PAR
Receiving a pixel-aspect-ratio should trigger a caps change, but not
replace the existing video codec tag
2019-12-16 21:51:38 +00:00
Mathieu Duponchelle 5766731bd4 qtmux: protect access to GstElement.sinkpads 2019-12-16 14:17:38 +00:00
Mathieu Duponchelle e2462005fb qtmux: port to GstAggregator 2019-12-16 14:17:38 +00:00
Joakim Johansson 4d7d577496 gstrtspsrc: Add missing lock on free set_get_param_q
Otherwise is it possible to get a crash in gst_rtspsrc_set_parameter.
2019-12-16 13:13:00 +01:00
Sebastian Dröge 9f6ed9ec72 splitmuxsink: Increment fragment_id even if no fragment location was provided
Applications might handle locations and generally configuration of the
sink by themselves instead of having splitmuxsink set the location on
the sink. Nonetheless it makes sense to increment the fragment_id that
is passed to the signal so that applications know which fragment is
requested.
2019-12-13 22:59:55 +00:00
Jan Alexander Steffens (heftig) 9e0eb77810
flvmux: Use the last DTS for the metadata timestamp
This avoids creating a timestamp regression during a stream.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/429
2019-12-12 11:09:31 +01:00
Mathieu Duponchelle 625eb00c06 qtdemux: send GAP events for lagging audio and video streams too
The logic is taken straight from matroskademux, see
77403d0afe
2019-12-11 19:59:13 +00:00
Seungha Yang 5009cad220 flvmux: Use thread-safe gmtime_r if available
gmtime on *nix is not thread-safe.
2019-12-10 23:48:35 +09:00
Stéphane Cerveau b44d37a338 splitmuxsink: provides a start-index property
Allow to change the fragment-id start index.
2019-12-05 14:58:40 +00:00
Tim-Philipp Müller 1df530eaa7 rtpjpegdepay: outputs framed jpeg
Add parsed=true to output caps, as we always output
whole frames, timestamped and all. Means also that
the output can be decoded by avdec_mjpeg wihout
plugging an extra parser (which has no rank).
2019-12-04 13:02:54 +00:00
Jan Alexander Steffens (heftig) 06600b2cd9
flvmux: Correct metadata handling in file and stream mode
In file mode, only push one onMetaData at the start of the stream.

In stream mode, always push complete onMetaData. They get replaced, not
merged.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/418
2019-12-03 14:01:19 +01:00
Jan Alexander Steffens (heftig) 6fdb6ece6e
flvmux: Don't calculate duration in streamable mode
There's no header to rewrite, so the duration is left unused.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/418
2019-12-03 14:01:14 +01:00
Havard Graff a7c887b197 rtpL16depay: don't crash if data is not modulo channels*width 2019-12-03 00:02:48 +00:00
Havard Graff 690c15bd78 rtpopuspay: use baseclass allocator for buffers
That way we get some of the meta -> rtp-extension goodies.
2019-12-02 13:05:12 +01:00
Havard Graff f997859913 rtpsession: add locking for clear-pt-map
...or it will segfault from time to time...
2019-11-29 14:23:49 +01:00
Linus Svensson 08060dd97b matroskamux: Add property to set DateUTC
Add a property that makes it possible for an application to set the
DateUTC header field in matroska files. This is useful for live feeds,
where the DateUTC header can be set to a UTC timestamp, matching the
beginning of the file.

Needs gstreamer!323

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/481
2019-11-25 14:01:48 +01:00
Linus Svensson 0690bd1b21 matroskamux: Use nanosecond precision for DateUTC
DateUTC is specified with nanosecond precision in matroska, make use of
that.
2019-11-22 16:30:50 +01:00
Jan Alexander Steffens (heftig) 1e7d2e2bbd
matroskamux: Pass the right size to gst_collect_pads_add_pad
We were lucky that GstMatroskamuxPad is larger than GstMatroskaPad.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/393
2019-11-19 14:57:11 +01:00
aogun a6e28ca268 aacparse: fix wrong offset of adts channel 2019-11-18 01:06:41 +00:00