Commit graph

7504 commits

Author SHA1 Message Date
Jan Schmidt 32d650491c mpegts: Re-work segment tracking
Add an output segment into the base class for sub-classes
to use for their output segment, in a place where the base
class can see it.
2019-08-07 16:39:21 +10:00
Mathieu Duponchelle aea20f207d rtponviftimestamp: add opt-out "drop-out-of-segment" property
The default behaviour of rtponviftimestamp is to drop buffers
outside the segment. This creates obvious problems for reverse
playback.

The ONVIF specification unfortunately doesn't describe how to handle
that specific use case, but we can expose a property to let the
user disable the dropping behaviour, and forward these buffers with
a G_MAXUINT64 ONVIF timestamp.

Also modify rtponvifparse to handle such timestamps appropriately.
2019-08-06 22:49:25 +00:00
Mathieu Duponchelle 1ef3186243 rtponvifparse: parse E flag and send EOS when needed 2019-08-06 22:49:25 +00:00
Sebastian Dröge 8257159909 errorignore: Try pushing again after a caps event too
It might have reconfigured everything correctly so that pushing buffers
works again afterwards, e.g. if the previous caps event was just
rejected.
2019-08-06 16:22:27 +00:00
Sebastian Dröge 5002efbf8d timecodestamper: Require a non-0/1 framerate on the pad templates
We reject caps with other framerates as it's impossible to generate
timecodes unless we actually know a constant framerate. Reflect this
also in the pad template caps.
2019-08-06 16:22:27 +00:00
Sebastian Dröge 2386385822 avwait: Improve debug output a bit 2019-08-06 16:22:27 +00:00
Fuwei Tang f3587c61ba h264parse: fix issue that caps "interlace-mode" can't be updated correctly
Upstream overrides the info "interlace-mode", otherwise update it with
SPS info.
2019-08-06 09:47:36 +08:00
Doug Nazar 6c552030f7 mpegdemux: Parse mpeg audio layer version and add to caps. 2019-08-05 14:32:24 +00:00
Doug Nazar 341a800954 mpegdemux: Finish setting up stream before adding pad. 2019-08-05 14:32:24 +00:00
Marc Leeman f5e7b4bd73 mpeg4videoparse: allow sending config at IDR
Based on h264parse, also allow to send the config at every IDR.
2019-07-31 18:03:19 +00:00
Mathieu Duponchelle 73f92371b8 basetsmux: expose pcr-interval property
Instead of using a static hardcoded PCR interval, allow the user
to configure it.

Also revert back the default to a 40 ms interval, that was changed
in recent patches for no good reason.
2019-07-31 15:54:13 +02:00
Seungha Yang 5e7dbdf585 h265parse: Add support for compatible profiles of extensions
From decoder's capability point of view as defined by the h265 specification,
accept peer profile caps.
2019-07-31 00:32:40 +09:00
Sebastian Dröge aafda1c76f timecodestamper: Validate LTC timestamps before trying to use them
There's no point in working with invalid LTC timestamps as all future
calculations will be wrong based on this, and invalid LTC timestamps can
sometimes be read via the audio input.
2019-07-25 18:27:30 +03:00
Fabrice Bellet 96004cd751 siren: fix a global buffer overflow spotted by asan
This patch just enforces boudaries for the access to the
standard_deviation array (64 floats). Such case can be
seen with a corrupted stream, where there's no hope to
obtain a valid decoded frame anyway.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1002
2019-07-22 08:00:00 +00:00
Mathieu Duponchelle f65c8fff50 rtponviftimestamp: fix setting of the discontinuity flag
The D bit is meant to be set whenever there is a discontinuity
in transmission, and directly maps to the DISCONT flag.

