summaryrefslogtreecommitdiff
path: root/gst/mpegtsdemux/mpegtspacketizer.h
Commit message (Collapse)AuthorAgeFilesLines
* mpegtsdemux: remove obsolete function declarationMark Nauwelaerts2017-08-091-2/+0
|
* tsparse: Handle backward and discont timestamps better.Jan Schmidt2014-10-291-0/+4
| | | | | | | | | | Assume that small backward PCR jumps are just from upstream packet mis-ordering and don't reset timestamp tracking state - assuming that things will be OK again shortly. Make the threshold for detecting discont between sequential buffers configurable and match the smoothing-latency setting on tsparse to better cope with data bursts.
* tsdemux: GAP detectionEdward Hervey2014-10-201-0/+3
| | | | | | | | | | All pads of a stream are now added at the beginning. In order to cope with streams that don't get any data (forever or for a long time) we detect gaps and push out GAP events when needed. Cleanups and commenting by Jan Schmidt <jan@centricular.com> https://bugzilla.gnome.org/show_bug.cgi?id=734040
* mpegtspacketizer: Store PCR time/byte offsets in 64 bit integersSebastian Dröge2014-08-051-2/+2
| | | | | | | | 32 bit integers are going to overflow, especially the PCR offset to the first PCR will overflow after about 159 seconds. This makes playback of streams stop at 159 seconds as suddenly the timestamps are starting again from 0. Now we have a few more years time until it happens again and 64 bits are too small.
* tsdemux: Add locking around mpegtspacketiser groups.Jan Schmidt2014-07-031-0/+2
| | | | | Otherwise occasionally DURATION queries can crash, if they happen at the wrong moment.
* mpegts: Unify API : GstMpegts / gst_mpegts_ / GST_*_MPEGTS_Edward Hervey2014-06-251-1/+1
| | | | | | | | | | | | | | | | 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)
* mpegtsdemux: New PCR<=>Offset estimation codeEdward Hervey2013-09-281-7/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows: * Better duration estimation * More accurate PCR location * Overall more accurate running-time location and calculation Location and values of PCR are recorded in groups (PCROffsetGroup) with notable PCR/Offset observations in them (when bitrate changed for example). PCR and offset are stored as 32bit values to reduce memory usage (they are differences against that group's first_{pcr|offset}. Those groups each contain a global PCR offset (pcr_offset) which indicates how far in the stream that group is. Whenever new PCR values are observed, we store them in a sliding window estimator (PCROffsetGroupCurrent). When a reset/wrapover/gap is detected, we close the current group with current values and start a new one (the pcr_offset of that new group is also calculated). When a notable change in bitrate is observed (+/- 10%), we record new values in the current group. This is a compromise between storing all PCR/offset observations and none, while at the same time providing better information for running-time<=>offset calculation in VBR streams. Whenever a new non-contiguous group is start (due to seeking for example) we re-evaluate the pcr_offset of each groups. This allows detecting as quickly as possible PCR wrapover/reset. When wanting to find the offset of a certain running-time, one can iterate the groups by looking at the pcr_offset (which in essence *is* the running-time of that group in the overall stream). Once a group (or neighbouring groups if the running-time is between two groups) is found, once can use the recorded values to find the most accurate offset. Right now this code is only used in pull-mode , but could also be activated later on for any seekable stream, like live timeshift with queue2. Future improvements: * some heuristics to "compress" the stored values in groups so as to keep the memory usage down while still keeping a decent amount of notable points. * After a seek compare expected and obtained PCR/Offset and if the difference is too big, re-calculate position with newly observed values and seek to that more accurate position. Note that this code will *not* provide keyframe-accurate seeking, but will allow a much more accurate PCR/running-time/offset location on any random stream. For past (observed) values it will be as accurate as can be. For future values it will be better than the current situation. Finally the more you seek, the more accurate your positioning will be.
* mpegtspacketizer: No longer use a private structEdward Hervey2013-09-281-2/+55
| | | | These are not public headers, it just adds complexity for no reason
* mpegtspacketizer: More AFC flagsEdward Hervey2013-07-291-5/+8
| | | | I should have put those in a previous commit. sorry :(
* mpegtsdemux: Add more flag debugging for PES and TS packetsEdward Hervey2013-07-261-3/+5
| | | | | | | | | | Helps with debugging issues. And also remove unused variable (opcr) This will also allow us in the future to properly detect: * random-access location (to enable keyframe observation and potentially seeking * discont location (to properly handle resets) * splice location (to properly handle new stream changes)
* mpegtsdemux: Remove unneeded variablesEdward Hervey2013-07-091-3/+0
| | | | | | * packet.origts is no longer used since the PCR refactoring done ages ago * known_packet_size is a duplicate of packet_size != 0 * caps was never used outside of the packetizer
* mpegtsdemux: Fix multiple-SI detection/parsingEdward Hervey2013-07-071-3/+1
| | | | | | | | | | | | | | | | We had two issues with the previous code: 1) We were badly handling PUSI-flagged packets. We were discarding the initial data (if pointer != 0) whereas we should have been accumulating it with the previous data (if there was a continuity of course). => First series of information loss 2) We were not checking whether there were more sections after the end of one (i.e. when the following byte was not a stuff byte). This fixes those two issues. Fixes #677443 https://bugzilla.gnome.org/show_bug.cgi?id=677443
* mpegtsdemux: GstMpegTS => GstMpegTsEdward Hervey2013-07-031-1/+1
|
* mpegtsdemux: Switch to MPEG-TS SI libraryEdward Hervey2013-07-031-44/+30
| | | | | | | | * Only mpeg-ts section packetization remains. * Improve code to detect duplicated sections as early as possible * Add FIXME for various issues that need fixing (but are not regressions) https://bugzilla.gnome.org/show_bug.cgi?id=702724
* mpegtspacketizer: Speedup packet parsingEdward Hervey2013-06-241-1/+1
| | | | | | Avoid using bitshifting where not needed. Speeds up packet parsing by 3% (this is *the* hotspot of mpeg-ts elements).
* mpegtspacketizer: Better detect already seen sectionEdward Hervey2013-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | In some cases (NIT on highly-populated DVB-C operator for example), there will be more than one section emitted for the same subtable and version number. In order not to lose those updates for the same version number, we checked against the CRC of the previous section we parsed. The problem is that, while it made sure we didn't lose any information, it also meant that if the same section came back (same version, same CRC) later on we would re-process it, re-parse it and re-emit it. This version improves on that by keeping a list of previously observed CRC for identical PID/subtable/version-number and will only process sections if they really were never seen in the past (as opposed to just before). On a 30s clip, this brings down the number of NIT section parsing from 4541 down to 663. https://bugzilla.gnome.org/show_bug.cgi?id=614479
* tsdemux: fixes seeking in pull modeJosep Torra2013-06-121-1/+1
| | | | | | | Preserve the current segment and observations in pull mode seeks with flushing. https://bugzilla.gnome.org/show_bug.cgi?id=698050
* Fix FSF addressTim-Philipp Müller2012-11-041-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=687520
* mpegts: Use G_GNUC_INTERNALEdward Hervey2012-08-141-25/+25
|
* tsdemux: Calculate pcr/time/offset separately per programEdward Hervey2012-08-141-20/+3
| | | | Avoids quite a few issues with multi-program streams
* mpegtsdemux: Also parse TOT (Time Offset Section)Edward Hervey2012-06-051-0/+2
| | | | It's the same as TDT, except with descriptors at the end
* mpegtspacketizer: Avoid alloc/free where possibleEdward Hervey2012-06-051-1/+7
| | | | Helps for streams with a lot of sections, like EIT
* mpegtsbase/packetizer: Add CAT section handlingEdward Hervey2012-06-051-0/+2
| | | | Allows reporting the global EMM
* mpegtspacketizer: Avoid usage of GstBuffer internallyEdward Hervey2012-05-221-26/+33
| | | | | | | | | | | | | | | | 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.
* mpegtspacketizer: Detect PCR wraparound in skew codeEdward Hervey2012-05-221-0/+1
| | | | | | | 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
* mpegtsdemux: port to 0.11Gil Pedersen2012-04-201-1/+3
| | | | Fixes https://bugzilla.gnome.org/show_bug.cgi?id=674397
* mpegtsdemux: Revert to 0.10 state as this is unmergeable, also put it into ↵Sebastian Dröge2012-03-291-6/+3
| | | | the non-ported plugins again
* Merge remote-tracking branch 'origin/0.10'Sebastian Dröge2012-03-291-1/+47
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: NEWS RELEASE common configure.ac docs/libs/gst-plugins-bad-libs-sections.txt docs/plugins/gst-plugins-bad-plugins.args docs/plugins/gst-plugins-bad-plugins.hierarchy docs/plugins/gst-plugins-bad-plugins.interfaces docs/plugins/inspect/plugin-adpcmdec.xml docs/plugins/inspect/plugin-adpcmenc.xml docs/plugins/inspect/plugin-assrender.xml docs/plugins/inspect/plugin-audiovisualizers.xml docs/plugins/inspect/plugin-autoconvert.xml docs/plugins/inspect/plugin-bayer.xml docs/plugins/inspect/plugin-bz2.xml docs/plugins/inspect/plugin-camerabin2.xml docs/plugins/inspect/plugin-celt.xml docs/plugins/inspect/plugin-dataurisrc.xml docs/plugins/inspect/plugin-debugutilsbad.xml docs/plugins/inspect/plugin-dtmf.xml docs/plugins/inspect/plugin-dtsdec.xml docs/plugins/inspect/plugin-dvbsuboverlay.xml docs/plugins/inspect/plugin-dvdspu.xml docs/plugins/inspect/plugin-faac.xml docs/plugins/inspect/plugin-faad.xml docs/plugins/inspect/plugin-gsm.xml docs/plugins/inspect/plugin-h264parse.xml docs/plugins/inspect/plugin-mms.xml docs/plugins/inspect/plugin-modplug.xml docs/plugins/inspect/plugin-mpeg2enc.xml docs/plugins/inspect/plugin-mpegdemux2.xml docs/plugins/inspect/plugin-mpegtsdemux.xml docs/plugins/inspect/plugin-mpegvideoparse.xml docs/plugins/inspect/plugin-mplex.xml docs/plugins/inspect/plugin-pcapparse.xml docs/plugins/inspect/plugin-rawparse.xml docs/plugins/inspect/plugin-rtpmux.xml docs/plugins/inspect/plugin-rtpvp8.xml docs/plugins/inspect/plugin-scaletempo.xml docs/plugins/inspect/plugin-schro.xml docs/plugins/inspect/plugin-sdp.xml docs/plugins/inspect/plugin-segmentclip.xml docs/plugins/inspect/plugin-shm.xml docs/plugins/inspect/plugin-videomaxrate.xml docs/plugins/inspect/plugin-videoparsersbad.xml docs/plugins/inspect/plugin-vp8.xml docs/plugins/inspect/plugin-y4mdec.xml ext/celt/gstceltdec.c ext/dts/gstdtsdec.c ext/modplug/gstmodplug.cc ext/opus/gstopusenc.c gst-libs/gst/video/gstbasevideocodec.c gst-libs/gst/video/gstbasevideocodec.h gst-libs/gst/video/gstbasevideodecoder.c gst-libs/gst/video/gstbasevideodecoder.h gst-libs/gst/video/gstbasevideoencoder.c gst-libs/gst/video/gstbasevideoencoder.h gst/adpcmdec/Makefile.am gst/audiovisualizers/gstbaseaudiovisualizer.c gst/h264parse/gsth264parse.c gst/mpegdemux/mpegtsparse.c gst/mpegtsdemux/mpegtsbase.c gst/mpegtsdemux/mpegtspacketizer.c gst/mpegtsdemux/mpegtsparse.c gst/mpegtsdemux/tsdemux.c gst/mpegtsdemux/tsdemux.h gst/mxf/mxfdemux.c gst/rawparse/gstaudioparse.c gst/videoparsers/gsth263parse.c gst/videoparsers/gsth264parse.c sys/d3dvideosink/d3dvideosink.c sys/decklink/gstdecklinksink.cpp sys/dvb/gstdvbsrc.c sys/shm/gstshmsrc.c sys/vdpau/h264/gstvdph264dec.c sys/vdpau/mpeg/gstvdpmpegdec.c tests/examples/opencv/gst_element_print_properties.c win32/common/config.h
| * mpegtspacketizer: Handle rollover in offset calculationsEdward Hervey2012-03-051-1/+1
| |
| * mpegtspacketizer: Offset calculationEdward Hervey2012-03-011-1/+22
| | | | | | | | | | | | 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
| * mpegtspacketizer: clock fix and minor additionEdward Hervey2012-03-011-0/+7
| | | | | | | | | | | | * 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
| * mpegtspacketizer: Fix issues with skew codeEdward Hervey2012-02-241-1/+0
| | | | | | | | | | | | * Always try to get a timestamp for the algorithm * Remove dead variable * Return proper default value
| * mpegtspacketizer: Estimate clock skew and retimestamps buffers more precislyThibault Saunier2012-02-241-0/+19
| | | | | | | | | | Apply the EPTLA algotithm to estimate clock skew. Reusing code from -good/gst/rtpmanager/rtpjitterbuffer.c
* | port to new memory APIWim Taymans2012-01-251-3/+2
| |
* | tsdemux/tsparse: Port to 0.11Edward Hervey2011-10-121-3/+7
|/ | | | | This is a naive port that somewhat works but is inefficient. I need to rethink how to make the best out of GstMemory/GstBuffer
* mpegtsdemux: push based seeking based on PCRJanne Grunau2011-06-071-0/+1
| | | | | | | | | | 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
* mpegtsdemux: create function for pcr parsingJanne Grunau2011-06-071-0/+1
|
* mpegtsdemux: add MPEG TS demuxer rewrite from Edward HerveyJanne Grunau2011-02-171-0/+167
with contributions from Miquel Angel Farre Guiu and Zaheer Abbas Merali