Commit graph

17107 commits

Author SHA1 Message Date
Nirbheek Chauhan 6ef601367e 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.
2016-08-13 10:29:31 +01:00
Tim-Philipp Müller e2cd6ffafc Remove old alloc tracing code now that we have a GstTracer-based replacement
It's been internal API only in 1.x.
2016-08-13 10:10:30 +01:00
Edward Hervey 5154dcfbdc 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
2016-08-12 16:26:40 +02:00
Josep Torra 5f021759b3 multiqueue: removed redundant call to g_thread_self
Remove an unneeded call to g_thread_self and minor coding style fix.
2016-08-08 16:42:06 +02:00
Jan Schmidt b50a12b8ac 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
2016-07-25 20:22:20 +10:00
Jan Schmidt 9fd2101b36 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
2016-07-25 20:22:20 +10:00
Carlos Rafael Giani eead9cf827 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
2016-07-25 12:59:21 +03:00
Jan Schmidt 4981e09bc7 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.
2016-07-25 19:34:52 +10:00
Tim-Philipp Müller d052ae63d8 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
2016-07-24 01:35:41 +01:00
Tim-Philipp Müller 12a10980b3 message: fix some nonsensical annotations 2016-07-22 17:32:33 +01:00
Vincent Penquerc'h e5a78516a8 docs: add GST_ELEMENT_*_WITH_DETAILS to doc list 2016-07-22 15:25:09 +01:00
Vincent Penquerc'h 9641502700 docs: list new message details apis where they seem to belong 2016-07-22 15:04:58 +01:00
Vincent Penquerc'h eb103a5ed1 libgstreamer.def: fix mentions of new message details api
I had not updated it after the review changes
2016-07-22 15:00:31 +01:00
Vincent Penquerc'h 1105caa805 message: new API for additional custom data to error messages
https://bugzilla.gnome.org/show_bug.cgi?id=756806
2016-07-22 14:16:34 +01:00
Guillaume Desmottes 714ea37282 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
2016-07-20 14:14:48 +01:00
Aurélien Zanelli ec2723d366 collectpads: add g-i transfer annotations to peek/pop/read_buffer/take_buffer functions
https://bugzilla.gnome.org/show_bug.cgi?id=768948
2016-07-20 12:34:00 +01:00
Jan Schmidt b08b97c99a 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
2016-07-19 23:28:32 +10:00
Guillaume Desmottes 31ef105110 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
2016-07-15 12:57:49 +01:00
Guillaume Desmottes 514beb7d60 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
2016-07-15 12:56:52 +01:00
Guillaume Desmottes 2a0bba69e1 pad: add g-i transfer annotatation to _store_sticky_event()
For clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=768810
2016-07-15 12:50:21 +01:00
Sebastian Dröge af0d087bbd 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.
2016-07-12 12:34:47 +03:00
Stefan Sauer 30ebde7b0f Automatic update of common submodule
From f363b32 to f49c55e
2016-07-11 21:13:28 +02:00
Nirbheek Chauhan 6e01d03d90 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
2016-07-11 14:18:21 +01:00
Guillaume Desmottes 59885c2a92 leaks: check return values of libunwind calls 2016-07-11 12:44:19 +01:00
Edward Hervey 1ff80fbf52 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
2016-07-11 10:08:44 +02:00
Guillaume Desmottes e73650e5f9 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
2016-07-08 17:52:48 +01:00
Guillaume Desmottes 757a8b04c0 bin: properly display the type of the removed message
Makes debugging easier.

https://bugzilla.gnome.org/show_bug.cgi?id=768579
2016-07-08 17:52:40 +01:00
Tim-Philipp Müller 7a0f4422fa 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
2016-07-08 17:46:06 +01:00
Guillaume Desmottes 9ba53ff1fc 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
2016-07-08 17:35:30 +01:00
Guillaume Desmottes 40727d9c83 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
2016-07-08 17:27:32 +01:00
Guillaume Desmottes 1ed4140d00 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
2016-07-08 12:38:46 +03:00
Guillaume Desmottes 17c37efa83 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
2016-07-08 12:07:53 +03:00
Guillaume Desmottes 3bb5c1e73a leaks tracer: add checkpoint support using SIGUSR2
https://bugzilla.gnome.org/show_bug.cgi?id=767857
2016-07-08 11:23:43 +03:00
Guillaume Desmottes 53d2e8c977 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
2016-07-08 11:23:38 +03:00
Sebastian Dröge 528fbfe7c1 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.
2016-07-07 13:32:39 +03:00
Miguel París Díaz 9f982e2d75 pad: check query caps answered and caps not NULL
https://bugzilla.gnome.org/show_bug.cgi?id=768450
2016-07-07 10:08:15 +03:00
Sebastian Dröge 52b1d7f42d Back to development 2016-07-06 13:50:56 +03:00
Sebastian Dröge af5c9cbb20 Release 1.9.1 2016-07-06 13:05:02 +03:00
Sebastian Dröge 476e139735 Update .po files 2016-07-06 11:37:56 +03:00
Sebastian Dröge 25247aabf1 po: Update translations 2016-07-06 10:17:37 +03:00
Jan Alexander Steffens (heftig) d71e03b3be 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
2016-07-05 19:42:38 +03:00
Sebastian Dröge 8e8b8a8d34 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
2016-07-04 10:35:41 +02:00
Jan Schmidt 17f9ac5657 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
2016-07-01 22:38:01 +10:00
Edward Hervey 530001661d multiqueue: Fix behaviour with not-linked and eos pads
This is an update on c9b6848885
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
2016-07-01 09:47:31 +02:00
Tim-Philipp Müller 3623f168e9 streams: sprinkle some Since: markers for docs 2016-06-30 15:07:28 +01:00
Tim-Philipp Müller 715939cce7 multiqueue: add gtk-doc blurb for new pad property 2016-06-30 14:37:17 +01:00
Edward Hervey f4ba43b15d 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).
2016-06-30 14:45:10 +02:00
Edward Hervey 63f6f05d66 gst: New Stream listing/selection system
* GstStream
* GstStreamCollection
* GST_EVENT_SELECT_STREAMS
* GST_MESSAGE_STREAM_COLLECTION
2016-06-30 12:31:06 +02:00
Sebastian Dröge 241d0f16f6 poll: #define EWOULDBLOCK to EAGAIN if it's not defined on Windows 2016-06-29 23:24:02 +02:00
Sebastian Dröge 60a2087cb1 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
2016-06-29 21:21:04 +02:00