Commit graph

7570 commits

Author SHA1 Message Date
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
Guillaume Desmottes 688108431a devicemonitor: Stop using g_clear_pointer()
We dont't want to depend on GLib 2.34 for now.
2014-06-30 11:17:44 +02:00
Tim-Philipp Müller 0e0e78e8af devicemonitor: don't fail when started without any filters
Just show all devices then.
2014-06-27 10:47:50 +01:00
Tim-Philipp Müller 9b07b935a4 deviceproviderfactory: handle NULL classes argument and match any 2014-06-27 10:44:01 +01:00
Olivier Crête 67440ce084 devicemonitor: Improve documentation 2014-06-26 21:01:38 -04:00
Olivier Crête 6d12b33945 devicemonitor: Make it possible to add multiple filters
Each filter will include a GstCaps and a set of classes to match
2014-06-26 21:01:38 -04:00
Olivier Crête d76e0be9fd device: Add pre-conditions 2014-06-26 16:31:51 -04:00
Olivier Crête c2583cae90 GstDeviceMonitor: Rename from GstGlobalDeviceMonitor 2014-06-26 15:08:46 -04:00
Olivier Crête 7992174a1a DeviceProvider: Rename from DeviceMonitor 2014-06-26 14:45:30 -04:00
Philip Withnall 9edef56efc miniobject: Add missing (nullable) annotations
gst_mini_object_replace() can take NULL mini-objects.

https://bugzilla.gnome.org/show_bug.cgi?id=730873
2014-06-26 19:16:07 +02:00
Sebastian Dröge fe192fe399 message: Application and element messages should not have NULL structures
It does not make sense for them.
2014-06-26 19:02:06 +02:00
Evan Nemerson 4088363aea introspection: add some missing allow-none annotations to in params
https://bugzilla.gnome.org/show_bug.cgi?id=730957
2014-06-26 19:00:58 +02:00
Evan Nemerson 5d80cf12ba introspection: add nullability annotations to out and inout params
https://bugzilla.gnome.org/show_bug.cgi?id=730957
2014-06-26 18:59:15 +02:00
Evan Nemerson 2759882379 introspection: add missing (nullable) annotations to return values
Support for (nullable) was added to G-I at the same time as nullable
return values.  Previous versions of G-I will not mark return values as
nullable, even when an (allow-none) annotation is present, so it is
not necessary to add (allow-none) annotations for compatibility with
older versions of G-I.

https://bugzilla.gnome.org/show_bug.cgi?id=730957
2014-06-26 18:56:38 +02:00
George Kiagiadakis 780c83d5c4 caps: unset the parent refcount of the old features before freeing them in gst_caps_set_features()
Otherwise gst_caps_features_free() asserts and the features structure is leaked
2014-06-26 11:16:34 +03:00
Tim-Philipp Müller 8e30a9462c caps: gst_caps_is_any() should return TRUE or FALSE
Not some flag value instead of TRUE. Fixes code like
gst_caps_is_any() == TRUE.

