Commit graph

2638 commits

Author SHA1 Message Date
Sebastian Dröge
cc15f68b6a netclientclock: Preparation for NTPv4 support
We extend our calculations to work with local send time, remote receive time,
remote send time and local receive time. For the netclientclock protocol,
remote receive and send time are assumed to be the same value.

For the results, this modified calculation makes absolutely no difference
unless the two remote times are different.
2015-06-06 20:39:47 +02:00
Sebastian Dröge
8d6837edf5 netclientclock. Fix last commit
Apparently I failed at git add -i.
2015-06-06 19:01:06 +02:00
Sebastian Dröge
4c62d791aa netclientclock: Make gst_net_client_clock_new() a thing wrapper around g_object_new()
Bindings will like this, and also it fixes a FIXME comment.
2015-06-06 18:42:18 +02:00
Sebastian Dröge
179eebdf44 ptpclock: Use #define everywhere instead of G_N_ELEMENTS() 2015-06-06 14:34:39 +02:00
Sebastian Dröge
f7a7a569cd netclientclock: Filter RTTs based on the median of the last RTTs before considering them at all
This improves accuracy on wifi or similar networks, where the RTT can go very
high up for a single observation every now and then. Without filtering them
away completely, they would still still modify the average RTT, and thus all
clock estimations.
2015-06-06 14:31:16 +02:00
Sebastian Dröge
42b16c9e3c ptpclock: Use a system clock for the time observations instead of gst_util_get_timestamp()
They don't necessarily use the same underlying clocks (e.g. on Windows), or
might be configured to a different clock type (monotonic vs. real time clock).

We need the values a clean system clock returns, as those are the values used
by the internal clocks.
2015-06-06 14:19:21 +02:00
Sebastian Dröge
bf62a96549 ptpclock: Fix documentation a bit 2015-06-06 12:36:34 +02:00
Sebastian Dröge
f02de0e9a1 ptp-helper: Make sure to use g_poll() for the main context
The modified main context from https://bugzilla.gnome.org/show_bug.cgi?id=741054
somehow calls setugid(), which abort()s setuid root applications on OSX.
2015-06-04 19:05:44 +02:00
Sebastian Dröge
c7c1dcd346 ptp-helper: Make sure that we are running setuid root if configured that way 2015-06-04 18:32:14 +02:00
Sebastian Dröge
d33784ccd0 ptp-helper: Fix interface listing and MAC retrieval on OSX 2015-06-04 18:00:50 +02:00
Luis de Bethencourt
c508ee27a1 gitignore: add libs/gst/helpers/gst-ptp-helper 2015-06-03 16:42:57 +01:00
Luis de Bethencourt
b76a7b4d5c ptp: ignore permission errors in Makefile
To satisfy the buildslaves ignore permission errors in chown, chmod and setcap
2015-06-03 16:34:58 +01:00
Sebastian Dröge
3af74817c1 ptp: Don't use SIOCGIFHWADDR on Apple
Just #ifdef the code for now, this should be implemented around
IOKit later instead of using ioctls.
2015-06-03 17:08:40 +02:00
Philippe Normand
55f79dd195 build: make install-exec-hooks depend on install-helpersPROGRAMS
To avoid race conditions where make would try to change ownership and
permissions of the not-yet-installed ptp helper.
2015-06-03 15:35:11 +01:00
Sebastian Dröge
d2da80e4e7 ptp: Fix debug output to print the difference instead of absolute values 2015-06-03 16:09:17 +02:00
Wim Taymans
e11568c5b8 ptpclock: fix compilation
Don't put code between declarations.
Fix use of uninitialized variables
2015-06-03 15:22:31 +02:00
Sebastian Dröge
ac2eb6e23e ptp: Add median based pre-filtering of delays
If the delay measurement is too far away from the median of the window of last
delay measurements, we discard it. This increases accuracy on wifi a lot.

https://bugzilla.gnome.org/show_bug.cgi?id=749391
2015-06-03 13:55:39 +02:00
Sebastian Dröge
02ba5b20c7 ptp: Add #define to only use SYNC messages for which we can send DELAY_REQ
https://bugzilla.gnome.org/show_bug.cgi?id=749391
2015-06-03 13:55:36 +02:00
Sebastian Dröge
5e1974fc08 ptp: Add #defines to enable/disable improvements for unreliable networks
We should do some more measurements with all these and check how much sense
they make for PTP. Also enabling them means not following IEEE1588-2008 by the
letter anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=749391
2015-06-03 13:55:32 +02:00
Sebastian Dröge
8d77759834 ptp: Initial implementation of a PTP clock
GstPtpClock implements a PTP (IEEE1588:2008) ordinary clock in
slave-only mode, that allows a GStreamer pipeline to synchronize
to a PTP network clock in some specific domain.

The PTP subsystem can be initialized with gst_ptp_init(), which then
starts a helper process to do the actual communication via the PTP
ports. This is required as PTP listens on ports < 1024 and thus
requires special privileges. Once this helper process is started, the
main process will synchronize to all PTP domains that are detected on
the selected interfaces.

gst_ptp_clock_new() then allows to create a GstClock that provides the
PTP time from a master clock inside a specific PTP domain. This clock
will only return valid timestamps once the timestamps in the PTP domain
are known. To check this, the GstPtpClock::internal-clock property and
the related notify::clock signal can be used. Once the internal clock
is not NULL, the PTP domain's time is known. Alternatively you can wait
for this with gst_ptp_clock_wait_ready().

