Commit graph

169 commits

Author SHA1 Message Date
Wim Taymans
7b43f02ed3 structure: fix some more 0.11 fixmes
don't allow spaces in structure names and fix unit tests.
2011-06-03 13:25:54 +02:00
Wim Taymans
04323a0bb9 structure: fix a FIXME 2011-06-02 15:38:29 +02:00
Wim Taymans
272b3263aa Merge branch 'master' into 0.11
Conflicts:
	plugins/elements/gstoutputselector.c
2011-06-01 19:47:10 +02:00
Sebastian Dröge
0a80b57d74 value: Consider "1" and "{1}" as equal in gst_value_compare()
Previously this was only done in the is_subset() check but
having it only there brings us into definition-hell where
"1" and "{1}" are subset of each other but not equal.
2011-05-30 11:33:57 +02:00
Sebastian Dröge
58302cedfa Merge branch 'master' into 0.11 2011-05-30 07:41:13 +02:00
Sebastian Dröge
f304196148 caps: Fix subset check for equivalent lists and scalar values
For example "{ 1 }" and "1" are not strictly equal but
both are a subset of each other. Also add a unit test
for this.
2011-05-30 07:38:40 +02:00
Sebastian Dröge
30a7fd7b4d Merge branch 'master' into 0.11 2011-05-27 13:58:26 +02:00
Sebastian Dröge
da58834884 structure: Add gst_structure_is_subset()
API: gst_structure_is_subset()
2011-05-27 13:47:11 +02:00
Sebastian Dröge
007b16b024 Merge branch 'master' into 0.11 2011-05-26 13:36:48 +02:00
Tim-Philipp Müller
8a3721a1ca gst: we can now use GLib 2.24 API unconditionally 2011-05-25 16:02:10 +01:00
Sebastian Dröge
077cf48689 structure: Fix compilation 2011-05-17 11:22:58 +02:00
Sebastian Dröge
e34c26b509 Merge branch 'master' into 0.11
Conflicts:
	win32/common/libgstreamer.def
2011-05-17 09:43:21 +02:00
Sebastian Dröge
b4dea3a1d3 structure: Make both parameters to gst_structure_is_equal() const 2011-05-17 09:35:54 +02:00
Sebastian Dröge
53ef31718d structure: Update Since markers to the correct version 2011-05-17 09:33:47 +02:00
Sebastian Dröge
a08a17dfbd structure: Add gst_structure_intersect()
API: gst_structure_intersect()
2011-05-17 09:33:04 +02:00
Edward Hervey
64725facb5 gststructure: Add gst_structure_can_intersect API
Allows checking if two structures can intersect without having to
go through GstCaps

API: gst_structure_can_intersect

https://bugzilla.gnome.org/show_bug.cgi?id=629300
2011-05-17 09:28:06 +02:00
Edward Hervey
ae46eb3a38 gstructure: New API: gst_structure_is_equal
Allows checking equality of GstStructure without having to create
intermediary GstCaps.

API: gst_structure_is_equal

https://bugzilla.gnome.org/show_bug.cgi?id=629300
2011-05-17 09:28:00 +02:00
Wim Taymans
9597545d23 structure: more cleanups
gst_structure_get_type() -> _gst_structure_type to avoid method calls for
getting the GType that initialized at the start.
Hide some structure fields in private data so that we can change the
implementation.
Move structure equality check from caps.c to structure.c where it belongs.
2011-05-11 18:17:45 +02:00
Sebastian Dröge
bf6c3ea6df gst: Add some more gobject-introspection annotations 2011-04-14 16:14:01 +02:00
Sebastian Dröge
5860734aaf structure: Add date as a type abbreviation of GDate
See bug #646696.
2011-04-05 14:37:55 +02:00
Sebastian Dröge
eba33c1de1 structure: Don't allow invalid GDates in all structures and don't allow NULL GDates in taglists
Some code (e.g. gstvorbistag.c) assumes non-NULL GDates in taglists and
explodes otherwise and NULL or invalid GDates don't make much sense anyway.
2011-04-04 10:18:14 +02:00
Stefan Kost
d963503b26 structure: gst_structure_empty_new() does better error checking
No need to check for media_type!=NULL as the function we call that actual create
the structure does a full check anyway.
2011-03-08 10:07:17 +02:00
Stefan Kost
4d9e645551 caps,structure: trim trailing whitespace 2011-03-08 10:07:03 +02:00
Mart Raudsepp
e7569342b1 docs: add missing "Since: 0.10.31" marker for gst_structure_get_date_time() 2011-01-24 14:38:15 +00: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
Edward Hervey
6aa8ca37ee micro-optim: if (x) is cheaper than if (x > 0) for unsigned integers 2010-12-03 12:03:42 +01:00
Tim-Philipp Müller
608628d10d structure: micro-optimisation for some setter functions
Split out functions that do the actual work, so we avoid doing
the same g_return_if_fail() checks multiple times for each call.
2010-09-16 19:40:15 +01:00
Tim-Philipp Müller
7e5a9580ef structure: add gst_structure_{id_}take_value()
Add _set_value() variants that take ownership of the value passed
instead of making a copy of the value. This is useful for setting
values to things that aren't refcounted (e.g. GValueArrays or
strings or string arrays, etc.).

API: gst_structure_take_value()
API: gst_structure_id_take_value()

