Commit graph

34 commits

Author SHA1 Message Date
Thibault Saunier 019971a3c7 Move files from gst-plugins-bad into the "subprojects/gst-plugins-bad/" subdir 2021-09-24 16:14:36 -03:00
Tim-Philipp Müller 11a151ef80 mpegtsmux, mpegpsmux: remove GPL from choice of licenses and add SPDX license identifiers
Some people need to avoid inclusion of GPL code for their use cases and thus
get easily spooked by GPL license headers. This code is actually licensed
under different licenses, only one of which is GPL, and it's already possible
to just upgrade from LGPL to GPL anyway so having the GPL listed explicitly
as one of the choices doesn't really add anything. So remove GPL from the list
and also add SPDX license identifiers while we're at it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2539>
2021-09-22 00:20:02 +00:00
Sebastian Dröge 52a0c36598 tsmux: When selecting random PIDs, name the pads according to those PIDs
Some elements will make use of the automatically generated names to
create new pads in future muxer instances, for example splitmuxsink.

Previously we would've created a pad with a random pid that would become
"sink_0", and then on a new muxer instance a pad "sink_0" and tsmux
would've then failed because 0 is not a valid PID.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2318>
2021-06-23 14:59:43 +00:00
Sebastian Dröge 127ade39cf tsmux: Recheck existing pad PIDs when requesting a new pad with a random pid
Previously pads might have been requested already (e.g. in NULL state),
then reset was called (e.g. because changing state) and then a new pad
was requested. Resetting is re-creating the internal muxer object and as
such resetting the pid counter, so the next requested pad would get the
same pid as the first requested pad which then leads to collisions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2317>
2021-06-23 05:44:48 +00:00
Stéphane Cerveau 891be51105 gst-plugins: allow per feature registration
Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2110>
2021-04-11 16:16:55 +00:00
Jan Schmidt 3a3c80e7be mpegtsmux: Respect the start-time-selection property.
Use the start time provided by the aggregator base class for output
times.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2105>
2021-03-31 13:34:40 +00:00
Jan Schmidt 18a095ca63 mpegtsmux: Add PMT_%d support to prog-map.
Support a PMT_%d field in the prog-map, that's optionally used
to set the PMT for each program in the mux.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2039>
2021-03-18 15:07:53 +00:00
Vivia Nikolaidou 82dcb27401 basetsmux: Don't send the capsheader if src pad has no caps
That means we're shutting down, so there's no point in the streamheader
being sent

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1864>
2020-12-09 13:14:40 +00:00
Jan Alexander Steffens (heftig) 5a1b56a0e0 mpegtsmux: Restore intervals when creating TsMux
Otherwise the settings from the properties would be overwritten with
the defaults.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1593>
2020-09-23 16:50:34 +00:00
Jan Alexander Steffens (heftig) 66f9d37c37 mpegtsmux: Make handling of sinkpads thread-safe
Ensure we take the object lock while accessing `GstElement.sinkpads`.
Use an iterator when the code isn't simple to avoid deadlock.

When we find the best pad, take a reference so a concurrent pad
release doesn't destroy the pad before we're done with it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1553>
2020-09-09 02:25:40 +00:00
Edward Hervey 1068083135 mpegtsmux: Don't create streams with reserved PID
There are quite a few reserved PID in the various MPEG-TS (and derivate)
specifications which we should definitely not use. Those PID have a certain
meaning and purpose.

Furthermore, a lot of the code in the muxer implementation also makes assumption
on the purpose of streams based on their PID.

Therefore, when requesting a pad with a specific PID, make sure it is not a
restricted PID.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1561>
2020-09-08 21:09:36 +00:00
Jan Alexander Steffens (heftig) ef8142ef90 mpegtsmux: Keep mux usable after stop
Otherwise you cannot request new pads until after it is started again.

gst_base_ts_mux_reset with FALSE is still called in the dispose
implementation, so the muxer still gets deallocated when we actually
clean up.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1552>
2020-09-01 14:01:56 +00:00
Mathieu Duponchelle 13376f88fe basetsmux: make use of gst_aggregator_finish_buffer_list
Fixes #1276

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1429>
2020-07-10 20:12:11 +00:00
Jan Schmidt 46cc64e09f mpegtsmux: Fix handling of MPEG-2 AAC
The audio/mpeg,mpegversion=2 caps in GStreamer refer to
MPEG-2 AAC (ISO 13818-7), not to the extended MP3 (ISO 13818-3),
which is audio/mpeg,mpegversion=1,mpegaudioversion=2/3