To gather statistics about the PTP clock synchronization,
gst_ptp_statistics_callback_add() can be used. This gives the
application the possibility to collect all kinds of statistics
from the clock synchronization.

https://bugzilla.gnome.org/show_bug.cgi?id=749391
2015-06-03 13:55:28 +02:00
Tim-Philipp Müller
828ceacc68 queuearray: remove duplicate assignment
We've already done this earlier in the function,
and nothing has changed since we first read it.
2015-05-30 12:40:44 +01:00
Matthew Waters
8bc0a6c562 basesink: use the slightly more correct take_sample for last-sample
gst_value_take_buffer() and gst_value_take_sample() both resolve to
g_value_take_boxed().  Use the method with the correct name if we
ever change that.
2015-05-25 21:05:56 +10:00
Tim-Philipp Müller
d71f5c7d73 net: keep GCancellable fd around instead of re-creating it constantly
Just create the cancellable fd once and keep it around instead
of creating/closing it for every single packet. Since we spend
most time waiting for packets, an fd is alloced and in use pretty
much all the time anyway.
2015-05-19 14:34:04 +01:00
Thibault Saunier
33924a7f04 timedvaluecontrolsource: Check that the only iter is the end iter in the GSequence
Previous patch was assuming that if the returned iter was the last iter
the GSequence was empty, which is obviously wrong.
2015-05-16 13:08:06 +02:00
Thibault Saunier
78bbaeb6e7 timedvaluecontrolsource: Fix removing all keyframes, and adding one back
We were segfaulting because g_sequence_search was returning the iter_end,
and that iterator does not contain anything and thus should not be used
directly
2015-05-16 11:20:26 +02:00
Jian
4f79c5e8da basesink: Fix QoS/lateness checking if subclass implements prepare/prepare_list vfuncs
In basesink functions gst_base_sink_chain_unlocked(), below code is used to
checking if buffer is late before doing prepare call to save some effort:
    if (syncable && do_sync)
      late =
          gst_base_sink_is_too_late (basesink, obj, rstart, rstop,
          GST_CLOCK_EARLY, 0, FALSE);

    if (G_UNLIKELY (late))
      goto dropped;

But this code has problem, it should calculate jitter based on current media
clock, rather than just passing 0. I found it will drop all the frames when
rewind in slow speed, such as -2X.

https://bugzilla.gnome.org/show_bug.cgi?id=749258
2015-05-14 11:18:12 +03:00
Ilya Konstantinov
b58245ac0a baseparse: fix GST_BASE_PARSE_FLAG_LOST_SYNC
Since frame->priv->discont was cleared earlier,
GST_BASE_PARSE_FLAG_LOST_SYNC was never being set.

Take the chance to refactor the frame creation a bit to
organize the flags setting and reset.

https://bugzilla.gnome.org/show_bug.cgi?id=738237
2015-04-28 12:57:35 -03:00
Thiago Santos
8641997630 baseparse: respect DISCONT flag on buffers
Drain the parser when a DISCONT buffer is received and then mark
the next buffer to be pushed as a DISCONT one

https://bugzilla.gnome.org/show_bug.cgi?id=745927
2015-04-28 12:54:08 -03:00
Tim-Philipp Müller
8e6561be91 Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 17:49:44 +01:00
Tim-Philipp Müller
ac8d5cac4e check: optionally check env var for us to make sure test env is set up
If GST_CHECK_TEST_ENVIRONMENT_BEACON is defined, check if the
environment variable it is defined to is set up at the start
of each test.

https://bugzilla.gnome.org//show_bug.cgi?id=747624
2015-04-23 15:54:08 +01:00
Changbok Chea
60706692b3 basesrc: Remove unused assignment in perform_seek()
https://bugzilla.gnome.org/show_bug.cgi?id=748345
2015-04-23 14:03:23 +01:00
Mathieu Duponchelle
41946aa3f6 helpers: on OSX, MKDIR_P is install-sh -c -d
So we need to call it before cding to the bin directory.
2015-04-17 15:19:07 +02:00
Mathieu Duponchelle
6ce8398bc6 helpers: install -D isn't portable, use $(MKDIR_P) instead. 2015-04-17 13:02:51 +02:00
Mathieu Duponchelle
5dea4b82dc helpers: use $(INSTALL) to ... install the helper.
As it will create the folders and set permissions appropriately,
better than doing it manually.
2015-04-15 14:45:21 +02:00
Mathieu Duponchelle
d4dcce78b0 helpers: Fix Makefile.am to install the completion-helper correctly.
+ The program is installed at install-exec time, we thus need
  to move it in install-exec-hook, not install-data-hook.
2015-04-15 13:05:46 +02:00
Vincent Penquerc'h
6240b03085 Revert "basesrc: fix pool leak on allocation query error path"
This reverts commit 84fdf50b2f.

It seems the bug was fixed independently, and the merge was
automagic, yielding two extra free calls.
2015-04-15 11:40:51 +01:00
Sebastian Dröge
7d3d4503a1 basesrc: Only set DTS to segment.start on the first buffer if subclass did not provide PTS
Otherwise we're going to set a rather arbitrary DTS of segment.start (usually
0) for live sources, which confuses synchronization if the source started
capturing at a later time. And it's especially wrong for raw media, for which
we should not set any DTS at all.

https://bugzilla.gnome.org/show_bug.cgi?id=747731
2015-04-13 09:23:02 +02:00
Vincent Penquerc'h
84fdf50b2f basesrc: fix pool leak on allocation query error path
It could be triggered by:

gst-launch-1.0 videotestsrc num-buffers=20 ! videcrop bottom=214748364 ! videoconvert ! autovideosink

