Commit graph

7616 commits

Author SHA1 Message Date
Sebastian Dröge
f72aaed9c7 timecodestamper: Add property to set the extra latency to introduce for waiting for LTC timecodes
Default to 150ms instead of 8 frames, which seems to work in the
majority of cases.
2020-01-13 18:17:23 +00:00
Sebastian Dröge
fdca7ebb4c timecodestamper: Add some more debug output 2020-01-13 18:17:23 +00:00
Josep Torra
bebf20c906 h264parse: do not push wrong PTS with some raw files
Some raw h264 encoded files trigger the assignment of wrong PTS to buffers
when some SEI data is provided. This change prevents it to happen.

Also ensure this behavior is being tested.
2020-01-10 15:03:38 +00:00
Sebastian Dröge
a4c925f694 timecodestamper: Skip over invalid LTC timecodes immediately 2020-01-10 15:59:27 +02:00
Sebastian Dröge
a1443518e0 timecodestamper: Clean up old LTC timecodes on LTC discontinuity
We might have some old timecodes that are in the future now and have to
drop those to make sure that our queue is correctly ordered and we don't
have multiple timecodes for the same running time.
2020-01-10 15:59:26 +02:00
Sebastian Dröge
bbdb392abe timecodestamper: Fix waiting for the first video frame in case of live video input 2020-01-10 15:59:25 +02:00
Sebastian Dröge
d7bb5b8a16 timecodestamper: Fix up handling/queueing of LTC timecodes
Directly read them out of the decoder as soon as we passed audio and
then store them in a queue that we handle internally together with their
timestamps. This cleans up memory management and gives us proper control
over the queue instead of guessing how the queue inside the LTC decoder
actually works and when it overflows.
2020-01-10 15:59:24 +02:00
Sebastian Dröge
0a53f6560a timecodestamper: Only allow requesting LTC audio pad in NULL/READY states
And don't introduce any latency at all if not LTC audio pad was
requested.
2020-01-10 15:59:21 +02:00
Sebastian Dröge
0a499242e9 timecodestamper: In live mode wait correctly for the latency to pass
And also introduce 6 instead of 2 frames of latency compared to the LTC
audio input as that seems to be an upper bound for how much the LTC
library is lagging behind.
2020-01-10 15:58:29 +02:00
Sebastian Dröge
31d7862051 timecodestamper: Use the internal LTC timecode tracker instead of the last one we retrieved
Otherwise we don't interpolate between LTC timecodes but only ever put
an LTC timecode on buffers once we actually received one.
2020-01-10 15:58:06 +02:00
Stéphane Cerveau
4b8c47ee37 h26xparse: Handle state change on IDR first slice
As the H265/H264 bitstream can support multiple slices,
mastering_display_info_state and content_light_level_state
should be changed only on first slice segment.

Fix #1152
2020-01-07 08:55:28 +00:00
Stéphane Cerveau
d414e90eff h265parse: use same algo for MDCV and CLL SEI management 2020-01-07 08:55:28 +00:00
Stéphane Cerveau
b481edd745 h264parser: add MDCV and CLL SEI message parsing
Allow to parse SEI message for:
- mastering display colour volume
- Light level infomation

Set to caps if necessary.

Fix #958
2020-01-07 08:55:28 +00:00
Thibault Saunier
1e5c117c7c fakevideosink: Use our pad template to create pad 2020-01-06 20:35:00 +00:00
Mark Nauwelaerts
42b60627fa mpegtsdemux: resurrect actual and efficient seeking of all kinds
... by seeking to target offset determined by new seek segment,
rather than that of the previous segment.  The latter would typically
seek back to start for a non-accurate seek, and lead to a lot
of skipping in case of an accurate seek.
2019-12-31 10:44:35 +01:00
Stéphane Cerveau
add7878e14 bad: use of g_value_dup_string
Use helper method to get string from GValue.
2019-12-30 14:13:03 +00:00
Sebastian Dröge
0dc783d719 timecodestamper: Refactor LTC audio waiting and properly handle live inputs
If one of the inputs is live, add a latency of 2 frames to the video
stream and wait on the clock for that much time to pass to allow for the
LTC audio to be ahead.

In case of live LTC, don't do any waiting but only ensure that we don't
overflow the LTC queue.