The E bit is not meant to be set on every buffer preceding a
discontinuity, but only on the last buffer of a contiguous section
of recording. This has to be signaled through the unfortunately-named
"discont" field of the custom NtpOffset event.
2019-07-18 23:07:57 +00:00
Mathieu Duponchelle 0d5db92953 rtponvifparse: set ONVIF timestamps as buffer PTS 2019-07-18 23:07:57 +00:00
Mathieu Duponchelle 2305bf272c h26{4,5}parse: add support for forward predicted trick mode
Also stop assigning TRUE to fields with |=
2019-07-18 13:46:45 +00:00
Seungha Yang 06d85ca487 h264parse: Update caps per pixel aspect ratio change
Output caps should be updated per pixel aspect ratio change.
2019-07-16 17:53:42 +00:00
Seungha Yang 0e4efb86c8 h265parse: Expose parsed colorimetry when VUI provided it
... and also if upstream did not specify the colorimetry.
2019-07-16 17:53:42 +00:00
Seungha Yang 375acd5a79 h264parse: Expose parsed colorimetry when VUI provided it
... and also if upstream did not specify the colorimetry.
2019-07-16 17:53:42 +00:00
Martin Theriault 30f85a3189 aiff: Fix infinite loop in header parsing. 2019-07-15 16:16:05 -04:00
Sebastian Dröge 5c324cebb9 avwait: In running-time mode, select start/end running time based on the actual video timestamps
Otherwise we would start/end at exactly the given times, which might be
up to 1 frame earlier/later than the video.
2019-07-12 12:54:02 +03:00
Sebastian Dröge 3863a356cb avwait: Add some more debug output 2019-07-12 12:54:02 +03:00
Sebastian Dröge 407f311f2c avwait: Fix clipping of audio buffers at the start of recording 2019-07-12 12:54:02 +03:00
Sebastian Dröge 6ea4557271 timecodestamper: Add support for linear timecode (LTC) from an audio stream
Based on a patch by
  Georg Lippitsch <glippitsch@toolsonair.com>
  Vivia Nikolaidou <vivia@toolsonair.com>

Using libltc from https://github.com/x42/libltc
2019-07-08 16:45:12 +00:00
Sebastian Dröge 678064d603 timecodestamper: Rewrite element API and code flow
We now have a single property to select the timecode source that should
be applied, and for each timecode source the timecode is updated at
every frame. Then based on a set mode, the timecode is added to the
frame if none exists already or all existing timecodes are removed and
the timecode is added.

In addition the real-time clock is considered a proper timecode source
now instead of only allowing to initialize once in the beginning with
it, and also instead of just taking the current time we now take the
current time at the clock time of the video frame.
2019-07-08 16:45:12 +00:00
Mathieu Duponchelle 9996ae9ae0 tsmux: output smoothly increasing PTS when in CBR mode
Thanks to that, when its output is plugged into eg a udp sink, the
outgoing data can be output in a smoother way, reducing burstiness
2019-07-04 23:28:42 +00:00
Jan Schmidt 8899a471e3 h264parse lib: Remove the SPS parse_vui_params flag
The SPS parsing functions take a parse_vui_param flag
to skip VUI parsing, but there's no indication in the output
SPS struct that the VUI was skipped.

The only caller that ever passed FALSE seems to be the
important gst_h264_parser_parse_nal() function, meaning - so the
cached SPS were always silently invalid. That needs changing
anyway, meaning noone ever passes FALSE.

I don't see any use for saving a few microseconds in
order to silently produce garbage, and since this is still
unstable API, let's remove the parse_vui_param.
2019-07-05 00:17:59 +10:00
Seungha Yang 1c99c37548 tsmuxstream: Do not try return from void function
../subprojects/gst-plugins-bad/gst/mpegtsmux/tsmux/tsmuxstream.c(1082): warning C4098:
  'tsmux_stream_get_es_descrs': 'void' function returning a value
2019-07-04 19:43:42 +09:00
Seungha Yang 00b2b599d6 mpegtsmux: Remove white space 2019-07-04 19:42:48 +09:00
Jan Schmidt bd46630b62 h265parse: Don't segfault when SPS hasn't been seen yet.
Fix a recently introduced segfault. Don't de-reference a NULL
SPS pointer when attempting to update source caps before SPS
has been seen in the stream.
2019-07-04 01:12:06 +10:00
OleksandrKvl 9a39ba6a35 irtspparse: handle multiple and incomplete frames
Interleaved frames can be fragmented between
incoming frames. Thus, we can have multiple
frames within the single input frame, as well as
incomplete frame. Now it preserves parsing
state and handle both situations.

Fixes #991
2019-07-02 13:23:27 +00:00
Seungha Yang be25c988fd rtp: Fix incompatible type build warning
Use GstURIType instead of guint

../subprojects/gst-plugins-bad/gst/rtp/gstrtpsink.c(575):
    warning C4133: '=': incompatible types ...

