Commit graph

7491 commits

Author SHA1 Message Date
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