platform/upstream/gstreamer.git
6 years agoxvimagesink: fix inaccurate error message
Jun Xie [Mon, 11 Dec 2017 03:45:37 +0000 (11:45 +0800)]
xvimagesink: fix inaccurate error message

It's about not being able to calculate the display size, not the display
ratio.

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

6 years agoappsrc: add support for pushing buffer lists
Tim-Philipp Müller [Thu, 31 Aug 2017 10:12:12 +0000 (11:12 +0100)]
appsrc: add support for pushing buffer lists

And samples that carry buffer lists.

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

6 years agoalsamidisrc: unlock create function on shutdown
Tim-Philipp Müller [Mon, 4 Dec 2017 09:49:35 +0000 (09:49 +0000)]
alsamidisrc: unlock create function on shutdown

Fixes occasional hang in generic/states unit test or

GST_CHECKS=test_state_changes_up_and_down_seq make forever

6 years agooggdemux: Check encoder name is valid
Edward Hervey [Fri, 8 Dec 2017 09:33:10 +0000 (10:33 +0100)]
oggdemux: Check encoder name is valid

Encoder names should be valid utf-8, if not just ignore them

6 years agotypefind: Avoid overflow calculation (image/quicktime)
Edward Hervey [Fri, 8 Dec 2017 07:00:07 +0000 (08:00 +0100)]
typefind: Avoid overflow calculation (image/quicktime)

The qt typefinder uses guint64 values for offset and size calculation
but the typefinder system only supports gint64 values.

Make sure we don't end up using potentially overflowing values.

6 years agotypefind: Avoid overflow calculation
Edward Hervey [Fri, 8 Dec 2017 07:00:07 +0000 (08:00 +0100)]
typefind: Avoid overflow calculation

The qt typefinder uses guint64 values for offset and size calculation
but the typefinder system only supports gint64 values.

Make sure we don't end up using potentially overflowing values.

6 years agoximagesink, xvimagesink: fix incorrect type conversion of pointer position
Akinobu Mita [Sat, 2 Dec 2017 17:10:40 +0000 (02:10 +0900)]
ximagesink, xvimagesink: fix incorrect type conversion of pointer position

I'm currently playing with modified ximagesink that does XGrabPointer()
in order to receive the mouse events occurred outside of the window and
send them to the navigation interface.

The pointer positions usually have positive coordinates, but it could
be negative with that change.

When the ximagesink handles XEvent that contains a negative pointer
coordinate, it incorrectly generates the GstEvent that contains an
extremely large positive pointer coordinate.

This is because the negative pointer position in XEvent is incorrectly
converted from signed to unsigned and passed as an argument to
gst_navigation_send_mouse_event() which causes implicit conversion from
integer to double.  So the pointer position in the received XEvent and
generated GstEvent are completely different.

This potential problem does not seem to be a real problem with unmodified
ximagesink but there is no reason to leave it as is.  This also fixes
xvimagesink that has the same potential problem.

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

6 years agotypefind: Fix previous commit
Edward Hervey [Thu, 7 Dec 2017 15:09:55 +0000 (16:09 +0100)]
typefind: Fix previous commit

We need to make sure we have *enough* data to read (including the
next 4 bytes)

6 years agotypefind: Optimize qt/3gp typefinding
Edward Hervey [Thu, 7 Dec 2017 14:02:41 +0000 (15:02 +0100)]
typefind: Optimize qt/3gp typefinding

Request the whole 'ftyp' atom data and scan within it. Avoids doing
a lot of small 4 byte pull from upstream if it's invalid.

6 years agotypefind: wavpack: limit search in blocksize
Edward Hervey [Thu, 7 Dec 2017 13:52:36 +0000 (14:52 +0100)]
typefind: wavpack: limit search in blocksize

The maximum blocksize is 131072 bytes, anything bigger is a corrupted
file.

6 years agotypefind: Fix ico out-of-bound read
Edward Hervey [Thu, 7 Dec 2017 10:03:20 +0000 (11:03 +0100)]
typefind: Fix ico out-of-bound read

The furthest we go to verify the data is reading a guint32 at offset
18, therefore make sure we can read as much.

6 years agoxvimageallocator: Fix build warning error
Seungha Yang [Tue, 14 Nov 2017 14:07:26 +0000 (23:07 +0900)]
xvimageallocator: Fix build warning error