Also in non-live LTC audio mode, flush too old items from the LTC queue
if the video is actually ahead instead of potentially waiting forever.
This could've happened if there was a bigger gap in the video stream.
2019-12-30 09:36:23 +00:00
Yeongjin Jeong
3f2240498b h265parser: Add simple GstH265Profile/string public utilites
It makes more simplifies the conversion between GstH265Profile and string.
2019-12-20 15:43:55 +00:00
Nicolas Dufresne
416728f213 autoconvert: Fix lock-less exchange or free condition
Before this change, we would free the list we just have saved.

Fixes #1158
2019-12-19 22:35:18 +00:00
Stéphane Cerveau
c6eb17be6e h264parse: Align GST_H264_PROFILE_HIGH_422 to H264 standards
According to H264 ITU standards from 06/19, GST_H264_PROFILE_HIGH_422
(profile_idc = 122) with constraint_set1_flag = 0 and
constraint_set3_flag = 0 can be mapped to high-4:2:2 or high-4:4:4.
GST_H264_PROFILE_HIGH_422 with constraint_set1_flag = 0 and
constraint_set3_flag = 1 can be mapped to high-4:2:2, high-4:4:4,
high-4:2:2-intra or high-4:4:4-intra.
2019-12-18 03:03:40 +00:00
Olivier Crête
1f766a7145 Revert "videoparseutils: support two new EIA 608 closed caption formats"
This reverts commit f5c1c90122.
2019-12-17 16:44:10 -05:00
Aaron Boxer
f5c1c90122 videoparseutils: support two new EIA 608 closed caption formats 2019-12-17 18:26:35 +00:00
Stéphane Cerveau
6bc0e9527e remove various useless linefeed in logs 2019-12-11 10:51:29 +01:00
Alicia Boya García
f816903e65 gsttestsrcbin: Avoid not-linked errors when switching tracks
The previous implementation had a very high reproducibility race where
if after a track switch, the ex-active track pad completed a buffer
chain (now returning not-linked) the flow combiner had all their pads in
non-linked state, propagating it as an error and stopping the pipeline.

By resetting the flow combiner in response to RECONFIGURE events that
race is made impossible.
2019-12-09 18:12:29 +01:00
Sebastian Dröge
812d593c4e interlace: Store unsigned integers in unsigned integer types
And add some assertions to guard against overflows and out of bounds
reads.
2019-12-03 21:12:26 +00:00
Sebastian Dröge
c67146b27a interlace: Increment phase_index before checking if we're at the end of the phase
Incrementing it afterwards will always have to phase_index >= 1 and we
will never be at the beginning (0) of the phase again, and thus never
reset timestamp tracking accordingly.

This was broken in bea13ef43b in 2010, and
causes interlace to run into integer overflows after 2^31 frames or
about 5 hours at 29.97fps. Due to usage of wrong types for the integers
this then causes negative numbers to be used in calculations and all
calculations spectacularly fail, leading to all following buffers to
have the timestamp of the first buffer minus one nanosecond.
2019-12-03 21:12:26 +00:00
Jan Alexander Steffens (heftig)
fd6c51b2e7
rtmp2sink: Only apply @setDataFrame to onMetaData messages
Only the metadata needs to be made "sticky". Custom data messages should
be passed on unmodified.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878
2019-12-03 14:11:47 +01:00
Jan Alexander Steffens (heftig)
042e439829
rtmp2: Add gst_rtmp_message_is_metadata
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878
2019-12-03 14:11:47 +01:00
Jan Alexander Steffens (heftig)
e07a1bb48f
rtmp2: Add gst_rtmp_connection_set_data_frame
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878
2019-12-03 14:11:47 +01:00
Jan Alexander Steffens (heftig)
8f1ae04ac5
rtmp2: Add single-value AMF0 parsing and serializing
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878
2019-12-03 14:11:47 +01:00
Jan Alexander Steffens (heftig)
f5b068b26c
rtmp2: Minor changes
- Remove an unneeded initialization to zero from AmfParser
- Add missing initialization to gst_amf_serialize_command_valist
- Add a g_return_if_fail to gst_rtmp_connection_request_window_size

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/878
2019-12-03 14:11:46 +01:00
Edward Hervey
d8a51c6097 atscmux: Add missing break in switch
CID: 1455515
2019-11-27 15:41:26 +01:00
Aaron Boxer
e3297be433 h264parse: buffer mismatch in map/unmap 2019-11-26 13:07:47 -05:00
Marc Leeman
31861b095a rtpmanagerbad: allow setting multicast-iface
Allowing the UDP elements to bind on an interface is needed in more
complex networks where there are mutiple networks interfaces without
default gateway
2019-11-19 12:39:59 +00:00
Sebastian Dröge
c7393af0bf timecodestamper: Create LTC sink pad with the correct name according to the template
Should be "ltc_sink" and not just "ltc"
2019-11-19 12:21:30 +02:00
Vivia Nikolaidou
851682629e videoparsers: Disable gst_base_parse_set_infer_ts
From the documentation of gst_base_parse_set_infer_ts, it should be
disabled for non-audio data. Currently just disabling for all video
parsers that have reordered data: h264, h265, mpeg, mpeg4, vc1. Was
already disabled in h263.
2019-11-19 10:23:31 +02:00
Kyrylo Polezhaiev
6af38c6ffe tsmux: Fix copying of buffer region 2019-11-18 07:31:33 +00:00
Marc Leeman
1569c33f24 rtpmanagerbad: name the element children
As discussed with RIST, it is best to name the children of the elements
since these are now created at the element initialisation.
2019-11-17 16:00:19 +00:00
Vivia Nikolaidou
413c6ec57b tsdemux: Always issue a DTS even when it's equal to PTS
Currently tsdemux timestamps only the PTS, and only issues the DTS if
it's different. In that case, parsers tend to estimate the next DTS
based on the previous DTS and the duration, which can accumulate
rounding errors.
2019-11-14 12:16:04 +00:00
Jan Schmidt
c94d50090b switchbin: Free path objects on finalize
Clean up path objects nicely when shutting down,
first by dropping pointers to elements during dispose,
and then by making sure to drop the ref to the path object
when finalizing the switch bin.