../subprojects/gst-plugins-bad/gst/rtp/gstrtpsrc.c(725):
    warning C4133: '=': incompatible types ...
2019-06-26 19:56:09 +09:00
OleksandrKvl 130d096608 pcapparse: Fix handling of TCP payload length
The length of the  TCP payload is the IP plus TCP header length
subtracted from the IP datagram length specified in the IP header.
Prior to this, the size was calculated incorrectly, considering
all data after TCP header as a payload till the end of a packet.

Fixes #995
2019-06-24 15:55:38 +00:00
Sebastian Dröge 934d0fcdd3 avwait: Make sure to never unref an input buffer we already unreffed before 2019-06-24 14:20:54 +03:00
Sebastian Dröge cf35802c52 avwait: Add support for setting an end running time
It was possible to set a start running time and start/end timecode
before, but not an end running time.
2019-06-24 14:20:54 +03:00
Sebastian Dröge 074df2f4bc avwait: Correctly stop recording and signal recording stop on EOS
If recording is set to FALSE after the last audio or video buffer and
before the EOS event then recording stop is never signalled.

Similarly, we should signal recording stop once both audio and video are
EOS, regardless of the recording property, as there's nothing to be
recorded anymore.
2019-06-24 07:56:04 +00:00
Sebastian Dröge 324e55a3cd mpegvideoparse: Pass through interlace-mode field from upstream if available
We generally always prefer the information from upstream for other
metadata (pixel-aspect-ration, etc.) and should also do so here.

Other parsers (h264parse) already do the same.
2019-06-19 12:49:01 +00:00
Nicola Murino 59d8e56e95 h265parse: update parser state and header flag when using fallback sps
When sps parsing fails we use a fallback sps from the caps, since we
have got an sps we need to update parser state and header as in the case the
sps was successfully parsed
2019-06-15 20:02:10 -04:00
Nicola Murino c22b52ef4d h264parse: update parser state and header flag when using fallback sps
When sps parsing fails we use a fallback sps from the caps, since we
have got an sps we need to update parser state and header as in the case the
sps was successfully parsed

Closes #503
2019-06-15 20:02:10 -04:00
Thibault Saunier 475628c20e h264parse: Post a WARNING when data is broken 2019-06-15 23:13:43 +00:00
Seungha Yang 4f6ac87f67 h265parse: Add more string representations of extension profiles 2019-06-13 23:05:09 -04:00
Dong Il Park 392f86ae35 h265parse: Update framerate when we found vps_timing_info
The timing_info was described at vps or vui parameter.
So we can update the framerate field of GstCaps when we could
parse vps_timing_info parameters.
2019-06-14 02:15:46 +00:00
Seungha Yang 6843b663b6 h265parse: Don't miss constraint indicator flags in codec data
Set more unhandled flags to general_constraint_indicator_flags field.
The field is required for building "Codecs" parameter as defined
ISO/IEC 14496-15 Annex E. The resulting "Codecs" string might be used
in various places (e.g., HLS/DASH manifest, browser, player, etc)
2019-06-11 21:15:49 +09:00
Marc Leeman 492603d723 rtpmanagerbad: fix the plugin registration
After compilation, the compiled library needs to be added to the list
of plugin libraries.
.
Also, fix for static builds
2019-06-07 14:12:25 +00:00
Tim-Philipp Müller efa5c02636 rtp: fix autotools build some more 2019-06-05 17:00:51 +01:00
Sebastian Dröge 7117ba0a53 avwait: Allow start and end timecode to be set back to NULL
And check everywhere if they're NULL before accessing them.
2019-06-05 11:47:36 +03:00
Nicolas Dufresne 2667081654 make: rtp: Remove spurious header file
This header file no longer exist.
2019-06-03 20:29:18 -04:00
Marc Leeman 3ef737605a rtpmanagerbad: add RTP streaming elements
This is a re-implementation of the RTP elements that are submitted in
2013 to handle RTP streams. The elements handle a correct connection
for the bi-directional use of the RTCP sockets.

https://bugzilla.gnome.org/show_bug.cgi?id=703111

The rtpsink and rtpsrc elements add an URI interface so that streams
can be decoded with decodebin using the rtp:// interface.

The code can be used as follows