Fix unused variable build error if HAVE_XSHM is undefined

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

6 years agoogmparse: Make sure we set valid string on caps
Edward Hervey [Wed, 6 Dec 2017 13:22:49 +0000 (14:22 +0100)]
ogmparse: Make sure we set valid string on caps

the fourcc might not contain printable characters, use the convenience
macro to turn it into a printable fourcc, like it's done in
gstogmparse

6 years agortsp: Register GstRTSPMessage as a boxed type
Matt Staples [Tue, 31 Oct 2017 22:10:19 +0000 (16:10 -0600)]
rtsp: Register GstRTSPMessage as a boxed type

Registering GstRTSPMessage as a boxed type allows it to be conveniently
used as an argument to signals, a-la GstSDPMessage, and general usage
from bindings.

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

6 years agoaudiodecoder: fix buffer leak in error code path
Havard Graff [Tue, 6 Jun 2017 08:39:15 +0000 (10:39 +0200)]
audiodecoder: fix buffer leak in error code path

6 years agoaudio: Add missing G_BEGIN/END_DECLS
Thibault Saunier [Fri, 1 Dec 2017 13:14:30 +0000 (10:14 -0300)]
audio: Add missing G_BEGIN/END_DECLS

6 years agodecodebin: Fix typo in docs
Jun Xie [Fri, 1 Dec 2017 08:25:32 +0000 (16:25 +0800)]
decodebin: Fix typo in docs

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

6 years agoalsamidisrc: Don't assume a clock has been set
Edward Hervey [Thu, 30 Nov 2017 09:46:44 +0000 (10:46 +0100)]
alsamidisrc: Don't assume a clock has been set

Can happen in testing scenarios for example

6 years agocodec-utils: add some missing gi annotations
Thiago Santos [Tue, 28 Nov 2017 17:33:11 +0000 (09:33 -0800)]
codec-utils: add some missing gi annotations

Missing some array and out parameters annotations

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

6 years agoalsamidisrc: Improve buffer timestamping
Antonio Ospite [Thu, 5 Oct 2017 10:10:50 +0000 (12:10 +0200)]
alsamidisrc: Improve buffer timestamping

Make buffer timestamps more accurate and, more importantly, actually
representative of the MIDI events timing.

Previously, buffers were only sent with timetamps aligned at a 10ms
boundary which was just wrong, now the buffer timestamp represents the
real time of the MIDI event.

Conveniently, the ALSA sequencer API supports scheduling events in the
future so the sequencer infrastructure can be used to have the tick
delivered at the right time, avoiding any custom scheduling mechanism.

The ticks scheduling starts on the first transition to PLAYING, and the
delay is also calculated when the pipeline goes into PLAYING.

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

6 years agoalsamidisrc: Expand snd_seq_create_simple_port() and use a queue for timestamps
Antonio Ospite [Wed, 4 Oct 2017 20:31:23 +0000 (22:31 +0200)]
alsamidisrc: Expand snd_seq_create_simple_port() and use a queue for timestamps

Events are timestamped with a real-time value representing the time
passed since the queue timer was started.

The timestamp is not used just yet.

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

6 years agoalsamidisrc: Merge prepare_buffer() and push_buffer()
Antonio Ospite [Wed, 4 Oct 2017 18:43:50 +0000 (20:43 +0200)]
alsamidisrc: Merge prepare_buffer() and push_buffer()

The separation is not very useful since push_buffer() is the only user
of prepare_buffer().

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

6 years agoalsamidisrc: Don't set buffer offset and duration
Antonio Ospite [Wed, 4 Oct 2017 17:46:55 +0000 (19:46 +0200)]
alsamidisrc: Don't set buffer offset and duration

They are not relly needed for a live source.

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

6 years agoalsamidisrc: Fix a memory leak when setting the "ports" property
Antonio Ospite [Wed, 4 Oct 2017 17:41:58 +0000 (19:41 +0200)]
alsamidisrc: Fix a memory leak when setting the "ports" property

When setting the "ports" property the value is duplicated but it's not
freed when the elements stops.