Spotted while testing:

https://bugzilla.gnome.org/show_bug.cgi?id=743910
2015-04-07 11:41:40 +01:00
Sebastian Dröge
370076edd5 baseparse: Forward SEGMENT_DONE events immediately
There might be no more data coming afterwards, and we just drained everything
that was left to be pushed anyway.
2015-04-06 18:46:06 -07:00
Ilya Konstantinov
f35ec14d33 basesrc: do not leak buffer pool in error case
https://bugzilla.gnome.org/show_bug.cgi?id=747321
2015-04-04 11:14:12 +01:00
Sebastian Dröge
7742f0a0d3 basesrc: Fix documentation, buffer pools are unreffed and not freed 2015-04-03 13:19:33 -07:00
Nicolas Dufresne
43f2f925a9 basetransform: Add Since mark for new method
https://bugzilla.gnome.org/show_bug.cgi?id=734424
2015-04-02 17:32:42 -04:00
Thibault Saunier
506afa54df basetransform: Add a method to let subclasses cleanly update srcpad caps
API:
    gst_base_transform_update_src

https://bugzilla.gnome.org/show_bug.cgi?id=734424
2015-04-02 17:16:23 -04:00
Edward Hervey
e4d07e161d introspection: Don't use g-ir-scanner cache at compile time
It pollutes user directories and we don't need to cache it

https://bugzilla.gnome.org/show_bug.cgi?id=747095
2015-03-31 11:16:09 +02:00
Nicolas Dufresne
208696a774 basesrc: Flush-stop starts live task in paused
The flush-stop event should not restart the task for live sources unless
the element is playing. This was breaking seeks in pause with the rtpsrc.

https://bugzilla.gnome.org/show_bug.cgi?id=635701
2015-03-27 19:03:30 -04:00
Thiago Santos
a041d8862d baseparse: only post 'no valid frames' error if buffers were received
Otherwise baseparse will consider empty streams to be an error while
an empty stream is a valid scenario. With this patch, errors would
only be emitted if the parser received data but wasn't able to
produce any output from it.

This change is only for push-mode operation as in pull mode an
empty file can be considered an error for the one driving the
pipeline

Includes a unit test for it

https://bugzilla.gnome.org/show_bug.cgi?id=733171
2015-03-26 12:25:57 -03:00
Mathieu Duponchelle
87130f3287 helpers: remove completion-helper on uninstall
+ And add it to CLEANFILES
2015-03-24 19:34:44 +01:00
Mathieu Duponchelle
c6e3c859a4 completions: remove last unnamespaced symbols.
https://bugzilla.gnome.org/show_bug.cgi?id=744877
2015-03-24 19:11:31 +01:00
Sebastian Dröge
805684585e check: Fix uninitialized variable compiler warning with gcc
check_run.c: In function 'sig_handler':
check_run.c:127:13: warning: 'child_sig' may be used uninitialized in this function [-Wmaybe-uninitialized]
             killpg(group_pid, child_sig);
             ^
check_run.c:130:31: warning: 'idx' may be used uninitialized in this function [-Wmaybe-uninitialized]
             sigaction(sig_nr, &old_action[idx], NULL);
                               ^
2015-03-21 19:37:30 +01:00
Sebastian Dröge
7646cef644 check: Catch SIGTERM and SIGINT in the test runner and kill all currently running tests
Otherwise e.g. ctrl+c in the test runner exits the test runner, while the test
itself is still running in the background, uses CPU and memory and potentially
never exits (e.g. if the test ran into a deadlock or infinite loop).

The reason why we have to manually kill the actual tests is that after
forking they will be moved to their own process group, and as such are
not receiving any signals sent to the test runner anymore. This is supposed
to be done to make it easier to kill a test, which it only really does if
the test itself is forking off new processes.

This fix is not complete though. SIGKILL can't be caught at all, and error
signals like SIGSEGV, SIGFPE are currently not caught. The latter will only
happen if there is a bug in the test runner itself, and as such seem less
important.
2015-03-21 15:19:43 +01:00
Olivier Crête
187570aded baseparse: remove duplicate code
These are already freed by gst_base_parse_clear_queues()

https://bugzilla.gnome.org/show_bug.cgi?id=679768
2015-03-17 19:35:08 +00:00
Vincent Penquerc'h
780f71c4d5 baseparse: reset skip on segments and discontinuities
Large scale skip is an optimization, and thus it is safer to
stop skipping than to continue. Clear skip on segments and
discontinuities, as these are points where it is possible that
the original idea of "bytes to skip" changes.
2015-03-16 12:53:50 +00:00
Tim-Philipp Müller
01e44969df basesink: handle empty buffer list more gracefully
Don't abort, just ignore it. It's like a buffer
without memories.
2015-03-14 21:09:50 +00:00
Tim-Philipp Müller
2b4d066355 adapter: minor optimisation for gst_adapter_take_buffer_list()
Try to allocate buffer list with a suitable size from the
beginning to avoid having to re-alloc the buffer list array.
2015-03-14 21:09:45 +00:00
Tim-Philipp Müller
e6a0f52e3c adapter: add gst_adapter_take_buffer_list()
API: gst_adapter_take_buffer_list()
2015-03-14 17:22:22 +00:00
Tim-Philipp Müller
68012b4d23 collectpads: avoid multiple calls to gst_buffer_get_size() in macro 2015-03-14 16:02:03 +00:00
Tim-Philipp Müller
4a1cee3c44 adapter: avoid multiple calls to gst_buffer_get_size() in macro 2015-03-14 16:02:03 +00:00
William Manley
fc765592a1 meta: Add GstNetControlMessageMeta
GstNetAddress can be used to store ancillary data which was received with
or is to be sent alongside the buffer data.  When used with socket sinks
and sources which understand this meta it allows sending and receiving
ancillary data such as unix credentials (See `GUnixCredentialsMessage`)
and Unix file descriptions (See `GUnixFDMessage`).

