Commit graph

5407 commits

Author SHA1 Message Date
Jesper Larsen
8e4f966018 tsdemux: fix program-number functionality
Setting the program-number property does not affect which program
is actually being demuxed.

Moving the initialization of the program_number from
gst_ts_demux_reset to gst_ts_demux_init seems to fix this issue.

https://bugzilla.gnome.org/show_bug.cgi?id=690934
2013-07-22 09:53:46 +02:00
Arnaud Vrac
506abb06e2 mpegdemux: do not push discont buffers if they aren't discont
Explicitly unset discont flag when it shouldn't be set.

https://bugzilla.gnome.org/show_bug.cgi?id=682110
2013-07-17 18:36:30 +01:00
Tim-Philipp Müller
ff495342f2 h263parse: fix height extraction for H263p 2013-07-15 23:04:35 +01:00
Tim-Philipp Müller
79249be0aa h263parse: add pixel-aspect-ratio if upstream doesn't provide one 2013-07-15 23:04:35 +01:00
Edward Hervey
1b1b3a40d7 mpegtsdemux: Remember seek sequence number
* Avoids handling twice the same seek (can happen with playbin and files
  with subtitles)
* Set the sequence number of the segment event to the sequence number of
  the seek event that generated it (-1 for the initial one).
2013-07-15 11:20:40 +02:00
Arnaud Vrac
024aa47f64 tsdemux: implement seeking in push mode 2013-07-15 11:20:40 +02:00
Arnaud Vrac
388c28381f tsdemux: recalculate new segment after byte seek
The seeking start time is approximated from the seek offset in bytes
using the accumulated PCR observations, so on a VBR stream there might
be a big difference between the actual PCR and the estimated one after
the seek. This might result in a long wait to skip all out of segments
packets.

Instead we just recalculate the new segment to start at the first PTS
after the seek, so that playback starts immediatly.
2013-07-15 10:51:28 +02:00
Sreerenj Balachandran
654744a03c mpegvideoparse: Use sequence_display_extension values to update the src caps
The caps should always represent what the user is supposed to see.
So if there is a sequence_display_extension associated with the
stream then use the display_horizontal_size/display_vertical_size
to update the src caps (if they are less than the values provided
by sequence header).