Reported by Valgrind (example run with "alsamidisrc ports=128:0"):

  6 bytes in 1 blocks are definitely lost in loss record 30 of 1,911
     at 0x4C2BBEF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
     by 0x5411528: g_malloc (gmem.c:94)
     by 0x542A9FE: g_strdup (gstrfuncs.c:363)
     by 0x775211E: gst_alsa_midi_src_set_property (gstalsamidisrc.c:284)
     by 0x5184A4D: object_set_property (gobject.c:1439)
     by 0x5184A4D: g_object_setv (gobject.c:2245)
     by 0x51859DD: g_object_set_property (gobject.c:2529)
     by 0x4F0474C: ??? (in /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1203.0)
     by 0x4F065C8: ??? (in /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1203.0)
     by 0x4F07557: ??? (in /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1203.0)
     by 0x4EFE3EE: gst_parse_launch_full (in /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1203.0)
     by 0x4EFE673: gst_parse_launchv_full (in /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0.1203.0)

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

6 years agoalsamidisrc: Prevent Valgrind from reporting cached config as memory leaks
Antonio Ospite [Mon, 25 Sep 2017 13:14:45 +0000 (15:14 +0200)]
alsamidisrc: Prevent Valgrind from reporting cached config as memory leaks

See http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=MEMORY-LEAK;hb=HEAD

This allows to have cleaner Valgrind reports about alsamidisrc and make
it easier to spot actual problems.

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

6 years agoalsamidisrc: Improve a comment and remove one trailing space
Antonio Ospite [Mon, 9 Oct 2017 16:50:23 +0000 (18:50 +0200)]
alsamidisrc: Improve a comment and remove one trailing space

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

6 years agoappsink: fix end condition of query drain handler
Julien Isorce [Wed, 29 Nov 2017 14:53:57 +0000 (14:53 +0000)]
appsink: fix end condition of query drain handler

The while loop should end when all buffers "and" the preroll
buffer are consumed but this means to continue waiting if there
are still some pending buffers "or" preroll buffer.

The unit test was correct but racy because of this mistake.
I.e. because of the wrong "and" the while could finish too early.

cd tests/check && GST_CHECKS=test_query_drain make elements/appsink.forever

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

6 years agoAutomatic update of common submodule
Matthew Waters [Mon, 27 Nov 2017 09:10:15 +0000 (20:10 +1100)]
Automatic update of common submodule

From 3f4aa96 to e8c7a71

6 years agowin32: remove .def file with exports
Tim-Philipp Müller [Sun, 26 Nov 2017 18:36:35 +0000 (18:36 +0000)]
win32: remove .def file with exports

They're no longer needed, symbol exporting is now explicit
via GST_EXPORT in all cases (autotools, meson, incl. MSVC).

6 years agoautotools: stop controlling symbol visibility with -export-symbols-regex
Tim-Philipp Müller [Sun, 26 Nov 2017 18:30:57 +0000 (18:30 +0000)]
autotools: stop controlling symbol visibility with -export-symbols-regex

Instead, use -fvisibility=hidden and explicit exports via GST_EXPORT.
This should result in consistent behaviour for the autotools and
Meson builds.

6 years agovideo: add missing GST_EXPORT
Tim-Philipp Müller [Sun, 26 Nov 2017 18:14:39 +0000 (18:14 +0000)]
video: add missing GST_EXPORT

6 years agourisourcebin: Don't leak mutexes
Edward Hervey [Sat, 25 Nov 2017 11:45:03 +0000 (12:45 +0100)]
urisourcebin: Don't leak mutexes

6 years agovideotestsrc: Avoid overflow calculation
Edward Hervey [Tue, 21 Nov 2017 09:15:02 +0000 (10:15 +0100)]
videotestsrc: Avoid overflow calculation

n_frames could end up being quite big (potentially up to G_MAXINT64). Which
would result in overflowing 64bits when multiplying it by GST_SECOND.

Instead move GST_SECOND to the num argument

6 years agortp: Require gconstpointer instead of gpointer for gst_rt[c]p_buffer_new_copy_data()
Sebastian Dröge [Fri, 17 Nov 2017 12:07:22 +0000 (14:07 +0200)]
rtp: Require gconstpointer instead of gpointer for gst_rt[c]p_buffer_new_copy_data()

6 years agodecodebin2: Don't spawn threads on shutdown
Edward Hervey [Thu, 16 Nov 2017 17:22:20 +0000 (18:22 +0100)]
decodebin2: Don't spawn threads on shutdown

If we are shutting down, don't spawn a cleanup thread to cleanup old
groups and instead queue them to be cleaned up in the state change
thread.

