platform/upstream/gst-plugins-good.git
7 years agoqtdemux: Fix out of bounds read in tag parsing code
Sebastian Dröge [Thu, 1 Dec 2016 11:32:22 +0000 (13:32 +0200)]
qtdemux: Fix out of bounds read in tag parsing code

We can't simply assume that the length of the tag value as given
inside the stream is correct but should also check against the amount of
data we have actually available.

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

7 years agortp: Fix some memory leaks in usage of gst_pad_get_current_caps()
Garima Gaur [Thu, 1 Dec 2016 09:36:06 +0000 (15:06 +0530)]
rtp: Fix some memory leaks in usage of gst_pad_get_current_caps()

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

7 years agoqtdemux: Read interlacing information from 'fiel' atom
Vivia Nikolaidou [Wed, 30 Nov 2016 15:56:02 +0000 (17:56 +0200)]
qtdemux: Read interlacing information from 'fiel' atom

Read interlacing and TFF/BFF information from the 'fiel' atom and pass it
into the caps

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

7 years agoqtdemux: Fix compiler warning
Sebastian Dröge [Tue, 29 Nov 2016 11:55:40 +0000 (13:55 +0200)]
qtdemux: Fix compiler warning

qtdemux.c: In function ‘qtdemux_parse_trak’:
qtdemux.c:10184:38: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 9 has type ‘gint {aka const int}’ [-Werror=format=]
           GST_DEBUG_OBJECT (qtdemux, "Found jpeg: len %u, need %lu", len,
                                      ^

7 years agoqtdemux: Change off_t type to gint
Scott D Phillips [Mon, 28 Nov 2016 21:45:24 +0000 (13:45 -0800)]
qtdemux: Change off_t type to gint

off_t is a signed integer type provided by sys/types.h on posix systems.
Replace with gint for building on non-posix systems (like windows).

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

7 years agomeson: add libm to has_function checks
Scott D Phillips [Wed, 23 Nov 2016 05:00:25 +0000 (21:00 -0800)]
meson: add libm to has_function checks

The functions from math.h may be implemented in libm.

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

7 years agoRevert "meson: dv plugin now works on MSVC"
Nirbheek Chauhan [Thu, 27 Oct 2016 17:32:37 +0000 (23:02 +0530)]
Revert "meson: dv plugin now works on MSVC"

This reverts commit 05a89613feff70cff416367f5aa807a1d5c68b63.

Let's not put in stuff that needs unreleased Meson. This can go in
for the next cycle.

7 years agoavidemux: Ensure that tags are valid UTF-8 before adding them to the taglist
Sebastian Dröge [Mon, 28 Nov 2016 11:51:41 +0000 (13:51 +0200)]
avidemux: Ensure that tags are valid UTF-8 before adding them to the taglist

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

7 years agomultipartdemux: Post an error message on the bus if we got EOS without having added...
Sebastian Dröge [Mon, 28 Nov 2016 10:22:49 +0000 (12:22 +0200)]
multipartdemux: Post an error message on the bus if we got EOS without having added any pads

7 years agosouphttpsrc: Handle non-UTF8 headers and error reasons more gracefully
Sebastian Dröge [Mon, 28 Nov 2016 10:00:09 +0000 (12:00 +0200)]
souphttpsrc: Handle non-UTF8 headers and error reasons more gracefully

Especially don't put them into GstStructures in one way or another, just
ignore them or error out cleanly depending on the importance of their
content.

7 years agovrawpay: Error out cleanly if mapping the video frame fails
Sebastian Dröge [Mon, 28 Nov 2016 07:30:25 +0000 (09:30 +0200)]
vrawpay: Error out cleanly if mapping the video frame fails

Instead of later dereferencing NULL and crashing.

7 years agortprtxsend: Update statistics before pushing
Edward Hervey [Sun, 27 Nov 2016 10:14:13 +0000 (11:14 +0100)]
rtprtxsend: Update statistics before pushing

If an element queries the number of retransmission buffers pushed
*while* the push is still taking place (and before the object lock
is taken just after) it would end up with the wrong statistic
being reported.

Increment it just before the push, avoids races when getting statistics

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

7 years agocommon: use https protocol for common submodule
Tim-Philipp Müller [Sat, 26 Nov 2016 11:20:51 +0000 (11:20 +0000)]
common: use https protocol for common submodule

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

7 years agogstv4l2bufferpool: lock flush_stop against regular qbuf
Philipp Zabel [Thu, 28 Jul 2016 16:51:24 +0000 (18:51 +0200)]
gstv4l2bufferpool: lock flush_stop against regular qbuf

These can be called from different threads and both manipulate the
pool->buffers array. Lock them properly and let flush_stop move the
array contents into a temporary array on the stack to avoid having
to call release_buffer under the object lock.

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

7 years agogstv4l2bufferpool: remove critical error message when process is called on an inactiv...
Philipp Zabel [Thu, 24 Nov 2016 13:25:22 +0000 (14:25 +0100)]
gstv4l2bufferpool: remove critical error message when process is called on an inactive pool

If the pool is inactive, it is guaranteed to also be flushing, so the
following check will return GST_FLOW_FLUSHING anyway.
This can happen if a v4l2src is blocking on DQBUF in create and is sent
an EOS event on another thread. In that case the pool is set to
flushing/inactive without locking, the v4l2src is unblocked, and may
call pool_process with a valid buffer on the already inactive pool.

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

7 years agov4l2src: release buffer if create fails
Philipp Zabel [Thu, 24 Nov 2016 13:41:52 +0000 (14:41 +0100)]
v4l2src: release buffer if create fails

gst_base_src_get_range does not expect a buffer to be returned in
the error case, so we are leaking a reference here if create fails.

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

7 years agortpbin: Handle create_session() returning NULL in bundle code
Sebastian Dröge [Wed, 23 Nov 2016 16:34:04 +0000 (18:34 +0200)]
rtpbin: Handle create_session() returning NULL in bundle code

CID 1394492.

7 years agoqtmux: Make sure to only change DTS of writable buffers
Sebastian Dröge [Tue, 22 Nov 2016 14:42:55 +0000 (16:42 +0200)]
qtmux: Make sure to only change DTS of writable buffers

And trivial cleanup

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

7 years agoqtmux: Error out much earlier if we don't have a valid PTS
Sebastian Dröge [Tue, 22 Nov 2016 14:42:26 +0000 (16:42 +0200)]
qtmux: Error out much earlier if we don't have a valid PTS

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

7 years agoqtmux: Only use buffer durations if they are actually valid
Sebastian Dröge [Tue, 22 Nov 2016 14:18:41 +0000 (16:18 +0200)]
qtmux: Only use buffer durations if they are actually valid

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

7 years agoqtmux: Revert commits that set DTS and duration on buffers unconditionally
Sebastian Dröge [Tue, 22 Nov 2016 13:59:19 +0000 (15:59 +0200)]
qtmux: Revert commits that set DTS and duration on buffers unconditionally

39f7e52266fde3b3c035e22cbcbb2bb1fa207b17 was setting the buffer duration
to 0 if is not valid, under the assumption that this is "the last"
buffer and no others are coming next. This is wrong, last_buf is the
previous buffer and not the very last one.

4e3c13c87c258c9c95e2217d32ab314d12b5fffc was setting DTS to 0 if there
was none. This will set DTS to 0 for all e.g. audio streams, completely
messing up calculations if streams don't start at 0.

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

7 years agoqtmux: Only write "gap" edit list if there is a non-zero gap
Sebastian Dröge [Tue, 22 Nov 2016 13:58:37 +0000 (15:58 +0200)]
qtmux: Only write "gap" edit list if there is a non-zero gap

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

7 years agoflxdec: rewrite logic based on GstByteReader/Writer
Matthew Waters [Tue, 22 Nov 2016 20:09:06 +0000 (07:09 +1100)]
flxdec: rewrite logic based on GstByteReader/Writer

Solves overreading/writing the given arrays and will error out if the
streams asks to do that.

Also does more error checking that the stream is valid and won't
overrun any allocated arrays.  Also mitigate integer overflow errors
calculating allocation sizes.

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

7 years agoflxdec: Don't unref() parent in the chain function
Sebastian Dröge [Wed, 23 Nov 2016 09:20:49 +0000 (11:20 +0200)]
flxdec: Don't unref() parent in the chain function

We don't own the reference here, it is owned by the caller and given to
us for the scope of this function. Leftover mistake from 0.10 porting.

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

7 years agovpxdec: libvpx's release buffer is sometimes called with fb->priv==NULL
Sebastian Dröge [Tue, 22 Nov 2016 18:33:29 +0000 (20:33 +0200)]
vpxdec: libvpx's release buffer is sometimes called with fb->priv==NULL

Don't assert on this but just ignore these cases.

7 years agomatroskademux: Fix cluster searching if we search multiple times in one chunk
Sebastian Dröge [Tue, 22 Nov 2016 18:24:59 +0000 (20:24 +0200)]
matroskademux: Fix cluster searching if we search multiple times in one chunk

After finding a cluster id in the byte reader, we skip ahead the reader
position by one further byte to be able to continue searching from there
inside the same chunk if the cluster candidate was a false positive.

We have to accomodate for that additional byte when resuming the search,
otherwise all following pulls are off-by-one for every resume and we run
into an assertion.

7 years agomatroska: Add size checks to the parsing of FLAC headers
Sebastian Dröge [Tue, 22 Nov 2016 18:01:20 +0000 (20:01 +0200)]
matroska: Add size checks to the parsing of FLAC headers

7 years agoflxdec: fix some warnings comparing unsigned < 0
Matthew Waters [Tue, 22 Nov 2016 12:46:00 +0000 (23:46 +1100)]
flxdec: fix some warnings comparing unsigned < 0

bf43f44fcfada5ec4a3ce60cb374340486fe9fac was comparing an unsigned
expression to be < 0 which was always false.

gstflxdec.c: In function ‘flx_decode_brun’:
gstflxdec.c:322:33: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
         if ((glong) row - count < 0) {
                                 ^
gstflxdec.c:332:33: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
         if ((glong) row - count < 0) {
                                 ^

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

7 years agoqtmux: Enable up to 16 unpositioned raw audio channels
Vivia Nikolaidou [Mon, 21 Nov 2016 14:17:31 +0000 (16:17 +0200)]
qtmux: Enable up to 16 unpositioned raw audio channels

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

7 years agoflxdec: add some write bounds checking
Matthew Waters [Tue, 22 Nov 2016 08:05:00 +0000 (19:05 +1100)]
flxdec: add some write bounds checking

Without checking the bounds of the frame we are writing into, we can
write off the end of the destination buffer.

https://scarybeastsecurity.blogspot.dk/2016/11/0day-exploit-advancing-exploitation.html

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

7 years agoqtdemux: Be sure not to read off end of FLAC dfLa box
David Evans [Mon, 21 Nov 2016 15:25:23 +0000 (15:25 +0000)]
qtdemux: Be sure not to read off end of FLAC dfLa box

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

7 years agomatroskademux: add support for skipping invalid data in push mode
Nicola Murino [Mon, 21 Nov 2016 10:48:58 +0000 (11:48 +0100)]
matroskademux: add support for skipping invalid data in push mode

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

7 years agomatroskaparse: add support for skipping invalid data
Nicola Murino [Mon, 21 Nov 2016 10:48:29 +0000 (11:48 +0100)]
matroskaparse: add support for skipping invalid data

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

7 years agortspsrc: Move to new helper function to parse authentication responses
Sebastian Dröge [Fri, 18 Nov 2016 15:00:59 +0000 (17:00 +0200)]
rtspsrc: Move to new helper function to parse authentication responses

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

7 years agoqtdemux: Fix wrong compiler warning with gcc 6.2
christophecvr [Sun, 20 Nov 2016 13:12:16 +0000 (14:12 +0100)]
qtdemux: Fix wrong compiler warning with gcc 6.2

| ../../../git/gst/isomp4/qtdemux.c: In function 'qtdemux_parse_tree':
| ../../../git/gst/isomp4/qtdemux.c:10224:24: error: 'size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|                  offset += size;
|                         ^~
| ../../../git/gst/isomp4/qtdemux.c:10197:25: note: 'size' was declared here
|                  guint32 size, tag;
|                          ^~~~

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

7 years agowin32: remove copies of generated headers
Tim-Philipp Müller [Sun, 20 Nov 2016 16:15:07 +0000 (16:15 +0000)]
win32: remove copies of generated headers

7 years agoavidemux: Ensure that raw video have properly aligned buffers
Sebastian Dröge [Sun, 20 Nov 2016 11:14:08 +0000 (13:14 +0200)]
avidemux: Ensure that raw video have properly aligned buffers

That is, aligned to to 32 bytes for video. Fixes crashes if the raw
buffers are passed to SIMD processing functions.

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

7 years agoqtdemux: Ensure that raw audio and video have properly aligned buffers
Sebastian Dröge [Sun, 20 Nov 2016 11:08:27 +0000 (13:08 +0200)]
qtdemux: Ensure that raw audio and video have properly aligned buffers

That is, aligned to the basic type for audio and to 32 bytes for video.
Fixes crashes if the raw buffers are passed to SIMD processing functions.

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

7 years agoqtmux: Always write edit lists for the tracks to give a more accurate duration
Sebastian Dröge [Mon, 14 Nov 2016 12:44:11 +0000 (14:44 +0200)]
qtmux: Always write edit lists for the tracks to give a more accurate duration

Always write an edit list for the whole track. In general this is not
necessary except for the case of having a gap or DTS adjustment but
it allows to give the whole track's duration in the usually more
accurate media timescale.

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

7 years agoqtdemux: Remove useless return variable
Seungha Yang [Fri, 18 Nov 2016 13:45:45 +0000 (22:45 +0900)]
qtdemux: Remove useless return variable

qtdemux_expose_streams() returns flow error immediately, if there is an error.
So, the variable for the flow return is not needed.

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

7 years agoqtdemux: Add support for FLAC encapsulated in ISOBMFF
David Evans [Thu, 17 Nov 2016 13:59:48 +0000 (13:59 +0000)]
qtdemux: Add support for FLAC encapsulated in ISOBMFF

As defined by
https://git.xiph.org/?p=flac.git;a=blob_plain;f=doc/isoflac.txt

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

7 years agortpmux: Mark pad as needing reconfiguration again if it failed
Sebastian Dröge [Thu, 17 Nov 2016 17:59:53 +0000 (19:59 +0200)]
rtpmux: Mark pad as needing reconfiguration again if it failed

And return FLUSHING instead of NOT_NEGOTIATED on flushing pads.

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

7 years agomonoscope: Mark pad as needing reconfiguration again if it failed
Sebastian Dröge [Thu, 17 Nov 2016 17:59:26 +0000 (19:59 +0200)]
monoscope: Mark pad as needing reconfiguration again if it failed

And return FLUSHING instead of NOT_NEGOTIATED on flushing pads.

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

7 years agodeinterlace: Mark pad as needing reconfiguration again if reconfiguration failed
Sebastian Dröge [Thu, 17 Nov 2016 17:58:52 +0000 (19:58 +0200)]
deinterlace: Mark pad as needing reconfiguration again if reconfiguration failed

And consider negotiation failures on flushing pads as FLUSHING, not as
NOT_NEGOTIATED.

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

7 years agodvdec: Fix handling of negotiation failures
Sebastian Dröge [Thu, 17 Nov 2016 17:56:23 +0000 (19:56 +0200)]
dvdec: Fix handling of negotiation failures

Return NOT_NEGOTIATED if sending the caps event fails, or FLUSHING if
the pad was flushing at that point.

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

7 years agomeson: add_global_arguments -> add_project_arguments
Scott D Phillips [Fri, 18 Nov 2016 01:16:26 +0000 (17:16 -0800)]
meson: add_global_arguments -> add_project_arguments

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

7 years agosplitmuxsink: pad request fails for flvmux
Vinod Kesti [Wed, 16 Nov 2016 05:23:51 +0000 (10:53 +0530)]
splitmuxsink: pad request fails for flvmux

splitmuxsink requests pad from element using pad template like "video_%u", "audio_%u" and "sink_%d". This is true for most of the muxers.
But splitmuxsink not able to request pad to flvmux as flvmux has "audio" and "video" as pad templates.
fix: splitmuxsink should fallback to "audio" and  "video" when template not found.

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

7 years agomatroskaparse: Add remaining relevant parts from a3a55305 to the parser
Sebastian Dröge [Thu, 17 Nov 2016 08:24:28 +0000 (10:24 +0200)]
matroskaparse: Add remaining relevant parts from a3a55305 to the parser

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

7 years agomatroskaparse: ignore parsing errors at the end of the file
Nicola Murino [Wed, 16 Nov 2016 21:39:01 +0000 (22:39 +0100)]
matroskaparse: ignore parsing errors at the end of the file

This is the same change as a3a55305 for the parser.

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

7 years agortpbin: receive bundle support
Philippe Normand [Wed, 16 Nov 2016 07:56:34 +0000 (08:56 +0100)]
rtpbin: receive bundle support

A new signal named on-bundled-ssrc is provided and can be
used by the application to redirect a stream to a different
GstRtpSession or to keep the RTX stream grouped within the
GstRtpSession of the same media type.

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

7 years agoaacparse: assertion while converting ADTS stream to RAW
Vinod Kesti [Tue, 15 Nov 2016 11:22:39 +0000 (16:52 +0530)]
aacparse: assertion while converting ADTS stream to RAW

aacparse resizes input buffer while converting ADTS stream to RAW,
During buffer resize buffer write permission is not checked.
This throws gst_buffer_is_writable assertion and leads to AV sync issue some times.
It is corrected by making buffer writeable using gst_buffer_make_writable

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

7 years agoqtdemux: Don't modify upstream TIME segment
Seungha Yang [Tue, 15 Nov 2016 12:17:51 +0000 (21:17 +0900)]
qtdemux: Don't modify upstream TIME segment

TIME segment implies that stream/running time is being handled by upstream.
So, we shouldn't override it without any clue.
This patch is for fixing seek in DASH streaming.

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

7 years agomeson: Add define for v4l2-probe config option
Arun Raghavan [Mon, 14 Nov 2016 17:03:27 +0000 (22:33 +0530)]
meson: Add define for v4l2-probe config option

7 years agodeinterleave: Reset caps accumulator to ANY when resyncing the adapter, not EMPTY
Sebastian Dröge [Mon, 14 Nov 2016 15:37:51 +0000 (17:37 +0200)]
deinterleave: Reset caps accumulator to ANY when resyncing the adapter, not EMPTY

The accumulator is filled by intersecting with all the pad caps, as such
it must be initialized with ANY (like it is before the iteration is
started) and not to EMPTY.

Fixes the CAPS query always returning EMPTY caps when resyncing happened
during the query, e.g. because pads were added/removed.

7 years agoudpsrc: remove redundant saddr unref
Petr Kulhavy [Mon, 14 Nov 2016 11:13:14 +0000 (12:13 +0100)]
udpsrc: remove redundant saddr unref

The g_object_unref (saddr) before receiving message seems to be redundant as it
is done just before jumping to retry

Though not directly related, part of
https://bugzilla.gnome.org/show_bug.cgi?id=772841

7 years agoudpsrc: receive control messages only in multicast
Petr Kulhavy [Sat, 12 Nov 2016 22:34:23 +0000 (23:34 +0100)]
udpsrc: receive control messages only in multicast

Control messages are used only in multicast mode - to detect if the destination
address is not ours and possibly drop the packet. However in non-multicast
modes the messages are still allocated and freed even if not used. Therefore
request control messages from g_socket_receive_message() only in multicast
mode.

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

7 years agoUse intermediate guint when handling GstVideoMultiviewFlags
Scott D Phillips [Fri, 11 Nov 2016 18:45:01 +0000 (10:45 -0800)]
Use intermediate guint when handling GstVideoMultiviewFlags

The underlying integer type of the enum GstVideoMultiviewFlags is
implementation defined and may not have the same size as guint.

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

7 years agosplitfilesrc: update uri_get_type to match the prototype in GstURIHandlerInterface
Scott D Phillips [Fri, 11 Nov 2016 18:44:18 +0000 (10:44 -0800)]
splitfilesrc: update uri_get_type to match the prototype in GstURIHandlerInterface

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

7 years agomeson: don't add_global_arguments when being built as a subproject
Scott D Phillips [Thu, 27 Oct 2016 05:37:34 +0000 (22:37 -0700)]
meson: don't add_global_arguments when being built as a subproject

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

7 years agoflacparse: fix header rewriting being ignored
Vincent Penquerc'h [Fri, 21 Oct 2016 14:49:36 +0000 (15:49 +0100)]
flacparse: fix header rewriting being ignored

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

7 years agoflvmux: Add metadatacreator property
Sean DuBois [Wed, 9 Nov 2016 06:25:27 +0000 (06:25 +0000)]
flvmux: Add metadatacreator property

Allow users to set metadatacreator value in the meta packet

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

7 years agosplitmuxsink: Use first buffer TS as mux start time
Vivia Nikolaidou [Tue, 1 Nov 2016 17:56:36 +0000 (19:56 +0200)]
splitmuxsink: Use first buffer TS as mux start time

Do not use last buffer TS + buffer duration because buffer duration
might be inaccurate, especially for frame rates like 30fps where a
rounding error is observed.

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

7 years agortpjitterbuffer: fix timer-reuse bug
Havard Graff [Thu, 3 Nov 2016 14:03:59 +0000 (15:03 +0100)]
rtpjitterbuffer: fix timer-reuse bug

When doing rtx, the jitterbuffer will always add an rtx-timer for the next
sequence number.

In the case of the packet corresponding to that sequence number arriving,
that same timer will be reused, and simply moved on to wait for the
following sequence number etc.

Once an rtx-timer expires (after all retries), it will be rescheduled as
a lost-timer instead for the same sequence number.

Now, if this particular sequence-number now arrives (after the timer has
become a lost-timer), the reuse mechanism *should* now set a new
rtx-timer for the next sequence number, but the bug is that it does
not change the timer-type, and hence schedules a lost-timer for that
following sequence number, with the result that you will have a very
early lost-event for a packet that might still arrive, and you will
never be able to send any rtx for this packet.

Found by Erlend Graff - erlend@pexip.com

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

7 years agortpjitterbuffer: fix lost-event using dts instead of pts
Havard Graff [Sun, 9 Oct 2016 13:59:05 +0000 (15:59 +0200)]
rtpjitterbuffer: fix lost-event using dts instead of pts

The lost-event was using a different time-domain (dts) than the outgoing
buffers (pts). Given certain network-conditions these two would become
sufficiently different and the lost-event contained timestamp/duration
that was really wrong. As an example GstAudioDecoder could produce
a stream that jumps back and forth in time after receiving a lost-event.

The previous behavior calculated the pts (based on the rtptime) inside the
rtp_jitter_buffer_insert function, but now this functionality has been
refactored into a new function rtp_jitter_buffer_calculate_pts that is
called much earlier in the _chain function to make pts available to
various calculations that wrongly used dts previously
(like the lost-event).

There are however two calculations where using dts is the right thing to
do: calculating the receive-jitter and the rtx-round-trip-time, where the
arrival time of the buffer from the network is the right metric
(and is what dts in fact is today).

The patch also adds two tests regarding B-frames or the
“rtptime-going-backwards”-scenario, as there were some concerns that this
patch might break this behavior (which the tests shows it does not).

7 years agortpjitterbuffer: fix bug in reschedule_timer
Havard Graff [Thu, 3 Nov 2016 15:33:53 +0000 (16:33 +0100)]
rtpjitterbuffer: fix bug in reschedule_timer

The new timeout is always going to be (timeout + delay), however, the
old behavior compared the current timeout to just (timeout), basically
being (delay) off.

This would happen if rtx-delay == rtx-retry-timeout, with the result that
a second rtx attempt for any buffers would be scheduled immediately instead
of after rtx-delay ms.

Simply calculate (new_timeout = timeout + delay) and then use that instead.

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

7 years agotests: wavparse: add test for processing an actual .wav file
Tim-Philipp Müller [Thu, 3 Nov 2016 13:27:51 +0000 (13:27 +0000)]
tests: wavparse: add test for processing an actual .wav file

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

7 years agowavparse: Don't set caps to NULL after setting them on the srcpad
Sebastian Dröge [Thu, 3 Nov 2016 10:34:51 +0000 (12:34 +0200)]
wavparse: Don't set caps to NULL after setting them on the srcpad

We would like to check later on EOS if we found a known stream type or
not, to possibly post an error message.

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

7 years agoqtmux: Don't deref NULL pads in debug output
Sebastian Dröge [Wed, 2 Nov 2016 12:33:28 +0000 (14:33 +0200)]
qtmux: Don't deref NULL pads in debug output

That tends to crash.

7 years agoisomp4: Don't use gst_video_colorimetry_to_string_full()
Jan Schmidt [Wed, 2 Nov 2016 00:46:07 +0000 (11:46 +1100)]
isomp4: Don't use gst_video_colorimetry_to_string_full()

The API was reverted. Just use the plain
gst_video_colorimetry_to_string() function.

7 years agosplitmuxsink: Fix GObject warnings on shutdown.
Jan Schmidt [Wed, 2 Nov 2016 00:00:13 +0000 (11:00 +1100)]
splitmuxsink: Fix GObject warnings on shutdown.

Commit 83e718 added a pad template to splitmux request
pads, which means that GstElement now releases the pads on
dispose, but after having removed all elements in the bin
and unlinked them. Make sure we can handle cleanup in that case
without throwing assertions.

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

7 years agosplitmuxsrc: Store seek seqnum and send it on EOS / segment events.
Jan Schmidt [Tue, 1 Nov 2016 15:25:51 +0000 (02:25 +1100)]
splitmuxsrc: Store seek seqnum and send it on EOS / segment events.

GES relies on the EOS event having the seqnum of the seek that
caused it.

7 years agosplitmuxsrc: Forward a not-linked error on the bus
Jan Schmidt [Tue, 1 Nov 2016 15:25:00 +0000 (02:25 +1100)]
splitmuxsrc: Forward a not-linked error on the bus

Handle not-linked as for other fatal errors and post it
onto the bus so the app knows

7 years agoqtdemux: Fix compiler warning
Sebastian Dröge [Tue, 1 Nov 2016 19:00:15 +0000 (21:00 +0200)]
qtdemux: Fix compiler warning

qtdemux.c: In function ‘qtdemux_parse_tree’:
qtdemux.c:10139:16: error: ‘color_table_id’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
             if (color_table_id != 0) {
                ^
qtdemux.c:10121:19: note: ‘color_table_id’ was declared here
           guint16 color_table_id;
                   ^~~~~~~~~~~~~~

7 years agoqtmux: Use a default interleave of 250ms for all codecs
Sebastian Dröge [Thu, 20 Oct 2016 14:40:59 +0000 (17:40 +0300)]
qtmux: Use a default interleave of 250ms for all codecs

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

7 years agoqtmux: Use a default interleave when ProRes is used
Sebastian Dröge [Wed, 19 Oct 2016 11:33:33 +0000 (14:33 +0300)]
qtmux: Use a default interleave when ProRes is used

The ProRes guidelines suggest an interleave of 0.5s is common, but
specifies that for ProRes at most 2MB (for SD) and 4MB (for HD) should
be used per chunk.

It might also make sense to use similar numbers in general.

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

7 years agoqtmux: Allow configuring the interleave size in bytes/time
Sebastian Dröge [Wed, 19 Oct 2016 11:25:28 +0000 (14:25 +0300)]
qtmux: Allow configuring the interleave size in bytes/time

Previously we were switching from one chunk to another on every single
buffer. This wastes some space in the headers and, depending on the
software, might depend in more reads (e.g. if the software is reading
multiple samples in one go if they're in the same chunk).

The ProRes guidelines suggest an interleave of 0.5s is common, but
specifies that for ProRes at most 2MB (for SD) and 4MB (for HD) should
be used per chunk. This will be handled in a follow-up commit.

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

7 years agoqtmux: Set compressor name, horizontal/vertical resolution and depth for ProRes
Sebastian Dröge [Fri, 30 Sep 2016 15:22:27 +0000 (18:22 +0300)]
qtmux: Set compressor name, horizontal/vertical resolution and depth for ProRes

This is also required by some software to handle ProRes files.

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

7 years agoqt: Add support for ProRes 4444 XQ
Sebastian Dröge [Fri, 30 Sep 2016 15:05:38 +0000 (18:05 +0300)]
qt: Add support for ProRes 4444 XQ

And also 4444 in the muxer.

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

7 years agoqtmux: Write 'clap' atom for ProRes
Sebastian Dröge [Fri, 30 Sep 2016 14:58:37 +0000 (17:58 +0300)]
qtmux: Write 'clap' atom for ProRes

It's required for ProRes to work with other software.

It is also in the MP4 standard, but inventing values here seems a bit
tricky for the general case and it does not really give any extra
information.

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

7 years agoqtdemux: Read colorimetry information from colr atom if available
Sebastian Dröge [Fri, 30 Sep 2016 06:55:58 +0000 (09:55 +0300)]
qtdemux: Read colorimetry information from colr atom if available

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

7 years agoqtmux: Always write colr atom with the colorimetry information
Sebastian Dröge [Thu, 29 Sep 2016 18:56:18 +0000 (21:56 +0300)]
qtmux: Always write colr atom with the colorimetry information

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

7 years agoqtmux: Fix writing of the 'fiel' extension atom
Sebastian Dröge [Thu, 29 Sep 2016 15:16:18 +0000 (18:16 +0300)]
qtmux: Fix writing of the 'fiel' extension atom

This was also wrong for JPEG2000. Also write it for all MOV files and
JPEG2000, not only for ProRes.

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

7 years agoqtmux: Write 4 bytes of zeroes at the end of the sample description extensions
Sebastian Dröge [Thu, 29 Sep 2016 14:40:23 +0000 (17:40 +0300)]
qtmux: Write 4 bytes of zeroes at the end of the sample description extensions

This is working around some broken software.

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

7 years agoatoms: 'pasp' atom is also part of MP4, write it always
Sebastian Dröge [Wed, 28 Sep 2016 17:55:24 +0000 (20:55 +0300)]
atoms: 'pasp' atom is also part of MP4, write it always

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

7 years agoqtmux: Write additional atoms for prores video
Vivia Nikolaidou [Mon, 11 Jul 2016 16:30:12 +0000 (19:30 +0300)]
qtmux: Write additional atoms for prores video

These required atoms are: colorimetry, field information, spatial/temporal
quality, and vendor.

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

7 years agortph263depay: Don't drop mode b packets with picture start code
Stian Selnes [Mon, 16 Jun 2014 15:20:32 +0000 (17:20 +0200)]
rtph263depay: Don't drop mode b packets with picture start code

Some buggy payloaders, e.g. rtph263pay, may use mode B for packets
that starts with a picture (or GOB) start code although it's not
allowed. Let's be nice and not drop these packets/frames.

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

7 years agortph263ppay: Fix caps leak
Havard Graff [Wed, 22 Jun 2016 11:59:35 +0000 (13:59 +0200)]
rtph263ppay: Fix caps leak

Fix leaking caps when downstream has not-fixed caps.

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

7 years agortph263pay: Fix indentation
Stian Selnes [Wed, 26 Oct 2016 14:42:19 +0000 (16:42 +0200)]
rtph263pay: Fix indentation

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

7 years agortph263pay: Use GST_TRACE_OBJECT for logging bitstream parsing
Stian Selnes [Tue, 18 Oct 2016 09:35:58 +0000 (11:35 +0200)]
rtph263pay: Use GST_TRACE_OBJECT for logging bitstream parsing

Bump the bitstream parsing to TRACE log level so it doesn't flood the
output when trying to read the more useful DEBUG and LOG messages.

Also use GST_DEBUG_OBJECT instead of GST_DEBUG in various places

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

7 years agortph263pay: Fix leak for B-fragments
Stian Selnes [Tue, 18 Oct 2016 09:09:10 +0000 (11:09 +0200)]
rtph263pay: Fix leak for B-fragments

Altough commits 6a16be7, 64f9d08 and 0c7e3a8 fixed some issues they
introduced others. This patch fixes the leak of one macroblock for every
B fragment.

Macroblock structures must not be freed immediately after finding the
boundaries as they are stored and used later. However the inital dummy
structure (used for finding the first boundary) must be freed.

CID #1212156

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

7 years agortpbin: avoid generating errors when rtcp messages are empty and check the queue...
Alejandro G. Castro [Thu, 20 Oct 2016 11:14:13 +0000 (13:14 +0200)]
rtpbin: avoid generating errors when rtcp messages are empty and check the queue is not empty

Add a check to verify all the output buffers were empty for the
session in a timout and log an error.

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

7 years agortpbin: pipeline gets an EOS when any rtpsources byes
Alejandro G. Castro [Wed, 26 Oct 2016 11:21:29 +0000 (13:21 +0200)]
rtpbin: pipeline gets an EOS when any rtpsources byes

Instead of sending EOS when a source byes we have to wait for
all the sources to be gone, which means they already sent BYE and
were removed from the session. We now handle the EOS in the rtcp
loop checking the amount of sources in the session.

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

7 years agortspsrc: Also handle redirect on PLAY
Matt Staples [Fri, 21 Oct 2016 17:31:00 +0000 (17:31 +0000)]
rtspsrc: Also handle redirect on PLAY

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

7 years agortspsrc: allow missing control attribute in case of a single stream
Petr Kulhavy [Tue, 30 Aug 2016 08:24:43 +0000 (10:24 +0200)]
rtspsrc: allow missing control attribute in case of a single stream

Improve RFC2326 - chapter C.3 compatibility:
In case just a single stream is specified in SDP and the control attribute
is missing do not drop the stream but rather assume "a=control:*"

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

7 years agov4l2: Warn, don't assert if v4l gives us a buffer with a too large size
William Manley [Sat, 8 Oct 2016 16:11:17 +0000 (18:11 +0200)]
v4l2: Warn, don't assert if v4l gives us a buffer with a too large size

I've seen problems where the `bytesused` field of `v4l2_buffer` would be
a silly number causing the later call to:

    gst_memory_resize (group->mem[i], 0, group->planes[i].bytesused);

to result in this error to be printed:

    (pulsevideo:11): GStreamer-CRITICAL **: gst_memory_resize: assertion 'size + mem->offset + offset <= mem->maxsize' failed

besides causing who-knows what other problems.

We make the assumption that this buffer has still been dequeued correctly
so just clamp to a valid size so downstream elements won't end up in
undefined behaviour.

The invalid `v4l2_buffer` I saw from my capture device was:

    buffer = {
      index = 0,
      type = 1,
      bytesused = 534748928, // <- Invalid
      flags = 8260, // V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC | V4L2_BUF_FLAG_ERROR | V4L2_BUF_FLAG_DONE
      field = 01330, // <- Invalid
      timestamp = {
        tv_sec = 0,
        tv_usec = 0
      },
      timecode = {
        type = 0,
        flags = 0,
        frames = 0 '\000',
        seconds = 0 '\000',
        minutes = 0 '\000',
        hours = 0 '\000',
        userbits = "\000\000\000"
      },
      sequence = 0,
      memory = 2,
      m = {
        offset = 3537219584,
        userptr = 140706665836544, // Could be nonsense, not sure
        planes = 0x7ff8d2d5b000,
        fd = -757747712
      },
      length = 2764800,
      reserved2 = 0,
      reserved = 0
    }

This is from gdb with my own annotations added.

This was with gst-plugins-good 1.8.1, a Magewell XI100DUSB-HDMI video
capture device and kernel 3.13 using a dodgy HDMI cable which is great at
breaking HDMI capture devices.  I'm using io-mode=userptr and have built
gst-plugins-good without libv4l.

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

7 years agoqtmux: Use a better default value for the movie header timescale
Sebastian Dröge [Thu, 20 Oct 2016 17:41:07 +0000 (20:41 +0300)]
qtmux: Use a better default value for the movie header timescale

Take the maximum video timescale, or if no video track is present the
previous value of 1800.

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

7 years agoqtmux: Be more clever with the default video track timescale
Sebastian Dröge [Thu, 20 Oct 2016 17:07:19 +0000 (20:07 +0300)]
qtmux: Be more clever with the default video track timescale

Use the number of milliframes per second for integral and drop-frame
framerates, as suggested by the QT file format specification and other
places. We already did that for integral framerates before, but not for
drop-frame framerates. This now keeps precision better.

For all other framerates, check if it's close to a well-known framerate
and use that instead.

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

7 years agoqtdemux: extract interlaced information from jpeg video
Vincent Penquerc'h [Mon, 10 Oct 2016 12:00:01 +0000 (13:00 +0100)]
qtdemux: extract interlaced information from jpeg video

This information is hidden in a small chunk of data.
Format found at https://developer.apple.com/standards/qtff-2001.pdf,
page 92, "Video Sample Description", under table 3.1.

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

7 years agogdkpixbufoverlay: Fixing x and y offset computation
Jagadish [Wed, 26 Oct 2016 07:16:28 +0000 (12:46 +0530)]
gdkpixbufoverlay: Fixing x and y offset computation

While computing the x and y offsets, it's the video resolution and
resized overlay resolution to be used instead of actual overlay image
resoltuion. Due to this, the overlay image used to get wrongly overlayed
in undesired location

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

7 years agomeson: update version
Tim-Philipp Müller [Tue, 1 Nov 2016 18:09:00 +0000 (18:09 +0000)]
meson: update version