Commit graph

428 commits

Author SHA1 Message Date
Jan Alexander Steffens (heftig)
fcaf5b0f0b interlace: Reset after changing state to READY
Trying to reset before the pads have been deactivated races with the
streaming thread. There was also a buggy buffer clear leaving a dangling
`stored_frame` pointer around. Use `gst_interlace_reset` so this happens
properly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1039>
2021-10-21 10:50:17 +00:00
Jan Alexander Steffens (heftig)
320bc6362b mpegtsmux: Avoid crash when best pad gets flushed
The 'best' pad might receive a flush event between us picking it and us
popping the buffer. In this case, the buffer will be missing.

Similar to https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/711

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1042>
2021-10-19 01:46:19 +00:00
Vivia Nikolaidou
6bf36f6e0f tsdemux: Change many GST_{DEBUG, LOG, etc} into _OBJECT
Log files with several demuxers running at once can otherwise get
confusing

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1096>
2021-10-18 18:34:04 +00:00
Vivia Nikolaidou
300e784a20 tsdemux: Issue GST_ELEMENT_WARNING for continuity errors
The application might want to make use of these.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1096>
2021-10-18 18:34:04 +00:00
Vivia Nikolaidou
95eb8672a6 basetsmux: Support for caps changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/981>
2021-10-18 15:37:41 +00:00
Jan Alexander Steffens (heftig)
a8ebf72627 basetsmux: Clean up gst_base_ts_mux_create_stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/981>
2021-10-18 15:37:40 +00:00
Vivia Nikolaidou
273e2a1db6 mpegtsbase: Search SCTE-35 DRF_ID_CUEI in multiple registration descriptors
There are streams in the wild that have to add a SCTE-35 trigger in
another e.g. GA94 stream. Most encoders would replace the GA94
descriptor ID with the CUEI one temporarily, but there are some that
will add two registration ID descriptors, one with GA94 and one with
CUEI.

Failing to parse the CUEI registration ID in that case would return
FALSE in _stream_is_private_section , therefore setting it as known PES
and pushing packets downstream instead of calling handle_psi.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/979>
2021-10-18 13:58:39 +00:00
Edward Hervey
d9b1e1e99f tsdemux: Improve gap detection
We should also take into account whether data is currently pending when checking
for gap on streams. It could very well be that some streams have very low
bitrate (and spread out) data. For those we don't want to push out a gap event.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1179>
2021-10-18 11:23:25 +00:00
Edward Hervey
0ff569d408 tsdemux: Handle "negative" timestamps
This is only enabled in push time mode. Furthermore it's only enabled for now if
PCR is to be ignored.

The problem is dealing with streams where the initial PTS/DTS observation might
be greater than following ones (from other PID for example). Before this patch,
this would result in sending buffers without any timestamp which would cause a
wide variety of issues.

Instead, pad segment and buffer timestamps with an extra
value (packetizer->extra_shift, default to 2s), to ensure that we can get valid
timestamps on outgoing buffers (even if that means they are before the segment
start).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1179>
2021-10-18 11:23:25 +00:00
Edward Hervey
74e9d44db3 tsdemux: Handle streams with bogus PTS vs DTS
PTS and DTS should be within a reasonable distance of each other.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1179>
2021-10-18 11:23:25 +00:00
Edward Hervey
6efa9dc00e tsdemux: Handle PTS->TS at wraparound
This has been a FIXME for ages.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1179>
2021-10-18 11:23:25 +00:00
Vivia Nikolaidou
23bf9f75b6 tsdemux: Handle delayed seek events
Store the event in case it cannot be processed immediately and process
it after the first segment has been produced.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/980>
2021-10-14 21:45:00 +00:00
Vivia Nikolaidou
5800ffea0f tsdemux: Protect demux->segment_event with a mutex
Would otherwise cause weird issues when processing a delayed seek event

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/980>
2021-10-14 21:45:00 +00:00
Vivia Nikolaidou
1fa1b18a24 chopmydata: Fix FIXMEs in gst_element_class_set_static_metadata
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1097>
2021-10-08 16:20:10 +03:00
Jan Alexander Steffens (heftig)
0596da1966 mpegtsparse: Don't assert the packet_size when filling for EOS
If the packetizer got reset for any reason (failure to find PCR?) then
the packet_size can be zero here even though we already enqueued some
packets.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1038>
2021-10-05 09:38:27 +00:00
Seungha Yang
90e5e0efea mpegtsmux: basetsmux: Don't try to return value from void function
gstbasetsmux.c(1508): warning C4098: 'free_splice': 'void' function returning a value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1018>
2021-10-04 13:37:09 +00:00
Marc Leeman
58d4a5b449 ristsink: set sync to FALSE on RTCP sink
See commit 921e9a54: rtpsink: set sync off on rtcp_sink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/993>
2021-10-01 22:57:02 +00:00
Marc Leeman
b7820a0de7 rtpsink: set sync off on rtcp_sink
When using the following setup (the error can be reproduced using
simpler sender pipelines), the receiver resynchronises the clock on RTCP
packets. The effect was that a couple seconds were cut out of the
playback because an initial RTCP packet was dropped.

