Commit graph

237 commits

Author SHA1 Message Date
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 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
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 02ded087a4 mpegtsmux: add SECTION comment
We include an example for injecting sections in the transport
stream in the documentation
2019-05-30 13:53:05 +00: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 fdfd4600c1 atscmux: send empty RRT / MGT / STT tables
These are mandated by A/65, their absence gets flagged by
stream analyzers. Users can of course provide filled up
versions through the send_event API.
2019-05-30 13:53:05 +00:00
Mathieu Duponchelle 5d41740ff6 tsmux: maintain packet counters in a global array
We can have multiple TsMuxPacketInfo objects for the same PID
with user-provided sections, for example ATSC requires multiple
tables with the same PID.
2019-05-30 13:53:05 +00:00
Seungha Yang 1e3eb00b17 mpegtsmux: Fix build warning error
gstmpegtsmux.c:291:3: error: implicit declaration of function ‘memmove’ [-Werror=implicit-function-declaration]
   memmove (map.data + 4, map.data, map.size - 4);
   ^
gstmpegtsmux.c:291:3: error: incompatible implicit declaration of built-in function ‘memmove’ [-Werror]
gstmpegtsmux.c:291:3: note: include ‘<string.h>’ or provide a declaration of ‘memmove’
2019-05-20 19:34:37 +09:00
Mathieu Duponchelle 54cb25456d basetsmux: improve bitrate property documentation 2019-05-19 19:40:48 +00:00
Mathieu Duponchelle 9190541e3c tsmux: refactor logic for when to (re)transmit tables
In order to output them at regular intervals in the bitstream
when a bitrate is specified.
2019-05-19 19:40:48 +00:00
Mathieu Duponchelle 52efb62876 basetsmux: fix PCR stream selection 2019-05-19 19:40:48 +00:00
Jan Schmidt 1ff72bb69d Fix compile after aggregator rewrite and base class refactor 2019-05-19 19:40:48 +00:00
Mathieu Duponchelle 3c7c08e7c4 tsmux: fix continuity counter for packets with no payload 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
Mathieu Duponchelle 44c701d113 basetsmux: extract m2ts-mode to mpegtsmux 2019-05-19 19:40:48 +00:00
Mathieu Duponchelle 649cc2d5e8 mpegtsmux: extract an actual base class 2019-05-19 19:40:48 +00:00
Mathieu Duponchelle 4e7f94f5fa mpegtsmux: expose the vmethods necessary for ATSC E-AC-3 handling 2019-05-19 19:40:48 +00:00
Mathieu Duponchelle ea011a3266 mpegtsmux: provide API for subclasses to override stream creation 2019-05-19 19:40:48 +00:00
Mathieu Duponchelle 80bfa16c95 mpegtsmux: add an ATSC subclass 2019-05-19 19:40:48 +00:00
Mathieu Duponchelle 98c98c7c53 tsmux: Calculate PCR from number of bytes written in CBR mode 2019-05-19 19:40:48 +00:00
Mathieu Duponchelle 07235bbf46 mpegtsmux: Expose bitrate property
This allows outputting a Transport Stream with a constant bitrate,
by inserting null packets.
2019-05-19 19:40:48 +00:00
Mathieu Duponchelle 4d53a7ac09 tsmux: actually respect the PCR frequency we target 2019-05-19 19:40:48 +00:00
Mathieu Duponchelle dc2b28d456 tsmux: Use DTS over PTS 2019-05-19 19:40:48 +00:00
Thibault Saunier 47a49f3381 docs: Build documentation with hotdoc 2019-05-13 17:00:00 -04:00
Mathieu Duponchelle 91c76b0851 mpegtsmux: restore stream creation order
In 7c767f3fcd , stream creation was
refactored to occur before potential program creation. This created
issues with pipelines such as:

gst-launch-1.0 videotestsrc ! video/x-raw, format=I420, width=640, height=640, framerate=25/1 ! \
x264enc ! hlssink2 target-duration=1

eg.: gst_buffer_copy_into: assertion 'bufsize >= offset + size' failed

As this reordering was actually not needed for the purpose of allowing
to specify a PCR stream, this reverts the reordering part of the
initial commit.
2019-02-27 19:00:36 +01:00
Mathieu Duponchelle 7c767f3fcd mpegtsmux: allow specifying the PID of the PCR stream
The structure passed through the prog-map can now contain a
PCR_<prog_id>=sink_<PID> key-value pair.
2019-02-20 16:22:33 +01:00
Sebastian Dröge bb135ba764 mpegtsmux: Handle zero-sized buffers correctly without going into an infinite loop
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/844
2018-12-10 14:20:14 +00:00
Mathieu Duponchelle 14b9a34f54 mpegtsmux: add custom AC-3 descriptor
tsdemux expects a custom descriptor (GST_MTS_DESC_AC3_AUDIO_STREAM)
to detect a stream as AC3 and not EAC3.