https://bugzilla.gnome.org//show_bug.cgi?id=731704
2014-06-22 12:50:42 +01:00
Tim-Philipp Müller 2092754ed1 device: rename "klass" and get_klass() to "device-class" and _get_device_class()
There's some precedent in GstElementFactory, but a
"klass" property just seems weird.
2014-06-21 01:26:46 +01:00
Tim-Philipp Müller 89a5b89388 value: simplify GST_VALUE_HOLDS for our boxed and fundamental types
Boxed types can't be derived from, and we don't support
deriving from our special fundamental types (the code
checks for GType equality in most places.
2014-06-21 01:10:22 +01:00
Olivier Crête 77db6bf3d6 GstDevice: Document GstDevice and related classes 2014-06-20 16:55:06 -04:00
Tim-Philipp Müller bc75a166f0 gstvalue: optimise checks for lists
Our fundamental types are non-derivable, so we can
just check for equality. Also avoid doing the same
check multiple times in a couple of places.
2014-06-19 08:40:16 +01:00
Tim-Philipp Müller d74708a820 gstvalue: use g_assert() in internal function for already-checked things
So these get compiled out for releases.
2014-06-19 08:40:15 +01:00
Tim-Philipp Müller bbefd6082f gstvalue: add internal _can_compare_unchecked() 2014-06-19 08:40:15 +01:00
Tim-Philipp Müller adcbe94aff gstvalue: add internal _list_concat() that takes ownership of input values
Avoids unnecessary copies.
2014-06-19 08:40:15 +01:00
Tim-Philipp Müller 5f6088f039 structure: simplify value type checks in getters
Just check for GType equality in common cases.
2014-06-19 08:40:15 +01:00
Sebastian Dröge 8f4b479c98 value: Add a FIXME 2.0 for a fraction ranges optimization
Currently we leak the internal representation of them as two GValues that
contain a fraction. Without this we could store fraction ranges as
  data[0] = (min_n << 32) | (min_d)
  data[1] = (max_n << 32) | (max_d)
and wouldn't require an additional allocation per range.
2014-06-19 09:33:55 +02:00
Sebastian Dröge 9b7da39b68 value: Make sure to cast int range values to guints before storing them
Otherwise negative values will sets all of the 64 bits due to two's
complement's definition of negative values.

Also add a test for negative int ranges.
2014-06-19 09:33:54 +02:00
Sebastian Dröge d84d01aad4 value: Store integer ranges directly in a GValue without additional allocation
Micro optimization to save some allocations. Next step to do this
with fraction ranges too.
2014-06-19 09:09:07 +02:00
Edward Hervey 37e8ffcc4f gst_private: Fix duplicate definition 2014-06-19 08:43:36 +02:00
Sebastian Dröge db1e4422b6 gst: Store more basic type GTypes in variables
Micro optimization to change a function call to a variable access
for all our basic types.
2014-06-19 08:06:55 +02:00
Sebastian Dröge f47a95f4cb value: Store our fundamental type GTypes in variables
Micro optimization to change a function call to a variable access
for all our basic types.
2014-06-19 08:06:55 +02:00
Edward Hervey b0b20b44e5 gstvalue: Speed up gst_value_intersect/_subtract
Both gst_value_intersect and gst_value_subtract will call
gst_value_compare if one of their arguments isn't a list.

gst_value_compare will then re-do a check to see if one of
the arguments is a list (for the special case of comparing a unitary
value with a list of length 1).

The problem is that the various G_VALUE_HOLDS represent an expensive
amount of calling gst_value_compare (almost half of it) to see if
the provided arguments are list. These checks can be done without
when we know that the arguments aren't lists.

* Create a new "nolist" gst_value_compare which avoids that special
  case comparision

Benchmarks:
 valgrind/callgrind: average speedup in instruction calls for
 gst_value_intersect and gst_value_subtract is around 56% (Makes 63%
 of the calls it used to take previously)

 tests/benchmarks/capsnego: With default settings (depth 4, children 3
 607 elements), time taken for transition from READY to PAUSED:
   Before : 00.391519153
   After  : 00.220397492
    56% of the time previously used, +77% speedup

https://bugzilla.gnome.org/show_bug.cgi?id=731756
2014-06-17 16:27:07 +02:00
Tim-Philipp Müller 87fcf1e078 bufferlist: fix buffer leak in _remove() 2014-06-16 20:29:56 +01:00
Tim-Philipp Müller bd26fa7ccb devicemonitor: some docs additions and fixes 2014-06-14 16:30:49 +01:00
Evan Nemerson 2a14482c62 introspection: minor annotation additions
https://bugzilla.gnome.org/show_bug.cgi?id=731541
2014-06-12 09:26:38 +01:00
Evan Nemerson ba1212f63b introspection: include gstversion.h in GIR generation
https://bugzilla.gnome.org/show_bug.cgi?id=703021
2014-06-12 08:22:20 +01:00
Tim-Philipp Müller 12088d87bb globaldevicemonitor: prettify header 2014-06-07 10:13:56 +01:00
Evan Nemerson 1fe6d3ad08 introspection: fix some minor annotation bugs
https://bugzilla.gnome.org/show_bug.cgi?id=730982
2014-06-06 15:15:12 -04:00
Tim-Philipp Müller b65a7a7034 info: make printing datetimes work with GST_PTR_FORMAT 2014-06-03 23:49:26 +01:00
Tim-Philipp Müller 8998cf840d datetime: change internal implementation to mini object
And move type stuff from GstValue to GstDateTime.
2014-06-03 23:49:21 +01:00
Wim Taymans 36d4c4c218 info: first handle all miniobjects, then GObjects
First handle all miniobjects before we attempt to dereference the first
field pointer and look at the GType. With the recent glib change to
speed up G_IS_OBJECT, this causes crashes on miniobjects otherwise.
2014-06-03 14:47:17 +02:00
Wim Taymans 460be3e124 info: GstDateTime does not have a GType as first field
GstDateTime does not have the GType as the first field so we can't use
it to detect its type.
2014-06-03 14:46:11 +02:00
Wim Taymans e457739ac9 info: use macros to check types
Use the macros to check the type of objects instead of directly poking
at the first field.
2014-06-03 14:45:22 +02:00
Tim-Philipp Müller 64c71323a6 globaldevicemonitor: connect sync-message signal on the right object
Fixes criticals at runtime and makes stuff actually work.
2014-06-01 23:51:20 +01:00
Sebastian Dröge 066fdcd432 Revert "miniobject: Add missing (nullable) annotations"
This reverts commit 96361e9b5c.

This was not supposed to be pushed yet!
2014-05-30 09:13:16 +02:00
Sebastian Dröge 67138f4ee8 bufferpool: It's pool, not poo... even when talking about flushing 2014-05-30 09:12:50 +02:00
Philip Withnall 96361e9b5c miniobject: Add missing (nullable) annotations
gst_mini_object_replace() can take NULL mini-objects.

https://bugzilla.gnome.org/show_bug.cgi?id=730873
2014-05-30 09:12:49 +02:00
Evan Nemerson e10266e3f3 docs: convert NULL, TRUE, and FALSE to %NULL, %TRUE, and %FALSE
This should help improve documentation generated for
languages other than C.

https://bugzilla.gnome.org/show_bug.cgi?id=730961
2014-05-30 00:20:27 +01:00
Tim-Philipp Müller 88191aa880 docs: fix type in GstObject docs 2014-05-30 00:14:01 +01:00
Evan Nemerson 4397150d54 bufferpool: fix gst_buffer_pool_has_option() documentation
https://bugzilla.gnome.org/show_bug.cgi?id=730962
2014-05-29 23:18:18 +01:00
Thiago Santos 1911554cff element: set pads need-parent flag to false when removing
When a pad is added the need-parent flag is set to true, so when
they are removed the flag should be set back to false

This was preventing GstPads to be reused in elements (removed and
later re-added). A unit tests was added to verify that this is
working now.

The use case is tsdemux that has a program-number property and
allows the user to switch programs. In order to do that tsdemux
will remove the pads of the current program and add from the new
ones. The removed pads are kept in the demuxer for later if the
user selects the old program again.
2014-05-29 17:01:20 -03:00
Tim-Philipp Müller ba3073ffce pad: two minor docs fixes 2014-05-27 13:37:05 +01:00
Thiago Santos c6f92562b6 pad: store last flow return and provide acessor function
Stores the last result of a gst_pad_push or a pull on the GstPad and provides
a getter and a macro to access this field.

Whenever the pad is inactive it is set to FLUSHING

API: gst_pad_get_last_flow_return

https://bugzilla.gnome.org/show_bug.cgi?id=709224
2014-05-26 15:29:53 -03:00
Nicolas Dufresne 103a40b6ce bufferpool: Add method and virtuals to set flushing state
Currently there is no other way to unlock a buffer pool other then
stopping it. This may have the effect of freeing all the buffers,
which is too heavy for a seek. This patch add a method to enter and
leave flushing state. As a convenience, flush_start/flush_stop
virtual are added so pool implementation can also unblock their own
internal poll atomically with the rest of the pool.  This is fully
backward compatible with doing stop/start to actually flush the pool
(as being done in GstBaseSrc).

https://bugzilla.gnome.org/show_bug.cgi?id=727611
2014-05-26 13:31:21 -04:00
Tim-Philipp Müller 48b608337b pluginloader: fix compiler warning on windows
gstpluginloader.c:584:1: error: label 'beach' defined but not used

https://bugzilla.gnome.org/show_bug.cgi?id=730125
2014-05-14 13:40:03 +01:00
Edward Hervey c7d68da704 pluginloader: Don't leak pluginloader in error cases
CID #1212154
2014-05-12 17:03:46 +02:00
Edward Hervey 25bcc2d7f6 caps: Don't leak features on error cases
If we fail to parse fields, we would end up leaking the features we
parsed just before

CID #1212152
2014-05-12 16:59:29 +02:00
Nicolas Dufresne 194db480e0 bufferpool: Add an helper to validate config
When we call gst_buffer_pool_set_config() the pool may return FALSE and
slightly change the parameters. This helper is useful to do the minial required
validation before accepting the modified configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=727916
2014-05-08 13:11:14 -04:00
Nicolas Dufresne 43acfbbb86 bufferpool: Update the configure even if set_config() returned false
According to the documentation, when set_config() return false, it should be
possible to read the modified version of the config. This patch fixes the
implementation so it is now according to the documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=727916
2014-05-08 13:08:21 -04:00
Nicolas Dufresne 6079666a71 bufferpool: Add support for reconfiguring a pool
If a pool config is being configured again, check if the configuration have changed.
If not, skip that step. Finally, if the pool is active, try deactivating it.

https://bugzilla.gnome.org/show_bug.cgi?id=728268
2014-05-08 13:08:21 -04:00
Nicolas Dufresne 64aa64cb80 value: Add support for GstAllocationParams comparision
This is useful to compare buffer pool configuaration.

https://bugzilla.gnome.org/show_bug.cgi?id=728268
2014-05-08 13:08:21 -04:00
Nicolas Dufresne 00614e2c2b value: Add support for GObject comparising in structures
This is useful to allow comparing pool configuration where a GstAllocator
is set.

https://bugzilla.gnome.org/show_bug.cgi?id=728268
2014-05-08 13:08:21 -04:00
Tim-Philipp Müller 035bc8b8db plugin: fix case where gst_plugin_load_file() didn't set the error on failure 2014-05-08 17:51:31 +01:00
Wim Taymans 35a1822d7a pads: update docs for request pads
We would like to encourage the use of gst_element_request_pad()
2014-05-08 09:13:04 +02:00
Tim-Philipp Müller 4e1699e030 value: init flag mask more correctly 2014-05-04 14:52:01 +01:00
Sebastian Dröge d2e431e0ff bin: Always first post the state-changed message for PAUSED->READY before posting any pending EOS message
https://bugzilla.gnome.org/show_bug.cgi?id=727949
2014-05-01 20:11:04 +02:00
Stian Selnes 40c8208ad2 bufferpool: fix log message of buffer pointer 2014-05-01 10:03:39 +02:00
Sebastian Dröge 3b331155e1 query: Add boolean to URI query to specify if a redirect is permanent or not 2014-04-28 10:03:15 +02:00
Felipe Ortiz c10663ba3e docs: add docs for various GstPad macros
https://bugzilla.gnome.org/show_bug.cgi?id=723652
2014-04-26 23:14:36 +01:00
Tim-Philipp Müller b2722a45dd Revert "docs: add docs for various GstPad macros"
This reverts commit d17438d5fd.

This commit featured the wrong author, sorry.
2014-04-26 23:12:13 +01: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
Nicolas Dufresne ec69ad4e8a buffer: Only set TAG_MEMORY if the memory has been replaced
Currently we set TAG_MEMORY as soon a resize changes the size of one
of the memory. This has the side effect that buffer pool cannot know if
the memory have simply been resized, or if the memorys has been replaced.
This make it hard to actually implement _reset(). Instead, only set the
TAG_MEMORY if one or more memory has been replaced, and do a light
sanity check of the size.

https://bugzilla.gnome.org/show_bug.cgi?id=727109
2014-04-26 15:03:04 -04:00
Showayb Zahda d17438d5fd docs: add docs for various GstPad macros
https://bugzilla.gnome.org/show_bug.cgi?id=723652
2014-04-26 17:05:41 +01:00
Sebastian Dröge b76d336549 bin: When going to READY make sure to always deactivate pads
We might not have reached PAUSED yet because of an async error,
but nonetheless we want to make sure that the pads are always
deactivated in READY state.
2014-04-25 15:38:39 +02:00
Sebastian Dröge ce8752c5ce bin: Don't left-shift into the sign bit, the result is undefined 2014-04-22 18:23:15 +02:00
Sebastian Dröge 3cbcfa1d7e value: Use an unsigned 64 bit integer as a mask
We shift the mask to the right later and shifting the result
of shifting over the sign bit is undefined.
2014-04-22 18:16:10 +02:00
Edward Hervey 8b51e9dc60 gstvalue: Prevent division or modulo by zero
The step can end up being zero if the underlying value isn't a valid
range GValue.

In those cases, return FALSE.

We don't use g_return*_if_fail since it will already have been triggered
by the above-mentionned _get_step() functions.

CID #1037132
2014-04-17 13:20:45 +02:00
Antoine Jacoutot 3e24bbefba libs: g-ir-scanner: do not hardcode libtool path
https://bugzilla.gnome.org/show_bug.cgi?id=726571
2014-04-17 09:26:20 +01:00
Sebastian Dröge 81f9a22228 memory/buffer: Initialise GstMapInfo to zeroes if mapping fails
This should allow for more meaningful errors. Dereferencing NULL
is more useful information than dereferencing a random address
happened to be on the stack.
2014-04-16 19:49:56 +02:00
Sebastian Dröge dded0a4bb6 preset: Unref return value of gst_child_proxy_get_child_by_index() instead of leaking it 2014-04-16 17:49:40 +02:00
Sebastian Dröge 552864332b preset: Automatic code style fixes 2014-04-16 17:49:40 +02:00
Sebastian Dröge dabb959747 pad: Add missing space in debug output 2014-04-15 21:16:06 +02:00
Linus Svensson cb554772e5 pad: don't access unowned and possibly already freed event
Don't print the name of the event when ownership is given away.

https://bugzilla.gnome.org/show_bug.cgi?id=727484
2014-04-12 11:44:36 +01:00
Edward Hervey c7295cf4b9 gstbuffer: Fix range iteration
We want to iterate over items idx to idx + length

We use the len variable as the corrected number of memory to iterate
and then properly go over all items.

Fixes the issue where specifying any idx different from 0 had no effect

Spotted by clang static analyzer
2014-04-11 13:45:21 +02:00
Vincent Penquerc'h 876af7b343 structure: error out when trying to fixate a fraction near an invalid target 2014-04-10 09:47:59 +01:00
Sebastian Dröge 1492465b89 event: Update running time in QoS based on the pad offsets
https://bugzilla.gnome.org/show_bug.cgi?id=722697
2014-04-10 08:25:50 +02:00
Sebastian Dröge 42cbb7c7c7 pad: Apply pad offsets on all events, not just segment events 2014-04-10 08:25:50 +02:00
Sebastian Dröge d445027ec1 event: Add running-time-offset field to all events
Events passing through #GstPads that have a running time
offset set via gst_pad_set_offset() will get their offset
adjusted according to the pad's offset.

If the event contains any information that related to the
running time, this information will need to be updated
before usage with this offset.
2014-04-10 08:25:50 +02:00
Vincent Penquerc'h 3004cc5f45 utils: avoid dividing by zero when multiplying y/z by 0/x
The gcd of 0/x is 0, and this is then used as a denominator.
2014-04-09 16:41:47 +01:00
Sebastian Dröge 191ca95fd9 parse: Don't dist the bison and flex generated headers
https://bugzilla.gnome.org/show_bug.cgi?id=727253
2014-04-07 11:36:58 +02:00
Sebastian Rasmussen e1e5183181 debugutils: Handle caps field values being NULL
GST_DEBUG_BIN_TO_DOT_FILE() would cause a segfault whenever it encountered an
element's caps that had a field value being NULL. Such fields are successfully
handled e.g. by GST_*_OBJECT(), and with this patch so does
GST_DEBUG_BIN_TO_DOT_FILE(). Even if string fields with a NULL value are
not supposed to be valid in caps, such caps can be created.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727701
2014-04-06 14:24:21 +01:00
Edward Hervey 470f194909 gstvalue: Prevent division or modulo by zero
The step can end up being zero if the underlying value isn't a valid
range GValue.

In those cases, return FALSE.

We don't use g_return*_if_fail since it will already have been triggered
by the above-mentionned _get_step() functions.

Spotted by Coverity.
2014-04-05 11:37:53 +02:00
Haakon Sporsheim e3388c22c2 gstvalue: Fix comparison of int/int64 range
Checking step three times seems unnecessary.
A similar bug was fixed for double range in
commit 3ea6b04c10
2014-04-05 07:03:07 +02:00
Sebastian Dröge 04a204cd4c pad: Include event type in debug output when delaying a sticky event because of not-linked 2014-03-29 10:32:25 +01:00
Wim Taymans ee348fe7cb buffer: don't clear TAG on NULL buffer
When the buffer fails to copy, don't clear the TAG on the NULL pointer.
2014-03-24 16:11:30 +01:00
Wim Taymans 533548529b gst: init new flag types to pass make check 2014-03-21 12:16:54 +01:00
Edward Hervey fb9ca6f7b4 devicemonitor: Use local includes and use gst_private before anything
Should fix build issues on BSD
2014-03-17 10:00:00 +01:00
Olivier Crête e743fac26b device: Add "klass" to GstDevices 2014-03-16 18:15:18 -04:00
Olivier Crête b8078e2656 devicemonitor: Make classes into pure strings
Instead of having strings & flags, make them just strings
2014-03-16 18:15:18 -04:00
Jan Schmidt 4d7d3a1c02 Fix extended message handling with gst_bus_pop_timed_filtered()
Make sure extended message types don't get accidentally matched
when not asked for in the mask
2014-03-17 06:29:27 +11:00
Jan Schmidt 44f0be4ee6 gstbin: Avoid pointless object lock forwarding messages.
Every instance of calling bin_do_message_forward() first took the
object lock, so that bin_do_message_forward() could drop it and
then reclaim. Instead, only take the object lock afterward where
needed.
2014-03-17 05:36:37 +11:00