https://bugzilla.gnome.org/show_bug.cgi?id=704009
2013-07-12 10:06:05 +02:00
Sebastian Dröge
1e7b3a8c9e Release 1.1.2
Oops... should've been part of 1.1.2 tag already :(
2013-07-12 09:46:11 +02:00
Sebastian Dröge
f83e9405de mpegpsmux: Send stream-start event before any data 2013-07-10 12:28:38 +02:00
Edward Hervey
8ca1751f00 mpegtsdemux: Avoid parsing section without enough data
This is actually a workaround (we'll be skipping the upcoming section)

This will only happen for sections where the beginning is located within
the last 8 bytes of a packet (which is the minimum we need to properly
identify any section beginning).

Later we should figure out a way to store those bytes and mark that
some analysis needs to happen. The probability of this happening is
too low for me to care right now and do that fix. There is a good chance
that section will eventually be repeated and won't end up on such border.
2013-07-09 12:25:11 +02:00
Edward Hervey
2fb7b87140 mpegtsdemux: Avoid vmethod calls
Depending on usage, tsparse and tsdemux might not need to be called
when new section/pes-data is available.
2013-07-09 12:25:11 +02:00
Edward Hervey
61b30175b3 mpegtsdemux: Remove unneeded variables
* 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
2013-07-09 12:25:11 +02:00
Gwenole Beauchesne
18984f98dd h264parser: fix size caps to report cropped dimensions.
Restore the original h264parser behaviour to report cropped dimensions
in size caps.

https://bugzilla.gnome.org/show_bug.cgi?id=694068

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-07-09 12:15:07 +02:00
Edward Hervey
f58f13e874 mpegtsdemux: Fix multiple-SI detection/parsing
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
2013-07-07 08:29:37 +02:00
Edward Hervey
513417e0ff mpegtbase: Fix switch/case typo
Ended up trying to analyze PMT ... with a PAT :(
2013-07-07 07:21:46 +02:00
Edward Hervey
1c96c79b88 mpegtsdemux: Handle private section streams
Until now we simply ignored those streams (since we couldn't do anything
with it anyway). Now that we have the mpegts library and we offload the
section handling to the application side we can properly identify and
extract them.

By default it is disabled for tsparse and enabled for tsdemux, but there is
a property to change that.

This should open the way to properly handle all private section streams,
including:
* DSM-CC
* MHEG
* Carousel data
* Metadata streams (though I haven't seen any of those in the wild)
* ... And all other specs/protocols making use of those

Partially fixes #560631
2013-07-06 14:50:52 +02:00
Edward Hervey
a3b6b1a951 mpegtsdemux: Handle registration descriptor for programs and streams
* Allows us to simplify some code and prepare for future cleanups.
* Remove useless casts
* Add some FIXME regarding VC1
2013-07-06 10:59:54 +02:00
Brendan Long
f53e66f4c6 webvttenc: Separate cues with two line breaks instead of one.
See http://dev.w3.org/html5/webvtt/#syntax

https://bugzilla.gnome.org/show_bug.cgi?id=703673
2013-07-05 18:32:43 +01:00
Gwenole Beauchesne
d10acd3879 mpegvideoparse: cope with new parser API.
Migrate the code to use the new parser API based on GstMpegVideoPacket.

Also try to optimize gst_mpegv_parse_process_config() by using more of
GstMpegVideoPacket and determining the extension_start_code_identifier
prior to calling the parser function for that extension packet.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-07-05 17:39:28 +02:00
Edward Hervey
9da7551993 mpegtsbase: Remove no-longer needed code
Since we now send all sections to the packetizer, we no longer need to do
anymore in-depth checks for the validity of a section.

The choice boils down to:
1) Is it from a known PES pid ? If so pass it on (which might be just pushing
   downstream in the case of tsparse, or accumulating PES data for tsdemux)
2) Is it from a known SI pid ? If so pass it to the section packetizer
2013-07-05 17:25:17 +02:00
Edward Hervey
b7bba5658a mpegtsdemux: Fix compilation with debugging disabling
We previously weren't using that variable ...
2013-07-05 10:57:34 +02:00
Edward Hervey
7814ed196b mpegtsdemux: Switch to using GstMpegTsStreamType
We still have some other stream types which haven't been ported, but
we will do so once we have defined the enums in the mpegts library.

Also add some FIXMEs regarding items discovered during analysis
2013-07-04 08:45:32 +02:00
Edward Hervey
1f2bb15618 mpegtsdemux: GstMpegTS => GstMpegTs 2013-07-03 14:00:58 +02:00
Edward Hervey
92edd82c86 mpegtsdemux: Switch to MPEG-TS SI library
* 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
2013-07-03 09:17:25 +02:00
Andoni Morales Alastruey
977bf98b44 frei0r: add the build prefix path in the search dirs 2013-06-28 12:40:52 +02:00
Edward Hervey
358a68e65b mpegdesc: Extend list of known descriptors
Add the various ATSC ones
2013-06-24 14:55:28 +02:00
Edward Hervey
26689fc437 mpegtsbase: Only warn for added streams when needed
We use add_stream(stream_type:-1) to ensure a programs' PCR Stream is
also taken into account. For most programs this will re-use an
existing ES stream.

So only warn that we are re-adding a stream if it was already present
AND it is not to ensure the PCR stream is taken into account.
2013-06-24 08:24:58 +02:00
Edward Hervey
f9b3b46ab5 mpegtspacketizer: Speed up section parsing
Only create subtables when needed. It was previously creating one every
single time ... to check if one was present.
And speed up code to detect whether a subtable was already present or not.

Overall makes section pushing 2 times faster.
2013-06-24 07:49:34 +02:00
Edward Hervey
15e3afc099 mpegdesc: Extend list of known descriptors
From ITU-T H222.0 (06/2012). Freely available from itu.int
2013-06-24 07:49:34 +02:00
Edward Hervey
9fd7f1c082 mpegtspacketizer: Speedup packet parsing
Avoid using bitshifting where not needed.

Speeds up packet parsing by 3% (this is *the* hotspot of mpeg-ts elements).
2013-06-24 07:49:34 +02:00
Edward Hervey
0592bcc3c9 mpegtspacketizer: Better detect already seen section
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
2013-06-23 09:06:15 +02:00
Edward Hervey
c0ce94dbf2 mpegtspacketizer: Speed up NIT parsing
Avoid duplicating the delivery structure, and instead give it to the
receiving container.
2013-06-19 19:31:12 +02:00
Edward Hervey
40bcf48b0c mpegtbase: simplify code
We don't need generic methods for push/flush since we know all the
subclass that we control
2013-06-19 12:29:47 +02:00
Edward Hervey
79e63e3daf mpegtsdemux: Fix for compiling without GST_DEBUG
Protect debug-only variables/usage, and in one case remove a useless
variable.
2013-06-19 12:29:46 +02:00
Edward Hervey
e66d543f00 tsparse: Ensure initial events are sent in the right order
First send stream-start, then caps, then segment.

The segment we push is from upstream in push-mode. If we work in pull-mode
then we initialize the base segment to BYTES.

https://bugzilla.gnome.org/show_bug.cgi?id=702422
2013-06-19 07:40:28 +02:00
Sebastian Dröge
d50625eeb0 mpegvideoparse: Make sure the buffer is writable before we add the MPEG video meta
https://bugzilla.gnome.org/show_bug.cgi?id=702174
2013-06-14 14:53:52 +02:00
Arnaud Vrac
a5402d6eeb tsdemux: fix M2TS stream resync
Sync byte scan is incorrect for M2TS streams because the timestamp 4
bytes were not included in the flush size. This can result in an
infinite loop.

Rework the scan code to be clearer and work in all cases.
2013-06-12 08:01:24 +02:00
Arnaud Vrac
065d421d34 tsdemux: move some debug prints at the log level 2013-06-12 08:01:20 +02:00
Josep Torra
28a2902a7b tsdemux: fixes seeking in pull mode
Preserve the current segment and observations in pull mode seeks with
flushing.

https://bugzilla.gnome.org/show_bug.cgi?id=698050
2013-06-12 08:01:06 +02:00
Hans de Goede
28e64d1031 wrappercamerabinsrc: Add video-source-filter during construction
By adding the video-source-filter during construction time, rather then
patching it in later (*), we can greatly reduce the amount of caps involved
in negotation, speeding up pipeline creation.

I wrote this while working on speeding up the startup of cheese. My cheese
has been modified to add a capsfilter, filtering for only the configured
resolution, with that cheese patch + this patch, the pipeline creation time
goes from aprox 1.1 seconds to aprox 350ms. This is with a Logitech 9000
pro camera, which supports lots of different resolutions at many different
framerates per resolution, causing a caps "explosion" if not filtered.

*) Note the code for this is left in, as it is still necessary if the
video-source-filter is changed between a stop + re-start.

