Commit graph

97 commits

Author SHA1 Message Date
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
Nicolas Huet
00bcd94723 systemclock: fix multi-thread entry status issue
Running two threads, one executing the timer and one unscheduling it, the
unscheduled status set by the second thread is sometimes overwritten by the
first one.

https://bugzilla.gnome.org/show_bug.cgi?id=737999
2014-10-06 15:58:42 +03: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
Tim-Philipp Müller
6eb6d9ec38 docs: remove outdated and pointless 'Last reviewed' lines from docs
They are very confusing for people, and more often than not
also just not very accurate. Seeing 'last reviewed: 2005' in
your docs is not very confidence-inspiring. Let's just remove
those comments.
2014-04-26 21:21:51 +01:00
Tim-Philipp Müller
e30eab99a2 systemclock: add Since markers for new API 2013-11-11 16:47:06 +00:00
Wim Taymans
02b64ee03b systemclock: Add gst_system_clock_set_default
Used for setting the default system clock that is obtained through
gst_system_clock_obtain(), which is sometimes needed for unit
testing.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=711269
2013-11-11 12:25:14 +01:00
Руслан Ижбулатов
e745a2bcf0 clock: Do use HAVE_CLOCK_GETTIME
Fixes #697549
2013-04-09 20:33:27 +02:00
Tim-Philipp Müller
666c8c11c6 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 20:44:48 +00:00
Tim-Philipp Müller
c0c79188ca bus, clock: make sure these never have a floating ref
Clear the initial floating ref in the init function for
busses and clocks. These objects can be set on multiple
elements, so there's no clear parent-child relationship
here. Ideally we'd just not make them derive from
GInitiallyUnowned at all, but since we want to keep
using GstObject features for debugging, we'll just do
it like this.

This should also fix some problems with bindings, which
seem to get confused when they get floating refs from
non-constructor functions (or functions annotated to
have a 'transfer full' return type). This works now:

from gi.repository import GObject, Gst

GObject.threads_init()
Gst.init(None)

pipeline=Gst.Pipeline()
bus = pipeline.get_bus()
pipeline.set_state(Gst.State.NULL)
del pipeline;

https://bugzilla.gnome.org/show_bug.cgi?id=679286
https://bugzilla.gnome.org/show_bug.cgi?id=657202
2012-07-09 13:09:45 +01:00
Raimo Järvi
63234a9dab gst: Fix compiler warnings on mingw-w64
https://bugzilla.gnome.org/show_bug.cgi?id=675525
2012-05-09 09:35:35 +02:00
Wim Taymans
eb84682e92 clock: make more stuff private
Expose methods to get and set the timeout because subclasses uses this.
2012-02-27 09:11:36 +01:00
Wim Taymans
8909205b85 systemclock: make more stuff private 2012-02-27 09:11:36 +01:00
Tim-Philipp Müller
2c8c44976f Replace deprecated GStaticMutex with GMutex
https://bugzilla.gnome.org/show_bug.cgi?id=662207
2012-01-22 22:44:59 +00:00
Tim-Philipp Müller
13d91d1f6c Use recent GLib API unconditionally now that we depend on the latest GLib 2012-01-22 01:25:22 +00:00
Tim-Philipp Müller
a1daf846f3 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	gst/gstobject.h
	libs/gst/check/gstcheck.h
	libs/gst/controller/gstcontroller.c
	plugins/elements/gstidentity.c
	tools/gst-xmlinspect.c
2011-12-04 15:38:09 +00:00
Tim-Philipp Müller
ca179625f8 g_thread_create() is deprecated in GLib master, use g_thread_try_new() instead 2011-12-03 13:58:51 +00:00
Wim Taymans
8e4f006c57 fix more parent_class 2011-10-16 14:45:03 +02:00
Wim Taymans
5cf8e68944 Merge branch 'master' into 0.11
Conflicts:
	gst/gstmessage.c
	gst/gstquery.c
	gst/gstregistrychunks.c
	gst/gstsegment.c
	libs/gst/base/gstbasetransform.c
	libs/gst/base/gstbasetransform.h
	libs/gst/base/gsttypefindhelper.c
	plugins/elements/gsttypefindelement.c
