platform/upstream/gstreamer.git
8 years agomultiqueue: Add higher-resolution low/high-watermark properties
Carlos Rafael Giani [Wed, 31 Aug 2016 07:49:03 +0000 (09:49 +0200)]
multiqueue: Add higher-resolution low/high-watermark properties

low/high-watermark are of type double, and given in range 0.0-1.0. This
makes it possible to set low/high watermarks with greater resolution,
which is useful with large multiqueue max sizes and watermarks like 0.5%.

Also adding a test to check the fill and watermark level behavior.

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

8 years agomultiqueue: Distinguish between buffering percentage and buffering level
Carlos Rafael Giani [Wed, 31 Aug 2016 07:48:53 +0000 (09:48 +0200)]
multiqueue: Distinguish between buffering percentage and buffering level

To make the code clearer, and to facilitate future improvements, introduce
a distinction between the buffering level and the buffering percentage.

Buffering level: the queue's current fill level. The low/high watermarks
are in this range.

Buffering percentage: percentage relative to the low/high watermarks
(0% = low watermark, 100% = high watermark).

To that end, get_percentage() is renamed to get_buffering_level(). Also,
low/high_percent are renamed to low/high_watermark to avoid confusion.
mq->buffering_percent values are now normalized in the 0..100 range for
buffering messages inside update_buffering(), and not just before sending
the buffering message. Finally the buffering level range is parameterized
by adding a new constant called MAX_BUFFERING_LEVEL.

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

8 years agomultiqueue: Rename percent/percent_changed to buffering_percent(_changed)
Carlos Rafael Giani [Wed, 31 Aug 2016 07:48:38 +0000 (09:48 +0200)]
multiqueue: Rename percent/percent_changed to buffering_percent(_changed)

This is a prerequisite for subsequent commits, and makes queue2 and
multiqueue code a little more consistent.

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

8 years agomultiqueue: Fix high_time wakeup logic
Edward Hervey [Tue, 23 Aug 2016 05:57:33 +0000 (14:57 +0900)]
multiqueue: Fix high_time wakeup logic

When calculating the high_time, cache the group value in each singlequeue.

This fixes the issue by which wake_up_next_non_linked() would use the global
high-time to decide whether to wake-up a waiting thread, instead of the group
one, resulting in those threads constantly spinning.

Tidy up a bit the waiting logic while we're at it.

With this patch, we go from 212% playing a 8 audio / 8 video file down to less
than 10% (most of it being the video decoding).

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

8 years agotools: gst-inspect: don't print internal pad request function name
Tim-Philipp Müller [Sun, 28 Aug 2016 15:02:14 +0000 (16:02 +0100)]
tools: gst-inspect: don't print internal pad request function name

This just confuses people, they look at it and try to call it
directly by name, instead of using the public GstElement API.
It stands to reason that it goes without saying that when an
element provides request pads that they can actually be
requested using the standard API, and there's no point in
printing internal implementation details of the element.

8 years agoMake use of the new GST_ELEMENT_FLOW_ERROR API all around.
Thibault Saunier [Tue, 23 Aug 2016 16:27:58 +0000 (13:27 -0300)]
Make use of the new GST_ELEMENT_FLOW_ERROR API all around.

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

8 years agoelement: Add API to more easily post messages about flowing issues
Thibault Saunier [Tue, 23 Aug 2016 16:27:20 +0000 (13:27 -0300)]
element: Add API to more easily post messages about flowing issues

In many parts of the code we raise streaming error when the flow
goes wrong, and each time we create more or less similare error
message. Also that message does not let the application know what
has actually gone wrong. In the new API we add a "flow-return" detail
field inside the GstMessage so that the application has all the information
if it needs it.

API:
    GST_ELEMENT_FLOW_ERROR

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

8 years agogstconfig: Decide GST_EXPORT declaration style at build time
Nirbheek Chauhan [Fri, 26 Aug 2016 13:57:22 +0000 (19:27 +0530)]
gstconfig: Decide GST_EXPORT declaration style at build time

