Commit graph

65 commits

Author SHA1 Message Date
Jan Schmidt
debf4984df mpegtsmux: Trivial bug fix. Don't copy data from an uninited buffer. 2012-02-13 23:05:35 +11:00
Vincent Penquerc'h
27f21d31ac mpegtsmux: specify in template caps we only take raw/adts AAC format
This appears to be what this element supports.

https://bugzilla.gnome.org/show_bug.cgi?id=665394
2012-02-02 12:37:02 +00:00
Alessandro Decina
f547336fdc mpegtsmux: update after collectpads2 changes 2012-01-31 08:44:04 +01:00
Vincent Penquerc'h
8147669971 plenty: fixup glib deprecations 2012-01-27 15:47:07 +00:00
Alessandro Decina
38a5719c53 mpegtsmux: unset the current PCR stream when starting a new unit
Unset the current PCR stream when starting a new unit so that afterwards a new
stream is selected as PCR and PAT and PMT tables are regenerated.
2011-12-18 17:32:11 +01:00
Alessandro Decina
ee429ba7b8 mpegtsmux: fix key unit event handling when muxing both audio and video
Take only video buffers into account when deciding when to cut so that new units
start with a video keyframe.
2011-12-18 17:31:18 +01:00
Vincent Penquerc'h
1029619766 mpegtsmux: port to GstCollectPads2
I *think* the stream lock use is correct, not 100% sure.
2011-12-15 13:22:24 +00:00
Tim-Philipp Müller
65e8564343 mpegtsmux: fix build in uninstalled setup
Add -base libs includes to CFLAGS, fix order of LIBS.
2011-11-30 10:35:12 +00:00
Alessandro Decina
777c1f034f mpegtsmux: add support for force key unit events
Handle force key unit events outputting PAT and PMT when all_headers=TRUE
2011-11-30 08:56:48 +01:00
Vincent Penquerc'h
7521b597f4 various: fix pad template ref leaks
https://bugzilla.gnome.org/show_bug.cgi?id=662664
2011-11-28 13:08:27 +00:00
Alessandro Decina
fa6d174455 tsmux: remove unnecessary check
remove an if (best) check where best != NULL has already been checked
2011-08-21 10:54:52 +02:00
Sameer Naik
666807ed69 mpegtsmux: fix segfault if gst_collect_pads_pop () returns no buffer
In mpegtsmux_choose_best_stream () call if the gst_collect_pads_pop () call
returns no buffer (NULL), the plugin SegFaults in the gst_buffer_unref call.
To fix this we check if a valid buffer is returned before calling
gst_buffer_unref ().

Fixes bug #654416.
2011-07-12 07:51:21 +02:00
Andreas Frisch
4a7057048f mpegtsmux: fix pointer output in stream-not-associated debug output
https://bugzilla.gnome.org/show_bug.cgi?id=651050
2011-05-25 14:21:57 +01:00
David Schleef
02daafb9ae mpegtsmux: use gst debug for tsmux library 2011-05-18 12:06:38 -07:00
David Schleef
55633f5e8f mpegtsmux: Add byte-stream to h264 caps 2011-04-18 09:50:56 -07:00
David Schleef
4a8ba50cb2 mpegtsmux: Fix 64-bit printf format problem 2011-03-27 13:57:05 -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
Jan Schmidt
9a26173a57 Rewrite M2TS packet output
Make sure we only write the bottom 30 bits of the PCR to the m2ts header.
Don't use floating point computation for it, and remove weird bit fiddling
that messes up the PCR in a way I can't find any
justification/documentation for.

Don't accidentally lose PCR packets from the output.

Fix the description for the m2ts-mode property so it's clear it's a flag,
and which setting does what.