```
gst-launch-1.0 videotestsrc ! x264enc ! rtph264pay config-interval=3 ! rtpsink uri=rtp://239.1.1.1:1234

gst-launch-1.0 videotestsrc ! x264enc ! rtph264pay config-interval=1 ! rtpsink uri=rtp://239.1.2.3:5000
gst-launch-1.0 rtpsrc uri=rtp://239.1.2.3:5000?encoding-name=H264 ! rtph264depay ! avdec_h264 ! videoconvert ! xvimagesink

gst-launch-1.0 videotestsrc ! avenc_mpeg4 ! rtpmp4vpay config-interval=1 ! rtpsink uri=rtp://239.1.2.3:5000
gst-launch-1.0 rtpsrc uri=rtp://239.1.2.3:5000?encoding-name=MP4V-ES ! rtpmp4vdepay ! avdec_mpeg4 ! videoconvert ! xvimagesink
```

rtpmanagerbad: add pkg-config
rtpmanagerbad: Rtp should be uppercase
rtpmanagerbad: add G_OS_WIN32 for shielding unix headers
rtpmanagerbad: remove Since from documentation
rtpmanagerbad: rename lib name from nrtp to rtpmanagerbad
rtpmanagerbad: sync meson.build with other modules
rtpmanagerbad: add Makefile.am
rtpmanagerbad: use GstElement to count pads
rtpmanagerbad: use gst_bin_set_suppressed_flags
rtpmanagerbad: check element creation
rtpmanagerbad: post message when trying to access missing rtpbin
rtpmanagerbad: return FALSE with g_return tests
rtpmanagerbad: use gsocket multicast check
rtpmanagerbad: use gst_caps_new_empty_simple iso gst_caps_from_string
rtpmanagerbad: sync with gstrtppayloads.h
rtpmanagerbad: correct media type X-GST
rtpmanagerbad: test if a compatible pad was found
rtpmanagerbad: remove evil copy of GstRTPPayloadInfo
rtpmanagerbad: add gio_dep to meson
rtpmanagerbad: revert to old glib boilerplate

GStreamer 1.16 does not yet support the newer GLib templates, so revert.

rtpmanagerbad: return GST_STATE_CHANGE_NO_PREROLL for live sources

for live sources, NO_PREROLL should be returned for PLAYING->PAUSED and
READY->PAUSED transitions.

rtpmanagerbad: use GstElement pad counting
rtpmanagerbad: just use template name to request pad
rtpmanagerbad: remove commented code
rtpmanagerbad: use funnel to send multiple streams on one socket
rtpmanagerbad: avoid beaches

beaches should only be used during the summer, so rewrite the code to
return explicitly and avoid beaches during the winter.

rtpmanagerbad: add copyright to test code
rtpmanagerbad: g_free is NULL safe
rtpmanagerbad: do not trace rtpbin
rtpmanagerbad: return NULL explitly
rtpmanagerbad: warn when data port is not even

According to RFC 3550, RTP data should be sent on even ports, while RTCP
is sent on the following odd port.

rtpmanagerbad: document port allocation in rtpsink/src
rtpmanagerbad: improve uri description
rtpmanagerbad: add comment re-use socket
rtpmanagerbad: rename gst_object_set_properties_from_uri_query
rtpmanagerbad: loan prop/val setter from rist
rtpmanagerbad: rtpsrc: fix unitialised pointer
rtpmanagerbad: fix silly typo
rtpmanagerbad: test for empty key/value
rtpmanagerbad: rtpsrc: deprecate ssrc collision to INFO
rtpmanagerbad: sync debug with rist
rtpmanagerbad: small strings allocated on stack
rtpmanagerbad: correct rename
rtpmanagerbad: add locking on prop setters/getters

Locking is added because the URI allows to access the properties too.

rtpmanagerbad: allow for RTCP through NAT
rtpmanagerbad: move gio to header file
rtpmanagerbad: free small strings too
rtpmanagerbad: ttl_mc for ttl on dynudpsink
rtpmanagerbad: add comments on the URI registered
rtpmanagerbad: correct macro after file rename
rtpmanagerbad: code style
rtpmanagerbad: handle wrong URIs in setter
rtpmanagerbad: nit URI notation correction

In an URI, the first key/value pair should not have an ampersand, the
parser did not die though.
2019-06-03 20:08:23 +00:00
Vivia Nikolaidou 50075616f2 avwait: Don't print warnings for every buffer passed 2019-05-31 18:47:03 +03:00