We only use GST_EXPORT consistently when building with MSVC by using the
visual studio definitions files (win32/common/*.def), so always disable
it when building with Autotools and only enable it with Meson when
building with MSVC.

This allows you to use MinGW to link to a GStreamer built with MSVC and
get the correct function prototypes to find functions and variables in
DLLs.

8 years agodocs: fix typo in stream selection docs
Wonchul Lee [Fri, 26 Aug 2016 07:21:30 +0000 (16:21 +0900)]
docs: fix typo in stream selection docs

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

8 years agoelement: rename gst_element_message_new_details() to gst_make_element_message_details()
Tim-Philipp Müller [Fri, 26 Aug 2016 11:55:04 +0000 (12:55 +0100)]
element: rename gst_element_message_new_details() to gst_make_element_message_details()

Fixes g-i warning "Gst: Constructor return type mismatch
symbol='gst_element_message_new_details' constructed='Gst.Element'
return='Gst.Structure'".

This is a newly-added function in git that has not been in a stable
release yet, so it's fine to rename it. It's also only used indirectly
via macros.

8 years agodocs: fix various gtk-doc warnings
Tim-Philipp Müller [Fri, 26 Aug 2016 11:35:23 +0000 (12:35 +0100)]
docs: fix various gtk-doc warnings

e.g. "warning: multi-line since docs found"

8 years agog-i: info: allow passing NULL to gst_debug_remove_log_function()
Tim-Philipp Müller [Fri, 26 Aug 2016 11:04:33 +0000 (12:04 +0100)]
g-i: info: allow passing NULL to gst_debug_remove_log_function()

Useful for removing the default handler from bindings.

8 years agomeson: doc: Fix building documentation when using subprojects
Thibault Saunier [Thu, 25 Aug 2016 18:04:06 +0000 (15:04 -0300)]
meson: doc: Fix building documentation when using subprojects

and check the presence of gtk-doc before building the documentation

8 years agovalue: Implement can_intersect for GstFlagSet types
Jan Schmidt [Thu, 25 Aug 2016 17:17:41 +0000 (03:17 +1000)]
value: Implement can_intersect for GstFlagSet types

Make sure that gst_value_can_intersect returns TRUE
for GstFlagSet combinations that can successfully
intersect

8 years agoqueue2: Add higher-resolution low/high-watermark properties
Carlos Rafael Giani [Wed, 3 Aug 2016 13:20:20 +0000 (15:20 +0200)]
queue2: Add higher-resolution low/high-watermark properties

low/high-watermark are of type double, and given in range 0.0-1.0. This
makes it possible to set low/high watermarks with greater resolution,
which is useful with large queue2 max sizes and watermarks like 0.5%.

Also adding a test to check the fill and watermark level behavior.

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

8 years agoqueue2: Distinguish between buffering percentage and buffering level
Carlos Rafael Giani [Wed, 3 Aug 2016 13:27:40 +0000 (15:27 +0200)]
queue2: Distinguish between buffering percentage and buffering level

To make the code clearer, and to facilitate future improvements, introduce
a distinction between the buffering level and the buffering percentage.

Buffering level: the queue's current fill level. The low/high watermarks
are in this range.

Buffering percentage: percentage relative to the low/high watermarks
(0% = low watermark, 100% = high watermark).

To that end, get_buffering_percent() is renamed to get_buffering_level(),
and the code at the end that transforms to the buffering percentage is
factored out into a new convert_to_buffering_percent() function. Also,
the buffering level range is parameterized by adding a new constant called
MAX_BUFFERING_LEVEL.

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

8 years agodocs: release: add tag signing command
Tim-Philipp Müller [Tue, 23 Aug 2016 09:52:32 +0000 (10:52 +0100)]
docs: release: add tag signing command

8 years agobuffer: add explicit getters and setters for buffer flags
Arjen Veenhuizen [Thu, 7 Jul 2016 06:01:24 +0000 (08:01 +0200)]
buffer: add explicit getters and setters for buffer flags

These can be used from bindings.

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

8 years agomeson: install libgstcheck-1.0 and add api version to name
Tim-Philipp Müller [Sun, 21 Aug 2016 23:01:46 +0000 (00:01 +0100)]
meson: install libgstcheck-1.0 and add api version to name

8 years agostreams: update and emit notify signal only if taglist actually changed
Hoonhee Lee [Fri, 19 Aug 2016 23:54:27 +0000 (08:54 +0900)]
streams: update and emit notify signal only if taglist actually changed

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

8 years agoAdd support for Meson as alternative/parallel build system
Nirbheek Chauhan [Fri, 12 Aug 2016 14:55:17 +0000 (20:25 +0530)]
Add support for Meson as alternative/parallel build system

https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Mathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.

8 years agoMove gstconfig.h back to normal include dir
Tim-Philipp Müller [Sat, 13 Aug 2016 12:55:15 +0000 (13:55 +0100)]
Move gstconfig.h back to normal include dir

Now that it's arch-independent again. Will need fixes in cerbero too.

8 years agogstconfig.h: Detect unaligned access support at compile-time
Nirbheek Chauhan [Tue, 21 Jun 2016 13:29:49 +0000 (18:59 +0530)]
gstconfig.h: Detect unaligned access support at compile-time

This makes gstconfig.h completely arch-independent. Should cover all
compilers that gstreamer is known to build on, and all architectures
that I could find information on. People are encouraged to file bugs if
their platform/arch is missing.

8 years agoRemove old alloc tracing code now that we have a GstTracer-based replacement
Tim-Philipp Müller [Sat, 13 Aug 2016 08:55:46 +0000 (09:55 +0100)]
Remove old alloc tracing code now that we have a GstTracer-based replacement

It's been internal API only in 1.x.

8 years agoqueue2: Post buffering messages earlier in ringbuffer mode
Edward Hervey [Fri, 12 Aug 2016 14:15:25 +0000 (16:15 +0200)]
queue2: Post buffering messages earlier in ringbuffer mode

In ringbuffer mode we need to make sure we post buffering messages *before*
blocking to wait for data to be drained.

Without this, we would end up in situations like this:
* pipeline is pre-rolling
* Downstream demuxer/decoder has pushed data to all sinks, and demuxer thread
  is blocking downstream (i.e. not pulling from upstream/queue2).
* Therefore pipeline has pre-rolled ...
* ... but queue2 hasn't filled up yet, therefore the application waits for
  the buffering 100% messages before setting the pipeline to PLAYING
* But queue2 can't post that message, since the 100% message will be posted
  *after* there is room available for that last buffer.

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

8 years agomultiqueue: removed redundant call to g_thread_self
Josep Torra [Mon, 8 Aug 2016 14:42:06 +0000 (16:42 +0200)]
multiqueue: removed redundant call to g_thread_self

Remove an unneeded call to g_thread_self and minor coding style fix.

8 years agoinputselector: Handle stream-group-done
Jan Schmidt [Wed, 16 Mar 2016 07:00:15 +0000 (18:00 +1100)]
inputselector: Handle stream-group-done

Handle the new stream-group-done message to unblock pads which
are waiting for the running time to advance on that group.

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

8 years agoevents: Implement the stream-group-done event
Jan Schmidt [Mon, 14 Mar 2016 03:20:42 +0000 (14:20 +1100)]
events: Implement the stream-group-done event

A new event which precedes EOS in situations where we
need downstream to unblock any pads waiting on a stream
before we can send EOS. E.g, decodebin draining a chain
so it can switch pads.

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

8 years agomessage: Add redirect message
Carlos Rafael Giani [Mon, 25 Jul 2016 09:22:36 +0000 (11:22 +0200)]
message: Add redirect message

Redirection messages are already used in fragmented sources and in
uridecodebin, so it makes sense to introduce these as an official message
type.

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

8 years agoinputselector: Wake other pads when selected goes EOS
Jan Schmidt [Mon, 25 Jul 2016 09:15:15 +0000 (19:15 +1000)]
inputselector: Wake other pads when selected goes EOS

Other pads that are waiting for the stream on the selected
pad to advance before they finish waiting themselves
should be given the chance to do so when the selected pad
goes EOS. Fixes problems where input streams can end up
waiting forever if the active stream goes EOS earlier than
their own end time.

8 years agoelement: fix GST_ELEMENT_ERROR() error code expansion
Tim-Philipp Müller [Sun, 24 Jul 2016 00:35:41 +0000 (01:35 +0100)]
element: fix GST_ELEMENT_ERROR() error code expansion

In some corner cases, the error 'code' part passed to
GST_ELEMENT_ERROR() is a valid define as well, in which
case it won't survive two levels of macro expansion, but
only one. Fixes:

oss4-sink.c: In function ‘gst_oss4_sink_open’:
error: ‘GST_RESOURCE_ERROR_0x00000002’ undeclared (first use in this function)
GST_ ## domain ## _ERROR_ ## code, __txt, __dbg, __FILE__,

which is from GST_ELEMENT_ERROR(el,RESOURCE,OPEN_WRITE,..)
and OPEN_WRITE happens to be defined to 2 here.

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

8 years agomessage: fix some nonsensical annotations
Tim-Philipp Müller [Fri, 22 Jul 2016 16:32:33 +0000 (17:32 +0100)]
message: fix some nonsensical annotations

8 years agodocs: add GST_ELEMENT_*_WITH_DETAILS to doc list
Vincent Penquerc'h [Fri, 22 Jul 2016 14:25:09 +0000 (15:25 +0100)]
docs: add GST_ELEMENT_*_WITH_DETAILS to doc list

8 years agodocs: list new message details apis where they seem to belong
Vincent Penquerc'h [Fri, 22 Jul 2016 14:04:58 +0000 (15:04 +0100)]
docs: list new message details apis where they seem to belong

8 years agolibgstreamer.def: fix mentions of new message details api
Vincent Penquerc'h [Fri, 22 Jul 2016 13:59:56 +0000 (14:59 +0100)]
libgstreamer.def: fix mentions of new message details api

I had not updated it after the review changes

8 years agomessage: new API for additional custom data to error messages
Vincent Penquerc'h [Wed, 2 Mar 2016 11:22:23 +0000 (11:22 +0000)]
message: new API for additional custom data to error messages

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

8 years agotracers: leaks: update type filter later for unknown types
Guillaume Desmottes [Wed, 20 Jul 2016 10:22:10 +0000 (12:22 +0200)]
tracers: leaks: update type filter later for unknown types

This allow us to filter using an object type which is implemented
by a plugin like, say, GstGtkGLSink.

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

8 years agocollectpads: add g-i transfer annotations to peek/pop/read_buffer/take_buffer functions
Aurélien Zanelli [Tue, 19 Jul 2016 12:45:53 +0000 (14:45 +0200)]
collectpads: add g-i transfer annotations to peek/pop/read_buffer/take_buffer functions

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

8 years agotests: Use gst_clock_wait_for_sync () for net client clock
Jan Schmidt [Tue, 19 Jul 2016 13:18:24 +0000 (23:18 +1000)]
tests: Use gst_clock_wait_for_sync () for net client clock

Instead of looping, use the gst_clock_wait_for_sync() function
to give clocks up to 1 second to synchronise

8 years agomessage: fix annotation of parse_stream_{collection,streams_selected}
Guillaume Desmottes [Wed, 13 Jul 2016 13:43:21 +0000 (15:43 +0200)]
message: fix annotation of parse_stream_{collection,streams_selected}

gst_structure_id_get() returns a new reference so the returned object is
actually (transfer full).

The unit tests was already unreffing the objects.

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

8 years agomessage: fix annotation of parse_device_{added,removed}
Guillaume Desmottes [Wed, 13 Jul 2016 13:43:21 +0000 (15:43 +0200)]
message: fix annotation of parse_device_{added,removed}

gst_structure_id_get() returns a new reference so the returned device is
actually (transfer full).

The code using this API was already correct but the code example in
comments was not.

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

8 years agopad: add g-i transfer annotatation to _store_sticky_event()
Guillaume Desmottes [Thu, 14 Jul 2016 14:40:22 +0000 (16:40 +0200)]
pad: add g-i transfer annotatation to _store_sticky_event()

For clarity.

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

8 years agobasesrc: Fix automatic-eos=false mode if a segment.stop is given
Sebastian Dröge [Tue, 12 Jul 2016 09:32:56 +0000 (12:32 +0300)]
basesrc: Fix automatic-eos=false mode if a segment.stop is given

If segment.stop was given, and the subclass provides a size that might be
smaller than segment.stop and also smaller than the actual size, we would
already stop there.

Instead try reading up to segment.stop, the goal is to ignore the (possibly
inaccurate) size the subclass gives and finish until segment.stop or when the
subclass tells us to stop.

8 years agoAutomatic update of common submodule
Stefan Sauer [Mon, 11 Jul 2016 19:13:28 +0000 (21:13 +0200)]
Automatic update of common submodule

From f363b32 to f49c55e

8 years agobenchmarks: Fix potential stack corruption in capsnego test
Nirbheek Chauhan [Mon, 11 Jul 2016 13:15:49 +0000 (18:45 +0530)]
benchmarks: Fix potential stack corruption in capsnego test

flavour_str is a non-const pointer that will be written to if the -f
option is passed

8 years agoleaks: check return values of libunwind calls
Guillaume Desmottes [Mon, 11 Jul 2016 09:34:02 +0000 (11:34 +0200)]
leaks: check return values of libunwind calls

8 years agoqueue2: Fix average input rate calculation on small input range
Edward Hervey [Mon, 11 Jul 2016 07:58:47 +0000 (09:58 +0200)]
queue2: Fix average input rate calculation on small input range

When dealing with small-ish input data coming into queue2, such as
adaptivedemux fragments, we would never take into account the last
<200ms of data coming in.

The problem is that usually on TCP connection the download rate
gradually increases (i.e. the rate is lower at the beginning of a
download than it is later on). Combined with small download time (less
than a second) we would end up with a computed average input rate
which was sometimes up to 30-50% off from the *actual* average input
rate for that fragment.

In order to fix this, force the average input rate calculation when
we receive an EOS so that we take into account that final window
of data.

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

8 years agominiobject: weak_unref: display the pointer of the object if failing
Guillaume Desmottes [Fri, 8 Jul 2016 14:31:56 +0000 (16:31 +0200)]
miniobject: weak_unref: display the pointer of the object if failing

That's generally the most useful information to help debugging the
problem.

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

8 years agobin: properly display the type of the removed message
Guillaume Desmottes [Fri, 8 Jul 2016 14:29:38 +0000 (16:29 +0200)]
bin: properly display the type of the removed message

Makes debugging easier.

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

8 years agoelement: re-create threadpool after cleaning up tasks
Tim-Philipp Müller [Fri, 8 Jul 2016 16:46:06 +0000 (17:46 +0100)]
element: re-create threadpool after cleaning up tasks

We don't free this from gst_deinit() but from gst_task_cleanup_all(),
so more GStreamer API may be called. In particular makes unit tests
work again with CK_FORK=no.

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

8 years agoleaks: warn if object is destroyed while the tracer is disposing
Guillaume Desmottes [Fri, 8 Jul 2016 14:53:51 +0000 (16:53 +0200)]
leaks: warn if object is destroyed while the tracer is disposing

This should not happen and generally means some thread is still running.

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

8 years agoelement: clean up thread pool from gst_task_cleanup_all()
Guillaume Desmottes [Fri, 8 Jul 2016 14:36:01 +0000 (16:36 +0200)]
element: clean up thread pool from gst_task_cleanup_all()

This ensures that all async operations (started from gst_element_call_async())
have been completed and so there is no extra thread running.

Fix races when checking for leaks on unit tests as some of those
operations were still running when the leaks tracer was checking for
leaked objects.

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

8 years agoleaks tracer: use G_OS_UNIX to check for signal support
Guillaume Desmottes [Fri, 8 Jul 2016 09:15:06 +0000 (11:15 +0200)]
leaks tracer: use G_OS_UNIX to check for signal support

Checking for signal.h is not good enough as it's present in Windows.
Those signals are UNIX specific anyway.

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

8 years agoleaks tracer: add creation stack trace support
Guillaume Desmottes [Wed, 22 Jun 2016 14:25:16 +0000 (16:25 +0200)]
leaks tracer: add creation stack trace support

This allow us to provide the trace of leaked objects making it easier
to debug.

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

8 years agoleaks tracer: add checkpoint support using SIGUSR2
Guillaume Desmottes [Wed, 1 Jun 2016 09:08:39 +0000 (11:08 +0200)]
leaks tracer: add checkpoint support using SIGUSR2

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

8 years agoleaks tracer: log alive objects when receiving SIGUSR1
Guillaume Desmottes [Tue, 31 May 2016 14:56:26 +0000 (16:56 +0200)]
leaks tracer: log alive objects when receiving SIGUSR1

We don't want to automatically catch signals so use an env variable to
enable this feature.

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

8 years agofunnel: Only forward sticky events on GAP events if needed
Sebastian Dröge [Thu, 7 Jul 2016 10:15:51 +0000 (13:15 +0300)]
funnel: Only forward sticky events on GAP events if needed

That is, if the active pad changed and if forwarding of sticky events is
requested at all. We otherwise forward events too often.

8 years agopad: check query caps answered and caps not NULL
Miguel París Díaz [Tue, 5 Jul 2016 14:50:16 +0000 (16:50 +0200)]
pad: check query caps answered and caps not NULL

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

8 years agoBack to development
Sebastian Dröge [Wed, 6 Jul 2016 10:50:56 +0000 (13:50 +0300)]
Back to development

8 years agoRelease 1.9.1
Sebastian Dröge [Wed, 6 Jul 2016 10:05:02 +0000 (13:05 +0300)]
Release 1.9.1

8 years agoUpdate .po files
Sebastian Dröge [Wed, 6 Jul 2016 08:37:56 +0000 (11:37 +0300)]
Update .po files

8 years agopo: Update translations
Sebastian Dröge [Wed, 6 Jul 2016 07:17:37 +0000 (10:17 +0300)]
po: Update translations

8 years agobaseparse: Don't add calculated bitrates until threshold
Jan Alexander Steffens (heftig) [Tue, 5 Jul 2016 10:17:18 +0000 (12:17 +0200)]
baseparse: Don't add calculated bitrates until threshold

Waiting before posting calculated bitrates seems to be the
intent of the code, so avoid adding them to the tag list
pushed with the first frame.

When the threshold is reached, gst_base_parse_update_bitrates
sets tags_changed, so this posts the calculated ones right
that moment.

This prevents an insane average calculated from just the
first (key) frame from getting posted.

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

8 years agobaseparse: Make sure to not create an invalid event order when generating the default...
Sebastian Dröge [Mon, 4 Jul 2016 08:00:38 +0000 (10:00 +0200)]
baseparse: Make sure to not create an invalid event order when generating the default CAPS event because of a GAP event

There must be a SEGMENT event before the GAP event, and SEGMENT events must
come after any CAPS event. We however did not produce any CAPS yet, so we need
to ensure to insert the CAPS event before the SEGMENT event into the pending
events list.

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

8 years agogstinfo: Avoid gcc 6 warning that breaks the tests build
Jan Schmidt [Fri, 1 Jul 2016 12:34:59 +0000 (22:34 +1000)]
gstinfo: Avoid gcc 6 warning that breaks the tests build

gcc 6 has problems detecting and avoiding throwing
a warning for tautological compares in macros (they
should only trigger for compares outside macros).

Avoid them with a nasty cast of one parameter to void *

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

8 years agomultiqueue: Fix behaviour with not-linked and eos pads
Edward Hervey [Fri, 1 Jul 2016 07:44:12 +0000 (09:44 +0200)]
multiqueue: Fix behaviour with not-linked and eos pads

This is an update on c9b6848885f4675d447e823c8fb117e247658252
multiqueue: Fix not-linked pad handling at EOS

While that commit did fix the behaviour if upstream sent a GST_EVENT_EOS,
it would break the same issue when *downstream* returns GST_FLOW_EOS
(which can happen for example when downstream decoders receive data
from after the segment stop).

GST_PAD_IS_EOS() is only TRUE when a GST_EVENT_EOS has flown through it
and not when a GST_EVENT_EOS has gone through it.

In order to handle both cases, also take into account the last flow
return.

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

8 years agostreams: sprinkle some Since: markers for docs
Tim-Philipp Müller [Thu, 30 Jun 2016 14:07:28 +0000 (15:07 +0100)]
streams: sprinkle some Since: markers for docs

8 years agomultiqueue: add gtk-doc blurb for new pad property
Tim-Philipp Müller [Thu, 30 Jun 2016 13:37:17 +0000 (14:37 +0100)]
multiqueue: add gtk-doc blurb for new pad property

8 years agomultiqueue: Add a pad property to "group" streams
Edward Hervey [Wed, 10 Feb 2016 10:42:04 +0000 (11:42 +0100)]
multiqueue: Add a pad property to "group" streams

When syncing by running time, multiqueue will throttle unlinked streams
based on a global "high-time" and the pending "next_time" of a stream.

The idea is that we don't want unlinked streams to be "behind" the global
running time of linked streams, so that if/when they get linked (like when
switching tracks) decoding/playback can resume from the same position as
the other streams.

The problem is that it assumes elements downstream will have a more or less
equal buffering/latency ... which isn't the case for streams of different
type. Video decoders tend to have higher latency (and therefore consume more
from upstream to output a given decoded frame) compared to audio ones, resulting
in the computed "high_time" being at the position of the video stream,
much further than the audio streams.

This means the unlinked audio streams end up being quite a bit after the linked
audio streams, resulting in gaps when switching streams.

In order to mitigate this issue, this patch adds a new "group-id" pad property
which allows users to "group" streams together. Calculating the high-time will
now be done not only globally, but also per group. This ensures that within
a given group unlinked streams will be throttled by that group's high-time
instead.

This fixes gaps when switching downstream elements (like switching audio tracks).

8 years agogst: New Stream listing/selection system
Edward Hervey [Fri, 12 Jun 2015 08:53:23 +0000 (10:53 +0200)]
gst: New Stream listing/selection system

* GstStream
* GstStreamCollection
* GST_EVENT_SELECT_STREAMS
* GST_MESSAGE_STREAM_COLLECTION

8 years agopoll: #define EWOULDBLOCK to EAGAIN if it's not defined on Windows
Sebastian Dröge [Wed, 29 Jun 2016 21:24:02 +0000 (23:24 +0200)]
poll: #define EWOULDBLOCK to EAGAIN if it's not defined on Windows

8 years agobufferpool: Fix handling of the GstPoll
Sebastian Dröge [Wed, 29 Jun 2016 12:05:18 +0000 (14:05 +0200)]
bufferpool: Fix handling of the GstPoll

Especially if multiple threads are waiting for buffers to be available again,
the current code was wrong. Fix this and document clearly how the GstPoll is
supposed to be used.

Also fix some potential races with reading from the GstPoll before writing
actually happened.

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

8 years agobus: Make sure to always read the control after popping a message
Sebastian Dröge [Wed, 29 Jun 2016 12:02:55 +0000 (14:02 +0200)]
bus: Make sure to always read the control after popping a message

It might happen that we popped the message before writing of the control
happened. In this case we just have to retry again a bit later, and failure to
do so will cause an additional byte in the control and the GSource /
gst_poll_wait() to always wake up again immediately.

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

8 years agosystemclock: Improve GstPoll handling and don't check for impossible errno values
Sebastian Dröge [Wed, 29 Jun 2016 11:37:28 +0000 (13:37 +0200)]
systemclock: Improve GstPoll handling and don't check for impossible errno values

Also just read/write control every time, GstPoll is optimized by itself
already to only do I/O if switching between empty and one byte.

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

8 years agopoll: Clarify when FALSE is returned from read/write_control()
Sebastian Dröge [Wed, 29 Jun 2016 11:35:35 +0000 (13:35 +0200)]
poll: Clarify when FALSE is returned from read/write_control()

And also mention what the expected values of errno are going to be.

write_control() will only ever return FALSE if there was a critical error. It
will never return because of EINTR, EAGAIN or EWOULDBLOCK.

read_control() will return FALSE if there was no byte to read, in which case
errno would be EWOULDBLOCK.
In all other cases there was a critical error.

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

8 years agopoll: set_controllable(), restart() and set_flushing() are only valid for non-timer...
Sebastian Dröge [Wed, 29 Jun 2016 11:26:57 +0000 (13:26 +0200)]
poll: set_controllable(), restart() and set_flushing() are only valid for non-timer GstPolls

On timer GstPolls it will cause the control socket state to become
inconsistent as now one less read_control() than write_control() be would
needed.

Similarly, read_control() and write_control() are only valid on timer
GstPolls.

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

8 years agopoll: Warn if the return value of gst_poll_read_control() is unused
Sebastian Dröge [Wed, 29 Jun 2016 11:11:01 +0000 (13:11 +0200)]
poll: Warn if the return value of gst_poll_read_control() is unused

This might fail even under correct usage, e.g. if read_control() is called
from another thread before write_control() finished in another. It has to be
retried then, or other measures have to be taken, depending on how it is used
by the surrounding code.

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

8 years agopoll: Fix various race conditions with read_control() and write_control()
Matthew Gruenke [Wed, 29 Jun 2016 16:57:42 +0000 (18:57 +0200)]
poll: Fix various race conditions with read_control() and write_control()

This addresses slightly different race conditions on Linux and Windows, and
fixes gst_poll_read_control() when control_pending == 0.

On Linux, the socketpair() used for control should not be made O_NONBLOCK.
If there's any propagation delay between set->control_write_fd.fd and
set->control_read_fd.fd, even the mutex now held will not be sufficient to
prevent a race condition.  There's no benefit to using O_NONBLOCK, here.
Only liabilities.

For Windows, it's necessary to fix the race condition between testing
set->control_pending and performing WAKE_EVENT()/RELEASE_EVENT().  This is
accomplished by acquiring and holding set->lock, for both of these operations.
We could optimize the Linux version by making this Windows-specific.

For consistency with the Linux implementation, Windows' RELEASE_EVENT()
has also been made to block, although it should never happen.

Also, changed release_wakeup() to return TRUE and decrement control_pending
only when > 0.  Furthermore, RELEASE_EVENT() is called only when
control_pending == 1.

Finally, changed control_pending to use normal, non-atomic arithmetic
operations, since it's now protected by set->lock.

Note: even though the underlying signaling mechanisms are blocking,
release_wakeup() is effectively non-blocking, as it will only attempt to read
from control_read_fd.fd after a byte has been written to control_write_fd.fd
or WaitForSingleObject() after it's been signaled.

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

8 years agobus: chain up GObject::constructed() to the parent class' implementation
Guillaume Desmottes [Tue, 28 Jun 2016 13:01:17 +0000 (15:01 +0200)]
bus: chain up GObject::constructed() to the parent class' implementation

Needed so GstBus can be tracked by the leaks tracer.

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

8 years agogstconfig.h: Don't use extern with dllexport
Nirbheek Chauhan [Thu, 23 Jun 2016 23:56:09 +0000 (05:26 +0530)]
gstconfig.h: Don't use extern with dllexport

GCC emits an error for this with -Werror:

plugin.c:22:1: error: 'gst_plugin_desc' initialized and declared 'extern' [-Werror]

This matches how glib does symbol exporting.

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

8 years agowin32: Don't use dllexport/import when only building statically
Nirbheek Chauhan [Tue, 21 Jun 2016 14:19:15 +0000 (19:49 +0530)]
win32: Don't use dllexport/import when only building statically

If the prototypes in the public API have dllimport in them when building
statically on Windows, the compiler will look for symbols with symbol
mangling and indirection corresponding to a DLL. This will cause a build
failure when trying to link tests/examples/etc.

External users of GStreamer also need to define -DGST_STATIC_COMPILATION
if they want to link to static gstreamer libraries on Windows.

A similar version of this patch has been committed to all gstreamer
repositories.

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

8 years agoAutomatic update of common submodule
Nicolas Dufresne [Tue, 21 Jun 2016 15:45:26 +0000 (11:45 -0400)]
Automatic update of common submodule

From ac2f647 to f363b32

8 years agotests: add a test for small ring buffer sizes
Vincent Penquerc'h [Wed, 15 Jun 2016 15:24:27 +0000 (16:24 +0100)]
tests: add a test for small ring buffer sizes

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

8 years agoqueue2: fix crash deleting current region for small ring buffers
Vincent Penquerc'h [Wed, 15 Jun 2016 12:43:59 +0000 (13:43 +0100)]
queue2: fix crash deleting current region for small ring buffers

Ensure we do not attempt to destroy the current range. Doing so
causes the current one to be left dangling, and it may be dereferenced
later, leading to a crash.

This can happen with a very small queue2 ring buffer (10000 bytes)
and 4 kB buffers.

repro case:

gst-launch-1.0 fakesrc sizetype=2 sizemax=4096 ! \
queue2 ring-buffer-max-size=1000 ! fakesink sync=true

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

8 years agotests: gstobject: fix typo in test name
Tim-Philipp Müller [Mon, 20 Jun 2016 10:34:49 +0000 (11:34 +0100)]
tests: gstobject: fix typo in test name

8 years agodocs/design/part-tracing: fix reference to renamed func
Reynaldo H. Verdejo Pinochet [Thu, 16 Jun 2016 21:08:01 +0000 (14:08 -0700)]
docs/design/part-tracing: fix reference to renamed func

8 years agotee: Properly handle return value when only 1 pad
Nicolas Dufresne [Wed, 8 Jun 2016 16:34:53 +0000 (12:34 -0400)]
tee: Properly handle return value when only 1 pad

This patch handle the case when you have 1 pad (so the fast path is
being used) but this pad is removed. If we are in allow-not-linked, we
should return GST_FLOW_OK, otherwise, we should return GST_FLOW_UNLINKED
and ignore the meaningless return value obtained from pushing.

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

8 years agogst-plot-traces.sh: add a script to plot gst-tracer graphs
Stefan Sauer [Thu, 16 Jun 2016 13:52:16 +0000 (15:52 +0200)]
gst-plot-traces.sh: add a script to plot gst-tracer graphs

The script extracts cpu-usage data from a tracelog and plots it via gnuplot.

8 years agodevice: Fix typo
Sebastian Dröge [Wed, 15 Jun 2016 14:12:23 +0000 (16:12 +0200)]
device: Fix typo

paramater -> parameter

8 years agoinfo: flesh out GST_PTR_FORMAT docs a bit
Tim-Philipp Müller [Tue, 14 Jun 2016 18:16:33 +0000 (19:16 +0100)]
info: flesh out GST_PTR_FORMAT docs a bit

8 years agobasesink: Update start time when losing state only if we were in PLAYING
Sebastian Dröge [Mon, 13 Jun 2016 16:33:27 +0000 (18:33 +0200)]
basesink: Update start time when losing state only if we were in PLAYING

If we were in PAUSED, the current clock time and base time don't have much to
do with the running time anymore as the clock might have advanced while we
were PAUSED. The system clock does that for example, audio clocks often don't.

Updating the start time in PAUSED will cause a) the wrong position to be
reported, b) step events to step not just the requested amount but the amount
of time we spent in PAUSED. The start time should only ever be updated when
going from PLAYING to PAUSED to remember the current running time (to be able
to compensate later when going to PLAYING for the clock time advancing while
PAUSED), not when we are already in PAUSED.

Based on a patch by Kishore Arepalli <kishore.arepalli@gmail.com>

The updating of the start time when the state is lost was added in commit
ba943a82c0bbfd17c9ee9f5068d44c9d9274fd13 to fix the position reporting when
the state is lost. This still works correctly after this change.

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

8 years agopad: Log pad offsets as signed times
Sebastian Dröge [Sat, 11 Jun 2016 19:18:06 +0000 (22:18 +0300)]
pad: Log pad offsets as signed times

8 years agopad: Also check the number of segment events and if other serialized events and queri...
Sebastian Dröge [Sat, 11 Jun 2016 18:56:19 +0000 (21:56 +0300)]
pad: Also check the number of segment events and if other serialized events and queries trigger segment updating too

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

8 years agopad: Add unit test for pad offset handling on src pads
Sebastian Dröge [Sat, 11 Jun 2016 18:37:47 +0000 (21:37 +0300)]
pad: Add unit test for pad offset handling on src pads

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

8 years agoadapter: Rename functions and implement new functions, update test
Sebastian Dröge [Tue, 7 Jun 2016 08:32:47 +0000 (11:32 +0300)]
adapter: Rename functions and implement new functions, update test

We don't do calculations with different units (buffer offsets and bytes)
anymore but have functions for:
1) getting the number of bytes since the last discont
2) getting the offset (and pts/dts) at the last discont

and the previously added function to get the last offset and its distance from
the current adapter position.

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

8 years agoadapter: Add methods to query current offset
Edward Hervey [Thu, 19 May 2016 08:31:02 +0000 (10:31 +0200)]
adapter: Add methods to query current offset

API: gst_buffer_prev_offset
API: gst_buffer_get_offset_from_discont

The gst_buffer_get_offset_from_discont() method allows retrieving the current
offset based on the GST_BUFFER_OFFSET of the buffers that were pushed in.

The offset will be set initially by the GST_BUFFER_OFFSET of
DISCONT buffers, and then incremented by the sizes of the following
buffers.

The gst_buffer_prev_offset() method allows retrievent the previous
GST_BUFFER_OFFSET regardless of flags. It works in the same way as
the other gst_buffer_prev_*() methods.

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

8 years agogstconfig.h.in: indent #if #else jungle for better readability
Tim-Philipp Müller [Thu, 9 Jun 2016 16:42:13 +0000 (17:42 +0100)]
gstconfig.h.in: indent #if #else jungle for better readability

8 years agoutils: Add gst_pad_link_maybe_ghosting() for consistency
Sebastian Dröge [Wed, 8 Jun 2016 09:11:19 +0000 (12:11 +0300)]
utils: Add gst_pad_link_maybe_ghosting() for consistency

We already had a _full() version, but having that alone seems inconsistent.
Add a non-full version that mirrors the behaviour of gst_pad_link() vs
gst_pad_link_full().

8 years agobaseparse: Make sure DISCONT flags are properly propagated
Edward Hervey [Sun, 22 May 2016 11:10:06 +0000 (13:10 +0200)]
baseparse: Make sure DISCONT flags are properly propagated

If we drop a frame that contained a discontinuity, we must remember
that for the next frame that *will* be pushed downstream.

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

8 years agodeviceprovider: remove base_class_finalize function
Tim-Philipp Müller [Sat, 4 Jun 2016 12:31:58 +0000 (13:31 +0100)]
deviceprovider: remove base_class_finalize function

It's not going to get called anyway.

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