Fixes: #611061 #644429
Partially fixes: #645006
2011-03-26 16:18:22 +11:00
Jan Schmidt
2721e943e2 Fix a FIXME, and some whitespace/code style bits.
Also, add a new copyright notice for me.
2011-03-26 16:18:22 +11:00
Tim-Philipp Müller
0276663d0c mpegtsmux: fix broken pad caps refcount handling
gst_caps_make_writable() takes ownership of the caps passed in, but
the caller doesn't own a ref to the caps here, because GST_PAD_CAPS
doesn't return a ref. Looks like the code relied on a caps leak
elsewhere for this to work properly.
2011-03-14 12:42:33 +00:00
Tim-Philipp Müller
70e71562b7 mpegtsmux: don't error out if downstream fails to handle the newsegment event
If downstream doesn't handle the newsegment event, don't error out (esp.
not without posting a proper error message on the bus), but just continue.
If there's a problem, we'll find out when we start pushing buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=644395
2011-03-14 12:42:33 +00:00
Andreas Frisch
aac497b635 mpegtsmux: remove unused variable 2011-03-14 12:42:33 +00:00
David Schleef
455aaa3fbd mpegtsmux: fix release_pad
Remove bogus freeing of pad element_private data that we
never set (collectpads uses it, which causes confusion here).
Also, check that our collectpads instance exists before using
it.  Partial fix for #636011.
2011-02-17 13:47:52 -08: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
David Schleef
7e8081c89e mpegtsmux: Fix some memleaks 2010-11-27 19:09:58 -08:00
Stefan Kost
0c22e1b954 various (gst): add missing G_PARAM_STATIC_STRINGS flags
Canonicalize property names as needed.
2010-10-19 15:47:17 +03: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
Benjamin Otte
775c7584fd gst_element_class_set_details => gst_element_class_set_details_simple 2010-03-18 22:46:41 +01:00
Julien Moutte
d8117471f6 mpegtsmux: Fix a potential unref of a NULL pointer.
At first iteration we don't have any cached SPS/PPS buffer to free.
2010-02-04 19:45:42 +01:00
Marc-André Lureau
4d3a965476 mpegtsmux: add PAT/PMT in streamheader
The check for PAT/PMT buffers was suggested by
Zaheer Abbas Merali.

https://bugzilla.gnome.org/show_bug.cgi?id=608896
2010-02-03 18:26:15 +00: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
Julien Moutte
6f1ee59df6 mpegtsmux: generate SPS/PPS header once and fix overflow
Some H264 packets can be as small as 5 bytes for repeated frames.
In such a situation the output buffer size was not big enough (5*2) to fit the
SPS/PPS header and the start codes. This corrupts the ES stream.
We now generate the SPS/PPS only once which is much more optimal and we now
know the size of the header to calculate the output buffer size more safely.
2010-02-02 12:23:24 +01:00
Thiago Santos
6e1f2cf392 mpegtsmux: Fix mistake on previous commit
Use the correct variables and variable format in the warning
message
2010-01-12 15:21:29 -03:00
Thiago Santos
ddeb6e17fd mpegtsmux: Do not crash on misinterpreted h264
Avoid crashing when bytestream h264 is interpreted as avc format
h264

Fixes #606657
2010-01-12 09:37:34 -03:00
Marc-André Lureau
67e5d76d08 mpegtsmux: only video can have non-delta-unit 2010-01-08 16:06:38 +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
Stefan Kost
b7b8b7f407 build: fprintf, sprintf, sscanf need stdio.h 2009-10-07 15:26:12 +03:00
Tim-Philipp Müller
95d894fd96 mpegsmux, mpegpsmux: fix unused variable warning with the debugging system in core disabled 2009-09-02 13:37:47 +01:00
Tim-Philipp Müller
10d67eda7a GstAdapter is not a GstObject and should be freed with g_object_unref() 2009-08-31 13:14:02 +01:00
Tim-Philipp Müller
d94d572e16 mpegtsmux: use an old-fashioned array instead of GPtrArray for mux->programs
Using GPtrArray for a fixed-sized array is a bit pointless and makes
for ugly code.
2009-08-31 13:00:04 +01:00
Lin YANG
e453e599af mpegtsmux: Minor fixes 2009-08-31 09:19:23 +02:00
Lin YANG
3ca8288c5b mpegtsmux: mux->programs: use GPrtArray instead of GArray 2009-08-31 09:19:17 +02:00
Lin YANG
5b0b69a858 mpegtsmux: mpegtsmux_collected(): calculate PCR for programs 2009-08-31 09:19:12 +02:00
Lin YANG
b67ed24676 mpegtsmux: mpegtsmux_create_streams(): create multi streams 2009-08-31 09:19:00 +02:00