This avoids (hopefully for good) having a race between the state change
thread and other threads trying to deactivate elements/pads.

6 years agodecodebin2: Avoid deactivation races
Edward Hervey [Thu, 16 Nov 2017 05:39:41 +0000 (06:39 +0100)]
decodebin2: Avoid deactivation races

Deactivating pads from two threads isn't 100% MT-safe. There is a
slim chance that the GstPadActivateFunc might be called twice with
the same values (in this case from the cleanup thread *and* from
the GstElement change_state function when going from PAUSED to READY).

In order to avoid that, call any existing cleanup function *before*
calling the parent change_state implementation on downwards state
changes.

6 years agodiscoverer: Don't remove element when switching to PLAYING
Edward Hervey [Wed, 15 Nov 2017 09:51:33 +0000 (10:51 +0100)]
discoverer: Don't remove element when switching to PLAYING

There is a race going on somewhere when we attempt to remove elements
*while* the parent container is switching to PLAYING.

In order to avoid this issue with discoverer, make sure we never
remove elements while switching to PLAYING.

6 years agodiscoverer: Don't add pads/elements when cleaning up
Edward Hervey [Wed, 15 Nov 2017 09:49:05 +0000 (10:49 +0100)]
discoverer: Don't add pads/elements when cleaning up

There is no need to add more pads/elements since we are already done.

6 years agodiscoverer: Remove probe when done
Edward Hervey [Wed, 15 Nov 2017 09:45:39 +0000 (10:45 +0100)]
discoverer: Remove probe when done

6 years agoogmparse: Set caps after sending pending events
Edward Hervey [Wed, 15 Nov 2017 07:29:17 +0000 (08:29 +0100)]
ogmparse: Set caps after sending pending events

Avoids sending STREAM_START before CAPS

6 years agooggstream: Demote error to warning
Edward Hervey [Wed, 15 Nov 2017 07:28:47 +0000 (08:28 +0100)]
oggstream: Demote error to warning

6 years agooggdemux: Move mutex/cond initialization/release
Edward Hervey [Wed, 15 Nov 2017 07:27:01 +0000 (08:27 +0100)]
oggdemux: Move mutex/cond initialization/release

We only need to initialize the mutex/cond once when creating the
element and then release them when we are done with the element.

Avoids weird "mutex_clear called when still locked" issues

6 years agodecodebin2: Don't try to add pads when shutting down
Edward Hervey [Tue, 14 Nov 2017 12:38:42 +0000 (13:38 +0100)]
decodebin2: Don't try to add pads when shutting down

Be even more agressive than before and just hold the DYN lock when/if
adding pads and return if we are shutting down.

6 years agodecodebin2: Don't take locks when deactivating pads
Edward Hervey [Tue, 14 Nov 2017 12:34:48 +0000 (13:34 +0100)]
decodebin2: Don't take locks when deactivating pads

When deactivating pads, we need to ensure that the streaming threads
going through the pads we wish to deactivate can cleanly return.
Failure to do that would result in the streaming locks of those
pads never being released. The end result would be a deadlock
when stopping decodebin2.

In order to avoid that situation, release the "dyn" lock around
the deactivation code. And refactor the code to cope with the
list of blocked pads having potentially changed when re-acquiring
the lock.

6 years agotheoradec: Handle negotiation failure
Edward Hervey [Sat, 11 Nov 2017 06:45:42 +0000 (07:45 +0100)]
theoradec: Handle negotiation failure

Avoids a trove of random issues afterwards (due to decoder not
*actually* being initialized/negotiated).

6 years agoplaybin3: Remove unneeded blacklisting
Edward Hervey [Fri, 22 Sep 2017 15:07:44 +0000 (17:07 +0200)]
playbin3: Remove unneeded blacklisting

Blacklisted mimetypes have been empty in almost 10 years ...

6 years agoplaybin3: Remove context caching
Edward Hervey [Fri, 22 Sep 2017 15:04:54 +0000 (17:04 +0200)]
playbin3: Remove context caching

This is now handled by the GstBin baseclass

6 years agoplaybin3: Remove source property
Edward Hervey [Fri, 22 Sep 2017 14:58:14 +0000 (16:58 +0200)]
playbin3: Remove source property

And instead use the "setup-source" signal. This opens the way to deal
with more than one 'source' for a given playlist entry

