..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.
..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.
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.
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
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
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.
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.
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
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.
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.
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
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).
This patch adds gst_caps_set_value() and allows gst_caps_set_simple() to
work on non-simple caps. See the API documentation for the functions
about what they do.
The intention of these changes is to ease working with caps in caps
transform functions. An example for this would be ffmpegcolorspace,
where the caps transform function could be changed to look roughly like
this (pseudocode ahead):
result = gst_caps_copy (template_caps);
value = gst_structure_get_value (gst_caps_get_structure (caps, 0),
"widh");
gst_caps_set_value (result, value);
/* same for height, framerate and par */
return caps;
which is much cleaner and easier to understand than the current code.
https://bugzilla.gnome.org/show_bug.cgi?id=597690
Often we don't need the result of the intersection. Add a variant that only
tries to intersect. It can break out earlier and does less GValue copying.
API: gst_caps_can_intersect()