Commit graph

254 commits

Author SHA1 Message Date
Tim-Philipp Müller 16dcd5e958 docs: fix Since: markers for API added after 0.10.35 2011-11-08 00:32:36 +00:00
Vincent Penquerc'h 9121a30f9a gstcaps: remove unneeded use of gint64
https://bugzilla.gnome.org/show_bug.cgi?id=662777
2011-11-07 15:17:35 +00:00
Sjoerd Simons 57074fc025 caps: Add gst_caps_is_strictly_equal 2011-11-04 17:49:55 +00:00
Thiago Santos 27ce89812a caps: No need to require writable caps for _append/_merge second caps
The second caps ownership is transfered, no need to require it to
be writable from the caller function. Instead, _append and _merge
make it writable on their own.

Discovered because of an assertion on encoding-profile.c in
_get_input_caps using _merge but not passing writable caps.
2011-10-21 10:23:04 -03:00
Fabrizio (Misto) Milo 7be3899653 caps: use g_value_take_string() and gst_value_get_caps() instead of accessing internal fields 2011-09-19 09:50:11 +02:00
Tim-Philipp Müller 98ee2979d1 caps: move log messages for caps creation/freeing into TRACE category
Reduce SPAM for GST_CAPS:5.
2011-09-10 18:24:49 +01:00
Piotr Fusik 14f5518f3d docs, gst: typo fixes
https://bugzilla.gnome.org/show_bug.cgi?id=658449
2011-09-07 18:03:17 +01:00
Tim-Philipp Müller 4985d2a954 caps: fix compiler warning reported by ICC
The MAX macro expands to code that checks if an unsigned integer is < 0.

Fixes warning #186: pointless comparison of unsigned integer reported by ICC.

https://bugzilla.gnome.org/show_bug.cgi?id=656265
2011-08-15 21:15:29 +01:00
Josep Torra d99d270a69 caps: define GST_CAPS_FLAGS_NONE for consistency with other enumerations
Use them to fix warnings when building with ICC.

API: GST_CAPS_FLAGS_NONE

https://bugzilla.gnome.org/show_bug.cgi?id=656265
2011-08-15 21:13:29 +01:00
Sebastian Dröge 57df188757 caps: Add gst_caps_is_subset_structure()
API: gst_caps_is_subset_structure()

This allows to check if a structure is a subset of given
caps without allocating a new caps instance for it.
2011-05-27 13:55:31 +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 d98e9acb0f caps: Optimize gst_caps_is_subset()
..and as a result gst_caps_is_equal() and others.

This now only checks if for every subset structure there is
a superset structure in the superset caps. Previously we were
subtracting one from another, creating completely new caps
and then even simplified them.

The new implemention now is about 1.27 times faster and doesn't
break the -base unit tests are anything anymore.
2011-05-27 13:38:51 +02:00
Sebastian Dröge 0cf2dfd0ba caps: Fix subset check in gst_caps_merge()
Caps A are a subset of caps B even if caps B doesn't
have all fields of caps A.

Also add a unit test for this.
2011-05-27 13:37:06 +02:00
Sebastian Dröge d706ca0859 Revert "caps: Optimize gst_caps_is_subset()"
This reverts commit 32248a9b85.

This breaks some tests in -base and the failures should
be fixed first.
2011-05-27 12:56:43 +02:00
Sebastian Dröge 32248a9b85 caps: Optimize gst_caps_is_subset()
..and as a result gst_caps_is_equal() and others.

This now only checks if for every subset structure there is
a superset structure in the superset caps. Previously we were
subtracting one from another, creating completely new caps
and then even simplified them.

The new implemention now is about 1.27 times faster.
2011-05-27 12:45:59 +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 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
Sebastian Dröge 6e57ce32e5 caps: Merge structures when intersecting instead of appending them
This prevents adding duplicates over and over again to the resulting
caps if they already describe the new intersection result.

While this changes intersection from O(n*m) to O(n^2*m), it results in
smaller caps, which in the end will decrease further processing times.

For example in an audioconvert ! audioconvert ! audioconvert pipeline,
when forwarding the downstream caps preference in basetransform
(see e26da72de25a91c3eaad9f7c8b2f53ba888a0394) this results in
16 instead of 191 caps structures.
2011-05-14 11:39:34 +02:00
Edward Hervey 09d83e589a gstcaps: new API : gst_caps_intersect_full
Just like gst_caps_intersect, but adds a new parameter 'mode'
that allows selecting the intersection algorithm to use.

Currently we have GST_CAPS_INTERSECT_MODE_ZIG_ZAG (default) and
GST_CAPS_INTERSECT_MODE_FIRST.

API: gst_caps_intersect_full
API: GstCapsIntersectMode
API: GST_CAPS_INTERSECT_MODE_ZIG_ZAG
API: GST_CAPS_INTERSECT_MODE_FIRST

