Commit graph

344 commits

Author SHA1 Message Date
Stéphane Cerveau
176a00985a mpegpsdemux: fix accurate seek
In an accurate seek, the segment start should be
the same as the one requested in the seek.
The start should be kept as the one from the
segment if its inferior.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2048>
2021-03-22 12:54:14 +01:00
Stéphane Cerveau
497e88ae88 mpegpsdemux: Keep seqnum events
Keep the same seqnum of the new segment events for each
of the streams.
Keep the segment to send the EOS event.
Keep the seek seqnum for segment and flush event.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2048>
2021-03-22 12:54:14 +01:00
Stéphane Cerveau
96467f581e mpegpsdemux: avoid early EOS
In a case of a scr different from 0, after a seek,
the src_segment.stop has been updated with the duration
not including the base_time (scr). The segment position
needs to be tested upon segment.stop + base_time (scr)
to check for an EOS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2048>
2021-03-22 12:54:14 +01:00
Seungha Yang
7cec64499d mpegdemux: Set duration on seeking query if possible
Set duration on seeking query in the same way as duration query handler.
Otherwise application might get confused as if the duration is unknown.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1791>
2020-11-11 14:10:27 +00:00
Seungha Yang
8e45fd27d1 mpegdemux: Add ignore-scr property to ignore broken SCR
Some MPEG-PS streams might not be compliant but the SCR can be ignored
if PTS/DTS in PES header is consistently increased.
2020-03-11 21:06:20 +09:00
Seungha Yang
f6328cec89 mpegdemux: Remove whitespace 2020-03-11 17:42:18 +09:00
Sebastian Dröge
287f9b18b0 mpegdemux: Update the last_ts correctly if we have no DTS
If we have no DTS but a PTS then this means both are the same, and we
should update the last_ts with the PTS. Only if both are unknown then we
don't know the current position and should not update it at all.

Previously we would always update the last_ts to GST_CLOCK_TIME_NONE if
the DTS is unknown, which caused the position to jump around and to
cause spurious gap events to be sent.
2020-01-21 23:50:52 +00:00
Sebastian Dröge
5f95a9ec61 mpegpsdemux: Send gap events for late streams whenever updating the SCR
Instead of doing it on each packet and doing it based on the distance to
the previous SCR instead of based on the DTS.

Previously we would send gap events for audio all the time if the SCR
distance was 400ms because the threshold for audio is 300ms and by only
ever updating the position when the SCR updates we would always be 100ms
above the threshold and send needless gap events.

This fixes audio glitches on various files caused by gap events.
2020-01-21 10:08:53 +00:00
Stéphane Cerveau
6bc0e9527e remove various useless linefeed in logs 2019-12-11 10:51:29 +01:00
Aaron Boxer
6d3429af34 documentation: fixed a heap o' typos 2019-11-05 09:11:25 -05:00
Tim-Philipp Müller
f218ec2794 Remove autotools build system 2019-10-14 13:54:27 +01:00
Doug Nazar
6c552030f7 mpegdemux: Parse mpeg audio layer version and add to caps. 2019-08-05 14:32:24 +00:00
Doug Nazar
341a800954 mpegdemux: Finish setting up stream before adding pad. 2019-08-05 14:32:24 +00:00
Thibault Saunier
47a49f3381 docs: Build documentation with hotdoc 2019-05-13 17:00:00 -04:00
Nicola Murino
60501f128c mpegdemux: add support for H.265 2019-01-24 09:35:06 +00:00
Nicola Murino
bbfd3154fb mpegdemux: add stream format to H.264 caps 2019-01-24 09:35:06 +00: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
Mark Nauwelaerts
eebc4c0022 mpegdemux: segment seek flag is not relevant when checking for EOS
It is only relevant in deciding whether or not send SEGMENT_DONE.
In this case, not detecting EOS leads to a busy loop when encountering
the originally recorded end-of-file of a file that is still growing.
2017-07-09 11:06:45 +02: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
Jan Schmidt
df612f7eb1 mpegdemux: Add stream-format to the H.264 caps.
H.264 in MPEG-PS is always byte-stream
2017-02-01 14:46:15 +11:00
Jan Schmidt
ae98d3537b mpegdemux: Add extra length checks to TS scanning.
Add some missing size checks to the timestamp scanning
fast path.
2017-02-01 14:46:15 +11:00
Jan Schmidt
948b87bf15 psdemux: Rewrite PSM parsing using GstByteReader
Avoid possible buffer overflows and ignore invalid PSM packets better
by using GstByteReader.

https://bugzilla.gnome.org/show_bug.cgi?id=777957
2017-02-01 14:46:15 +11:00
Thibault Saunier
2fb716409c Use the new API to post flow ERROR messages on the bus
https://bugzilla.gnome.org/show_bug.cgi?id=770158
2016-08-26 19:23:31 -03: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 Schmidt
b6d5aac1c0 mpegdemux: Handle system header when scanning for timestamps.
When scanning for SCR / PTS / DTS, handle the case where
the pack header is followed by the optional system header,
so we can correctly collect timestamps in such cases.

https://bugzilla.gnome.org/show_bug.cgi?id=623860
2016-05-15 19:30:55 +10:00
Jan Schmidt
e3b554f0e6 mpegdemux: Fix backward timestamp scan on small files.
When the file size is smaller than the configured 4MB scan
limit for timestamps, don't underflow the guard variable
when checking if it's time to stop.

