Commit graph

84 commits

Author SHA1 Message Date
Edward Hervey
a931620208 mpegtspacketizer: Don't use GByteArray
Using a simple array comes to the same result for a fraction of the cost
2012-06-19 10:49:45 +01:00
Edward Hervey
94c68115ef mpegdesc: Don't allocate/free GstMPEGDescriptor
Just use static variables
2012-06-19 10:49:26 +01:00
Edward Hervey
e2576f0e86 mpegtsdemux: Also parse TOT (Time Offset Section)
It's the same as TDT, except with descriptors at the end
2012-06-05 10:54:27 +02:00
Edward Hervey
d9121c38ea mpegtsdemux: FIXME/Comment about issues/errors 2012-06-05 10:54:26 +02:00
Edward Hervey
9e117b83fc mpegtspacketizer: Fix leak 2012-06-05 10:54:26 +02:00
Edward Hervey
5f7ecaa0f1 mpegtspacketizer: Reduce usage of GstAdapter
Peek as much as possible in one go. Ideally we should remove usage of
adapter altogether, but for the time being it provides a big enough
speedup (around 2 times faster per packet processed).
2012-06-05 10:54:26 +02:00
Edward Hervey
f0867c7247 mpegtspacketizer: Avoid alloc/free where possible
Helps for streams with a lot of sections, like EIT
2012-06-05 10:54:26 +02:00
Edward Hervey
0e86e68c6a mpegtspacketizer: Clarify debug statements
Use hex values in more cases (since that's how PID/table_id/... are
represented in the various specs).
2012-06-05 10:54:26 +02:00
Edward Hervey
63f8b970af mpegtsbase/packetizer: Add CAT section handling
Allows reporting the global EMM
2012-06-05 10:54:25 +02:00
Edward Hervey
c6035d403c mpegtspacketizer: Avoid usage of GstBuffer internally
The overhead of creating/using 188 byte GstBuffer from GstAdapter
is too expensive.
We now peek the next packet, and provide a data/size which is only
valid until the packetizerpacket is cleared.

In addition, cleanup all the internal code to deal with that new
behaviour and remove double-checks which are no longer needed.

The section_length is now the corrected section_length (i.e. with
the additional 3 bytes).

Avoid using gst_adapter_prev_timestamp and instead track
the timestamp ourself.
2012-05-22 17:43:38 +02:00
Edward Hervey
6d01f5f1b3 mpegtspacketizer: Detect PCR wraparound in skew code
If the received PCR is going backwards (by a safe margin), include
that wraparound for further calculation.

https://bugzilla.gnome.org/show_bug.cgi?id=674536
2012-05-22 16:51:25 +02:00
Edward Hervey
8a4fd8358d tsdemux: Detect and handle scrambled packets
Users (tsdemux/mpegtsparse) can decide what to do with that
2012-05-18 11:11:31 +02:00
Albert Astrals Cid
dda551e723 mpegts: support items in extended event descriptor
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=672478
2012-05-14 11:51:15 +02:00
Wim Taymans
6bf0ebdcd8 mpegts: don't poke into private adapter fields 2012-05-01 09:41:18 +02:00
Gil Pedersen
fcd8155d87 mpegtsdemux: port to 0.11
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=674397
2012-04-20 11:25:31 +02:00
Edward Hervey
dd6550a663 mpegtspacketizer: Don't leak buffer in fast variant 2012-04-02 15:25:46 +02:00
Edward Hervey
416b10b991 mpegtspacketizer: Handle rollover in offset calculations 2012-03-05 12:46:13 +01:00
Edward Hervey
a4899af8d6 mpegtspacketizer: Offset calculation
Allows PCR<=>PTS<=>offset estimation/calculation
Right now the calculation is very naive, but can be extended later on
without disrupting the code in tsdemux/mpegtsbase
2012-03-01 18:15:51 +01:00
Edward Hervey
39cc29a7d2 mpegtspacketizer: clock fix and minor addition
* Don't take into account packets that arrived at the same time as
  previous ones for clock skew estimation
* Add convenience method for processing the next ts packet
2012-03-01 18:15:51 +01:00
Thibault Saunier
5c2e6dc512 mpegtspacketizer: catch section lengths extending past the buffer length
This is probably the cause for an occasional crash while streaming
MPEG. Blind fix after staring at the code and following logic, so
may or may not fix the issue, I cannot test.

(Port of 4275a70cb5 from mpegdemux)
2012-02-27 09:57:45 -03:00
Thibault Saunier
58a210e3d3 mpegtspacketizer: support more character set encodings
Support UTF-16BE, EUC-KR (KSX1001), GB2312 and ISO-10646/UTF8 text
encoding and fixed new line for multibyte encoding
    
https://bugzilla.gnome.org/show_bug.cgi?id=664257

(Port of 9759d66407 from the mpegtsdemux
element)
2012-02-27 09:42:27 -03:00
Edward Hervey
4bc7cd04c1 mpegtspacketizer: Fix issues with skew code
* Always try to get a timestamp for the algorithm
* Remove dead variable
* Return proper default value
2012-02-24 17:47:38 +01:00
Thibault Saunier
6a8d2c45f6 mpegtspacketizer: Estimate clock skew and retimestamps buffers more precisly
Apply the EPTLA algotithm to estimate clock skew.
Reusing code from  -good/gst/rtpmanager/rtpjitterbuffer.c
2012-02-24 10:57:09 +01:00
Thibault Saunier
adc947e127 tsdemux: fix glib deprecation 2012-02-17 12:19:20 -03:00
Thibault Saunier
6094ec27b1 tsdemux: Minor refactoring/code cleaning
... add some debugging symbols in the mean time.
2012-02-15 15:48:44 -03:00
Olivier Crête
ca7a512739 mpegtsdemux: Restore erroneously removed data++
Also, put back some unused code in comment and replace // comments by /* */
2011-07-13 13:39:54 -04:00
Olivier Crête
d7a774cc44 mpegdemux: Fix unused-but-set warnings 2011-07-12 17:53:33 -04:00
Edward Hervey
e1a7d71184 tsdemux: More fixes to handle non-188 byte packets 2011-06-07 20:50:35 +02:00
Janne Grunau
15391b29e1 mpegtsdemux: push based seeking based on PCR
buffer timestamps are converted to GstClockTime to cover pcr/pts wraps.
multiple pcr/pts wraps are handled with an index which ensures at most
a single pcr wraparound between two entries.
the last seen pcr is recorded to have a nearby index point for short seeks
resuming playback might be delayed if the postion is not a keyframe

TODO: replace manual packet scanning and parsing in the initial duration estimation
2011-06-07 20:50:34 +02:00
Janne Grunau
f89a0abca0 mpegtsdemux: create function for pcr parsing 2011-06-07 20:50:34 +02:00
Janne Grunau
37f1decf78 mpegtsdemux: adaptation field length == 0 is valid
it can be used to insert a single stuffing byte
do not parse the following payload as adaptation field
2011-06-07 20:50:34 +02:00
Mart Raudsepp
b69450af92 mpegtspacketizer: Handle all ISO8859-x encodings in get_encoding()
... according to ETSI EN 300 468, "Selection of character table"
2011-03-21 19:57:39 +01:00
Tim-Philipp Müller
6e321d2d87 mpegtspacketizer: fix log message printf format 2011-02-18 15:17:17 +00:00
Janne Grunau
22ecf13e42 mpegtsdemux: add MPEG TS demuxer rewrite from Edward Hervey
with contributions from Miquel Angel Farre Guiu and Zaheer Abbas Merali
2011-02-17 17:56:59 +01:00