6 years agoparsebin: Don't let thread run after unref
Edward Hervey [Fri, 10 Nov 2017 13:54:12 +0000 (14:54 +0100)]
parsebin: Don't let thread run after unref

We have a dedicated one-shot thread to handle cleanup of old groups.

While this is a good idea. It's an even better idea to make sure
that thread is *completed* before the parsebin element to which
it is related isn't freed/gone.

* There can only be one cleanup thread happening at any point in time.
  If there is already one, we wait for the previous one to finish.
* When shutting down (NULL=>READY) make sure the thread is finished

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

6 years agodecodebin2: Don't let thread run after unref
Edward Hervey [Fri, 10 Nov 2017 13:54:12 +0000 (14:54 +0100)]
decodebin2: Don't let thread run after unref

We have a dedicated one-shot thread to handle cleanup of old groups.

While this is a good idea. It's an even better idea to make sure
that thread is *completed* before the decodebin2 element to which
it is related isn't freed/gone.

* There can only be one cleanup thread happening at any point in time.
  If there is already one, we wait for the previous one to finish.
* When shutting down (NULL=>READY) make sure the thread is finished

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

6 years agoparsebin: Check for shutdown before exposing pads
Edward Hervey [Fri, 10 Nov 2017 13:22:38 +0000 (14:22 +0100)]
parsebin: Check for shutdown before exposing pads

We already checked previously, but we need to do it before adding
pads.

6 years agoparsebin: Emit 'drained' only for the top-level chain
Edward Hervey [Wed, 6 Sep 2017 14:50:31 +0000 (16:50 +0200)]
parsebin: Emit 'drained' only for the top-level chain

Instead of emitting 'drained' whenever every single chain is drained
(which would result in plenty of signal emission, and would also
occur when switching groups), only emit it when the top-level chain
is drained.

Furthermore, mark unknown (and therefore unexposed) pads as drained
since we'll never get EOS on them.

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

6 years agoaudiobasesink: Print signed time offset as a signed number
Sebastian Dröge [Wed, 8 Nov 2017 17:24:31 +0000 (19:24 +0200)]
audiobasesink: Print signed time offset as a signed number

6 years agoaudiostreamalign: Add G_BEGIN_DECLS/G_END_DECLS
Sebastian Dröge [Wed, 8 Nov 2017 17:24:02 +0000 (19:24 +0200)]
audiostreamalign: Add G_BEGIN_DECLS/G_END_DECLS

6 years agooggdemux: Solidify gst_ogg_demux_loop_push() some more
Edward Hervey [Wed, 8 Nov 2017 16:15:09 +0000 (17:15 +0100)]
oggdemux: Solidify gst_ogg_demux_loop_push() some more

There were still some races going on where seeking events wouldn't
be properly intercepted/executed by this thread.

* Instead of always waiting for the GCond to be emitted, first just
  check if there is an event available
* Take ownership of the event *while* the lock is taken and not
  after releasing/reacquiring it
* Finally acquire lock at the very top and release it at the end
  to make it a bit more streamlined

This removes the remaining issues with seeks not being executed

6 years agooggdemux: Don't double-unlock
Edward Hervey [Wed, 8 Nov 2017 16:08:49 +0000 (17:08 +0100)]
oggdemux: Don't double-unlock

The previous branch will release the lock in the call to
gst_ogg_demux_seek_back_after_push_duration_check_unlock()

Only unlock it if we didn't call that function

6 years agooggdemux: Drop data before new segment
Edward Hervey [Tue, 7 Nov 2017 14:09:40 +0000 (15:09 +0100)]
oggdemux: Drop data before new segment

When calculating duration in push-mode we seek to a certain position
and discard any data until we get data from that requested position.

The problem is that basing ourselves solely on offset to determine
whether we reached the target offset is wrong since the source might
be fast enough  to send us that target position *before* it processed
the requested seek.

This would end up in a situation where:
* We think we're done with duration estimate
* We fire a seek back to "0" in the loop thread
* We resume normal processing
* ... except that we're still getting data from too far ahead which
  we decide to process.
* And we start doing totally wrong granule/time/duration calculation
  and pushing wrong data.

Instead of this confusion, wait until we receive data from the requested
seek. We do that by using the fact that the seqnum in
seek_event_drop_til will be non-zero until the SEGMENT corresponding
to the requested SEEK has been received.

Bonus: makes startup slightly faster