2011-08-26 14:37:54 +02:00
Josep Torra
95b96b57a2 tagsetter: use GST_TAG_MERGE_UNDEFINED instead of FALSE
Fixes warning #188: enumerated type mixed with another type reported by ICC.
2011-08-26 14:11:14 +02:00
Tim-Philipp Müller
5a8273e527 Merge branch 'master' into 0.11 2011-06-05 15:48:51 +01:00
David Schleef
f3eac7de22 Work around changes in g_atomic API
See #651514 for details.  It's apparently impossible to write code
that avoids both type punning warnings with old g_atomic headers and
assertions in the new.  Thus, macros and a version check.
2011-06-04 00:36:26 -07:00
Sebastian Dröge
007b16b024 Merge branch 'master' into 0.11 2011-05-26 13:36:48 +02:00
Руслан Ижбулатов
d56b3ec5aa systemclock: Placate gcc by defining EWOULDBLOCK to something 2011-05-25 12:04:14 +02:00
Sebastian Dröge
b935a814d9 Merge branch 'master' into 0.11
Conflicts:
	configure.ac
	docs/gst/gstreamer-sections.txt
	gst/gstbin.c
	gst/gstelement.c
	gst/gstelement.h
	gst/gstghostpad.c
	gst/gstminiobject.c
	gst/gstminiobject.h
	libs/gst/base/gstbasesrc.c
	libs/gst/base/gstbasetransform.c
	plugins/elements/gstinputselector.c
	tests/check/gst/gstminiobject.c
2011-05-16 16:53:04 +02:00
Sebastian Dröge
cdffc1d5d5 systemclock: Only retry writing to the socket for EAGAIN, EWOULDBLOCK and EINTR
Fixes infinite loop in some cases, bug #650002.
2011-05-14 11:39:35 +02:00
Wim Taymans
5dd9ab1cab cleanups
Fix padding, remove deprecated symbols.
2011-02-22 16:04:12 +01:00
Tim-Philipp Müller
8a7fc1d8c9 Revert "micro-optim: if (x) is cheaper than if (x > 0) for unsigned integers"
This reverts commit 6aa8ca37ee.

See http://article.gmane.org/gmane.comp.video.gstreamer.devel/32282
2010-12-26 21:21:43 +00:00
Tim-Philipp Müller
3256c708be docs: gst: more gobject introspection annotations
Many of these are superfluous, added for clarity.
2010-12-07 18:37:04 +00:00
Wim Taymans
ba7157dce6 clock: make sync clock wait lockfree
Make the common case lockfree.
2010-12-03 16:11:04 +01:00
Edward Hervey
6aa8ca37ee micro-optim: if (x) is cheaper than if (x > 0) for unsigned integers 2010-12-03 12:03:42 +01:00
Stefan Kost
a09bd97bc6 systemclock: add a missing G_PARAM_STATIC_STRINGS 2010-10-13 15:59:16 +03:00
Trond Andersen
a95eacb56a clock: fix racy shutdown clock id leak
Clock IDs were leaked if the clock got disposed before the worker thread
got a chance to reap unscheduled entries.

Fixes bug #630439.
2010-09-23 21:54:01 +02:00
Benjamin Otte
e8f65e8bff Make code safe for -Wredundant-decls
Adds that warning to configure.ac

Includes a tiny change of the GST_BOILERPLATE_FULL() macro:
The get_type() function is no longer declared before being defined.

https://bugzilla.gnome.org/show_bug.cgi?id=611692
2010-03-10 20:45:33 +01:00
Руслан Ижбулатов
4ad052fed7 systemclock: fix compilation of win32 code
Fixes #593460.
2009-08-29 11:32:21 +01:00
Wim Taymans
e54e5eb9bb systemclock: use preformance counters on windows
Based on clock implementation by Håvard Graff <havard.graff@tandberg.com>

