Commit graph

14637 commits

Author SHA1 Message Date
Edward Hervey
0baac2ffb9 h264parse: Unify value setting
the initial par_n = par_d = 0; was always overwritten since the switch/case
handles all values

And remove the 0 case (it's the same handling as default)
2013-10-28 09:35:20 +01:00
Edward Hervey
77f254abb3 h264parse: Avoid ending up with undefined values
If caps aren't fixed, we'd end up with undefined values for format
and align.
2013-10-28 09:33:16 +01:00
Edward Hervey
64592da3e9 tsdemux: Demote GST_ERROR to GST_WARNING
discontinuities are not errors per-se and we handle them correctly.
2013-10-28 09:15:20 +01:00
Alex Ashley
58072914fa hlsdemux: fix memory leak in gst_hls_demux_get_next_fragment
This patch fixes three memory leaks in hlsdemux, one that occurs
during normal operation and two that occur during error conditions.

The gst_hls_demux_get_next_fragment function calls
gst_fragment_get_buffer which increments the reference count
on the buffer but gst_hls_demux_get_next_fragment never calls unref on
the buffer. This means that the reference count for each downloaded
fragment never gets to zero and so its memory is never released.

This patch adds a call to gst_buffer_unref after the flags have been
updated on the buffer.

There is a leak-on-error in gst_hls_demux_decrypt_fragment if it fails
to download the key file. If the key fails to download, null is
returned without doing an unref on the encrypted fragment. The
semantics of gst_hls_demux_decrypt_fragment is that it takes ownership
of the encrypted fragment and releases it before returning.

There is a leak-on-error in gst_hls_src_buf_to_utf8_playlist in the
unlikely event that the gst_buffer_map fails. In the "happy path"
operation of gst_hls_src_buf_to_utf8_playlist the buffer gets an unref
before the function returns, therefore the error condition must do the
same.

https://bugzilla.gnome.org/show_bug.cgi?id=710881
2013-10-25 23:12:25 -03:00
Matthieu Bouron
e7687dbaa2 mpegtsmux: fix uninitialized variable warning
https://bugzilla.gnome.org/show_bug.cgi?id=710759
2013-10-25 12:26:23 +01:00
Matthieu Bouron
84fbc08c25 mpegtsdemux: fix uninitialized variable warning
https://bugzilla.gnome.org/show_bug.cgi?id=710759
2013-10-25 12:26:23 +01:00
Chen Jie
b05a1f75fd androidmedia: make gst_amc_avc_profile_from_string recognize alt name
https://bugzilla.gnome.org/show_bug.cgi?id=710433
2013-10-18 10:01:43 +01:00
Olivier Crête
2046ba220f pitch: Fix inverted condition in setcaps 2013-10-12 16:04:25 -04:00
Edward Hervey
70d83b323b mpegtspacketizer: Skip packets with corrupted length
This is similar to what we do for packets with payload
2013-10-11 10:34:17 +02:00
Edward Hervey
5e50cd507c tsdemux: Refactor language tag extraction
subtitling descriptor needs to be used with a different method to extract
language codes.
2013-10-11 10:29:20 +02:00
Edward Hervey
f36e0bca83 mpegts: Add support for parsing DVB Subtitling descriptor (0x59)
Essentially works in the same vein as the iso639 descriptor code
2013-10-11 10:21:25 +02:00
Jesper Larsen
0d57756512 mpegts: Fix assertion fault in ISO 639 parsing
https://bugzilla.gnome.org/show_bug.cgi?id=709180
2013-10-11 10:20:57 +02:00
Sebastian Dröge
f0b5d84c54 speed: Fix some bytes-per-frame vs. bytes-per-sample mixups
Otherwise we will crash when handling multiple channels and
miscalculate timestamps.

https://bugzilla.gnome.org/show_bug.cgi?id=709734
2013-10-09 17:18:41 +02:00
Sebastian Dröge
f16e70e4ca configure: Make sure to try window-system-agnostic EGL if nothing was auto-detected 2013-10-08 11:11:18 +02:00
Stefan Sauer
0d54e5857f mpegpsdemux: log time format as name instead of the number 2013-10-08 09:05:36 +02:00
Gilles Dartiguelongue
ce080cb7cc egl: Allow disabling gstreamer-egl library
https://bugzilla.gnome.org/show_bug.cgi?id=709531
2013-10-07 11:31:14 +02:00
Jesper Larsen
b6d33e5ce4 tsdemux: Use mpegts-lib for ISO 639 language tags
https://bugzilla.gnome.org/show_bug.cgi?id=709180
2013-10-07 10:23:22 +02:00
Jesper Larsen
279bdef4ea tsdemux: Return descriptor in get_descriptor
https://bugzilla.gnome.org/show_bug.cgi?id=709180
2013-10-07 10:23:22 +02:00
Jesper Larsen
7cb434e42f mpegts: Add ISO 639 parsing functions
https://bugzilla.gnome.org/show_bug.cgi?id=709180
2013-10-07 10:23:22 +02:00
Matej Knopp
f489ae5d55 dvdspu: handle sticky dvd events
palette-changed events are now sticky.

https://bugzilla.gnome.org/show_bug.cgi?id=709454
2013-10-05 10:50:15 +01:00
Thiago Santos
9a50ca5fbc hlsdemux: Small improvement on always valid if condition
No need to check for !cancelled as the above if guarantees it
to be true
2013-10-03 09:15:37 -03:00
Thiago Santos
72e05dfd7c hlsdemux: Do not call _stop holding the updates lock
It will cause a deadlock and the calers for _get_next_fragment
will already call _stop if required when _get_next_fragment fails.

Fixes #690148
2013-10-03 09:15:37 -03:00
Greg Rutz
6819d1a206 dashdemux: Improve if cause readability
Fixed up the error-handling code when downloading fragments.
Modifed the error-handling code to use positive logic when
testing for cancellation of the download loop.

https://bugzilla.gnome.org/show_bug.cgi?id=701404
2013-10-03 09:15:37 -03:00
Thiago Santos
b8dd95e219 dashdemux: actually return true on latency query
Do not forget to set the return for latency query
2013-10-03 09:15:37 -03:00
Alex Ashley
42fd04ce48 dashdemux: stop fetching live fragments that don't yet exist
There is an issue for live streams where download_loop will keep
downloading segments until it gets a 404 error for a segment
that has not yet been published. This is a problem because this
request for a segment that doesn't exist will propagate all the
way back to the origin server(s). This means that dashdemux causes
extra load on the origin server(s) for segments that aren't yet
available.

This patch uses availabilityStartTime, period
and the host's idea of UTC to decide if a fragment is available to
be requested from an HTTP server and filter out requests for fragments
that are not yet available.

https://bugzilla.gnome.org/show_bug.cgi?id=701404
2013-10-03 09:15:37 -03:00
Sebastian Dröge
4b5d560092 h264parse: Fix conversion to AVC if a SPS/PPS not from the first indizes is used
https://bugzilla.gnome.org/show_bug.cgi?id=707974
2013-10-03 13:26:06 +02:00
Sebastian Dröge
c57be26ed9 openjpeg: Port OpenJPEG plugin to the 2.0 API 2013-10-02 20:07:16 +02:00
Dominik Röttsches
b002490ab2 vtenc: Add support for I420
https://bugzilla.gnome.org/show_bug.cgi?id=709241
2013-10-02 13:18:04 +02:00
Dominik Röttsches
24c79af394 vtenc: Use correct strides, etc from the GstVideoFrame
https://bugzilla.gnome.org/show_bug.cgi?id=706211
2013-10-02 13:14:32 +02:00
Sreerenj Balachandran
e943f56bf8 codecparsers: h264: store quantization matrices in zig-zag order
Quantizer matrices are encoded in zigzag scan order in the bitstream,
so always parse it as it is.

https://bugzilla.gnome.org/show_bug.cgi?id=708629
2013-10-02 10:59:10 +02:00
Sreerenj Balachandran
7622c9b10a win32: update with the new file libgstcodecparsers.def
https://bugzilla.gnome.org/show_bug.cgi?id=708629
2013-10-02 10:59:03 +02:00
Sreerenj Balachandran
8c9eaf0dc9 codecparsers: h264: add helpers to convert quantization matrices
Add utility functions to convert quantization matrices from zig-zag scan
order into raster scan order and vice-versa

https://bugzilla.gnome.org/show_bug.cgi?id=708629
2013-10-02 10:57:54 +02:00
Brendan Long
5ff85dd16a Add gstreamer-mpegts pkg-config file.
https://bugzilla.gnome.org/show_bug.cgi?id=709145
2013-10-01 09:02:32 +02:00
Tim-Philipp Müller
2d29f22338 opencv: don't unref NULL caps in finalize
Fixes gst-inspect-1.0 -a and generic states unit test.
2013-09-29 23:43:23 +01:00
Sebastian Dröge
4bed01aff9 iosassetsrc: Port to 1.0 and fix some bugs on the way 2013-09-28 20:36:21 +02:00
Andoni Morales Alastruey
e5d5faa67e iosassetsrc: Add new element from the GStreamer SDK project 2013-09-28 20:36:21 +02:00
Sebastian Dröge
3d5e214f83 eglglessink: Port iOS part to 1.0 2013-09-28 20:36:21 +02:00
Sebastian Dröge
f13a574e2b configure: Fix iOS check for eglglessink 2013-09-28 20:36:21 +02:00
Sebastian Dröge
dd19715961 applemedia: avfvideosrc is not ported to 1.0 yet 2013-09-28 20:36:21 +02:00
Michael Olbrich
93ec45a6df liveadder: round when calculation length from duration
liveadder sometimes calculates the offsets incorrectly before adding. The
resulting errors can easily be heard when mixing silence with a sine.
I'm not sure what the exact conditions are to trigger this, but it definitively
happens when the buffers of two streams have a different duration and buffer
length and duration don't match exactly for one stream because of rounding
errors (e.g.  duration=0:00:00.021333333)

I have to admit, I got lost in the math somewhere but it seems that not
rounding in gst_live_adder_length_from_duration() causes 1 sample overlaps in
consecutive buffers from the same stream.
When using gst_util_uint64_scale_int_round() instead of just truncating the
sine sound correctly again.

https://bugzilla.gnome.org/show_bug.cgi?id=708345
2013-09-28 13:31:13 +02:00
Javier Jardón
a1cc9ca4de hlssink: Use floats for the EXTINF duration values
https://bugzilla.gnome.org/show_bug.cgi?id=708851
2013-09-28 13:20:08 +02:00
Javier Jardón
203f527653 hlssink: Write EXT-X-VERSION tag in the playlist file
https://bugzilla.gnome.org/show_bug.cgi?id=708851
2013-09-28 13:20:08 +02:00
Edward Hervey
e9373604d6 check: Update uvch264demux for behaviour change
Since 006e7a3428 we no longer error out on
incomplete aux segment.
2013-09-28 13:15:44 +02:00
Steve Maynard
17ed696faa mpegts: Add SCTE/EISS sections and table types
https://bugzilla.gnome.org/show_bug.cgi?id=708688
2013-09-28 13:15:44 +02:00
Edward Hervey
0e9ce593bf tsdemux: Wait for valid PCR/offset obvervations
It is quite possible that we might get PTS/DTS before the first
PCR/Offset observation.

In order to end up with valid timestamp we wait until at least one
stream was able to get a proper running-time for any PTS/DTS.
Until then, we queue up the pending buffers to push out.

Once we see a first valid timestamp, we re-evaluate the amount of
running-time elapsed (based on returned inital running-time and amount
of data/DTS queued up) for any given stream.

Taking the biggest amount of elapsed time, we set that on the packetizer
as the initial offset and recalculate all pending buffers running-time
PTS/DTS.

Note: The buffer queueing system can also be used later on for the
dvb fast start proposal (where we queue up all stream packets before
seeing PAT/PMT and then push them once we know if they belong to the
chosen program).
2013-09-28 13:15:43 +02:00
Edward Hervey
a4ee1abb15 examples: Add descriptor dumping 2013-09-28 13:15:43 +02:00
Edward Hervey
2762ead5ef mpegtsdemux: New PCR<=>Offset estimation code
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.
2013-09-28 13:15:43 +02:00
Edward Hervey
5017ba84a7 mpegtspacketizer: No longer use a private struct
These are not public headers, it just adds complexity for no reason
2013-09-28 13:15:43 +02:00
Alex Ashley
0bdf13c36a hlsdemux: Fix dereferencing of NULL pointer
On some live HLS streams, gst_hls_demux_switch_playlist causes
assertion failures because it tried to dereference a NULL fragment.
This is because g_queue_peek_tail sometimes was returning NULL and
this case was not being checked.

This patch does two things:
* move the g_queue_peek_tail inside the semaphore protection
* check if q_queue_peek_tail returns NULL

https://bugzilla.gnome.org/show_bug.cgi?id=708849
2013-09-28 13:14:01 +02:00
Sebastian Dröge
d7c7f54734 mpegtsparse: Queue buffers until we have enough to know the caps
https://bugzilla.gnome.org/show_bug.cgi?id=708222
2013-09-27 16:10:54 +02:00