When sending out all RTCP packets (setting sync=FALSE on the RTCP
updsink), the playback is fine.

This syncs rtpsink with rtpsrc (where this property was already set).

gst-launch-1.0 filesrc location=899-en.mp3 \
    ! mpegaudioparse \
    ! mpg123audiodec \
    ! audioconvert \
    ! audioresample \
    ! avenc_g722 \
    ! rtpg722pay
    ! rtpsink uri=rtp://239.1.2.3:1234

gst-launch-1.0 uridecodebin rtp://239.1.2.3:1234?encoding-name=G722 \
    ! autoaudiosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/993>
2021-10-01 22:57:02 +00:00
Marc Leeman
a774dfb18f rtpmanagerbad: do not set iface on sink
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/994>
2021-10-01 20:31:17 +00:00
Mathieu Duponchelle
f0a158407c mpegts: add missing Since comments after SCTE 35 work
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/913>
2021-09-25 01:29:38 +00:00
Mathieu Duponchelle
555a5ea9dd basetsmux: use private copy of g_ptr_array_copy
This function is only present since glib 2.62

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/913>
2021-09-25 01:29:38 +00:00
Mathieu Duponchelle
c2eeb639b0 basetsmux: fix SCTE pts_adjustment with offsets
When there are elements between the demuxer and the muxer that
introduce an offset to the running time, or when offsets are
set on pads by the application, this shift must be taken into
account when calculating the final pts_adjustement.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/913>
2021-09-25 01:29:38 +00:00
Mathieu Duponchelle
c3a161f287 basetsmux: rework SCTE section handling to handle passthrough
mpegtsmux can receive SCTE sections from two origins: events
created by the application, and events forwarded downstream by
mpegtsdemux, containing sections that may not have been fully
parsed, and additional data to help tsmux translate times to
the correct domain, both for requesting keyframes and calculating
an accurate pts_adjustment.

The complete approach is documented further in a comment above
the relevant function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/913>
2021-09-25 01:29:38 +00:00
Mathieu Duponchelle
4af003bc02 tsdemux: switch SCTE 35 sections handling to a passthrough model
Instead of modifying the splice times in the incoming sections
to running time and expecting eg mpegtsmux to convert those back
to its local PES time domain, which might be impossible when
those splice times are encrypted or the specification is extended,
transmit the needed information to the muxer as separate fields in
the event:

* A pts offset field can be used by the muxer in order to calculate
  a final pts_adjustment

* A rtime_map can be used by the muxer to determine the correct
  running times at which it should request keyframes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/913>
2021-09-25 01:29:38 +00:00
Mathieu Duponchelle
be4d0fff23 basetsmux: extend SCTE 35 support
Makes it possible to support passing SCTE 35 cue points from
demuxer to muxer, while preserving correct timing.

This will also improve ex nihilo cue points injection, as splice
times and durations are now interpreted as running time values,
and may trigger key unit requests.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/913>
2021-09-25 01:29:37 +00:00
Mathieu Duponchelle
1ca08bff57 tsdemux: Expose send-scte35-events property
When enabled, SCTE 35 sections (eg ad placement opportunities)
are forwarded as events donwstream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/913>
2021-09-25 01:29:37 +00:00
Mathieu Duponchelle
b2718ed6cf mpegtsbase: expose vmethod to let subclass handle sections
This can be used by tsdemux to handle and forward SCTE 35
sections.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/913>
2021-09-25 01:29:37 +00:00
Thibault Saunier
019971a3c7 Move files from gst-plugins-bad into the "subprojects/gst-plugins-bad/" subdir 2021-09-24 16:14:36 -03:00