This will be useful for implementing protocols which use file-descriptor
passing in payloaders/depayloaders without having to re-implement all the
socket handling code already present in elements such as multisocketsink,
etc.  This, in turn, will be useful for implementing zero-copy video IPC.

This meta uses the platform independent `GSocketControlMessage` API
provided by GLib as a part of GIO.  As a result this new meta does not
require any new dependencies or any conditional compliation for
portablility, although it is unlikely to do anything useful on non-UNIX
platforms.
2015-03-14 13:54:51 +01:00
Thiago Santos
5e15d4aa60 basesink: drain on allocation query
Allows buffers to be reclaimed when caps is to be renegotiated so
that bufferpools can be stopped. As the allocation query is
serialized all buffers have been already drained from the pipeline,
except this last_sample one.

https://bugzilla.gnome.org/show_bug.cgi?id=682770
2015-03-13 19:03:01 +00:00
Thiago Santos
901fea5985 basesink: when draining, deep copy the last buffer to unref old memory
Use gst_buffer_copy_deep() to force the copy of the underlying
memory instead of possibly doing a shallow copy of the buffer
and just referencing the memory

https://bugzilla.gnome.org/show_bug.cgi?id=745287
2015-03-13 18:37:04 +00:00
Michał Dębski
a7797d30a8 check: Use mkstemp instead of tempnam if possible
Using tempnam() is deprecated, this gives warning and fails the build
with -Werror.

https://bugzilla.gnome.org/show_bug.cgi?id=745858
2015-03-11 16:14:24 +00:00
Wim Taymans
4b174b14f5 basesink: clean up the need_preroll variable
Based on patch from Song Bing <b06498@freescale.com>

Don't just set the need_preroll flag to TRUE in all cases. When we
are already prerolled it needs to be set to FALSE and when we go to
READY we should not touch it. We should only set it to TRUE in other
cases, like what the code above does.

See https://bugzilla.gnome.org/show_bug.cgi?id=736655
2015-03-11 16:40:17 +01:00
Luis de Bethencourt
58f9c1dd71 check: duplicate code branches
CID #1226446
2015-03-10 16:42:48 +00:00
Mark Nauwelaerts
b9411dab75 flowcombiner: add a gst_flow_combiner_update_pad_flow() method
https://bugzilla.gnome.org/show_bug.cgi?id=744572

API: gst_flow_combiner_update_pad_flow()
2015-03-07 20:18:43 +01:00
Mark Nauwelaerts
8ec7272d99 flowcombiner: add a gst_flow_combiner_reset() method
https://bugzilla.gnome.org/show_bug.cgi?id=744572

API: gst_flow_combiner_reset()
2015-03-07 20:18:43 +01:00
Sebastian Dröge
bfaa7d1b9f basesrc: Fix typo in debug message 2015-03-06 11:00:20 +01:00
Edward Hervey
c1d2254b23 baseparse: Don't emit errors on EOS if we saw GAP events
If we saw GAP events (meaning the streams is advancing) before we get
EOS, we should not post an ERROR, since it is not fatal.