Fix the caps, and add handling for MPEG-2 AAC in both ADTS and raw
form, adding ADTS headers for the latter.
2020-07-08 12:24:13 +00:00
Jan Alexander Steffens (heftig) cba9ba9b38 mpegtsmux: Avoid crash releasing pad with NULL prog
If we release a pad while the muxer is running which has never been used
for aggregation (thus it does not have an assigned program), `prog` is
NULL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1411>
2020-07-07 14:05:04 +02:00
Mathieu Duponchelle 6baffc2931 docs: mark more types as plugin API 2020-06-23 12:10:17 -04:00
Mathieu Duponchelle a048ce81d4 plugins: uddate gst_type_mark_as_plugin_api() calls 2020-06-06 00:40:42 +02:00
Sebastian Dröge 74f2f733be plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-04 13:33:16 -04:00
Alex Hoenig 0a2e026985 mpegtsmux: detect and ignore gap buffers
Fixes #1291.  Without this, when a stream has gaps and then resumes, the next buffer PTS that is written to the TS is given the PTS of the first gap.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1263>
2020-05-12 12:18:28 -04:00
Sebastian Dröge 5394269c91 mpegtsmux: Chain up pad dispose function to the one of the parent class
Otherwise we will leak various memory.
2020-04-15 09:07:24 +00:00
Sebastian Dröge b41ed0fbb0 mpegtsmux: Properly release requests pads by chaining up to aggregators function 2020-04-15 09:07:24 +00:00
Vivia Nikolaidou fecd38c8f6 tsmux: Ability for streams to disappear and reappear
Until now, any streams in tsmux had to be present when the element
started its first buffer. Now they can appear at any point during the
stream, or even disappear and reappear later using the same PID.
2020-04-15 09:07:24 +00:00
Aaron Boxer 6892078b00 basetsmux: allow null J2K profile
Since we are not requiring that profile equals GST_JPEG2000_PARSE_PROFILE_BC_SINGLE,
(as the standard requires) we can allow profile to be null. We relax this condition because
OpenJPEG can't create broadcast profiles.
2019-11-05 21:21:51 +00:00
Edward Hervey ef16d7558f mpegtsmux: Add SCTE-35 support
This adds two properties:
* scte-35-pid: If not 0, enables the SCTE-35 support for the current
  program. This will write the proper PMT and send SCTE-35 NULL
  commands (i.e. heartbeats) at a regular interval
* scte-35-null-interval: This specifies the interval at which the
  NULL commands should be sent

Sending SCTE-35 commands is done by creating the appropriate SCTE-35
GstMpegtsSection and then sending them on the muxer. See the
associated example
2019-10-31 12:31:27 +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
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
Seungha Yang 00b2b599d6 mpegtsmux: Remove white space 2019-07-04 19:42:48 +09:00
Mathieu Duponchelle f5495700fb basetsmux: don't reset pad on flush_stop
This was mistakenly added when porting to aggregator, this
restores the old behaviour, by only resetting them when the
muxer itself is reset
2019-05-30 17:20:49 +02:00
Mathieu Duponchelle 1e72aa6e85 basetsmux: fix send_event by chaining up 2019-05-30 17:20:12 +02:00
Mathieu Duponchelle 76c3d98962 basetsmux: preserve user-specified sections across resets
As sections can be provided by the user through send_event
when the element state is NULL, their lifetime is expected
to match that of the muxer, and they must be preserved when
the state changes
2019-05-30 13:53:05 +00:00
Mathieu Duponchelle 54cb25456d basetsmux: improve bitrate property documentation 2019-05-19 19:40:48 +00:00
Mathieu Duponchelle 52efb62876 basetsmux: fix PCR stream selection 2019-05-19 19:40:48 +00:00
Mathieu Duponchelle a1cadd11b8 mpegtsmux: aggregator port 2019-05-19 19:40:48 +00:00
Mathieu Duponchelle a57f4dc8d9 mpegtsmux: spring cleanup, no functional change 2019-05-19 19:40:48 +00:00
Renamed from gst/mpegtsmux/basetsmux.c (Browse further)