Limit the backward SCR scan to the same 4MB as the PTS scan.

Add some comments.
2016-05-15 19:30:55 +10:00
Tim-Philipp Müller
d520e25db3 mpegdemux: don't do bogus adjustments on seek if we have no first_pts
Fixes bogus segment and gap events with start=GST_CLOCK_TIME_NONE if
we failed to find a first_pts.

https://bugzilla.gnome.org/show_bug.cgi?id=623860
2016-05-15 10:18:11 +01:00
Tim-Philipp Müller
c4680ab2a9 mpegdemux: fix description 2016-05-05 10:44:22 +01:00
Tim-Philipp Müller
536e3742aa Fix file permissions of some files 2015-08-28 19:55:59 +01:00
Sangkyu Park
0ca354eb10 mpegdemux: check pointer before dereferencing
gst_ps_demux_get_stream() could return NULL when it is unknown stream,
check this hasn't happened before dereferencing the returned pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=751528
2015-06-26 18:02:22 +01:00
Luis de Bethencourt
d45a1253b1 mpegdemux: remove unused property enum item
The property enum item has been there since the origin of the element but it
has never been used. Removing it.
2015-04-27 14:56:13 +01:00
Luis de Bethencourt
925b65b02e Rename property enums from ARG_ to PROP_
Property enum items should be named PROP_ for consistency and readability.
2015-04-27 10:55:18 +01:00
Tim-Philipp Müller
699452ef31 Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 18:59:32 +01:00
Vincent Penquerc'h
d84d803431 mpegdemux: fix pad leak when not adding a new pad after no-more-pads 2015-04-16 13:35:40 +01:00
Mark Nauwelaerts
b2d109242f mpegdemux: resurrect some flow return handling
https://bugzilla.gnome.org/show_bug.cgi?id=744572
2015-03-28 18:22:29 +01:00
Edward Hervey
ca22a8e87f mpegdemux: minor debug update
Only show PTS/DTS when they are valid, and include the stream id
2015-01-21 08:47:48 +01:00
Luis de Bethencourt
8b2fc918b6 mpegdemux: fix dead code
found is initialized to FALSE to then only be used in two conditional statements
that will always be false, making the blocks inside them dead code. Looking back
in the file's history the setting of the variable's value before it is checked
was dropped as part of the port to 0.11, bringing that value setting back.

https://bugzilla.gnome.org/show_bug.cgi?id=742638
2015-01-12 12:59:20 +00:00
Tim-Philipp Müller
9f3a5fc168 mpegdemux: minor optimisation when scanning for SCRs
Bail out early when we're scanning for SCR, no need to
parse stuff we're not going to use nor interested in.
2015-01-11 20:42:13 +00:00
Tim-Philipp Müller
074d6347d1 mpegdemux: start pushing data again when a pad gets linked later
The whole not_linked optimisation is really a bit dodgy here, but
let's leave it in place for now and at least start pushing data
again when a pad got linked later, in which case we should get a
RECONFIGURE event.
2014-11-02 22:49:05 +00:00
Tim-Philipp Müller
2a93e71e67 mpegdemux: namespace fixes 2014-11-02 22:46:49 +00:00
Sanjay NM
44874d35b5 mpegdemux: removed an unwanted initialization and a variable
https://bugzilla.gnome.org/show_bug.cgi?id=736863
2014-09-18 12:54:05 +03:00
Edward Hervey
e7a0d7d0ed mpegdemux: avoid crashing in pathological case
(Identical to commit 612cdeec80 which
was for resindvd)

When we'd see an unknown stream type, then a SDDS stream.
Then we'd get to the end of the switch with a NULL temp stream
pointer, and dereference it.

Coverity 1139708
2014-06-02 09:42:33 +02:00
Thiago Santos
6dc571b5cf mpegdemux: use GstFlowCombiner
Removes flow return combination code to use the newly added GstFlowCombiner

https://bugzilla.gnome.org/show_bug.cgi?id=709224
2014-05-26 23:29:43 -03:00
Edward Hervey
f982feb1d9 mpegpsdemux: Flush program end code bytes
This should not harm regular files, since those are the last 4 bytes of
a normal file.

This allows to handle playback of concatenated mpeg-ps files. Seeking and
duration reporting is still wrong though.
2014-04-23 10:46:20 +02:00
Sebastian Dröge
03043b7238 mpegdemux: Don't write after the end of the psm array when initialising it 2014-02-27 22:28:16 +01:00
Edward Hervey
3bede97970 mpegpsdemux: Initialize PSM fully
Some gaps were missed in the previous version. Instead just initialize
the whole table to -1 first and then fill what needs to be specified.
2014-02-25 11:29:06 +01:00
Jan Schmidt
d52b0f922b mpegdemux: Merge some changes from the resindvd copy
One bug fix, some debug changes and other inconsequential changes
just to reduce the diff between the 2 copies a bit.
2014-01-16 20:16:27 +11:00
Mark Nauwelaerts
b57981d15b mpgegdemux: do not use pushed buffer in debug message 2013-11-11 13:36:02 +01:00
Stefan Sauer
0d54e5857f mpegpsdemux: log time format as name instead of the number 2013-10-08 09:05:36 +02:00
Tim-Philipp Müller
310a633afb mpegpsdemux: minor clean-up 2013-09-02 23:28:38 +01:00