2003-11-11 19:14:14 +00:00
|
|
|
/* GStreamer
|
2004-03-12 18:25:07 +00:00
|
|
|
* Copyright (C) 2003 David A. Schleef <ds@schleef.org>
|
2003-11-11 19:14:14 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 20:44:48 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2003-11-11 19:14:14 +00:00
|
|
|
*/
|
|
|
|
|
2003-12-22 01:39:35 +00:00
|
|
|
#ifndef __GST_CAPS_H__
|
|
|
|
#define __GST_CAPS_H__
|
2003-11-11 19:14:14 +00:00
|
|
|
|
|
|
|
#include <gst/gstconfig.h>
|
2009-12-04 21:32:38 +00:00
|
|
|
#include <gst/gstminiobject.h>
|
2003-11-11 19:14:14 +00:00
|
|
|
#include <gst/gststructure.h>
|
2013-03-30 14:35:19 +00:00
|
|
|
#include <gst/gstcapsfeatures.h>
|
2005-11-21 19:58:23 +00:00
|
|
|
#include <gst/glib-compat.h>
|
2003-11-11 19:14:14 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API GType _gst_caps_type;
|
2010-11-02 12:31:25 +00:00
|
|
|
|
|
|
|
#define GST_TYPE_CAPS (_gst_caps_type)
|
2011-05-10 10:29:06 +00:00
|
|
|
#define GST_IS_CAPS(obj) (GST_IS_MINI_OBJECT_TYPE((obj), GST_TYPE_CAPS))
|
|
|
|
#define GST_CAPS_CAST(obj) ((GstCaps*)(obj))
|
|
|
|
#define GST_CAPS(obj) (GST_CAPS_CAST(obj))
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2005-12-20 11:12:53 +00:00
|
|
|
#define GST_TYPE_STATIC_CAPS (gst_static_caps_get_type())
|
|
|
|
|
2005-08-27 10:57:00 +00:00
|
|
|
/**
|
2005-11-20 13:28:11 +00:00
|
|
|
* GstCapsFlags:
|
2011-11-28 13:24:16 +00:00
|
|
|
* @GST_CAPS_FLAG_ANY: Caps has no specific content, but can contain
|
2005-11-20 13:28:11 +00:00
|
|
|
* anything.
|
2005-08-27 10:57:00 +00:00
|
|
|
*
|
2005-11-20 13:28:11 +00:00
|
|
|
* Extra flags for a caps.
|
2005-08-27 10:57:00 +00:00
|
|
|
*/
|
2005-11-20 13:28:11 +00:00
|
|
|
typedef enum {
|
2011-11-28 13:24:16 +00:00
|
|
|
GST_CAPS_FLAG_ANY = (GST_MINI_OBJECT_FLAG_LAST << 0)
|
2005-11-20 13:28:11 +00:00
|
|
|
} GstCapsFlags;
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2011-02-25 11:50:12 +00:00
|
|
|
/**
|
|
|
|
* GstCapsIntersectMode:
|
|
|
|
* @GST_CAPS_INTERSECT_ZIG_ZAG : Zig-zags over both caps.
|
|
|
|
* @GST_CAPS_INTERSECT_FIRST : Keeps the first caps order.
|
|
|
|
*
|
|
|
|
* Modes of caps intersection
|
2011-05-02 12:52:58 +00:00
|
|
|
*
|
|
|
|
* @GST_CAPS_INTERSECT_ZIG_ZAG tries to preserve overall order of both caps
|
2011-02-25 11:50:12 +00:00
|
|
|
* by iterating on the caps' structures as the following matrix shows:
|
2011-05-02 12:52:58 +00:00
|
|
|
* |[
|
2011-02-25 11:50:12 +00:00
|
|
|
* caps1
|
|
|
|
* +-------------
|
|
|
|
* | 1 2 4 7
|
|
|
|
* caps2 | 3 5 8 10
|
|
|
|
* | 6 9 11 12
|
2011-05-02 12:52:58 +00:00
|
|
|
* ]|
|
2011-02-25 11:50:12 +00:00
|
|
|
* Used when there is no explicit precedence of one caps over the other. e.g.
|
|
|
|
* tee's sink pad getcaps function, it will probe its src pad peers' for their
|
|
|
|
* caps and intersect them with this mode.
|
|
|
|
*
|
2011-05-02 12:52:58 +00:00
|
|
|
* @GST_CAPS_INTERSECT_FIRST is useful when an element wants to preserve
|
2011-02-25 11:50:12 +00:00
|
|
|
* another element's caps priority order when intersecting with its own caps.
|
|
|
|
* Example: If caps1 is [A, B, C] and caps2 is [E, B, D, A], the result
|
|
|
|
* would be [A, B], maintaining the first caps priority on the intersection.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
GST_CAPS_INTERSECT_ZIG_ZAG = 0,
|
|
|
|
GST_CAPS_INTERSECT_FIRST = 1
|
|
|
|
} GstCapsIntersectMode;
|
|
|
|
|
2005-08-27 10:57:00 +00:00
|
|
|
/**
|
|
|
|
* GST_CAPS_ANY:
|
|
|
|
*
|
|
|
|
* Means that the element/pad can output 'anything'. Useful for elements
|
2011-12-20 12:14:07 +00:00
|
|
|
* that output unknown media, such as filesrc. This macro returns a singleton and
|
|
|
|
* should not be unreffed.
|
2005-08-27 10:57:00 +00:00
|
|
|
*/
|
2011-12-20 12:14:07 +00:00
|
|
|
#define GST_CAPS_ANY _gst_caps_any
|
2005-08-27 10:57:00 +00:00
|
|
|
/**
|
|
|
|
* GST_CAPS_NONE:
|
|
|
|
*
|
|
|
|
* The opposite of %GST_CAPS_ANY: it means that the pad/element outputs an
|
2011-12-20 12:14:07 +00:00
|
|
|
* undefined media type that can not be detected. This macro returns a singleton
|
|
|
|
* and should not be unreffed.
|
2005-08-27 10:57:00 +00:00
|
|
|
*/
|
2011-12-21 10:08:34 +00:00
|
|
|
#define GST_CAPS_NONE _gst_caps_none
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2005-08-27 10:57:00 +00:00
|
|
|
/**
|
|
|
|
* GST_STATIC_CAPS_ANY:
|
|
|
|
*
|
2005-09-11 12:57:36 +00:00
|
|
|
* Creates a new #GstCaps static caps that matches anything.
|
|
|
|
* This can be used in pad templates.
|
2005-08-27 10:57:00 +00:00
|
|
|
*/
|
2004-03-12 18:25:07 +00:00
|
|
|
#define GST_STATIC_CAPS_ANY GST_STATIC_CAPS("ANY")
|
2005-08-27 10:57:00 +00:00
|
|
|
/**
|
|
|
|
* GST_STATIC_CAPS_NONE:
|
|
|
|
*
|
2005-09-11 12:57:36 +00:00
|
|
|
* Creates a new #GstCaps static caps that matches nothing.
|
|
|
|
* This can be used in pad templates.
|
2005-08-27 10:57:00 +00:00
|
|
|
*/
|
2004-03-12 18:25:07 +00:00
|
|
|
#define GST_STATIC_CAPS_NONE GST_STATIC_CAPS("NONE")
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2005-08-27 10:57:00 +00:00
|
|
|
/**
|
|
|
|
* GST_CAPS_IS_SIMPLE:
|
|
|
|
* @caps: the #GstCaps instance to check
|
|
|
|
*
|
2005-09-11 12:57:36 +00:00
|
|
|
* Convenience macro that checks if the number of structures in the given caps
|
2005-08-27 10:57:00 +00:00
|
|
|
* is exactly one.
|
|
|
|
*/
|
2004-03-12 18:25:07 +00:00
|
|
|
#define GST_CAPS_IS_SIMPLE(caps) (gst_caps_get_size(caps) == 1)
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2005-08-27 10:57:00 +00:00
|
|
|
/**
|
|
|
|
* GST_STATIC_CAPS:
|
2005-09-11 12:57:36 +00:00
|
|
|
* @string: the string describing the caps
|
2005-08-27 10:57:00 +00:00
|
|
|
*
|
2005-09-11 12:57:36 +00:00
|
|
|
* Creates a new #GstCaps static caps from an input string.
|
|
|
|
* This can be used in pad templates.
|
2005-08-27 10:57:00 +00:00
|
|
|
*/
|
2004-03-12 18:25:07 +00:00
|
|
|
#define GST_STATIC_CAPS(string) \
|
|
|
|
{ \
|
2012-01-26 13:33:12 +00:00
|
|
|
/* caps */ NULL, \
|
2004-03-12 18:25:07 +00:00
|
|
|
/* string */ string, \
|
2006-09-20 16:17:26 +00:00
|
|
|
GST_PADDING_INIT \
|
2004-03-12 18:25:07 +00:00
|
|
|
}
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2003-12-22 01:39:35 +00:00
|
|
|
typedef struct _GstCaps GstCaps;
|
|
|
|
typedef struct _GstStaticCaps GstStaticCaps;
|
2003-11-11 19:14:14 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API GstCaps * _gst_caps_any;
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API GstCaps * _gst_caps_none;
|
2009-12-02 20:21:48 +00:00
|
|
|
/**
|
|
|
|
* GST_CAPS_FLAGS:
|
|
|
|
* @caps: a #GstCaps.
|
|
|
|
*
|
|
|
|
* A flags word containing #GstCapsFlags flags set on this caps.
|
|
|
|
*/
|
|
|
|
#define GST_CAPS_FLAGS(caps) GST_MINI_OBJECT_FLAGS(caps)
|
|
|
|
|
2005-03-07 18:27:42 +00:00
|
|
|
/* refcount */
|
2005-11-04 20:12:01 +00:00
|
|
|
/**
|
|
|
|
* GST_CAPS_REFCOUNT:
|
|
|
|
* @caps: a #GstCaps
|
|
|
|
*
|
|
|
|
* Get access to the reference count field of the caps
|
|
|
|
*/
|
2009-12-02 20:21:48 +00:00
|
|
|
#define GST_CAPS_REFCOUNT(caps) GST_MINI_OBJECT_REFCOUNT(caps)
|
2005-11-04 20:12:01 +00:00
|
|
|
/**
|
|
|
|
* GST_CAPS_REFCOUNT_VALUE:
|
|
|
|
* @caps: a #GstCaps
|
|
|
|
*
|
|
|
|
* Get the reference count value of the caps.
|
|
|
|
*/
|
2009-12-02 20:21:48 +00:00
|
|
|
#define GST_CAPS_REFCOUNT_VALUE(caps) GST_MINI_OBJECT_REFCOUNT_VALUE(caps)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_CAPS_FLAG_IS_SET:
|
2009-12-03 19:49:30 +00:00
|
|
|
* @caps: a #GstCaps.
|
2011-09-26 18:47:35 +00:00
|
|
|
* @flag: the #GstCapsFlags to check.
|
2009-12-02 20:21:48 +00:00
|
|
|
*
|
|
|
|
* Gives the status of a specific flag on a caps.
|
|
|
|
*/
|
|
|
|
#define GST_CAPS_FLAG_IS_SET(caps,flag) GST_MINI_OBJECT_FLAG_IS_SET (caps, flag)
|
|
|
|
/**
|
|
|
|
* GST_CAPS_FLAG_SET:
|
2009-12-03 19:49:30 +00:00
|
|
|
* @caps: a #GstCaps.
|
2011-09-26 18:47:35 +00:00
|
|
|
* @flag: the #GstCapsFlags to set.
|
2009-12-02 20:21:48 +00:00
|
|
|
*
|
|
|
|
* Sets a caps flag on a caps.
|
|
|
|
*/
|
|
|
|
#define GST_CAPS_FLAG_SET(caps,flag) GST_MINI_OBJECT_FLAG_SET (caps, flag)
|
|
|
|
/**
|
|
|
|
* GST_CAPS_FLAG_UNSET:
|
2009-12-03 19:49:30 +00:00
|
|
|
* @caps: a #GstCaps.
|
2011-09-26 18:47:35 +00:00
|
|
|
* @flag: the #GstCapsFlags to clear.
|
2009-12-02 20:21:48 +00:00
|
|
|
*
|
|
|
|
* Clears a caps flag.
|
|
|
|
*/
|
|
|
|
#define GST_CAPS_FLAG_UNSET(caps,flag) GST_MINI_OBJECT_FLAG_UNSET (caps, flag)
|
2005-03-07 18:27:42 +00:00
|
|
|
|
2009-12-03 19:49:30 +00:00
|
|
|
/* refcounting */
|
|
|
|
/**
|
|
|
|
* gst_caps_ref:
|
|
|
|
* @caps: the #GstCaps to reference
|
|
|
|
*
|
|
|
|
* Add a reference to a #GstCaps object.
|
|
|
|
*
|
|
|
|
* From this point on, until the caller calls gst_caps_unref() or
|
|
|
|
* gst_caps_make_writable(), it is guaranteed that the caps object will not
|
|
|
|
* change. This means its structures won't change, etc. To use a #GstCaps
|
|
|
|
* object, you must always have a refcount on it -- either the one made
|
|
|
|
* implicitly by e.g. gst_caps_new_simple(), or via taking one explicitly with
|
|
|
|
* this function.
|
|
|
|
*
|
|
|
|
* Returns: the same #GstCaps object.
|
|
|
|
*/
|
|
|
|
static inline GstCaps *
|
|
|
|
gst_caps_ref (GstCaps * caps)
|
|
|
|
{
|
|
|
|
return (GstCaps *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (caps));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_caps_unref:
|
|
|
|
* @caps: a #GstCaps.
|
|
|
|
*
|
|
|
|
* Unref a #GstCaps and and free all its structures and the
|
|
|
|
* structures' values when the refcount reaches 0.
|
|
|
|
*/
|
|
|
|
static inline void
|
|
|
|
gst_caps_unref (GstCaps * caps)
|
|
|
|
{
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT_CAST (caps));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* copy caps */
|
|
|
|
/**
|
|
|
|
* gst_caps_copy:
|
|
|
|
* @caps: a #GstCaps.
|
|
|
|
*
|
|
|
|
* Creates a new #GstCaps as a copy of the old @caps. The new caps will have a
|
|
|
|
* refcount of 1, owned by the caller. The structures are copied as well.
|
|
|
|
*
|
|
|
|
* Note that this function is the semantic equivalent of a gst_caps_ref()
|
|
|
|
* followed by a gst_caps_make_writable(). If you only want to hold on to a
|
|
|
|
* reference to the data, you should use gst_caps_ref().
|
|
|
|
*
|
|
|
|
* When you are finished with the caps, call gst_caps_unref() on it.
|
|
|
|
*
|
|
|
|
* Returns: the new #GstCaps
|
|
|
|
*/
|
|
|
|
static inline GstCaps *
|
|
|
|
gst_caps_copy (const GstCaps * caps)
|
|
|
|
{
|
|
|
|
return GST_CAPS (gst_mini_object_copy (GST_MINI_OBJECT_CAST (caps)));
|
|
|
|
}
|
|
|
|
|
2011-06-02 11:18:39 +00:00
|
|
|
/**
|
|
|
|
* gst_caps_is_writable:
|
|
|
|
* @caps: a #GstCaps
|
|
|
|
*
|
|
|
|
* Tests if you can safely modify @caps. It is only safe to modify caps when
|
2012-07-04 14:38:15 +00:00
|
|
|
* there is only one owner of the caps - ie, the object is writable.
|
2011-06-02 11:18:39 +00:00
|
|
|
*/
|
|
|
|
#define gst_caps_is_writable(caps) gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (caps))
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_caps_make_writable:
|
|
|
|
* @caps: (transfer full): a #GstCaps
|
|
|
|
*
|
|
|
|
* Returns a writable copy of @caps.
|
|
|
|
*
|
|
|
|
* If there is only one reference count on @caps, the caller must be the owner,
|
|
|
|
* and so this function will return the caps object unchanged. If on the other
|
|
|
|
* hand there is more than one reference on the object, a new caps object will
|
|
|
|
* be returned. The caller's reference on @caps will be removed, and instead the
|
|
|
|
* caller will own a reference to the returned object.
|
|
|
|
*
|
|
|
|
* In short, this function unrefs the caps in the argument and refs the caps
|
|
|
|
* that it returns. Don't access the argument after calling this function. See
|
|
|
|
* also: gst_caps_ref().
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): a writable caps which may or may not be the
|
|
|
|
* same as @caps
|
|
|
|
*/
|
|
|
|
#define gst_caps_make_writable(caps) GST_CAPS_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (caps)))
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_caps_replace:
|
2014-06-11 23:06:19 +00:00
|
|
|
* @old_caps: (inout) (transfer full) (nullable): pointer to a pointer
|
|
|
|
* to a #GstCaps to be replaced.
|
2011-12-05 09:24:34 +00:00
|
|
|
* @new_caps: (transfer none) (allow-none): pointer to a #GstCaps that will
|
2014-07-05 16:29:29 +00:00
|
|
|
* replace the caps pointed to by @old_caps.
|
2011-06-02 11:18:39 +00:00
|
|
|
*
|
|
|
|
* Modifies a pointer to a #GstCaps to point to a different #GstCaps. The
|
|
|
|
* modification is done atomically (so this is useful for ensuring thread safety
|
|
|
|
* in some cases), and the reference counts are updated appropriately (the old
|
|
|
|
* caps is unreffed, the new is reffed).
|
|
|
|
*
|
2014-07-05 16:29:29 +00:00
|
|
|
* Either @new_caps or the #GstCaps pointed to by @old_caps may be %NULL.
|
2011-12-05 09:24:34 +00:00
|
|
|
*
|
2014-05-29 21:54:34 +00:00
|
|
|
* Returns: %TRUE if @new_caps was different from @old_caps
|
2011-12-05 09:24:34 +00:00
|
|
|
*/
|
|
|
|
static inline gboolean
|
|
|
|
gst_caps_replace (GstCaps **old_caps, GstCaps *new_caps)
|
|
|
|
{
|
|
|
|
return gst_mini_object_replace ((GstMiniObject **) old_caps, (GstMiniObject *) new_caps);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_caps_take:
|
|
|
|
* @old_caps: (inout) (transfer full): pointer to a pointer to a #GstCaps to be
|
|
|
|
* replaced.
|
|
|
|
* @new_caps: (transfer full) (allow-none): pointer to a #GstCaps that will
|
2014-07-05 16:29:29 +00:00
|
|
|
* replace the caps pointed to by @old_caps.
|
2011-12-05 09:24:34 +00:00
|
|
|
*
|
|
|
|
* Modifies a pointer to a #GstCaps to point to a different #GstCaps. This
|
|
|
|
* function is similar to gst_caps_replace() except that it takes ownership
|
|
|
|
* of @new_caps.
|
|
|
|
*
|
2014-05-29 21:54:34 +00:00
|
|
|
* Returns: %TRUE if @new_caps was different from @old_caps
|
2011-06-02 11:18:39 +00:00
|
|
|
*/
|
2011-12-05 09:24:34 +00:00
|
|
|
static inline gboolean
|
|
|
|
gst_caps_take (GstCaps **old_caps, GstCaps *new_caps)
|
|
|
|
{
|
|
|
|
return gst_mini_object_take ((GstMiniObject **) old_caps, (GstMiniObject *) new_caps);
|
|
|
|
}
|
2009-12-03 19:49:30 +00:00
|
|
|
|
2005-11-09 12:01:46 +00:00
|
|
|
/**
|
|
|
|
* GstCaps:
|
2009-11-28 23:21:24 +00:00
|
|
|
* @mini_object: the parent type
|
2005-11-09 12:01:46 +00:00
|
|
|
*
|
|
|
|
* Object describing media types.
|
|
|
|
*/
|
2004-03-15 14:43:35 +00:00
|
|
|
struct _GstCaps {
|
2009-11-28 23:21:24 +00:00
|
|
|
GstMiniObject mini_object;
|
2003-11-11 19:14:14 +00:00
|
|
|
};
|
|
|
|
|
2005-11-09 12:01:46 +00:00
|
|
|
/**
|
|
|
|
* GstStaticCaps:
|
|
|
|
* @caps: the cached #GstCaps
|
|
|
|
* @string: a string describing a caps
|
|
|
|
*
|
|
|
|
* Datastructure to initialize #GstCaps from a string description usually
|
|
|
|
* used in conjunction with GST_STATIC_CAPS() and gst_static_caps_get() to
|
|
|
|
* instantiate a #GstCaps.
|
|
|
|
*/
|
2004-03-15 14:43:35 +00:00
|
|
|
struct _GstStaticCaps {
|
2005-03-07 18:27:42 +00:00
|
|
|
/*< public >*/
|
2012-01-26 13:33:12 +00:00
|
|
|
GstCaps *caps;
|
2003-11-11 19:14:14 +00:00
|
|
|
const char *string;
|
2005-03-07 18:27:42 +00:00
|
|
|
|
|
|
|
/*< private >*/
|
2004-09-26 17:35:08 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
2003-11-11 19:14:14 +00:00
|
|
|
};
|
|
|
|
|
2014-11-07 10:15:09 +00:00
|
|
|
/**
|
|
|
|
* GstCapsForeachFunc:
|
|
|
|
* @features: the #GstCapsFeatures
|
|
|
|
* @structure: the #GstStructure
|
|
|
|
* @user_data: user data
|
|
|
|
*
|
|
|
|
* A function that will be called in gst_caps_foreach(). The function may
|
|
|
|
* not modify @features or @structure.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the foreach operation should continue, %FALSE if
|
|
|
|
* the foreach operation should stop with %FALSE.
|
|
|
|
*
|
|
|
|
* Since: 1.6
|
|
|
|
*/
|
|
|
|
typedef gboolean (*GstCapsForeachFunc) (GstCapsFeatures *features,
|
|
|
|
GstStructure *structure,
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstCapsMapFunc:
|
|
|
|
* @features: the #GstCapsFeatures
|
|
|
|
* @structure: the #GstStructure
|
|
|
|
* @user_data: user data
|
|
|
|
*
|
|
|
|
* A function that will be called in gst_caps_map_in_place(). The function
|
|
|
|
* may modify @features and @structure.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the map operation should continue, %FALSE if
|
|
|
|
* the map operation should stop with %FALSE.
|
|
|
|
*/
|
|
|
|
typedef gboolean (*GstCapsMapFunc) (GstCapsFeatures *features,
|
|
|
|
GstStructure *structure,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2014-12-16 15:31:21 +00:00
|
|
|
/**
|
|
|
|
* GstCapsFilterMapFunc:
|
|
|
|
* @features: the #GstCapsFeatures
|
|
|
|
* @structure: the #GstStructure
|
|
|
|
* @user_data: user data
|
|
|
|
*
|
|
|
|
* A function that will be called in gst_caps_filter_and_map_in_place().
|
|
|
|
* The function may modify @features and @structure, and both will be
|
|
|
|
* removed from the caps if %FALSE is returned.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the features and structure should be preserved,
|
|
|
|
* %FALSE if it should be removed.
|
|
|
|
*/
|
|
|
|
typedef gboolean (*GstCapsFilterMapFunc) (GstCapsFeatures *features,
|
|
|
|
GstStructure *structure,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2014-11-07 10:15:09 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2011-08-29 13:34:30 +00:00
|
|
|
GType gst_caps_get_type (void);
|
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
GstCaps * gst_caps_new_empty (void);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
GstCaps * gst_caps_new_any (void);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2011-11-26 19:44:23 +00:00
|
|
|
GstCaps * gst_caps_new_empty_simple (const char *media_type) G_GNUC_WARN_UNUSED_RESULT;
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
GstCaps * gst_caps_new_simple (const char *media_type,
|
2006-08-28 16:39:20 +00:00
|
|
|
const char *fieldname,
|
2011-11-26 19:44:23 +00:00
|
|
|
...) G_GNUC_NULL_TERMINATED G_GNUC_WARN_UNUSED_RESULT;
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2011-10-27 13:56:24 +00:00
|
|
|
GstCaps * gst_caps_new_full (GstStructure *struct1,
|
2011-11-26 19:44:23 +00:00
|
|
|
...) G_GNUC_NULL_TERMINATED G_GNUC_WARN_UNUSED_RESULT;
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
GstCaps * gst_caps_new_full_valist (GstStructure *structure,
|
2011-11-26 19:44:23 +00:00
|
|
|
va_list var_args) G_GNUC_WARN_UNUSED_RESULT;
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-28 16:39:20 +00:00
|
|
|
GType gst_static_caps_get_type (void);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
GstCaps * gst_static_caps_get (GstStaticCaps *static_caps);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2011-06-22 10:28:14 +00:00
|
|
|
void gst_static_caps_cleanup (GstStaticCaps *static_caps);
|
2003-11-11 19:14:14 +00:00
|
|
|
|
|
|
|
/* manipulation */
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
void gst_caps_append (GstCaps *caps1,
|
2006-08-28 16:39:20 +00:00
|
|
|
GstCaps *caps2);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
void gst_caps_append_structure (GstCaps *caps,
|
2006-08-28 16:39:20 +00:00
|
|
|
GstStructure *structure);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2013-03-30 14:35:19 +00:00
|
|
|
void gst_caps_append_structure_full (GstCaps *caps,
|
|
|
|
GstStructure *structure,
|
|
|
|
GstCapsFeatures *features);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-28 16:39:20 +00:00
|
|
|
void gst_caps_remove_structure (GstCaps *caps, guint idx);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2012-03-11 17:57:44 +00:00
|
|
|
GstCaps * gst_caps_merge (GstCaps *caps1,
|
|
|
|
GstCaps *caps2) G_GNUC_WARN_UNUSED_RESULT;
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2012-03-11 17:57:44 +00:00
|
|
|
GstCaps * gst_caps_merge_structure (GstCaps *caps,
|
|
|
|
GstStructure *structure) G_GNUC_WARN_UNUSED_RESULT;
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2013-03-30 14:35:19 +00:00
|
|
|
GstCaps * gst_caps_merge_structure_full (GstCaps *caps,
|
|
|
|
GstStructure *structure,
|
|
|
|
GstCapsFeatures *features) G_GNUC_WARN_UNUSED_RESULT;
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
guint gst_caps_get_size (const GstCaps *caps);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
GstStructure * gst_caps_get_structure (const GstCaps *caps,
|
2006-08-28 16:39:20 +00:00
|
|
|
guint index);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2012-03-11 17:57:44 +00:00
|
|
|
GstStructure * gst_caps_steal_structure (GstCaps *caps,
|
2011-11-26 18:57:44 +00:00
|
|
|
guint index) G_GNUC_WARN_UNUSED_RESULT;
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2013-03-30 14:35:19 +00:00
|
|
|
void gst_caps_set_features (GstCaps *caps,
|
|
|
|
guint index,
|
|
|
|
GstCapsFeatures * features);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2013-03-30 14:35:19 +00:00
|
|
|
GstCapsFeatures * gst_caps_get_features (const GstCaps *caps,
|
|
|
|
guint index);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2011-11-26 19:44:23 +00:00
|
|
|
GstCaps * gst_caps_copy_nth (const GstCaps *caps, guint nth) G_GNUC_WARN_UNUSED_RESULT;
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2012-03-11 17:57:44 +00:00
|
|
|
GstCaps * gst_caps_truncate (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2009-10-07 13:32:18 +00:00
|
|
|
void gst_caps_set_value (GstCaps *caps,
|
|
|
|
const char *field,
|
|
|
|
const GValue *value);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
void gst_caps_set_simple (GstCaps *caps,
|
2008-03-24 10:33:41 +00:00
|
|
|
const char *field, ...) G_GNUC_NULL_TERMINATED;
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
void gst_caps_set_simple_valist (GstCaps *caps,
|
2008-03-24 10:33:41 +00:00
|
|
|
const char *field,
|
2006-08-28 16:39:20 +00:00
|
|
|
va_list varargs);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2014-11-07 10:15:09 +00:00
|
|
|
gboolean gst_caps_foreach (const GstCaps *caps,
|
|
|
|
GstCapsForeachFunc func,
|
|
|
|
gpointer user_data);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2014-11-07 10:15:09 +00:00
|
|
|
gboolean gst_caps_map_in_place (GstCaps *caps,
|
|
|
|
GstCapsMapFunc func,
|
|
|
|
gpointer user_data);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2014-12-16 15:31:21 +00:00
|
|
|
void gst_caps_filter_and_map_in_place (GstCaps *caps,
|
|
|
|
GstCapsFilterMapFunc func,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2003-11-11 19:14:14 +00:00
|
|
|
/* tests */
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
gboolean gst_caps_is_any (const GstCaps *caps);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
gboolean gst_caps_is_empty (const GstCaps *caps);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
gboolean gst_caps_is_fixed (const GstCaps *caps);
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-21 14:54:31 +00:00
|
|
|
gboolean gst_caps_is_always_compatible (const GstCaps *caps1,
|
2006-08-28 16:39:20 +00:00
|
|
|
const GstCaps *caps2);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-28 16:39:20 +00:00
|
|
|
gboolean gst_caps_is_subset (const GstCaps *subset,
|
|
|
|
const GstCaps *superset);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2011-05-27 11:55:31 +00:00
|
|
|
gboolean gst_caps_is_subset_structure (const GstCaps *caps,
|
|
|
|
const GstStructure *structure);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2013-03-30 14:35:19 +00:00
|
|
|
gboolean gst_caps_is_subset_structure_full (const GstCaps *caps,
|
|
|
|
const GstStructure *structure,
|
|
|
|
const GstCapsFeatures *features);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-28 16:39:20 +00:00
|
|
|
gboolean gst_caps_is_equal (const GstCaps *caps1,
|
|
|
|
const GstCaps *caps2);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2006-08-28 16:39:20 +00:00
|
|
|
gboolean gst_caps_is_equal_fixed (const GstCaps *caps1,
|
|
|
|
const GstCaps *caps2);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2009-07-22 06:38:10 +00:00
|
|
|
gboolean gst_caps_can_intersect (const GstCaps * caps1,
|
|
|
|
const GstCaps * caps2);
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2011-11-03 15:35:32 +00:00
|
|
|
gboolean gst_caps_is_strictly_equal (const GstCaps *caps1,
|
|
|
|
const GstCaps *caps2);
|
2005-08-24 16:09:50 +00:00
|
|
|
|
2003-11-11 19:14:14 +00:00
|
|
|
|
|
|
|
/* operations */
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2012-03-11 17:57:44 +00:00
|
|
|
GstCaps * gst_caps_intersect (GstCaps *caps1,
|
|
|
|
GstCaps *caps2) G_GNUC_WARN_UNUSED_RESULT;
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2012-03-11 17:57:44 +00:00
|
|
|
GstCaps * gst_caps_intersect_full (GstCaps *caps1,
|
|
|
|
GstCaps *caps2,
|
2011-11-26 19:44:23 +00:00
|
|
|
GstCapsIntersectMode mode) G_GNUC_WARN_UNUSED_RESULT;
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2012-03-11 17:57:44 +00:00
|
|
|
GstCaps * gst_caps_subtract (GstCaps *minuend,
|
|
|
|
GstCaps *subtrahend) G_GNUC_WARN_UNUSED_RESULT;
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2012-03-11 17:57:44 +00:00
|
|
|
GstCaps * gst_caps_normalize (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2012-03-12 10:38:37 +00:00
|
|
|
GstCaps * gst_caps_simplify (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
|
2012-03-11 17:57:44 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2012-03-11 17:57:44 +00:00
|
|
|
GstCaps * gst_caps_fixate (GstCaps *caps) G_GNUC_WARN_UNUSED_RESULT;
|
2011-08-15 12:40:38 +00:00
|
|
|
|
2003-11-11 19:14:14 +00:00
|
|
|
/* utility */
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2011-11-26 18:57:44 +00:00
|
|
|
gchar * gst_caps_to_string (const GstCaps *caps) G_GNUC_MALLOC;
|
2017-05-10 09:56:16 +00:00
|
|
|
|
2018-03-12 23:03:26 +00:00
|
|
|
GST_API
|
2011-11-26 19:44:23 +00:00
|
|
|
GstCaps * gst_caps_from_string (const gchar *string) G_GNUC_WARN_UNUSED_RESULT;
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2015-11-10 17:38:59 +00:00
|
|
|
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstCaps, gst_caps_unref)
|
|
|
|
#endif
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
G_END_DECLS
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2003-12-22 01:39:35 +00:00
|
|
|
#endif /* __GST_CAPS_H__ */
|