https://bugzilla.gnome.org/show_bug.cgi?id=629831
2010-09-16 19:39:58 +01:00
Philippe Normand
b2e6379be8 gstvalue: Add new GstInt64Range type
new GstInt64Range to store gint64 ranges.

API: GST_TYPE_INT64_RANGE
API: gst_value_set_int64_range
API: gst_value_get_int64_range_min
API: gst_value_get_int64_range_max

Fixes bug #627826.
2010-09-01 11:07:37 +02:00
Thiago Santos
f2c18c6c98 gststructure: Adds datetime getter function
Adds gst_structure_get_date_time function

API: gst_structure_get_date_time

Fixes #594504
2010-07-26 11:57:52 -03:00
Thiago Santos
b4870282cb gstvalue: Adds datetime functions
Adds a datetime functions to gstvalue

Fixes #594504
2010-07-26 11:57:50 -03:00
Sebastian Dröge
88ec06f433 structure: Use a const GstStructure * as parameter for some more gst_structure_get variants 2010-07-16 17:33:38 +02:00
Sebastian Dröge
e35fe4ef9c structure: API: Add gst_structure_fixate_field_string() 2010-05-22 10:01:44 +02:00
Tim-Philipp Müller
24ce15bca7 structure: log what structure string we failed to parse 2010-04-14 23:53:26 +01:00
Sebastian Dröge
e305e49ef4 structure: Make structure abbreviations array one-time initialization threadsafe 2010-03-28 19:49:00 +02:00
Tim-Philipp Müller
0aa584917a structure: add mapping for (uint) to allow deserialisation of unsigned integers
Unsigned ints are used in taglists, would be nice to be able to
deserialise them, esp. in connection with the taginject API.
2010-03-23 19:23:22 +00:00
Mart Raudsepp
db949f66e0 docs: fix since tag for gst_structure_id_has_field_typed()
gst_structure_id_has_field_typed was added in 0.10.26, not 0.10.16.
Apparent typo in commit f9e3b72f when the API was added.
2010-03-17 11:03:15 +00:00
Tim-Philipp Müller
235910e227 gst: use #if GLIB_CHECK_VERSION instead of #ifndef GLIBMACRO
for better greppability at the time we bump GLib version requirements.
2010-03-17 11:03:15 +00:00
Edward Hervey
bbe26d36ba gst: Use G_VALUE_COLLECT_INIT if available
This brings total call speedups between 5% and 25%.
gst_caps_set_simple_valist: +5%
gst_structure_set_valist: + 10%
gst_structure_id_set_valist: +25%
gst_tag_list_add_valist: +5%

Measured using valgrind when run over the discovery of 200 media files.

Fixes #610256
2010-03-12 10:01:47 +01:00
Benjamin Otte
a9d1a493a7 Fixes for -Wwrite-strings
This changes some APIs in compatible ways:
- Some functions now take "const char *" arguments, not "char *"
- Some structs now have "conts char *" members, not "char *"
The changes may cause warnings when compiling with the right warning
flags. You've been warned.

Also adds -Wwrite-strings as a warning flag in configure.ac.

https://bugzilla.gnome.org/show_bug.cgi?id=611692
2010-03-10 20:50:10 +01:00
Tim-Philipp Müller
51a462853a structure: remove superfluous guard against NULL
All callers of this static function already check for NULL-ness
themselves, so no need to do it again (and if we do it, we should
probably do so before dereferencing the pointer for the first time).
2010-01-16 19:44:35 +00:00
Tim-Philipp Müller
4cdf375b1a structure: micro-optimise some getters
Avoid checking the GType of the value twice (once on our side and
once in g_value_get_*()) by by-passing g_value_get() and accessing
the GValue structure directly.
2010-01-16 19:37:46 +00:00
Stefan Kost
23da3639f0 docs: fix xrefs in docs
Fix typos in xrefs, links to non existing functions and rework plural forms.
2009-11-25 16:59:50 +02:00
Tim-Philipp Müller
ab5f2f4f5d Revert "structure: don't check type twice"
This reverts commit f864187bf5.

Reverting this as it changes behaviour and the documentation is
ambiguous about whether the caller must check the type first or
not (call must check type vs. returns NULL if not a string). If
GLib has been compiled with G_DISABLE_CHECKS then g_value_get_string()
may return complete garbage even if the value does not contain
a string. Better play it safe, esp. since the extra check is just
an integer comparison. For fundamental types we could return values
from the GValue structure directly if we really wanted to bypass
the extra check.
2009-11-18 09:22:57 +00:00
Stefan Kost
f864187bf5 structure: don't check type twice 2009-11-18 10:12:13 +02:00
Stefan Kost
da9b082808 structure: remove some blank lines (previous gst-indent failure) 2009-11-17 09:40:12 +02:00
Stefan Kost
94f6eced23 structure: use local variable earlier 2009-11-17 09:40:12 +02:00
Stefan Kost
7bd9299f3e structure: don't check enum types twice.
G_VALUE_HOLDS_ENUM(value) is defined as G_TYPE_CHECK_VALUE_TYPE (value,
 G_TYPE_ENUM). Just check for the right enum-type right away.
2009-11-17 09:40:12 +02:00
Stefan Kost
c84d17bcaf debug: add more debug logging to help tracking parsing errors 2009-11-13 15:46:40 +02:00