Note that tsdemux expects this descriptor because mpegtsmux writes
a stream with a HDMV registration descriptor.

Fixes:

gst-launch-1.0 -v audiotestsrc ! avenc_ac3 ! ac3parse ! mpegtsmux ! \
tsdemux ! ac3parse ! avdec_ac3 ! audioconvert ! autoaudiosink

https://bugzilla.gnome.org/show_bug.cgi?id=797220
2018-09-27 17:34:10 +02:00
Xavier Claessens 83d0623293 Meson: Generate pc file for all plugins in bad
https://bugzilla.gnome.org/show_bug.cgi?id=794568
2018-04-25 11:08:09 +01:00
Sebastian Dröge 7a2110a499 mpegtsmux: Resend initial segments and header sections after FLUSH_STOP
https://bugzilla.gnome.org/show_bug.cgi?id=794816
2018-04-03 14:38:15 +03:00
Sebastian Dröge 93e56ed473 mpegtsmux: Explicitly resend PAT/SI/PMT on force-keyunit events
And don't randomly change the PCR stream, which would cause a new PMT
version to be generated instead and could confuse players.
2018-03-21 13:42:30 +02:00
Sebastian Dröge 3f0463c43e mpegtsmux: Deterministically set the PCR stream to the first stream of the program
Otherwise it would be randomly set to the first stream of the program
that receives a buffer.
2018-03-21 13:34:17 +02:00
Sebastian Dröge 19acd7b215 mpegtsmux: Reset a few more fields in mpegtsmux_reset() to their original values 2018-03-21 11:05:23 +02:00
Sebastian Dröge e3740b58d7 tsmux: Don't use GST_DEBUG_OBJECT() with non-GObject types 2018-03-21 10:59:29 +02:00
Reynaldo H. Verdejo Pinochet 0f71d2e408 Use proper GtkDoc notation for NULL/FALSE/TRUE 2017-10-03 14:35:48 -07:00
Sebastian Dröge 819406b563 tsmux: Fix make distcheck 2017-07-21 12:28:50 +03:00
Sebastian Dröge 489466e2a5 tsmux: Add mpegtsmux_jpeg2000.c to meson.build 2017-07-21 09:33:54 +03:00
Sebastian Dröge 3fe65ad854 tsmux: Store PES payload size in a 32 bit integer
While the size in the packet is only 16 bits, we need to handle bigger
sizes without overflowing. For video streams this can happen, 0 is
written to the stream instead.

This fixes muxing of buffers >= 2**16.
2017-07-21 09:33:31 +03:00
Aaron Boxer bbbdc2cd7e tsmux/tsdemux: Add support for JPEG2000
Based on patches by Milos Seleceni.

https://bugzilla.gnome.org/show_bug.cgi?id=753323
2017-07-21 09:33:31 +03:00
Nicolas Dufresne 4261692187 Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-05-16 14:05:52 -04:00
Vincent Penquerc'h 1630d2a0d7 mpegtsmux: fix buffer size mismatch in M2TS mode
In M2TS mode, we need an extra 4 bytes in the buffer, so need
to ensure the buffer can contain these. The allocation site
does not know the mode, so this is done in all cases.
2016-10-17 12:32:58 +01:00
Nirbheek Chauhan 42af2d66d8 Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Matej Knopp <matej.knopp@gmail.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2016-08-20 11:35:54 +01:00
Jan Alexander Steffens (heftig) 851c89ded9 mpegtsmux: Set PTS on aligned buffers
This was broken in 09c05df (make "alignment" property more useful for
packetisation).

https://bugzilla.gnome.org/show_bug.cgi?id=765926
2016-06-07 15:11:00 +03:00
Thiago Santos 1b1beded51 mpegtsmux: effectively check if there is a language
'language' is an array and not a pointer.

CID 1358835
2016-04-29 17:19:19 -03:00
Thiago Santos 9cc00bf2c9 mpegtsmux: write language descriptor when language is available
Adds a new function to mpegts lib to create a iso639 language
descriptor from a language and use it in mpegtsmux to add
a language descriptor to audio streams that have a language set.

https://bugzilla.gnome.org/show_bug.cgi?id=763647
2016-04-26 23:45:34 -03:00
Jan Schmidt 4e5b0b38a4 mpegtsmux: Remove an unnecessary check for NULL before g_free 2016-04-16 22:43:38 +10:00