Fixes valgrind checks in the unit test.
2019-11-13 10:15:32 +00:00
Jan Schmidt
ed63012d70 switchbin: Add current-path property
Returns the index of the currently selected processing
path, or MAX-UINT if none
2019-11-13 10:15:32 +00:00
Jan Schmidt
6d292c86e9 switchbin: Add docs
Add documentation clauses and enrol switchbin to generate
plugin docs
2019-11-13 10:15:32 +00:00
Jan Schmidt
e367258eef switchbin: Initial checkin
Add code from Stream Unlimited implementing a bin
which switches between different internal decoding/processing
chains based on input caps
2019-11-13 10:15:31 +00:00
Jan Alexander Steffens (heftig)
346bca80af
rtmp2: Fix NULL check in gst_rtmp_meta_transform
Coverity rightly complains that checking a pointer for NULL after
dereferencing it is pointless.

Remove the check, and to be safe, assert that gst_buffer_add_meta
returns non-NULL.

CID 1455485
2019-11-12 12:20:34 +01:00
Jan Alexander Steffens (heftig)
f730f4a694
rtmp2: Check for missing GstRtmpMeta
The message buffers are created using `gst_rtmp_message_new` and thus
always contain a GstRtmpMeta. Add checks to appease Coverity's static
analysis.

CID 1455596
CID 1455384
2019-11-12 12:20:30 +01:00
Vivia Nikolaidou
8d7489a734 rtmp2sink: Add a check that meta isn't NULL before accessing
It really can't be NULL, this is just to convince coverity

CID 1455553
2019-11-12 12:36:38 +02:00
Nicolas Dufresne
44322b1dfc vc1parse: Avoid division by zero assertion
A framerate of 0/1 is valid, but we cannot calculate the frame duration
in this context. Simply protect against this case.

Related to #660
2019-11-11 16:23:18 -05:00
Nicolas Dufresne
a5113fe8c8 vc1parser: Relax ASF Binding Byte validation
According to the spec, the least significant bit is reserved and should
always we set to 1. Though, some wrong file has been found. Considering
how low important this reserved bit is, relax the validation.

Related to #660
2019-11-11 16:22:54 -05:00
Edward Hervey
7bceb6c3ff bad: Avoid using deprecated API
GTimeval is deprecated
2019-11-08 10:43:08 +00:00
Edward Hervey
60cec38591 tsdemux: Handle continuity mismatch in more cases
Packets of a given PID are meant to have sequential continuity counters
(modulo 16). If there are not sequential, this is the sign of a broken
stream, which we then consider as a discontinuity.

But if that new packet is a frame start (PUSI is true), then we can resume
from that packet without any damage.
2019-11-07 09:17:25 +00:00