Try to get the time on windows using the performance counters. These have a much
higher resolution and accuracy than the regular getcurrenttime(). Be careful to
fall back to regular getcurrenttime() or posix clocks when performance counters
are not available.
2009-08-28 17:02:30 +02:00
Wim Taymans
cabc9cbbef clock: enable monotonic clock when we can
Enable the monotonic clock by default when we can.
Fixes #583554
2009-05-25 16:23:30 +02:00
Tim-Philipp Müller
7f0b2f3d3b systemclock: remove duplicate _get_type() function for GstClockType
Remove the static gst_clock_type_get_type() function in the
systemclock code in favour of the public one in gstenumtypes.c.
2009-05-12 20:57:09 +01:00
Wim Taymans
84c5db2635 Use new _ref_sink when we can 2009-05-11 22:35:09 +02:00
Sebastian Dröge
e7ccf786c3 gst: Use G_DEFINE_TYPE and friends or at least g_once_init_* in the _get_type() functions 2009-04-04 10:20:36 +02:00
Edward Hervey
00cbbc87c7 Remove unused variables detected by LLVM's Clang static analyzer. 2009-04-03 12:56:48 +02:00
Wim Taymans
659e1d2dc2 clock: wakeup the async thread a bit more
Also wake up the async thread when it is doing an async wait for an entry.
2009-03-27 16:15:55 +01:00
Wim Taymans
4446f9972d clock: make UNSCHEDULED checks threadsafe
Move the checks for using an unscheduled entry from the unsafe GstClock to the
SystemClock object so that we can perform the correct locking.
fix a leak and potential deadlock then the async thread fails to start.
Sprinkle some G_LIKELY around because we can.
2009-03-26 22:05:31 +01:00
Wim Taymans
e15cf9bc12 clock: remove pending async wakeup sooner
Remove a pending async wakeup before we check if the next entry is UNSCHEDULED
because we might leave the control socket busy.
2009-03-26 21:40:20 +01:00
Wim Taymans
41f1a1881e clock: add some more comments. 2009-03-26 19:13:55 +01:00
Wim Taymans
16b68e7de0 clock: rework the wakeup of entries.
Keep a counter for the amount of outstanding wakeups that we produce and only
perform a write/read to the control socket when 1 or 0 respectively.
don't poll when waiting for the entries to be unblocked and clear their wakeup
counts, just act on the signal when the wakeup count is 0.
unscheduled entries will clear their wakeup count themselves.
Keep track of when we wakeup the async thread because the list of entries has
changed.
don't try to see if the list changed because we can't really know when one entry
is added multiple times.
Only wake up the async thread when we add an async entry to the head of the list
and the old entry was BUSY.
2009-03-26 18:53:02 +01:00
Wim Taymans
df30f60048 clock: fix 2 wakeup races.
when an entry being waited on in the async thread is unscheduled, clear the
wakeup queue so we can continue waiting on other entries.
When an entry being waited on in the async thread is unlocked because an earlier
entry was added to the list, set the entry to OK again. This makes sure that
only the entries being waited on have the BUSY flag set and wake up the timer
poll when they are unscheduled.
2009-03-26 15:59:17 +01:00
Stefan Kost
73953055af systemclock: these warnings are serious, give more detail in the message 2009-03-15 23:41:33 +02:00
Jonas Holmberg
abffdb2ac3 Implement the systemclock with gstpoll
Add a property to select the clock type, currently REALTIME and MONOTONIC when
posix timers are available.

Implement the systemclock with GstPoll instead of GCond. This allows us to
schedule timeouts with nanosecond precission on newer kernels and with ppoll
support. It's also resilient to changes to the systemclock because of NTP or
similar.
2009-02-03 18:04:46 +01:00
Wim Taymans
20b951efc1 gst/gstsystemclock.c: Add some more docs to explain why a FIXME was wrongly added.
Original commit message from CVS:
* gst/gstsystemclock.c: (gst_system_clock_id_wait_jitter_unlocked):
Add some more docs to explain why a FIXME was wrongly added.
2007-12-24 14:35:24 +00:00
Stefan Kost
0873492be6 gst/gstbin.h: Move priv to the right place.
Original commit message from CVS:
* gst/gstbin.h:
Move priv to the right place.
* gst/gstsystemclock.c:
Add FIXME: and improve log.
* tests/check/Makefile.am:
* tests/examples/manual/Makefile.am:
Work with all types of registries.
2007-09-20 07:42:35 +00:00