https://bugzilla.gnome.org/show_bug.cgi?id=617045
2011-03-24 11:14:18 -03:00
Stefan Kost 4d9e645551 caps,structure: trim trailing whitespace 2011-03-08 10:07:03 +02:00
Jonathan Matthew 2bbfa3304c caps: don't create broken caps for invalid media types
Check if structure has been created before appending it to the caps. Free the
caps in the case of an error to not conceal it be returning empty caps.

Fixes #642271
2011-03-08 10:06:12 +02: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
Mark Nauwelaerts efe3c70450 caps: fix doc typo 2010-12-03 13:35:38 +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
Wim Taymans d36903c1c2 caps: improve some comments about the zigzag intersection 2010-12-02 19:10:44 +01:00
Stefan Kost 8ef7e46d24 docs: fix warnings pointed out by gtk-doc 2010-09-13 11:18:25 +03:00
Tim-Philipp Müller bf2bdba6b3 caps: simplify code a bit
No need to call g_slist_length() here.
2010-09-08 18:51:09 +01:00
Edward Hervey 70d1f1f177 gstcaps: Make sure _normalize() is applied on all structures.
We need to use gst_caps_get_size() in the loop counter since some
structures could be added while iterating.

Fixes #623301
2010-07-01 18:17:40 +02:00
Tim-Philipp Müller 71f3a6f0f7 Don't include <libxml/parser.h> from public headers if GST_DISABLE_DEPRECATED is defined
Since everything GstXML related has been deprecated, we can now skip the
libxml includes from the public headers when GST_DISABLE_DEPRECATED is
defined.

See #463435.
2010-06-26 10:35:38 +01:00
Sebastian Dröge 5f4a965f67 gstxml: Deprecate GstXml and related functions
Pipeline serialisation to and from XML is horribly broken for all
but the most simple use cases, and will likely never be fixed.
Make sure everyone playing around with these tools is aware of
this, to avoid frustration. See countless bug reports in bugzilla.

Fixes bug #622685.
2010-06-25 18:25:40 +02:00
Tim-Philipp Müller 6edfcc3705 docs: add Since: tag for new gst_caps_steal_structure 2010-06-14 12:28:57 +01:00
Edward Hervey 32adac81ee gstcaps: New gst_caps_steal_structure() method
This allows removing structures from caps without them being freed. Helpful when
plugins need to move around structures without having to do an expensive structure
copy.

API:gst_caps_steal_structure

https://bugzilla.gnome.org/show_bug.cgi?id=621527
2010-06-14 13:16:18 +02:00
Stefan Kost 2d2ec4e3d5 caps: use gst_caps_append_structure_unchecked() macro once more 2010-06-08 12:19:49 +03:00
Stefan Kost c5f85a1cda caps: use a safer name for temporary var. to not shadow one from outer scope 2010-06-08 12:19:22 +03:00
Tim-Philipp Müller 66fc4c8ba2 info: add new TRACE log level and move refcounting there from LOG level
This makes it possible to easily get a *:5 debug log without all
the refcounting noise, and drastically reduces the number of lines
output for a normal log (46m to 28m for a 20min video). The full log
including refcounting information can still be gotten using *:7.

Fixes #620460.
2010-06-05 12:53:15 +01:00
Stefan Kost ccaadae492 caps: use our macros more often in the code 2010-05-22 23:26:16 +03:00
Stefan Kost bd7a34bfa1 caps: add append_structure_unchecked
This is useful when we know that caps is !NULL, writable and structure is
!NULL too.
2010-05-22 23:14:48 +03:00
Stefan Kost 999a6235c0 caps: use our macos more 2010-05-22 22:44:02 +03:00
Stefan Kost e8c2c40b21 caps: comment and whitespace cleanup
Make comment more specific, reposition it and add more of the kind.
Move one ifdef'ed function around.
2010-05-14 11:54:56 +03: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
Stefan Kost 1ca450ba5c caps: move the check to the public api.
This avoids creating empty caps and destroying them in the case of an error. We
also avoid double checking in other code path where we call the internal api.
2010-03-15 11:17:22 +02:00
Stefan Kost 43a4763491 caps: this is internal API where we need to ensure !NULL higher up 2010-03-15 11:17:22 +02: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
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
Edward Hervey e5a13bd3fc gstcaps: Use inlined version of _is_any()/_is_empty()
CAPS_IS_ANY and CAPS_IS_EMPTY are the equivalent of their gst_caps_*
counterpart except that they avoid the typechecking and are inlined.

CAPS_IS_EMPTY_SIMPLE only checks for empty caps (without checking if
the caps is ANY).
2009-10-23 17:47:43 +02:00
Benjamin Otte 868711fc70 docs: Fix docs for gst_caps_set_simple() 2009-10-20 10:51:25 +01:00
Jan Schmidt 08c56edb84 docs: Modify docs string slightly.
Apparently starting the last line of a docs string with 'returns' both
confuses and enrages gtk-doc. Use a slightly different wording instead.
2009-10-19 13:02:30 +01:00