Commit graph

49 commits

Author SHA1 Message Date
Sebastian Dröge e75a9edff1 tsmux: Add support for Opus
https://bugzilla.gnome.org/show_bug.cgi?id=757049
2015-11-03 20:35:41 +02:00
Tim-Philipp Müller c05a9424be mpegtsmux: add basic support for asynchronous KLV metadata streams
This is defined in SMPTE Rp 217. In this case the
metadata PES packets carry no timestamps of their
own and no Metadata Access Unit Wrappers are used.
2015-07-13 23:34:31 +01:00
Vineeth TM 39d657c274 tsmux: code style fix
trivial patch to add proper ( while checking for if(G_UNLIKELY())

https://bugzilla.gnome.org/show_bug.cgi?id=751305
2015-06-22 10:12:45 +01:00
Nicolas Dufresne e000a6f0a4 tsmux: Add negative DTS support
Use the saved DTS, make it signed and pass that to the stream muxer. This
preserves the running time sign. All usage of -1 as invalid TS are now
replaced with G_MININT64. Negative values will be seen as wrap-around
point, but the delta between PTS and DTS will remain correct. Demuxers
don't care about absolute values, they only cares about deltas.

https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-06-12 17:10:29 -04:00
Luis de Bethencourt 3e38d3ae02 mpegtsmux: fall through switch statement
Adding a comment makes coverity happy and quells the issue.

CID #1139748
2015-03-06 14:27:48 +00:00
Edward Hervey 22dfd9aef3 mpegts: Unify API : GstMpegts / gst_mpegts_ / GST_*_MPEGTS_
It was previously a mix and match of both variants, introducing just too much
confusion.

The prefix are from now on:
* GstMpegts for structures and type names (and not GstMpegTs)
* gst_mpegts_ for functions (and not gst_mpeg_ts_)
* GST_MPEGTS_ for enums/flags (and not GST_MPEG_TS_)
* GST_TYPE_MPEGTS_ for types (and not GST_TYPE_MPEG_TS_)

The rationale for chosing that is:
* the namespace is shorter/direct (it's mpegts, not mpeg_ts nor mpeg-ts)
* the namespace is one word under Gst
* it's shorter (yah)
2014-06-25 14:50:05 +02:00
Jesper Larsen f9a4d559eb mpegtsmux: Remove unused data in TsMuxSection
https://bugzilla.gnome.org/show_bug.cgi?id=721685
2014-05-06 14:10:06 +02:00
Edward Hervey 998e19896b mpegtsmux: Remove unneeded unref
packet_buffer has already been cleared in all code paths leading
to this point.

CID #1199696
2014-04-11 11:34:26 +02:00
Vincent Penquerc'h 931150cb91 Revert "tsmux: catch alloc failure"
Turns out glib aborts on allocation failure, so this is pointless.
We'll just ignore Coverity warnings on such constructs.

This reverts commit d347809a82.
2014-04-09 16:01:43 +01:00
Vincent Penquerc'h d6dc066527 tsmux: prevent possible double free on error path
Spotted while looking at a Coverity issue in the area.
2014-04-09 13:44:59 +01:00
Vincent Penquerc'h d347809a82 tsmux: catch alloc failure
While it will probably not trigger, it should silence a Coverity
warning about the fail code path testing for NULLness before
freeing, where the buffer was already dereferenced. It seems
safest to keep that test, in case future goto fail statements
happen to have a NULL buffer there.

Coverity 1139851
2014-04-09 13:44:45 +01:00
Jesper Larsen 6a5f1354b3 mpegtsmux: Use mpeg-ts lib for PAT/PMT sections
Rewrite of the PAT/PMT section handling to use the mpeg-ts library
2014-02-06 15:57:50 +01:00
Jesper Larsen 93a8137be6 mpegtsmux: Add support for muxing SI tables
The muxer is now able to include DVB sections in the transport stream.

The si-interval property will determine how often the SI tables are
muxed into the stream.

The section is handled by the mpeg-ts library. Below is a small example
that will include a Netork Information Table with a Network Name
descriptor in the stream.

GstMpegTsNIT *nit;
GstMpegTsDescriptor *descriptor;
GstMpegTsSection *section;
GstElement *mpegtsmux;

gst_mpegts_initialize ();

nit = gst_mpegts_section_nit_new ();
nit->actual_network = TRUE;

descriptor = gst_mpegts_descriptor_from_dvb_network_name ("Network name");
g_ptr_array_add (nit->descriptors, descriptor);

section = gst_mpegts_section_from_nit (nit);

// mpegtsmux should be retrieved from the pipeline
gst_mpegts_section_send_event (section, mpegtsmux);
gst_mpegts_section_unref (section);
2014-02-06 15:55:46 +01:00
Thibault Saunier b148c22cec mpegtsmux: Properly add subtitle descriptor for DVb subpicture subtitles
We were adding an empty descriptor for them and it was not possible to
actually use them on muxed streams.
2013-11-13 17:56:07 -03:00
Jesper Larsen e4a0c4d509 mpegtsmux: Set the program number from prog-map
The prog-map property of mpegtsmux only allows you to group pids together in a program.
The program number set in the PAT/PMT tables cannot be set explicitly.

This patch will set the program number according to the prog-map.
If a program id of 0 is given, the first vacant program number starting from 1 will be used.

https://bugzilla.gnome.org/show_bug.cgi?id=697239
2013-08-21 13:02:02 +02:00
Tim-Philipp Müller 9e1b75fda3 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:09:59 +00:00
Mark Nauwelaerts c4b480b993 mpegtsmux: apply some more CLOCK_BASE to ensure slack for PCR offset
Conflicts:

	gst/mpegtsmux/tsmux/tsmux.c
2012-06-27 14:52:10 +02:00
Mark Nauwelaerts beceb09acc mpegtsmux: add support for DVB subtitle and teletext streams
See bug #673582.

Conflicts:

	gst/mpegtsmux/Makefile.am
2012-06-16 19:23:00 +02:00
Mark Nauwelaerts 898f6b48be mpegtsmux: optionally use fixed-size PES header 2012-06-16 19:23:00 +02:00
Mark Nauwelaerts f49e74aa34 mpegtsmux: only write PTS and DTS if different 2012-06-16 19:23:00 +02:00
Mark Nauwelaerts fd92a8b65a mpegtsmux: optionally set data_alignment flag in PES header 2012-06-16 19:23:00 +02:00
Mark Nauwelaerts c76627ec9a mpegtsmux: re-enable inadvertent disabled code 2012-06-16 19:22:59 +02:00
Raimo Järvi 3f9a0a1747 mpegtsmux: Fix compiler warnings
https://bugzilla.gnome.org/show_bug.cgi?id=678211
2012-06-16 19:22:59 +02:00
Matej Knopp 6229305d7b mpegtsmux: port to 0.11
https://bugzilla.gnome.org/show_bug.cgi?id=678130
2012-06-16 19:22:35 +02:00
Mark Nauwelaerts 05dcabfe16 mpegtsmux: avoid memcpy due to temporary packet buffer
... by writing directly into the output buffer instead.
2012-06-11 16:52:49 +02:00
Mark Nauwelaerts c2387d8bf6 mpegtsmux: plug leaks when freeing stream 2012-06-08 17:20:30 +02:00
Mark Nauwelaerts ead42a5e27 mpegtsmux: improve m2ts timestamp interpolation
* a known PCR should really belong to a packet holding that PCR
* interpolation can be extended backward for initial packets (PAT, PMT)
2012-06-08 11:30:03 +02:00
Mark Nauwelaerts 4cc905409e mpegtsmux: more header clarifications and remove some redundant fields 2012-06-06 10:32:05 +02:00
Mark Nauwelaerts 38bb55c472 mpegtsmux: avoid PID collision for auto-generated PID 2012-06-06 10:31:59 +02:00
Edward Hervey fa4f487d8f tsmux: inline more code
With the previous commit, makes mpegtsmux 10 to 15% faster
2012-06-06 10:31:54 +02:00
Edward Hervey e3a02ce49a mpegtsmux: Don't use g_list_first ()
Seriously ...
2012-06-06 10:31:48 +02:00
David Schleef 02daafb9ae mpegtsmux: use gst debug for tsmux library 2011-05-18 12:06:38 -07:00
Jan Schmidt 5111540ceb Use correct clock when checking whether to write a new PCR
The PCR clocks against the 27MHz SCR clock, so check it correctly
to avoid writing the PCR too often.

Partially fixes: #611046
2011-03-26 16:18:22 +11:00
David Schleef 94f6f34ace mpegtsmux: Set adaptation flag when appropriate
Specifically, when there's stuff to go into the adaptation
header.
2011-01-02 14:52:34 -08:00
David Schleef ea113a79aa mpegtsmux: Set random_access_indicator for keyframes 2011-01-02 14:52:34 -08:00
Andoni Morales Alastruey 4668330bdc mpegtsmux: Initialize PES packet before getting the header size.
The PES header length is calculated before setting the dynamic flags, returning
a wrong value. Small frames that should be sent in a single TS packet are
spawned to a new packet because of that error. For audio streams where a single
frame can cope in one TS packet it introduces a huge overhead.

For a 100B packet, we prepare a TS packet with a payload of(100+9)B. Then, we
write the TS header using this value in tsmux_write_ts_header, and call
tsmux_stream_get_data(). The dynamic flags where not set yet and now
tsmux_stream_pes_header_length() returns 14B instead of 9B. The payload of the
TS packet is 114B, 5B more than what was calculated. 109B are sent in a first
packet and the remaining 5B are sent in another one.

Fixes bug #628548.
2010-09-04 15:01:30 +02:00
Marc-André Lureau 43f8e926e7 mpegtsmux: start pmt at 0x020 as suggested by Zaheer 2010-06-08 15:36:47 +02:00
Marc-André Lureau d335a55b49 mpegtsmux: take all the pmt in the streamheaders 2010-06-08 15:36:29 +02:00
Benjamin Otte 240f494aa7 Add -Wold-style-definition
and fix the warnings
2010-03-22 16:56:03 +01:00
Marc-André Lureau 1537023905 mpegtsmux: add pat-interval and pmt-interval properties
https://bugzilla.gnome.org/show_bug.cgi?id=608896
2010-02-03 18:26:12 +00:00
Marc-André Lureau 130cf80752 mpegtsmux: fix PAT/PMT insertion frequency
The current code is comparing timestamps with different clock.
Let's use only the clock for PTS values.

Also rename frequency to interval, to avoid confusion. And remove
documentation about value 0, which won't work like documented.

https://bugzilla.gnome.org/show_bug.cgi?id=608896
2010-02-03 18:26:09 +00:00
Marc-André Lureau 6d554a5560 mpegtsmux: marking non-delta unit, including pre-sections
This patch address the issue observed with KF timestamps
and delta flag. When a section is appended before the keyframe,
it is not marked as non-delta. It's preferable to mark the
first buffer non-delta.

This patch also simplify the initial patch written by thomas,
since it does not clutter tsmux/ with a delta flag passed
around only for GStreamer convenience.

https://bugzilla.gnome.org/show_bug.cgi?id=604908
2010-02-03 16:37:27 +00:00
Thomas Vander Stichele 5fab65aafb mpegtsmux: mark delta-unit on outgoing buffers
Signed-off-by: Marc-André Lureau <mlureau@flumotion.com>
2010-01-08 13:07:53 +01:00
vanista 751555b5c3 gst/mpegtsmux/: Improve muxing of AC3/h264 streams a bit. Fixes bug #550613.
Original commit message from CVS:
Patch by: vanista <vanista at gmail dot com>
* gst/mpegtsmux/mpegtsmux.c: (mpegtsmux_create_stream):
* gst/mpegtsmux/tsmux/tsmux.c: (tsmux_write_pmt):
* gst/mpegtsmux/tsmux/tsmuxstream.c: (tsmux_stream_new),
(tsmux_stream_write_pes_header), (tsmux_stream_get_es_descrs):
* gst/mpegtsmux/tsmux/tsmuxstream.h:
Improve muxing of AC3/h264 streams a bit. Fixes bug #550613.
2009-01-05 11:28:49 +00:00
vanista 2082d618f9 gst/mpegtsmux/: Add initial support for muxing AC3/DTS/LPCM into MPEG TS.
Original commit message from CVS:
Patch by: vanista <vanista at gmail dot com>
* gst/mpegtsmux/mpegtsmux.c: (mpegtsmux_create_stream):
* gst/mpegtsmux/tsmux/tsmuxstream.c: (tsmux_stream_new):
Add initial support for muxing AC3/DTS/LPCM into MPEG TS.
Fixes bug #550613.
2008-11-24 10:46:01 +00:00
Edward Hervey d5e8bc1472 gst/mpegtsmux/tsmux/tsmux.c: Fix build on macosx.
Original commit message from CVS:
* gst/mpegtsmux/tsmux/tsmux.c: (tsmux_write_ts_header):
Fix build on macosx.
2008-09-02 09:46:04 +00:00
Sebastian Dröge 7ac077828f gst/mpegtsmux/mpegtsmux_aac.c: Allocate a fixed size buffer on the stack instead of using malloc().
Original commit message from CVS:
* gst/mpegtsmux/mpegtsmux_aac.c: (mpegtsmux_prepare_aac):
Allocate a fixed size buffer on the stack instead of using malloc().
* gst/mpegtsmux/tsmux/tsmux.c: (tsmux_new), (tsmux_free),
(tsmux_program_new), (tsmux_program_free):
* gst/mpegtsmux/tsmux/tsmuxstream.c: (tsmux_stream_new),
(tsmux_stream_free), (tsmux_stream_consume),
(tsmux_stream_add_data):
Use GSlice.
2008-09-01 17:49:59 +00:00
Edward Hervey b76d9f5bcd gst/mpegtsmux/tsmux/: Fix build of mpegtsmux.
Original commit message from CVS:
* gst/mpegtsmux/tsmux/tsmux.h:
* gst/mpegtsmux/tsmux/tsmuxstream.h:
Fix build of mpegtsmux.
2008-09-01 17:41:39 +00:00
Sebastian Dröge 845094c32e Add Fluendo MPEG-TS muxer and libtsmux to gst-plugins-bad. This is renamed to mpegtsmux to prevent conflicts. Also al...
Original commit message from CVS:
* configure.ac:
* gst/mpegtsmux/Makefile.am:
* gst/mpegtsmux/mpegtsmux.c: (mpegtsmux_base_init),
(mpegtsmux_class_init), (mpegtsmux_init), (mpegtsmux_dispose),
(gst_mpegtsmux_set_property), (gst_mpegtsmux_get_property),
(release_buffer_cb), (mpegtsmux_create_stream),
(mpegtsmux_create_streams), (mpegtsmux_choose_best_stream),
(mpegtsmux_collected), (mpegtsmux_request_new_pad),
(mpegtsmux_release_pad), (new_packet_cb),
(mpegtsdemux_prepare_srcpad), (mpegtsmux_change_state),
(plugin_init):
* gst/mpegtsmux/mpegtsmux.h:
* gst/mpegtsmux/mpegtsmux_aac.c: (mpegtsmux_prepare_aac):
* gst/mpegtsmux/mpegtsmux_aac.h:
* gst/mpegtsmux/mpegtsmux_h264.c: (mpegtsmux_prepare_h264):
* gst/mpegtsmux/mpegtsmux_h264.h:
* gst/mpegtsmux/tsmux/Makefile.am:
* gst/mpegtsmux/tsmux/crc.h:
* gst/mpegtsmux/tsmux/tsmux.c: (tsmux_new), (tsmux_set_write_func),
(tsmux_set_pat_frequency), (tsmux_get_pat_frequency), (tsmux_free),
(tsmux_program_new), (tsmux_set_pmt_frequency),
(tsmux_get_pmt_frequency), (tsmux_program_add_stream),
(tsmux_program_set_pcr_stream), (tsmux_get_new_pid),
(tsmux_create_stream), (tsmux_find_stream), (tsmux_packet_out),
(tsmux_write_adaptation_field), (tsmux_write_ts_header),
(tsmux_write_stream_packet), (tsmux_program_free),
(tsmux_write_section), (tsmux_write_section_hdr),
(tsmux_write_pat), (tsmux_write_pmt):
* gst/mpegtsmux/tsmux/tsmux.h:
* gst/mpegtsmux/tsmux/tsmuxcommon.h:
* gst/mpegtsmux/tsmux/tsmuxstream.c: (tsmux_stream_new),
(tsmux_stream_get_pid), (tsmux_stream_free),
(tsmux_stream_set_buffer_release_func), (tsmux_stream_consume),
(tsmux_stream_at_pes_start), (tsmux_stream_bytes_avail),
(tsmux_stream_bytes_in_buffer), (tsmux_stream_get_data),
(tsmux_stream_pes_header_length),
(tsmux_stream_find_pts_dts_within),
(tsmux_stream_write_pes_header), (tsmux_stream_add_data),
(tsmux_stream_get_es_descrs), (tsmux_stream_pcr_ref),
(tsmux_stream_pcr_unref), (tsmux_stream_is_pcr),
(tsmux_stream_get_pts):
* gst/mpegtsmux/tsmux/tsmuxstream.h:
Add Fluendo MPEG-TS muxer and libtsmux to gst-plugins-bad. This
is renamed to mpegtsmux to prevent conflicts. Also all relevant
informations about copyright and license are added to the top of
every file but apart from that no changes compared to the latest
SVN versions happened.
2008-09-01 16:38:40 +00:00