6 years agooggdemux: Wait for push loop to be started
Edward Hervey [Tue, 7 Nov 2017 14:05:19 +0000 (15:05 +0100)]
oggdemux: Wait for push loop to be started

Code using the push_loop_thread (using for sending seeks) assumes
that the thread was properly started, except that this isn't always
true and the thread might not have completely started.

Instead wait for the thread to properly start before doing anything
else.

6 years agoplaybin: Don't ref_sink() the sinks twice
shakin chou [Fri, 3 Nov 2017 03:39:54 +0000 (11:39 +0800)]
playbin: Don't ref_sink() the sinks twice

Since we're already sunk floating reference, we shouldn't call ref_sink
again, which increases the ref_count and cause leaks.

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

6 years agooggstream: Ensure enough bytes for fishead header parsing
Edward Hervey [Mon, 6 Nov 2017 13:28:52 +0000 (14:28 +0100)]
oggstream: Ensure enough bytes for fishead header parsing

6 years agooggstream: Use proper type for sample calculation
Edward Hervey [Sun, 5 Nov 2017 11:16:13 +0000 (12:16 +0100)]
oggstream: Use proper type for sample calculation

If we are going to return a (potentially) 64bit integer, don't use
a 32bit one for calculation, otherwise we could end up exceeding
the maximum size of a 32bit int.

6 years agooggstream: More fixes for invalid granuleshift
Edward Hervey [Sun, 5 Nov 2017 11:15:33 +0000 (12:15 +0100)]
oggstream: More fixes for invalid granuleshift

Don't use granuleshift if it wasn't set

6 years agodiscoverer: Don't switch to PLAYING if we saw an error
Edward Hervey [Sat, 4 Nov 2017 18:48:13 +0000 (19:48 +0100)]
discoverer: Don't switch to PLAYING if we saw an error

If we saw an error on the bus, we can't be guaranteed that element will
function properly anyway. Avoids weird state change races also

6 years agoRevert "discoverer: Avoid race of adding elements while stopping"
Edward Hervey [Sat, 4 Nov 2017 18:08:40 +0000 (19:08 +0100)]
Revert "discoverer: Avoid race of adding elements while stopping"

This reverts commit 9a8cb299702c6e8c01b5f4a366f7cffc6b13f97a.

The problem is deeper down the stack

6 years agortcpbuffer: fix left shift override
Edward Hervey [Sat, 4 Nov 2017 15:56:10 +0000 (16:56 +0100)]
rtcpbuffer: fix left shift override

Needs to be cast to the target type

6 years agodiscoverer: Avoid race of adding elements while stopping
Edward Hervey [Sat, 4 Nov 2017 15:13:06 +0000 (16:13 +0100)]
discoverer: Avoid race of adding elements while stopping

This would result in a lot of warnings regarding elements not being
in NULL state when removed, or even leaked elements.

Instead make sure we take the lock and check whether we are processing
or not before allocating or adding anything to the pipeline

6 years agovideotestsrc: Fix undefined left shift
Edward Hervey [Sat, 4 Nov 2017 11:19:46 +0000 (12:19 +0100)]
videotestsrc: Fix undefined left shift

Cast value to target type

6 years agovideo-converter: Fix undefined left shift
Edward Hervey [Sat, 4 Nov 2017 11:18:39 +0000 (12:18 +0100)]
video-converter: Fix undefined left shift

Cast value to target type

6 years agooggstream: Fix default granuleshift usage
Edward Hervey [Sat, 4 Nov 2017 10:29:52 +0000 (11:29 +0100)]
oggstream: Fix default granuleshift usage

For stream mappers that don't set a specific granuleshift, it will
have the default value of -1.

Protect the code for that and return the granule value as-is

6 years agooggdemux: Protect against invalid granule positions
Edward Hervey [Sat, 4 Nov 2017 10:28:47 +0000 (11:28 +0100)]
oggdemux: Protect against invalid granule positions

Only valid values are -1, 0 or positive values. Anything else is
most likely corrupted data streams

6 years agocodecutils: improve input validation in opus header parsing
Mathieu Duponchelle [Fri, 3 Nov 2017 16:20:44 +0000 (17:20 +0100)]
codecutils: improve input validation in opus header parsing

Invalid input files do not warrant assertions. Instead
output error messages and let the error bubble up.