https://bugzilla.gnome.org/show_bug.cgi?id=745143
2015-02-26 07:52:05 +01:00
Mathieu Duponchelle
dc10b11391 helpers: Fix install of completion-helper.
By applying the supplied transformation to the program name,
for example --program-prefix.
2015-02-24 14:11:45 +01:00
Nicolas Dufresne
8786655b5e completion-helper: Add missing DESTDIR
Otherwise doing "make install DESTDIR" will try to write to
/usr/share/...
2015-02-23 16:50:34 -05:00
Mathieu Duponchelle
c2d483941d completion-helper: Add filtering by klass and sink caps. 2015-02-23 21:17:54 +01:00
Mark Nauwelaerts
70603c1d27 flowcombiner: fix documentation comment typo 2015-02-23 20:08:20 +01:00
Mark Nauwelaerts
aca7faf520 baseparse: drain segment upon SEGMENT_DONE to ensure proper event order 2015-02-23 20:08:20 +01:00
Mark Nauwelaerts
84f0410186 baseparse: clean up some bogus commented code 2015-02-23 20:08:20 +01:00
Mathieu Duponchelle
f3c9647518 completion-helper: Append $(EXEEXT) to the name of the moved file.
Fixes the build on Windows
(https://ci.gstreamer.net/job/cerbero-cross-mingw32/1742/console)
2015-02-23 19:11:32 +01:00
Mathieu Duponchelle
46e7baff74 bash-completion: Implement in a different way.
+ Gets installed
+ Uses a helper tool, gst-completion-helper, installed in
  bash-completions/helpers.
+ Adds a common script that other tools can source.

https://bugzilla.gnome.org/show_bug.cgi?id=744877
2015-02-23 17:57:57 +01:00
Mathieu Duponchelle
0ee2183aa5 check: cast element in ASSERT_SET_STATE.
https://bugzilla.gnome.org/show_bug.cgi?id=744777
2015-02-19 12:18:50 +01:00
Thibault Saunier
025c8343f2 timedvaluecontrolsource: Do not wrongly send value-removed
And avoid freeing something we do not own
2015-02-13 19:59:57 +01:00
Thiago Santos
d718a2befd basesrc: fix documentation and debug message after latency updates
Changes docs and message according to latency handling fix
2015-02-12 14:12:08 -03:00
Sebastian Dröge
4a5ce862a2 Improve and fix LATENCY query handling
This now follows the design docs everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=744106
2015-02-11 17:53:04 +02:00
Jan Schmidt
f0e3b7f904 netclock: Don't update the clock when it desynch
Add a hold off when the clock calibration suddenly loses synch,
as it may be a glitch, but also make sure we update if it stays
desynched for more than a few seconds
2015-02-07 04:41:52 +11:00
Jan Schmidt
824b821caa netclock: Make the RTT average ignore large values more forcefully.
Smooth larger RTTs a little harder, so excessively large values
perturb the average a bit less, and therefore get filtered out
more strongly
2015-02-07 04:38:42 +11:00
Stefan Sauer
8695a202c8 check: fix another typo in the docs 2015-01-23 08:59:57 +01:00
Heinrich Fink
1b472377c8 check: Fix doc of GST_CHECKS and GST_CHECKS_IGNORE
https://bugzilla.gnome.org/show_bug.cgi?id=743335
2015-01-22 21:38:51 +11:00
Sebastian Dröge
ee3db74ec4 check: Add _fail_unless() compatibility function around _ck_assert_failed()
We exported this in < 1.5 and it was automatically used by many macros
from the header. Keep it exported for now.
2015-01-21 18:09:38 +01:00
Jan Schmidt
aeca7eb480 netclock: Fix docs typo. Clock bus messages are GST_MESSAGE_ELEMENT 2015-01-21 22:44:59 +11:00
Jan Schmidt
27997cb8a3 netclock: Implement rate limits for polling and fix up skew limits
Add the minimum-update-interval property to the clock, with a default
of 50ms and don't send polling requests faster than that. That helps to
ensure we spread the initial observations out a little - startup takes
a little longer, but tracking is more stable.

Move the discont skew limiting code inside an if statement, so that
it's only done when the linear regression succeeds and the clock
parameters might actually change.
2015-01-21 22:27:18 +11:00
Jan Schmidt
1c9c9847fd netclock: Implement sending statistic bus messages and discont limits
Allow setting a GstBus on the network clock client
via a new 'bus' object property. If a bus is set, the
clock will output an element message containing statistics
about new clock observations and the clock correlation.

When the local clock is synchronised with the remote, limit the
maximum jump in the clock at any point to be one average RTT to
the server. Also, publish in the bus message whether we are
synched with the remote or not.
2015-01-21 22:27:18 +11:00
Sebastian Dröge
f4bd5f119a basetransform: Short-circuit CAPS query handling if transform_caps returns EMPTY caps
Both for the peer filter caps and the converted caps based on the peer caps.

If the peer filter caps are EMPTY, the peer caps query will also return
EMPTY. There's no ned to both downstream/upstream with this query.
2014-12-22 13:08:37 +01:00
Thiago Santos
896b3bfeed gstcheck: fix GI annotation
Add missing : to annotation
2014-12-18 12:04:22 -03:00
Vincent Penquerc'h
dd40d99710 baseparse: jump over large skips in pull mode
This bypasses the dumping of buffers we still have to do in push mode.

https://bugzilla.gnome.org/show_bug.cgi?id=730053
2014-12-18 13:11:46 +00:00
Sebastian Rasmussen
0b09573bbe check: Have autotools generate internal-check.h
Previously GStreamer got access to the libcheck interface by including
libs/gst/check/check.h which in turn included internal-check.h in the
same directory. internal-check.h was generated by copying
libs/gst/check/libcheck/check.h which in turn was generated from
check.h.in in the same directory. In this case generating
libs/gst/check/libcheck/check.h is unnecessary, in addition this file
was accidentally distributed in generated project tarballs.

Now libs/gst/check/internal-check.h is generated directly from
libs/gst/check/libcheck/check.h.in by configure. This means that the
libcheck source must include internal-check.h instead of the previously
generated libs/gst/check/libcheck/check.h. However the unnecessary
intermediate step is now skipped.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=741359
2014-12-16 16:32:39 +01:00
Sebastian Rasmussen
1cf733f282 check: Avoid requring (u)intmax_t in macros
Previously embedded libcheck versions did not depend on (u)intmax_t and
doing so would require projects using GStreamer's check framework to add
AX_CREATE_STDINT_H to their configure.ac. A workaround is to fallback to
glib types. This patch assumes that glib.h is always included before
internal-check.h which is ok since everything Gstreamer would include
gst/gstcheck.h instead of directly including internal-check.h.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727826
2014-12-07 17:32:30 +01:00
Sebastian Rasmussen
fb6ea425b0 check: Fix compilation error for iOS
libcheck includes CoreServices for its compat for clock_gettime(),
even though it never uses anything it declares. Let's remove it.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727826
2014-12-06 19:46:29 +01:00
Sebastian Rasmussen
85c8b5d2c4 check: Apply GStreamer-specific patches
Reintroduced patches:

 * Make sure that fail_if(1) actually fails
   from commit 9f99d056a2

New patches due to updated libcheck (based on 0.9.14):

 * Checks in m4/check-checks.m4 to cater for new dependencies
 * Conditional compile-time compat POSIX fallbacks for libcheck
 * Avoid relative paths for libcheck header files
 * Make timer_create() usage depend on posix timers, not librt
 * Rely on default AX_PTHREAD behavior to allow HAVE_PTHREAD to be used
   when checking for types and functions (like clock_gettime())
 * Avoid double declaration of clock_gettime() when availabe outside of
   librt by making compat clock_gettime() declaration conditional
 * check 0.9.9 renamed _fail_unless() and 0.9.12 later renamed it again
   to _ck_assert_failed(), so ASSERT_{CRITICAL,WARNING}() now calls this
   function
 * Remove libcheck fallback infrastructure for malloc(), realloc(),
   gettimeofday() and snprintf() since either they appear to be
   available or they introduce even more dependencies.

The result is an embedded check in gstreamer that has been tested by
running check tests in core, -base, -good, -bad, -ugly and rtsp-server
on Linux, OSX and Windows.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727826
2014-12-06 17:48:25 +01:00
Sebastian Rasmussen
f1df7aba8f check: Import version 0.9.14
This lifts the files almost verbatim (the changes being running though
gst-indent and fixing the FSF address) from the upstream respository.
Therefore this commit reverts some GStreamer-specific patches to check
that will be reintroduced next.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727826
2014-12-06 17:48:16 +01:00
Edward Hervey
05092eda8e basesink: clamp reported position based on direction
When using a negative rate (rate being segment.rate * segment.applied_rate),
we will end up reporting decreasing positions, therefore adjust the clamping
against last reported value accordingly.

Fixes positions getting properly reported with applied_rate < 0.0

https://bugzilla.gnome.org/show_bug.cgi?id=738092
2014-12-01 10:46:42 +01:00
Sebastian Dröge
154eefecc9 Don't compare booleans for equality to TRUE and FALSE
TRUE is 1, but every other non-zero value is also considered true. Comparing
for equality with TRUE would only consider 1 but not the others.

Also normalize booleans in a few places.
2014-12-01 09:51:37 +01:00
Thiago Santos
8f4ef80fc4 baseparse: update the duration variable before emitting the bus
Otherwise the application might still get the old value if it asks
between the message and the real update.
2014-11-28 17:00:17 -03:00
Sebastian Dröge
21321ce674 basetransform: Compare correct caps variable against NULL before comparing caps 2014-11-27 18:00:57 +01:00
Sebastian Dröge
92b69256e2 triggercontrolsource: Fix short description for the docs 2014-11-25 17:46:12 +01:00
Sebastian Dröge
a7f3571d02 basetransform: Fix caps equality check
Instead of checking if our outcaps are equivalent to the previous incaps, and
if that is the case not setting any caps on the pad... compare against our
previous outcaps because that's what we care about.

Fixes some cases where the outcaps became equivalent to the previous incaps,
but the previous outcaps were different and we were then sending buffers
downstream that were corresponding to the caps we forgot to set on the pad.
Resulting in crashes or image corruption.
2014-11-20 21:37:24 +01:00
Vincent Penquerc'h
7c4fbc9fb1 baseparse: allow skipping more data than we currently have
This can be useful for skipping large unwanted data, such as
large album art, when we know the size of it from a metadata
header.
2014-11-12 13:43:33 +00:00
Sebastian Dröge
a52184ed55 basetransform: Don't bother the subclass with setting the same caps multiple times 2014-11-09 10:42:55 +01:00
Sebastian Dröge
acc295c93b basesink: Don't bother the subclass with setting the same caps multiple times 2014-11-09 10:42:55 +01:00
Sebastian Dröge
674b555bec basesrc: Don't bother the subclass with setting the same caps multiple times 2014-11-09 10:42:54 +01:00
Jan Schmidt
f470d57edd dataqueue: Fix gst_data_queue_new() description.
Reword the function docs, which haven't made any sense since
gst_data_queue_new_full() was removed a few years ago.
2014-11-06 21:09:09 +11:00
Thibault Saunier
56606c5264 basesink: Answer the query position when receiving it from upstream
Currently we are just returning FALSE, but we do have the information
we should just answer the query the same way as when answering through
the GstElement.query vmethod default implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=739580
2014-11-04 11:53:23 +01:00
Luis de Bethencourt
c42b525848 doc: Do not use deprecated gtk-doc 'Rename to' tag
GObject introspection GTK-Doc tag "Rename to" has been deprecated, changing to
rename-to annotation.

https://bugzilla.gnome.org/show_bug.cgi?id=739514
2014-11-02 15:17:57 +00:00
Tim-Philipp Müller
989e97d1dd basesink: don't unlock mutex that is not locked
Fixes 'Attempt to unlock mutex that was not locked'
warning with newer GLibs when sink is shut down in
certain situations. Triggered by the decodebin
test_reuse_without_decoders unit test in -base
sometimes, esp. on slower machines.
2014-10-24 12:51:07 +01:00
Thibault Saunier
1a02a59e42 timedvaluecontrolsource: Add some signals about values changes
In order for user to be able to track changes in the value set in
GstTimedValueControlSource the following signals have been added:
 * value-added
 * value-removed
 * value-changed

To be able to use a GstControlPoint to be marshalled into the signals,
the GstControlPoint structure is now registerd as a GBoxed type.

New API:
~~~~~~~
  * GstTimedValueControlSource::value-added
  * GstTimedValueControlSource::value-removed
  * GstTimedValueControlSource::value-added

https://bugzilla.gnome.org/show_bug.cgi?id=737616
2014-10-22 18:08:30 +02:00
Jan Schmidt
33e65d9358 collectpads: Use GST_PTR_FORMAT in debug to output buffer details
Use %GST_PTR_FORMAT instead of %p in debug output so all the buffer
details are output
2014-10-08 01:33:51 +11:00
Matej Knopp
d8aac32c78 baseparse: don't leak caps in gst_base_parse_process_streamheader
https://bugzilla.gnome.org/show_bug.cgi?id=737762
2014-10-03 12:36:27 +01:00
Tim-Philipp Müller
c78a1b111c Revert "baseparse: don't leak caps in gst_base_parse_process_streamheader"
This reverts commit 5e8b4bf085.

This causes refcounting criticals in the baseparse unit test.
2014-10-03 09:01:39 +01:00
Matej Knopp
5e8b4bf085 baseparse: don't leak caps in gst_base_parse_process_streamheader
https://bugzilla.gnome.org/show_bug.cgi?id=737762
2014-10-02 10:39:54 +03:00
Stefan Sauer
d5518edf12 fixme: bump leftover 0.11 fixme comments 2014-09-25 21:27:03 +02:00
Stefan Sauer
e8c5627802 basesrc: move the quick return up
Don't assign local vars if we skip anyway. Add logging for failure conditio
2014-09-25 20:33:17 +02:00
Jonas Holmberg
4a304a7774 flowcombiner: add a gst_flow_combiner_clear() method
https://bugzilla.gnome.org/show_bug.cgi?id=737359

API: gst_flow_combiner_clear()
2014-09-25 15:40:42 +01:00
Stefan Sauer
feeb2902da docs: fix a small contradition in the docs
The vmethod get_size() shall return the size in 'format' as configured by
_set_format().
2014-09-23 12:53:18 +02:00
Aurélien Zanelli
fefd6d06a1 basesrc: handle reference in set_allocation rather than in prepare_allocation
Otherwise we can forget to unref objects in error cases.

https://bugzilla.gnome.org/show_bug.cgi?id=736680
2014-09-16 10:17:28 +03:00
Sebastian Dröge
84c6e885f1 check: Use the name parameter of gst_check_setup_src_pad_by_name() and the sink variant
This was hardcoded to "sink" / "src" by accident in previous refactoring.
2014-09-15 13:08:09 +03:00
Thibault Saunier
87a79673b0 check: Add a function to check destruction of objects
Add a method letting people to ensure that unreffing one object
leads to its destruction, and possibly the destruction of more object
(think destruction of a GstBin etc...).

https://bugzilla.gnome.org/show_bug.cgi?id=736477
2014-09-12 17:18:21 +02:00
Tiago
076b83208a check: Adding documentation to the gst_check_setup_sink_pad_by_name function
https://bugzilla.gnome.org/show_bug.cgi?id=734190
2014-09-12 14:14:05 +03:00
Tim-Philipp Müller
d4a4a96f82 baseparse: minor docs fix 2014-09-09 20:43:02 +01:00
Thiago Santos
59c34a8ff7 baseparse: handle streamheaders by prepending them to the stream
Add a first_buffer boolean state flag to have baseparse do actions
before pushing data. This is used to check the caps for streamheader
buffers that are prepended to the stream, but only if the first buffer
isn't already marked with the _HEADER flag. In this case, it is assumed
that the _HEADER marked buffer is the same as the streamheader.

https://bugzilla.gnome.org/show_bug.cgi?id=735070
2014-08-27 10:30:09 -03:00
Tim-Philipp Müller
86d7a597f0 bytereader: add gst_byte_reader_peek_sub_reader() and _get_sub_reader()
Adds API to get or peek a sub-reader of a certain size from
a given byte reader. This is useful when parsing nested chunks,
one can easily get a byte reader for a sub-chunk and make
sure one never reads beyond the sub-chunk boundary.

API: gst_byte_reader_peek_sub_reader()
API: gst_byte_reader_get_sub_reader()
2014-08-15 10:03:26 +01:00
Aurélien Zanelli
b9fa37f074 docs: make explicit that the caps passed to gst_base_src_set_caps() are 'tranfer none'
https://bugzilla.gnome.org/show_bug.cgi?id=733741
2014-08-15 09:53:09 +01:00
Tim-Philipp Müller
f88a981997 base: and fix build with new g-i again 2014-08-14 14:38:57 +01:00
Tim-Philipp Müller
55498523e4 base: remove g-i annotation that makes older g-ir-scanner crash
Just remove one skip annotation that causes this:

  ** (g-ir-compiler:12458): ERROR **: Caught NULL node, parent=empty

with older g-i versions such as 1.32.1.
2014-08-14 14:27:13 +01:00
Tim-Philipp Müller
d9516d3c58 bytereader: use unchecked inline variant for get_remaining in more places
We've already done the g_return_*_if_fail (reader != NULL)
dance in those places, so no need to do it again.
2014-08-06 14:23:47 +01:00
Tiago Cesar Katcipis
91045ccd83 gstcheck: add docs for gst_check_setup_src_pad_by_name()
https://bugzilla.gnome.org/show_bug.cgi?id=734142
2014-08-03 00:27:14 +01:00
Thiago Santos
f8323b17fb bytereader: add gst_byte_reader_masked_scan_uint32_peek
Adds gst_byte_reader_masked_scan_uint32_peek just like
GstAdapter has a _peek and non _peek version

Upgraded tests to check that the returned value is correct in the
_peek version

API: gst_byte_reader_masked_scan_uint32_peek

https://bugzilla.gnome.org/show_bug.cgi?id=728356
2014-07-24 17:00:09 -03:00
Thibault Saunier
4c38895f4b baseparse: Return FLOW_FLUSHING when pushing a frame on a pad that has been flushed
When going to READY, it is possible that we are still pusing a frame but that
our srcpad has already been set to flushing. In that case we should not
post any error on the bus but instead cleanly return FLOW_FLUSHING.

https://bugzilla.gnome.org/show_bug.cgi?id=733320
2014-07-17 17:46:16 +02:00
Sebastian Rasmussen
863ba1a598 docs: Fix documentation typos and inconsistencies
* GstGlobalDeviceMonitor was renamed to GstDeviceMonitor
 * Expand GST_MESSAGE_DEVICE to the full enum value names
 * Correct the incorrect references to the GstDeviceProvider interfaces
 * Describe caps arguments for gstcheck interface
 * Add missing docs for GstNetAddressMeta and its add function
 * Add docs for toc helper macros
 * Avoid refering to GstValueList type as done elsewhere

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732786
2014-07-09 09:22:11 +02:00
Tim-Philipp Müller
ba31faf261 libs: gstcheck: check that mutex is locked before g_cond_wait*() is called
Sanity check to catch problems in unit test.
2014-07-06 12:13:04 +01:00
Tim-Philipp Müller
b2bbd1edfa libs: gstcheck: init and clear global mutex and cond variables 2014-07-06 12:12:20 +01:00
Vincent Penquerc'h
2dc8839234 basesink: reset QoS on segment event
This avoids spurious warnings about slow machine when upstream
sends new segments without flushing.
2014-07-01 16:30:23 +01:00
Evan Nemerson
5abc82e9f3 introspection: Assorted minor introspection and documentation fixes
https://bugzilla.gnome.org/show_bug.cgi?id=732534
2014-07-01 09:03:41 +02:00
Sebastian Dröge
4720e6d0e0 dataqueue: Hide from bindings
Other languages have their own data structures that are more convenient to
use.

https://bugzilla.gnome.org/show_bug.cgi?id=731303
2014-06-26 19:32:28 +02:00
Sebastian Dröge
0d5177b5fe queuearray: Hide from bindings
Other languages have their own data structures that are more convenient to use.

https://bugzilla.gnome.org/show_bug.cgi?id=731350
2014-06-26 19:32:18 +02:00
Evan Nemerson
eebff7b048 base: assorted introspection fixes and additions
https://bugzilla.gnome.org/show_bug.cgi?id=731542
2014-06-26 18:55:26 +02:00
Evan Nemerson
c38f3254f8 base: add (nullable) annotations to return values
https://bugzilla.gnome.org/show_bug.cgi?id=731542
2014-06-26 18:55:25 +02:00
Thiago Santos
b7516dbf7c baseparse: avoid returning _OK for _NOT_LINKED
When the parser receives non-aligned packets it can push a buffer
and get a not-linked return while still leaving some data still to
be parsed. This remaining data will not form a complete frame and
the subclass likely returns _OK and baseparse would take that
as the return, while it the element is actually not-linked.

This patch fixes this by storing the last flow-return from a push
and using that if a parsing operation doesn't result in data being
flushed or skipped.

https://bugzilla.gnome.org/show_bug.cgi?id=731474
2014-06-25 12:13:07 -03:00
Tim-Philipp Müller
f6e2dee6f9 flowcombiner: fix g-i transfer annotations 2014-06-16 09:18:45 +01:00
Edward Hervey
ecd8fd3511 flowcombiner: Fixed GBoxedCopyFunc
I'll just quote the most interesting man in the world:

"I don't usually push commits, but when I do I don't compile it
first"
2014-06-16 08:43:57 +02:00
Tim-Philipp Müller
b05eeb9df4 flowcombiner: keep a ref to the pads we're using
Needed for use via the boxed type.

https://bugzilla.gnome.org/show_bug.cgi?id=731355
2014-06-14 11:32:42 +01:00
Tim-Philipp Müller
49fedb521f flowcombiner: add boxed type for bindings
https://bugzilla.gnome.org/show_bug.cgi?id=731355
2014-06-14 10:54:41 +01:00
Nicolas Dufresne
d99e621533 bytereader: Use concistant derefence method
This is minor style fix to not mix *var and var[N].
2014-06-10 10:23:13 -04:00
Sungho Bae
d3b2f6e4b8 bytereader: Use pointer instead of index access
Currently the scan uses Boyer-moore method and its performance is good.
but, it can be optimized from an implementation of view.

The original scan code is implemented by byte array and index-based access.
In _scan_for_start_code(), the index is increasing from start to end and the
base address of the byte array is referred to as return value.

In the case, index-based access can be replaced by pointer access, which
improve the performance by removing index-related operations.

Its performace is enhanced by approximately 8% on arm-based embedded devices.
Although it seems trivial, it can affect the overall performance because the
_scan_for_start_code() function is very often called when H.264/H.265 video is
played.

In addition, the technique can apply for all architectures and it is good in
view of readability and maintainability.

https://bugzilla.gnome.org/show_bug.cgi?id=731442
2014-06-10 09:35:38 -04:00
Evan Nemerson
1cd4bd64b0 queuearray: fix expanding size of queue from 1
Without we would not actually expand and access
memory beyond the allocated region for the array.

https://bugzilla.gnome.org/show_bug.cgi?id=731349
2014-06-07 09:45:39 +01:00
Evan Nemerson
75e0a3c676 dataqueue: clear up documentation of gst_data_queue_new
The gpointer argument is passed to all three callbacks, not just one.

https://bugzilla.gnome.org/show_bug.cgi?id=731302
2014-06-07 09:30:14 +01:00