https://bugzilla.gnome.org/show_bug.cgi?id=701953
2013-06-11 12:47:53 +02:00
Hans de Goede
8dc7fae455 wrappercamerabinsrc: Don't unset the video-source property on pipeline start
check_and_replace_src() was setting self->app_vid_src to NULL, which
means that an app setting the video-source property, and then starting,
stopping and re-starting the pipeline (ie to make changes to the
video-source-filter property) would after the restart no longer have
a video-source.

This patch fixes this by making gst_camerabin_setup_default_element return a
ref to the passed in user_element, rather then returning the user_element as
is, so that that ref can be passed on to the bin, and the app_vid_src ref
stays valid.

https://bugzilla.gnome.org/show_bug.cgi?id=701915
2013-06-10 16:16:29 +02:00
Sebastian Dröge
c383dd6420 rfb: Link with libgstbase for GstPushSrc 2013-06-07 15:18:15 +02:00
Alban Browaeys
44b1bc6081 mpegdemux: accept ID_PRIVATE_STREAM_1 to avoid loosing sync
Current fallback to lost_sync seems to impede a delay to restore
sync. Let the parser parse and skip the private stream.
Here it contains the digital camera brand (in 2010 bytes)
and is repeated twice.

https://bugzilla.gnome.org/show_bug.cgi?id=697283
2013-06-07 12:57:03 +02:00
Ilya Smelykh
ef0e051e7d h264parse: Wait until SPS/PPS before outputting any data
https://bugzilla.gnome.org/show_bug.cgi?id=646327
2013-06-07 12:10:08 +02:00
Sebastian Dröge
37427ccaef Release 1.1.1 2013-06-05 18:29:49 +02:00
Edward Hervey
0809770d26 mpegtspacketizer: Fix leak
Since we were manually setting GValue to the GValueArray, we also need
to specify how many were set, otherwise all values in the array will
be leaked.
2013-06-05 15:23:18 +02:00
Edward Hervey
877019ae00 mpegtspacketizer: Speedup TDT/TOT parsing
Use quarks where needed, makes it 2.5 times faster
2013-06-05 13:39:14 +02:00
Edward Hervey
824f08d1d8 mpegtspacketizer: Fix string leak
The description/text get copied in the structure.
2013-06-05 13:21:29 +02:00
Edward Hervey
f3bf40e2b0 mpegtspacketizer: Speed up descriptor parsing/packing
descriptors are stored as a GValueArray of GString. The downside is
that there is no way to "pass" ownership of a GValue to a GValueArray
which previously resulted in expensive copy/free of the (already expensive)
GString.

Here we estimate first the size of the GValueArray, then create it,
then directly use the GValue of that array.

Speeds up total SI parsing by ~30%
2013-06-05 12:49:09 +02:00