6 years agosdpmessage: add_attribute accepts NULL value
Justin Kim [Wed, 1 Nov 2017 02:23:17 +0000 (11:23 +0900)]
sdpmessage: add_attribute accepts NULL value

The attribute can be defined without value regardless session-level
or media-level.
Although `gst_sdp_message_insert_attribute` can be used to set NULL,
it would be easier if `gst_sdp_message_add_attribute` accepts NULL.

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

6 years agotypefind: Fix out-of-bound read in PNM typefinder
Edward Hervey [Thu, 2 Nov 2017 14:14:49 +0000 (15:14 +0100)]
typefind: Fix out-of-bound read in PNM typefinder

6 years agovorbistag: Fix previous comment
Edward Hervey [Thu, 2 Nov 2017 09:40:37 +0000 (10:40 +0100)]
vorbistag: Fix previous comment

We already NULL-ended the string, don't use the bogus cur_size

6 years agotypefindfunctions: fix off-by-one in webvtt typefinder
Tim-Philipp Müller [Thu, 2 Nov 2017 09:05:47 +0000 (09:05 +0000)]
typefindfunctions: fix off-by-one in webvtt typefinder

We're also checking the byte after the WEBVTT magic.

6 years agoriff-media: Handle strf_data being NULL
Edward Hervey [Thu, 2 Nov 2017 08:19:21 +0000 (09:19 +0100)]
riff-media: Handle strf_data being NULL

Instead of trying to get the size of a NULL buffer :)

6 years agovorbistag: Check whether tag name is valid
Edward Hervey [Thu, 2 Nov 2017 07:18:26 +0000 (08:18 +0100)]
vorbistag: Check whether tag name is valid

In the same way we check before whether the content of the tag
is UTF-8

6 years agodiscoverer: Check return values
Edward Hervey [Thu, 2 Nov 2017 07:04:27 +0000 (08:04 +0100)]
discoverer: Check return values

The target pad of a ghostpad could have gone (due to shutdown taking
place for example). Check for it's existence before doing anything
with it.

6 years agodecodebin2: Recheck shutdown behaviour in error case
Edward Hervey [Thu, 2 Nov 2017 06:55:16 +0000 (07:55 +0100)]
decodebin2: Recheck shutdown behaviour in error case

If we can expose the main chain, recheck whether we are shutting
down or not.

decodebin2 might have been set to READY/NULL during the attempt
to expose, which would cause it to fail ... but it is not a fatal
issue.

6 years agodiscoverer: Uniquely name elements
Edward Hervey [Thu, 2 Nov 2017 06:18:17 +0000 (07:18 +0100)]
discoverer: Uniquely name elements

Helps identifying actual queue/fakesink usage. There seems to be
a race in discoverer, this should help track it down.

6 years agooggdemux: Only track time for initialized streams
Edward Hervey [Wed, 1 Nov 2017 17:26:20 +0000 (18:26 +0100)]
oggdemux: Only track time for initialized streams

in push-mode we only can track time (or most operations on streams
for that matter) if the underlying GstOggMap was properly initialized.

6 years agooggstream: Add a default GstOggMap
Edward Hervey [Wed, 1 Nov 2017 17:24:11 +0000 (18:24 +0100)]
oggstream: Add a default GstOggMap

Since the default value of a GstOggPad.map.map was 0 ... we would
end up using wrong functions from mappers() if the stream wasn't
initialized yet.

Instead of that, use a default blank/empty first entry.

6 years agortspconnection: Allow setting a custom accept-certificate function for manually check...
Sebastian Dröge [Mon, 17 Jul 2017 14:07:26 +0000 (17:07 +0300)]
rtspconnection: Allow setting a custom accept-certificate function for manually checking a TLS certificate for validity

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

6 years agoogmparse: Ensure we don't create bogus fractions
Edward Hervey [Wed, 1 Nov 2017 10:19:58 +0000 (11:19 +0100)]
ogmparse: Ensure we don't create bogus fractions

The clamping of the fraction denominator was bogus (it needs to
be >0)

6 years agooggdemux: Fix chain leak in push mode
Edward Hervey [Wed, 1 Nov 2017 10:18:12 +0000 (11:18 +0100)]
oggdemux: Fix chain leak in push mode

In some corner cases we end up with the building chain not being
properly tracked (and therefore not properly freed).

Add a FIXME so it can later be fixed, but for now just fix the leak

6 years agovorbistag: Fix leak in error case
Edward Hervey [Wed, 1 Nov 2017 09:53:54 +0000 (10:53 +0100)]
vorbistag: Fix leak in error case

Don't leak the vendor_string on error cases

6 years agoogmparse: Error out if we can't figure out the format
Edward Hervey [Wed, 1 Nov 2017 09:31:28 +0000 (10:31 +0100)]
ogmparse: Error out if we can't figure out the format

In some cases we might not be able to figure out the fixed format
from the header.

Properly error out in those cases.

6 years agortcpbuffer: Add XR type
Justin Kim [Wed, 1 Nov 2017 04:52:50 +0000 (13:52 +0900)]
rtcpbuffer: Add XR type

RTCP XR provides supplements information of the report blocks
from SR and RR. This patch is for downgrading warnings when
XR is detected before implementing entire block types of RFC3611.

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

6 years agosdpmessage: do not append NULL value for session-level attr
Justin Kim [Wed, 1 Nov 2017 03:44:59 +0000 (12:44 +0900)]
sdpmessage: do not append NULL value for session-level attr

If an attribute is defined without value, the generated text
should be 'a=key' rather than 'a=key:'. For media-level, it
has already been done.

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

6 years agoUpdate disted orc file
Edward Hervey [Tue, 31 Oct 2017 10:56:22 +0000 (11:56 +0100)]
Update disted orc file

For latest orc fixes

6 years agoogg: Don't add tags to empty taglist
Edward Hervey [Tue, 31 Oct 2017 09:34:26 +0000 (10:34 +0100)]
ogg: Don't add tags to empty taglist

6 years agotypefind: Use GST_READ_UINT32 macros
Edward Hervey [Mon, 30 Oct 2017 10:10:11 +0000 (11:10 +0100)]
typefind: Use GST_READ_UINT32 macros

Avoids undefined behaviour with shifting

6 years agotypefind: Fix out-of-bound memory access
Edward Hervey [Mon, 30 Oct 2017 07:55:48 +0000 (08:55 +0100)]
typefind: Fix out-of-bound memory access

We were not checking the proper amount of available data in several
places

6 years agoaudioconvert: Fix empty mix matrix documentation typo
Vivia Nikolaidou [Fri, 27 Oct 2017 15:29:40 +0000 (18:29 +0300)]
audioconvert: Fix empty mix matrix documentation typo

6 years agodecodebin3: Allow configure output stream without reassign slot
Seungha Yang [Thu, 16 Mar 2017 11:55:44 +0000 (20:55 +0900)]
decodebin3: Allow configure output stream without reassign slot

By select-streams event, current implementation of decodebin3
supports deactivate output stream (i.e., decoder element)
in reassign slot(), but cannot activate any slot without track change.

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

6 years agoplaybin3: Use STREAMS_SELECTED message to update selected stream types
Seungha Yang [Thu, 16 Mar 2017 10:53:11 +0000 (19:53 +0900)]
playbin3: Use STREAMS_SELECTED message to update selected stream types

Application might choose only specific type among all available types
using select-streams event. In this case, it is desired that reconfigure
of playsink to clear unused stream path.

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

6 years agogst-play: Prevent disabling all streams
Edward Hervey [Fri, 27 Oct 2017 07:51:29 +0000 (09:51 +0200)]
gst-play: Prevent disabling all streams

This would have bad effects :)

6 years agogst-play: Support track change on playbin3
Seungha Yang [Thu, 16 Mar 2017 08:52:04 +0000 (17:52 +0900)]
gst-play: Support track change on playbin3

* playbin3 does not support {current,n}-{audio,video,text}
properties, and they were replaced by GstStreams API.
So, GstStreams API and select-stream event should be used
for track change in case of playbin3.
see also https://bugzilla.gnome.org/show_bug.cgi?id=769079

* By using commend line option "--use-playbin3", gst-play will
use playbin3 regardless of "USE_PLAYBIN" env variable.

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

6 years agoaudioconvert: document passing an empty mix-matrix
Mathieu Duponchelle [Thu, 26 Oct 2017 16:05:31 +0000 (18:05 +0200)]
audioconvert: document passing an empty mix-matrix

6 years agocheck: Fix minor leak
Edward Hervey [Thu, 26 Oct 2017 13:55:32 +0000 (15:55 +0200)]
check: Fix minor leak