/* playing = FALSE; */
}
-G_GNUC_UNUSED static GstCaps2*
+G_GNUC_UNUSED static GstCaps*
gst_play_type_find (GstBin *bin, GstElement *element)
{
GstElement *typefind;
GstElement *pipeline;
- GstCaps2 *caps = NULL;
+ GstCaps *caps = NULL;
GST_DEBUG ("GstPipeline: typefind for element \"%s\"",
GST_ELEMENT_NAME(element));
char buffer[20]; /* hold the names */
/* GstAutoplug *autoplug;
- GstCaps2 *srccaps; */
+ GstCaps *srccaps; */
GstElement *new_element;
GstElement *decoder;
#endif
new_element = gst_autoplug_to_caps (autoplug, srccaps,
- gst_caps2_new ("audio/raw", NULL), NULL);
+ gst_caps_new ("audio/raw", NULL), NULL);
if (!new_element) {
g_print ("could not autoplug, no suitable codecs found...\n");
#include <gst/gst.h>
void
-type_found (GstElement *typefind, const GstCaps2 * caps)
+type_found (GstElement *typefind, const GstCaps * caps)
{
xmlDocPtr doc;
xmlNodePtr parent;
parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
/* FIXME */
- //gst_caps2_save_thyself (caps, parent);
+ //gst_caps_save_thyself (caps, parent);
xmlDocDump (stdout, doc);
}
* Returns: TRUE, if both caps intersect.
*/
gboolean
-gst_autoplug_caps_intersect (const GstCaps2 *src, const GstCaps2 *sink)
+gst_autoplug_caps_intersect (const GstCaps *src, const GstCaps *sink)
{
- GstCaps2 *caps;
+ GstCaps *caps;
/* if there are no caps, we can link */
if ((src == NULL) && (sink == NULL))
return TRUE;
/* get an intersection */
- caps = gst_caps2_intersect (src, sink);
+ caps = gst_caps_intersect (src, sink);
/* if the caps can't link, there is no intersection */
if (caps == NULL)
return FALSE;
/* hurrah, we can link, now remove the intersection */
- gst_caps2_free (caps);
+ gst_caps_free (caps);
return TRUE;
}
* Returns: #GstPadTemplate that can connect to the given caps
*/
GstPadTemplate *
-gst_autoplug_can_connect_src (GstElementFactory *fac, const GstCaps2 *src)
+gst_autoplug_can_connect_src (GstElementFactory *fac, const GstCaps *src)
{
GList *templs;
* Returns: #GstPadTemplate that can connect to the given caps
*/
GstPadTemplate *
-gst_autoplug_can_connect_sink (GstElementFactory *fac, const GstCaps2 *sink)
+gst_autoplug_can_connect_sink (GstElementFactory *fac, const GstCaps *sink)
{
GList *templs;
while (templs)
{
- GstCaps2 *caps = GST_PAD_TEMPLATE_CAPS (templs->data);
+ GstCaps *caps = GST_PAD_TEMPLATE_CAPS (templs->data);
if ((GST_PAD_TEMPLATE_DIRECTION (templs->data) == GST_PAD_SRC) &&
gst_autoplug_caps_intersect (caps, sink))
{
*/
/**
* gst_autoplug_sp:
- * @src_caps: a #GstCaps2 to plug from.
- * @sink_caps: the #GstCaps2 to plug to.
+ * @src_caps: a #GstCaps to plug from.
+ * @sink_caps: the #GstCaps to plug to.
* @factories: a #GList containing all allowed #GstElementFactory entries.
*
* Finds the shortest path of elements that together make up a possible
* to get the shortest path.
*/
GList *
-gst_autoplug_sp (const GstCaps2 *srccaps, const GstCaps2 *sinkcaps, GList *factories)
+gst_autoplug_sp (const GstCaps *srccaps, const GstCaps *sinkcaps, GList *factories)
{
GList *factory_nodes = NULL;
guint curcost = GST_AUTOPLUG_MAX_COST; /* below this cost, there is no path */
g_return_val_if_fail (sinkcaps != NULL, NULL);
GST_INFO ("attempting to autoplug via shortest path from %s to %s",
- gst_caps2_to_string(srccaps), gst_caps2_to_string(sinkcaps));
+ gst_caps_to_string(srccaps), gst_caps_to_string(sinkcaps));
/* wrap all factories as GstAutoplugNode
* initialize the cost */
};
/* helper functions */
-gboolean gst_autoplug_caps_intersect (const GstCaps2 *src, const GstCaps2 *sink);
-GstPadTemplate * gst_autoplug_can_connect_src (GstElementFactory *fac, const GstCaps2 *src);
-GstPadTemplate * gst_autoplug_can_connect_sink (GstElementFactory *fac, const GstCaps2 *sink);
+gboolean gst_autoplug_caps_intersect (const GstCaps *src, const GstCaps *sink);
+GstPadTemplate * gst_autoplug_can_connect_src (GstElementFactory *fac, const GstCaps *src);
+GstPadTemplate * gst_autoplug_can_connect_sink (GstElementFactory *fac, const GstCaps *sink);
GstPadTemplate * gst_autoplug_can_match (GstElementFactory *src, GstElementFactory *dest);
gboolean gst_autoplug_factory_has_direction (GstElementFactory *fac, GstPadDirection dir);
#define gst_autoplug_factory_has_sink(fac) gst_autoplug_factory_has_direction((fac), GST_PAD_SINK)
GList * gst_autoplug_factories_at_most_templates(GList *factories, GstPadDirection dir, guint maxtemplates);
/* shortest path algorithm */
-GList * gst_autoplug_sp (const GstCaps2 *src_caps, const GstCaps2 *sink_caps, GList *factories);
+GList * gst_autoplug_sp (const GstCaps *src_caps, const GstCaps *sink_caps, GList *factories);
#endif /* __GST_SEARCHFUNCS_H__ */
"src_%d",
GST_PAD_SRC,
GST_PAD_REQUEST,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
/* standard GObject stuff */
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
static GstStaticPadTemplate spider_sink_factory =
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
/* SpiderIdentity signals and args */
/* functions set in pads, elements and stuff */
static void gst_spider_identity_chain (GstPad *pad, GstBuffer *buf);
static GstElementStateReturn gst_spider_identity_change_state (GstElement *element);
-static GstPadLinkReturn gst_spider_identity_link (GstPad *pad, const GstCaps2 *caps);
-static GstCaps2 * gst_spider_identity_getcaps (GstPad *pad);
+static GstPadLinkReturn gst_spider_identity_link (GstPad *pad, const GstCaps *caps);
+static GstCaps * gst_spider_identity_getcaps (GstPad *pad);
/* loop functions */
static void gst_spider_identity_dumb_loop (GstSpiderIdentity *ident);
static void gst_spider_identity_src_loop (GstSpiderIdentity *ident);
/* shamelessly stolen from gstqueue.c to get proxy links */
static GstPadLinkReturn
-gst_spider_identity_link (GstPad *pad, const GstCaps2 *caps)
+gst_spider_identity_link (GstPad *pad, const GstCaps *caps)
{
GstSpiderIdentity *spider_identity = GST_SPIDER_IDENTITY (gst_pad_get_parent (pad));
GstPad *otherpad;
return GST_PAD_LINK_OK;
}
-static GstCaps2*
+static GstCaps*
gst_spider_identity_getcaps (GstPad *pad)
{
GstSpiderIdentity *spider_identity = GST_SPIDER_IDENTITY (gst_pad_get_parent (pad));
if (peer)
return gst_pad_get_caps (peer);
}
- return gst_caps2_new_any ();
+ return gst_caps_new_any ();
}
GstPad*
typedef struct {
GstBuffer *buffer;
guint best_probability;
- GstCaps2 *caps;
+ GstCaps *caps;
} SpiderTypeFind;
guint8 *
spider_find_peek (gpointer data, gint64 offset, guint size)
}
}
static void
-spider_find_suggest (gpointer data, guint probability, const GstCaps2 *caps)
+spider_find_suggest (gpointer data, guint probability, const GstCaps *caps)
{
SpiderTypeFind *find = (SpiderTypeFind *) data;
G_GNUC_UNUSED gchar *caps_str;
- caps_str = gst_caps2_to_string (caps);
+ caps_str = gst_caps_to_string (caps);
GST_INFO ("suggest %u, %s", probability, caps_str);
g_free (caps_str);
if (probability > find->best_probability) {
- gst_caps2_replace (&find->caps, gst_caps2_copy (caps));
+ gst_caps_replace (&find->caps, gst_caps_copy (caps));
find->best_probability = probability;
}
}
plug:
GST_INFO ("typefind function found caps");
g_assert (gst_pad_try_set_caps (ident->src, find.caps) > 0);
- gst_caps2_debug (find.caps, "spider starting caps");
- gst_caps2_free (find.caps);
+ gst_caps_debug (find.caps, "spider starting caps");
+ gst_caps_free (find.caps);
if (type_list)
g_list_free (type_list);
gboolean plugged;
/* Caps from typefinding */
- GstCaps2 *caps;
+ GstCaps *caps;
};
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
#define GST_TYPE_AGGREGATOR_SCHED (gst_aggregator_sched_get_type())
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
#define GST_TYPE_FAKESINK_STATE_ERROR (gst_fakesink_state_error_get_type())
"src%d",
GST_PAD_SRC,
GST_PAD_REQUEST,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type())
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property);
}
-static GstCaps2*
+static GstCaps*
gst_identity_getcaps (GstPad *pad)
{
GstIdentity *identity;
if (peer) {
return gst_pad_get_caps (peer);
} else {
- return gst_caps2_new_any ();
+ return gst_caps_new_any ();
}
}
static GstPadLinkReturn
-gst_identity_link (GstPad *pad, const GstCaps2 *caps)
+gst_identity_link (GstPad *pad, const GstCaps *caps)
{
GstIdentity *identity;
identity = GST_IDENTITY (gst_pad_get_parent (pad));
- if (gst_caps2_is_fixed (caps)) {
+ if (gst_caps_is_fixed (caps)) {
if (identity->delay_capsnego && GST_PAD_IS_SINK (pad)) {
- identity->srccaps = gst_caps2_copy (caps);
+ identity->srccaps = gst_caps_copy (caps);
return GST_PAD_LINK_OK;
}
gboolean dump;
gchar *last_message;
gboolean delay_capsnego;
- GstCaps2 *srccaps;
+ GstCaps *srccaps;
};
struct _GstIdentityClass {
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
/* GObject stuff */
"src%d",
GST_PAD_SRC,
GST_PAD_SOMETIMES,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
GstStaticPadTemplate shaper_sink_template = GST_STATIC_PAD_TEMPLATE (
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
#define GST_TYPE_SHAPER_POLICY (gst_shaper_policy_get_type())
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR (gst_shaper_request_new_pad);
}
-static GstCaps2*
+static GstCaps*
gst_shaper_getcaps (GstPad *pad)
{
GstPad *otherpad;
otherpad = (pad == connection->srcpad ? connection->sinkpad : connection->srcpad);
- return gst_caps2_copy (gst_pad_get_allowed_caps (otherpad));
+ return gst_caps_copy (gst_pad_get_allowed_caps (otherpad));
}
static GList*
}
static GstPadLinkReturn
-gst_shaper_link (GstPad *pad, const GstCaps2 *caps)
+gst_shaper_link (GstPad *pad, const GstCaps *caps)
{
GstPad *otherpad;
GstShaperConnection *connection;
"src%d",
GST_PAD_SRC,
GST_PAD_REQUEST,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
static void gst_tee_base_init (gpointer g_class);
}
static GstPadLinkReturn
-gst_tee_sinklink (GstPad *pad, const GstCaps2 *caps)
+gst_tee_sinklink (GstPad *pad, const GstCaps *caps)
{
GstTee *tee;
const GList *pads;
GstPadLinkReturn set_retval;
- GST_DEBUG ( "gst_tee_sinklink caps=%s", gst_caps2_to_string(caps));
+ GST_DEBUG ( "gst_tee_sinklink caps=%s", gst_caps_to_string(caps));
tee = GST_TEE (gst_pad_get_parent (pad));
- if (!gst_caps2_is_fixed (caps)) {
+ if (!gst_caps_is_fixed (caps)) {
return GST_PAD_LINK_DELAYED;
}
}
static GstPadLinkReturn
-gst_tee_srclink (GstPad *pad, const GstCaps2 *caps)
+gst_tee_srclink (GstPad *pad, const GstCaps *caps)
{
GstTee *tee;
- GST_DEBUG ( "gst_tee_srclink caps=%s", gst_caps2_to_string(caps));
+ GST_DEBUG ( "gst_tee_srclink caps=%s", gst_caps_to_string(caps));
tee = GST_TEE (gst_pad_get_parent (pad));
return gst_pad_proxy_link (tee->sinkpad, caps);
}
-static GstCaps2*
+static GstCaps*
gst_tee_getcaps (GstPad *pad)
{
- GstCaps2 *caps = GST_CAPS2_ANY;
+ GstCaps *caps = GST_CAPS_ANY;
GstTee *tee;
const GList *pads;
while (pads) {
GstPad *srcpad = GST_PAD (pads->data);
GstPad *peer;
- const GstCaps2 *peercaps;
- GstCaps2 *newcaps;
+ const GstCaps *peercaps;
+ GstCaps *newcaps;
pads = g_list_next (pads);
}
peercaps = gst_pad_get_caps (peer);
- newcaps = gst_caps2_intersect (caps, peercaps);
- gst_caps2_free (caps);
+ newcaps = gst_caps_intersect (caps, peercaps);
+ gst_caps_free (caps);
caps = newcaps;
}
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
GstStaticPadTemplate type_find_element_src_template = GST_STATIC_PAD_TEMPLATE (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
/* TypeFind signals and args */
return typefind_type;
}
static void
-gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps2 *caps)
+gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps *caps)
{
gchar *caps_str;
g_assert (typefind->caps == NULL);
g_assert (caps != NULL);
- caps_str = gst_caps2_to_string (caps);
+ caps_str = gst_caps_to_string (caps);
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
g_free (caps_str);
- gst_caps2_replace (&typefind->caps, caps);
+ gst_caps_replace (&typefind->caps, caps);
if (gst_pad_try_set_caps (typefind->src, caps) < GST_PAD_LINK_OK) {
gst_element_error (GST_ELEMENT (typefind), "could not set caps on source pad");
}
g_object_class_install_property (gobject_class, ARG_CAPS,
g_param_spec_boxed ("caps", _("caps"), _("detected capabilities in stream"),
- gst_caps2_get_type(), G_PARAM_READABLE));
+ gst_caps_get_type(), G_PARAM_READABLE));
g_object_class_install_property (gobject_class, ARG_MINIMUM,
g_param_spec_uint ("minimum", _("minimum"), "minimum probability required to accept caps",
GST_TYPE_FIND_MINIMUM, GST_TYPE_FIND_MAXIMUM, GST_TYPE_FIND_MINIMUM, G_PARAM_READWRITE));
G_TYPE_FROM_CLASS (g_class), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstTypeFindElementClass, have_type), NULL, NULL,
gst_marshal_VOID__UINT_BOXED, G_TYPE_NONE, 2,
- G_TYPE_UINT, gst_caps2_get_type());
+ G_TYPE_UINT, gst_caps_get_type());
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state);
}
typedef struct {
GstTypeFindFactory * factory;
gint probability;
- GstCaps2 * caps;
+ GstCaps * caps;
gint64 requested_offset;
guint requested_size;
free_entry_buffers (entry);
if (entry->caps)
- gst_caps2_free (entry->caps);
+ gst_caps_free (entry->caps);
g_free (entry);
}
static void
}
}
static void
-find_suggest (gpointer data, guint probability, const GstCaps2 *caps)
+find_suggest (gpointer data, guint probability, const GstCaps *caps)
{
gchar *str;
TypeFindEntry *entry = (TypeFindEntry *) data;
- str = gst_caps2_to_string (caps);
+ str = gst_caps_to_string (caps);
GST_LOG_OBJECT (entry->self, "'%s' called suggest (%u, %s)",
GST_PLUGIN_FEATURE_NAME (entry->factory), probability, str);
g_free (str);
if (((gint) probability) > entry->probability) {
entry->probability = probability;
- gst_caps2_replace (&entry->caps, gst_caps2_copy (caps));
+ gst_caps_replace (&entry->caps, gst_caps_copy (caps));
}
}
static gint
free_entry (entry);
} else if (entry->probability >= typefind->max_probability) {
/* wooha, got caps */
- GstCaps2 *found_caps = entry->caps;
+ GstCaps *found_caps = entry->caps;
guint probability = entry->probability;
- found_caps = gst_caps2_copy (found_caps);
+ found_caps = gst_caps_copy (found_caps);
GST_INFO_OBJECT (typefind, "'%s' returned %u/%u probability, using it NOW",
GST_PLUGIN_FEATURE_NAME (entry->factory), probability, typefind->max_probability);
while (walk) {
typefind->possibilities = NULL;
g_list_free (typefind->possibilities);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, probability, found_caps);
- gst_caps2_free (found_caps);
+ gst_caps_free (found_caps);
} else {
typefind->possibilities = g_list_prepend (typefind->possibilities, entry);
}
break;
case GST_STATE_PAUSED_TO_READY:
stop_typefinding (typefind);
- gst_caps2_replace (&typefind->caps, NULL);
+ gst_caps_replace (&typefind->caps, NULL);
break;
default:
break;
guint min_probability;
guint max_probability;
- GstCaps2 * caps;
+ GstCaps * caps;
guint mode;
GstBufferStore * store;
/* signals */
void (*have_type) (GstTypeFindElement *element,
guint probability,
- GstCaps2 * caps);
+ GstCaps * caps);
};
GType gst_type_find_element_get_type (void);
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
GstStaticPadTemplate type_find_element_src_template = GST_STATIC_PAD_TEMPLATE (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
/* TypeFind signals and args */
return typefind_type;
}
static void
-gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps2 *caps)
+gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps *caps)
{
gchar *caps_str;
g_assert (typefind->caps == NULL);
g_assert (caps != NULL);
- caps_str = gst_caps2_to_string (caps);
+ caps_str = gst_caps_to_string (caps);
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
g_free (caps_str);
- gst_caps2_replace (&typefind->caps, caps);
+ gst_caps_replace (&typefind->caps, caps);
if (gst_pad_try_set_caps (typefind->src, caps) < GST_PAD_LINK_OK) {
gst_element_error (GST_ELEMENT (typefind), "could not set caps on source pad");
}
g_object_class_install_property (gobject_class, ARG_CAPS,
g_param_spec_boxed ("caps", _("caps"), _("detected capabilities in stream"),
- gst_caps2_get_type(), G_PARAM_READABLE));
+ gst_caps_get_type(), G_PARAM_READABLE));
g_object_class_install_property (gobject_class, ARG_MINIMUM,
g_param_spec_uint ("minimum", _("minimum"), "minimum probability required to accept caps",
GST_TYPE_FIND_MINIMUM, GST_TYPE_FIND_MAXIMUM, GST_TYPE_FIND_MINIMUM, G_PARAM_READWRITE));
G_TYPE_FROM_CLASS (g_class), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstTypeFindElementClass, have_type), NULL, NULL,
gst_marshal_VOID__UINT_BOXED, G_TYPE_NONE, 2,
- G_TYPE_UINT, gst_caps2_get_type());
+ G_TYPE_UINT, gst_caps_get_type());
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state);
}
typedef struct {
GstTypeFindFactory * factory;
gint probability;
- GstCaps2 * caps;
+ GstCaps * caps;
gint64 requested_offset;
guint requested_size;
free_entry_buffers (entry);
if (entry->caps)
- gst_caps2_free (entry->caps);
+ gst_caps_free (entry->caps);
g_free (entry);
}
static void
}
}
static void
-find_suggest (gpointer data, guint probability, const GstCaps2 *caps)
+find_suggest (gpointer data, guint probability, const GstCaps *caps)
{
gchar *str;
TypeFindEntry *entry = (TypeFindEntry *) data;
- str = gst_caps2_to_string (caps);
+ str = gst_caps_to_string (caps);
GST_LOG_OBJECT (entry->self, "'%s' called suggest (%u, %s)",
GST_PLUGIN_FEATURE_NAME (entry->factory), probability, str);
g_free (str);
if (((gint) probability) > entry->probability) {
entry->probability = probability;
- gst_caps2_replace (&entry->caps, gst_caps2_copy (caps));
+ gst_caps_replace (&entry->caps, gst_caps_copy (caps));
}
}
static gint
free_entry (entry);
} else if (entry->probability >= typefind->max_probability) {
/* wooha, got caps */
- GstCaps2 *found_caps = entry->caps;
+ GstCaps *found_caps = entry->caps;
guint probability = entry->probability;
- found_caps = gst_caps2_copy (found_caps);
+ found_caps = gst_caps_copy (found_caps);
GST_INFO_OBJECT (typefind, "'%s' returned %u/%u probability, using it NOW",
GST_PLUGIN_FEATURE_NAME (entry->factory), probability, typefind->max_probability);
while (walk) {
typefind->possibilities = NULL;
g_list_free (typefind->possibilities);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, probability, found_caps);
- gst_caps2_free (found_caps);
+ gst_caps_free (found_caps);
} else {
typefind->possibilities = g_list_prepend (typefind->possibilities, entry);
}
break;
case GST_STATE_PAUSED_TO_READY:
stop_typefinding (typefind);
- gst_caps2_replace (&typefind->caps, NULL);
+ gst_caps_replace (&typefind->caps, NULL);
break;
default:
break;
guint min_probability;
guint max_probability;
- GstCaps2 * caps;
+ GstCaps * caps;
guint mode;
GstBufferStore * store;
/* signals */
void (*have_type) (GstTypeFindElement *element,
guint probability,
- GstCaps2 * caps);
+ GstCaps * caps);
};
GType gst_type_find_element_get_type (void);
_gst_cpu_initialize (_gst_enable_cpu_opt);
_gst_structure_initialize ();
_gst_value_initialize ();
- _gst_caps2_initialize ();
+ _gst_caps_initialize ();
_gst_plugin_initialize ();
_gst_event_initialize ();
_gst_buffer_initialize ();
#include <gst/gst.h>
-static void _gst_caps2_transform_to_string (const GValue *src_value,
+static void _gst_caps_transform_to_string (const GValue *src_value,
GValue *dest_value);
-static void _gst_caps2_value_init (GValue *value);
-static void _gst_caps2_value_free (GValue *value);
-static void _gst_caps2_value_copy (const GValue *src, GValue *dest);
-static gpointer _gst_caps2_value_peek_pointer (const GValue *value);
-static gboolean _gst_caps2_from_string_inplace (GstCaps2 *caps,
+static void _gst_caps_value_init (GValue *value);
+static void _gst_caps_value_free (GValue *value);
+static void _gst_caps_value_copy (const GValue *src, GValue *dest);
+static gpointer _gst_caps_value_peek_pointer (const GValue *value);
+static gboolean _gst_caps_from_string_inplace (GstCaps *caps,
const gchar *string);
-GType _gst_caps2_type;
+GType _gst_caps_type;
-void _gst_caps2_initialize (void)
+void _gst_caps_initialize (void)
{
static const GTypeValueTable type_value_table = {
- _gst_caps2_value_init,
- _gst_caps2_value_free,
- _gst_caps2_value_copy,
- _gst_caps2_value_peek_pointer,
+ _gst_caps_value_init,
+ _gst_caps_value_free,
+ _gst_caps_value_copy,
+ _gst_caps_value_peek_pointer,
NULL,
NULL,
NULL,
&type_value_table,
};
- _gst_caps2_type = g_type_register_static (G_TYPE_BOXED, "GstCaps2",
+ _gst_caps_type = g_type_register_static (G_TYPE_BOXED, "GstCaps",
&caps2_info, 0);
- g_value_register_transform_func (_gst_caps2_type, G_TYPE_STRING,
- _gst_caps2_transform_to_string);
+ g_value_register_transform_func (_gst_caps_type, G_TYPE_STRING,
+ _gst_caps_transform_to_string);
}
-GType gst_caps2_get_type (void)
+GType gst_caps_get_type (void)
{
- return _gst_caps2_type;
+ return _gst_caps_type;
}
/* creation/deletion */
-GstCaps2 *gst_caps2_new_empty (void)
+GstCaps *gst_caps_new_empty (void)
{
- GstCaps2 *caps = g_new0(GstCaps2, 1);
+ GstCaps *caps = g_new0(GstCaps, 1);
- caps->type = _gst_caps2_type;
+ caps->type = _gst_caps_type;
caps->structs = g_ptr_array_new();
return caps;
}
-GstCaps2 *gst_caps2_new_any (void)
+GstCaps *gst_caps_new_any (void)
{
- GstCaps2 *caps = g_new0(GstCaps2, 1);
+ GstCaps *caps = g_new0(GstCaps, 1);
- caps->type = _gst_caps2_type;
+ caps->type = _gst_caps_type;
caps->structs = g_ptr_array_new();
- caps->flags = GST_CAPS2_FLAGS_ANY;
+ caps->flags = GST_CAPS_FLAGS_ANY;
return caps;
}
-GstCaps2 *gst_caps2_new_simple (const char *media_type, const char *fieldname,
+GstCaps *gst_caps_new_simple (const char *media_type, const char *fieldname,
...)
{
- GstCaps2 *caps;
+ GstCaps *caps;
GstStructure *structure;
va_list var_args;
- caps = g_new0(GstCaps2, 1);
- caps->type = _gst_caps2_type;
+ caps = g_new0(GstCaps, 1);
+ caps->type = _gst_caps_type;
caps->structs = g_ptr_array_new();
va_start (var_args, fieldname);
structure = gst_structure_new_valist (media_type, fieldname, var_args);
va_end (var_args);
- gst_caps2_append_cap (caps, structure);
+ gst_caps_append_structure (caps, structure);
return caps;
}
-GstCaps2 *gst_caps2_new_full (GstStructure *struct1, ...)
+GstCaps *gst_caps_new_full (GstStructure *struct1, ...)
{
- GstCaps2 *caps;
+ GstCaps *caps;
va_list var_args;
va_start (var_args, struct1);
- caps = gst_caps2_new_full_valist (struct1, var_args);
+ caps = gst_caps_new_full_valist (struct1, var_args);
va_end (var_args);
return caps;
}
-GstCaps2 *gst_caps2_new_full_valist (GstStructure *structure,
+GstCaps *gst_caps_new_full_valist (GstStructure *structure,
va_list var_args)
{
- GstCaps2 *caps;
+ GstCaps *caps;
- caps = g_new0(GstCaps2, 1);
- caps->type = _gst_caps2_type;
+ caps = g_new0(GstCaps, 1);
+ caps->type = _gst_caps_type;
caps->structs = g_ptr_array_new();
while(structure){
- gst_caps2_append_cap (caps, structure);
+ gst_caps_append_structure (caps, structure);
structure = va_arg (var_args, GstStructure *);
}
return caps;
}
-GstCaps2 *gst_caps2_copy (const GstCaps2 *caps)
+GstCaps *gst_caps_copy (const GstCaps *caps)
{
- GstCaps2 *newcaps;
+ GstCaps *newcaps;
GstStructure *structure;
int i;
g_return_val_if_fail(caps != NULL, NULL);
- newcaps = g_new0(GstCaps2, 1);
- newcaps->type = _gst_caps2_type;
+ newcaps = g_new0(GstCaps, 1);
+ newcaps->type = _gst_caps_type;
newcaps->flags = caps->flags;
newcaps->structs = g_ptr_array_new();
for(i=0;i<caps->structs->len;i++){
- structure = gst_caps2_get_nth_cap (caps, i);
- gst_caps2_append_cap (newcaps, gst_structure_copy(structure));
+ structure = gst_caps_get_structure (caps, i);
+ gst_caps_append_structure (newcaps, gst_structure_copy(structure));
}
return newcaps;
}
-void gst_caps2_free (GstCaps2 *caps)
+void gst_caps_free (GstCaps *caps)
{
GstStructure *structure;
int i;
g_return_if_fail(caps != NULL);
for(i=0;i<caps->structs->len;i++){
- structure = gst_caps2_get_nth_cap (caps, i);
+ structure = gst_caps_get_structure (caps, i);
gst_structure_free (structure);
}
g_ptr_array_free(caps->structs, TRUE);
#ifdef USE_POISONING
- memset (caps, 0xff, sizeof(GstCaps2));
+ memset (caps, 0xff, sizeof(GstCaps));
#endif
g_free(caps);
}
-const GstCaps2 *gst_static_caps2_get (GstStaticCaps2 *static_caps)
+const GstCaps *gst_static_caps_get (GstStaticCaps *static_caps)
{
- GstCaps2 *caps = (GstCaps2 *)static_caps;
+ GstCaps *caps = (GstCaps *)static_caps;
gboolean ret;
if (caps->type == 0) {
- caps->type = _gst_caps2_type;
+ caps->type = _gst_caps_type;
caps->structs = g_ptr_array_new();
- ret = _gst_caps2_from_string_inplace (caps, static_caps->string);
+ ret = _gst_caps_from_string_inplace (caps, static_caps->string);
if (!ret) {
g_critical ("Could not convert static caps \"%s\"", static_caps->string);
}
/* manipulation */
-void gst_caps2_append (GstCaps2 *caps1, GstCaps2 *caps2)
+void gst_caps_append (GstCaps *caps1, GstCaps *caps2)
{
GstStructure *structure;
int i;
for(i=0;i<caps2->structs->len;i++){
- structure = gst_caps2_get_nth_cap (caps2, i);
- gst_caps2_append_cap (caps1, structure);
+ structure = gst_caps_get_structure (caps2, i);
+ gst_caps_append_structure (caps1, structure);
}
g_ptr_array_free(caps2->structs, TRUE);
#ifdef USE_POISONING
- memset (caps2, 0xff, sizeof(GstCaps2));
+ memset (caps2, 0xff, sizeof(GstCaps));
#endif
g_free(caps2);
}
-void gst_caps2_append_cap (GstCaps2 *caps, GstStructure *structure)
+void gst_caps_append_structure (GstCaps *caps, GstStructure *structure)
{
g_return_if_fail(caps != NULL);
}
}
-GstCaps2 *gst_caps2_split_one (GstCaps2 *caps)
+GstCaps *gst_caps_split_one (GstCaps *caps)
{
/* FIXME */
return NULL;
}
-int gst_caps2_get_n_structures (const GstCaps2 *caps)
+int gst_caps_get_size (const GstCaps *caps)
{
g_return_val_if_fail (caps != NULL, 0);
return caps->structs->len;
}
-GstStructure *gst_caps2_get_nth_cap (const GstCaps2 *caps, int index)
+GstStructure *gst_caps_get_structure (const GstCaps *caps, int index)
{
g_return_val_if_fail (caps != NULL, NULL);
g_return_val_if_fail (index >= 0, NULL);
return g_ptr_array_index(caps->structs, index);
}
-GstCaps2 *gst_caps2_copy_1 (const GstCaps2 *caps)
+GstCaps *gst_caps_copy_1 (const GstCaps *caps)
{
- GstCaps2 *newcaps;
+ GstCaps *newcaps;
GstStructure *structure;
g_return_val_if_fail(caps != NULL, NULL);
- newcaps = g_new0(GstCaps2, 1);
- newcaps->type = _gst_caps2_type;
+ newcaps = g_new0(GstCaps, 1);
+ newcaps->type = _gst_caps_type;
newcaps->flags = caps->flags;
newcaps->structs = g_ptr_array_new();
if (caps->structs->len > 0){
- structure = gst_caps2_get_nth_cap (caps, 0);
- gst_caps2_append_cap (newcaps, gst_structure_copy(structure));
+ structure = gst_caps_get_structure (caps, 0);
+ gst_caps_append_structure (newcaps, gst_structure_copy(structure));
}
return newcaps;
}
-void gst_caps2_set_simple (GstCaps2 *caps, char *field, ...)
+void gst_caps_set_simple (GstCaps *caps, char *field, ...)
{
GstStructure *structure;
va_list var_args;
g_return_if_fail (caps != NULL);
g_return_if_fail (caps->structs->len == 1);
- structure = gst_caps2_get_nth_cap (caps, 0);
+ structure = gst_caps_get_structure (caps, 0);
va_start (var_args, field);
gst_structure_set_valist (structure, field, var_args);
va_end(var_args);
}
-void gst_caps2_set_simple_valist (GstCaps2 *caps, char *field, va_list varargs)
+void gst_caps_set_simple_valist (GstCaps *caps, char *field, va_list varargs)
{
GstStructure *structure;
g_return_if_fail (caps != NULL);
g_return_if_fail (caps->structs->len != 1);
- structure = gst_caps2_get_nth_cap (caps, 0);
+ structure = gst_caps_get_structure (caps, 0);
gst_structure_set_valist (structure, field, varargs);
}
/* tests */
-gboolean gst_caps2_is_any (const GstCaps2 *caps)
+gboolean gst_caps_is_any (const GstCaps *caps)
{
g_return_val_if_fail(caps != NULL, FALSE);
- return (caps->flags & GST_CAPS2_FLAGS_ANY);
+ return (caps->flags & GST_CAPS_FLAGS_ANY);
}
-gboolean gst_caps2_is_empty (const GstCaps2 *caps)
+gboolean gst_caps_is_empty (const GstCaps *caps)
{
g_return_val_if_fail(caps != NULL, FALSE);
- if (caps->flags & GST_CAPS2_FLAGS_ANY) return FALSE;
+ if (caps->flags & GST_CAPS_FLAGS_ANY) return FALSE;
return (caps->structs == NULL) || (caps->structs->len == 0);
}
-gboolean gst_caps2_is_chained (const GstCaps2 *caps)
+gboolean gst_caps_is_chained (const GstCaps *caps)
{
g_return_val_if_fail(caps != NULL, FALSE);
}
static gboolean
-_gst_caps2_is_fixed_foreach (GQuark field_id, GValue *value, gpointer unused)
+_gst_caps_is_fixed_foreach (GQuark field_id, GValue *value, gpointer unused)
{
GType type = G_VALUE_TYPE (value);
if (G_TYPE_IS_FUNDAMENTAL (type)) return TRUE;
return FALSE;
}
-gboolean gst_caps2_is_fixed (const GstCaps2 *caps)
+gboolean gst_caps_is_fixed (const GstCaps *caps)
{
GstStructure *structure;
if (caps->structs->len != 1) return FALSE;
- structure = gst_caps2_get_nth_cap (caps, 0);
+ structure = gst_caps_get_structure (caps, 0);
- return gst_structure_foreach (structure, _gst_caps2_is_fixed_foreach, NULL);
+ return gst_structure_foreach (structure, _gst_caps_is_fixed_foreach, NULL);
}
static gboolean
}
static gboolean
-_gst_caps2_cap_is_always_compatible (const GstStructure *struct1,
- const GstCaps2 *caps2)
+_gst_caps_cap_is_always_compatible (const GstStructure *struct1,
+ const GstCaps *caps2)
{
int i;
for(i=0;i<caps2->structs->len;i++){
- GstStructure *struct2 = gst_caps2_get_nth_cap (caps2, i);
+ GstStructure *struct2 = gst_caps_get_structure (caps2, i);
if (_gst_cap_is_always_compatible (struct1, struct2)) {
return TRUE;
}
gboolean
-gst_caps2_is_always_compatible (const GstCaps2 *caps1, const GstCaps2 *caps2)
+gst_caps_is_always_compatible (const GstCaps *caps1, const GstCaps *caps2)
{
int i;
g_return_val_if_fail (caps1 != NULL, FALSE);
g_return_val_if_fail (caps2 != NULL, FALSE);
/* FIXME: is this right ? */
- g_return_val_if_fail (!gst_caps2_is_empty (caps1), FALSE);
- g_return_val_if_fail (!gst_caps2_is_empty (caps2), FALSE);
+ g_return_val_if_fail (!gst_caps_is_empty (caps1), FALSE);
+ g_return_val_if_fail (!gst_caps_is_empty (caps2), FALSE);
- if (gst_caps2_is_any (caps2))
+ if (gst_caps_is_any (caps2))
return TRUE;
- if (gst_caps2_is_any (caps1))
+ if (gst_caps_is_any (caps1))
return FALSE;
for(i=0;i<caps1->structs->len;i++) {
- GstStructure *struct1 = gst_caps2_get_nth_cap (caps1, i);
+ GstStructure *struct1 = gst_caps_get_structure (caps1, i);
- if (_gst_caps2_cap_is_always_compatible(struct1, caps2) == FALSE){
+ if (_gst_caps_cap_is_always_compatible(struct1, caps2) == FALSE){
return FALSE;
}
} IntersectData;
static gboolean
-gst_caps2_structure_intersect_field (GQuark id, GValue *val1, gpointer data)
+gst_caps_structure_intersect_field (GQuark id, GValue *val1, gpointer data)
{
IntersectData *idata = (IntersectData *) data;
GValue dest_value = { 0 };
return TRUE;
}
-static GstStructure *gst_caps2_structure_intersect (const GstStructure *struct1,
+static GstStructure *gst_caps_structure_intersect (const GstStructure *struct1,
const GstStructure *struct2)
{
IntersectData data;
data.intersect = struct2;
data.first_run = TRUE;
if (!gst_structure_foreach ((GstStructure *) struct1,
- gst_caps2_structure_intersect_field, &data))
+ gst_caps_structure_intersect_field, &data))
goto error;
data.intersect = struct1;
data.first_run = FALSE;
if (!gst_structure_foreach ((GstStructure *) struct2,
- gst_caps2_structure_intersect_field, &data))
+ gst_caps_structure_intersect_field, &data))
goto error;
return data.dest;
}
#if 0
-static GstStructure *gst_caps2_structure_union (const GstStructure *struct1,
+static GstStructure *gst_caps_structure_union (const GstStructure *struct1,
const GstStructure *struct2)
{
int i;
#endif
/* operations */
-GstCaps2 *gst_caps2_intersect (const GstCaps2 *caps1, const GstCaps2 *caps2)
+GstCaps *gst_caps_intersect (const GstCaps *caps1, const GstCaps *caps2)
{
int i,j;
GstStructure *struct1;
GstStructure *struct2;
- GstCaps2 *dest;
+ GstCaps *dest;
g_return_val_if_fail (caps1 != NULL, NULL);
g_return_val_if_fail (caps2 != NULL, NULL);
- if (gst_caps2_is_empty (caps1) || gst_caps2_is_empty (caps2)){
- return gst_caps2_new_empty ();
+ if (gst_caps_is_empty (caps1) || gst_caps_is_empty (caps2)){
+ return gst_caps_new_empty ();
}
- if (gst_caps2_is_any (caps1)) return gst_caps2_copy (caps2);
- if (gst_caps2_is_any (caps2)) return gst_caps2_copy (caps1);
+ if (gst_caps_is_any (caps1)) return gst_caps_copy (caps2);
+ if (gst_caps_is_any (caps2)) return gst_caps_copy (caps1);
- dest = gst_caps2_new_empty();
+ dest = gst_caps_new_empty();
for(i=0;i<caps1->structs->len;i++){
- struct1 = gst_caps2_get_nth_cap (caps1, i);
+ struct1 = gst_caps_get_structure (caps1, i);
for(j=0;j<caps2->structs->len;j++){
GstStructure *istruct;
- struct2 = gst_caps2_get_nth_cap (caps2, j);
- istruct = gst_caps2_structure_intersect (struct1, struct2);
+ struct2 = gst_caps_get_structure (caps2, j);
+ istruct = gst_caps_structure_intersect (struct1, struct2);
- gst_caps2_append_cap(dest, istruct);
+ gst_caps_append_structure(dest, istruct);
}
}
return dest;
}
-GstCaps2 *gst_caps2_union (const GstCaps2 *caps1, const GstCaps2 *caps2)
+GstCaps *gst_caps_union (const GstCaps *caps1, const GstCaps *caps2)
{
- GstCaps2 *dest1;
- GstCaps2 *dest2;
+ GstCaps *dest1;
+ GstCaps *dest2;
- dest1 = gst_caps2_copy (caps1);
- dest2 = gst_caps2_copy (caps2);
- gst_caps2_append (dest1, dest2);
+ dest1 = gst_caps_copy (caps1);
+ dest2 = gst_caps_copy (caps2);
+ gst_caps_append (dest1, dest2);
/* FIXME: need a simplify function */
return dest1;
}
-GstCaps2 *gst_caps2_normalize (const GstCaps2 *caps)
+GstCaps *gst_caps_normalize (const GstCaps *caps)
{
return NULL;
}
#ifndef GST_DISABLE_LOADSAVE
-xmlNodePtr gst_caps2_save_thyself (const GstCaps2 *caps, xmlNodePtr parent)
+xmlNodePtr gst_caps_save_thyself (const GstCaps *caps, xmlNodePtr parent)
{
return 0;
}
-GstCaps2 *gst_caps2_load_thyself (xmlNodePtr parent)
+GstCaps *gst_caps_load_thyself (xmlNodePtr parent)
{
return NULL;
#endif
/* utility */
-void gst_caps2_replace (GstCaps2 **caps, GstCaps2 *newcaps)
+void gst_caps_replace (GstCaps **caps, GstCaps *newcaps)
{
/* FIXME */
- if (*caps) gst_caps2_free(*caps);
+ if (*caps) gst_caps_free(*caps);
*caps = newcaps;
}
-gchar *gst_caps2_to_string (const GstCaps2 *caps)
+gchar *gst_caps_to_string (const GstCaps *caps)
{
int i;
GstStructure *structure;
if (caps == NULL) {
return g_strdup("NULL");
}
- if(gst_caps2_is_any(caps)){
+ if(gst_caps_is_any(caps)){
return g_strdup("ANY");
}
- if(gst_caps2_is_empty(caps)){
+ if(gst_caps_is_empty(caps)){
return g_strdup("EMPTY");
}
s = g_string_new("");
- structure = gst_caps2_get_nth_cap (caps, 0);
+ structure = gst_caps_get_structure (caps, 0);
g_string_append(s, gst_structure_to_string(structure));
for(i=1;i<caps->structs->len;i++){
- structure = gst_caps2_get_nth_cap (caps, i);
+ structure = gst_caps_get_structure (caps, i);
g_string_append(s, "; ");
g_string_append(s, gst_structure_to_string(structure));
return g_string_free(s, FALSE);
}
-static gboolean _gst_caps2_from_string_inplace (GstCaps2 *caps,
+static gboolean _gst_caps_from_string_inplace (GstCaps *caps,
const gchar *string)
{
GstStructure *structure;
gchar *s;
if (strcmp("ANY", string)==0) {
- caps->flags = GST_CAPS2_FLAGS_ANY;
+ caps->flags = GST_CAPS_FLAGS_ANY;
return TRUE;
}
if (strcmp("NONE", string)==0) {
if (structure == NULL) {
return FALSE;
}
- gst_caps2_append_cap (caps, structure);
+ gst_caps_append_structure (caps, structure);
while (*s == ';') {
s++;
if (structure == NULL) {
return FALSE;
}
- gst_caps2_append_cap (caps, structure);
+ gst_caps_append_structure (caps, structure);
while (g_ascii_isspace(*s))s++;
}
return TRUE;
}
-GstCaps2 *gst_caps2_from_string (const gchar *string)
+GstCaps *gst_caps_from_string (const gchar *string)
{
- GstCaps2 *caps;
+ GstCaps *caps;
- caps = gst_caps2_new_empty();
- if (_gst_caps2_from_string_inplace (caps, string)) {
+ caps = gst_caps_new_empty();
+ if (_gst_caps_from_string_inplace (caps, string)) {
return caps;
} else {
- gst_caps2_free (caps);
+ gst_caps_free (caps);
return NULL;
}
}
-static void _gst_caps2_transform_to_string (const GValue *src_value,
+static void _gst_caps_transform_to_string (const GValue *src_value,
GValue *dest_value)
{
g_return_if_fail (src_value != NULL);
g_return_if_fail (dest_value != NULL);
dest_value->data[0].v_pointer =
- gst_caps2_to_string (src_value->data[0].v_pointer);
+ gst_caps_to_string (src_value->data[0].v_pointer);
}
-static void _gst_caps2_value_init (GValue *value)
+static void _gst_caps_value_init (GValue *value)
{
- value->data[0].v_pointer = gst_caps2_new_empty();
+ value->data[0].v_pointer = gst_caps_new_empty();
}
-static void _gst_caps2_value_free (GValue *value)
+static void _gst_caps_value_free (GValue *value)
{
- if (value->data[0].v_pointer) gst_caps2_free (value->data[0].v_pointer);
+ if (value->data[0].v_pointer) gst_caps_free (value->data[0].v_pointer);
}
-static void _gst_caps2_value_copy (const GValue *src, GValue *dest)
+static void _gst_caps_value_copy (const GValue *src, GValue *dest)
{
if (dest->data[0].v_pointer) {
- gst_caps2_free (dest->data[0].v_pointer);
- dest->data[0].v_pointer = gst_caps2_copy (src->data[0].v_pointer);
+ gst_caps_free (dest->data[0].v_pointer);
+ dest->data[0].v_pointer = gst_caps_copy (src->data[0].v_pointer);
} else {
dest->data[0].v_pointer = NULL;
}
}
-static gpointer _gst_caps2_value_peek_pointer (const GValue *value)
+static gpointer _gst_caps_value_peek_pointer (const GValue *value)
{
return value->data[0].v_pointer;
}
/* fixate utility functions */
-gboolean gst_caps2_structure_fixate_field_nearest_int (GstStructure *structure,
+gboolean gst_caps_structure_fixate_field_nearest_int (GstStructure *structure,
const char *field_name, int target)
{
const GValue *value;
return FALSE;
}
-gboolean gst_caps2_structure_fixate_field_nearest_double (GstStructure
+gboolean gst_caps_structure_fixate_field_nearest_double (GstStructure
*structure, const char *field_name, double target)
{
const GValue *value;
* Boston, MA 02111-1307, USA.
*/
-#ifndef __GST_CAPS2_H__
-#define __GST_CAPS2_H__
+#ifndef __GST_CAPS_H__
+#define __GST_CAPS_H__
#include <gst/gstconfig.h>
#include <gst/gststructure.h>
G_BEGIN_DECLS
-#define GST_CAPS2_FLAGS_ANY (1<<0)
+#define GST_CAPS_FLAGS_ANY (1<<0)
-extern GType _gst_caps2_type;
+extern GType _gst_caps_type;
-typedef struct _GstCaps2 GstCaps2;
-typedef struct _GstStaticCaps2 GstStaticCaps2;
+typedef struct _GstCaps GstCaps;
+typedef struct _GstStaticCaps GstStaticCaps;
-struct _GstCaps2 {
+struct _GstCaps {
GType type;
guint16 flags;
GPtrArray *structs;
};
-struct _GstStaticCaps2 {
- GstCaps2 caps;
+struct _GstStaticCaps {
+ GstCaps caps;
const char *string;
};
/* string */ string, \
}
-#define GST_CAPS2_ANY gst_caps2_new_any()
-#define GST_CAPS2_NONE gst_caps2_new_empty()
+#define GST_CAPS_ANY gst_caps_new_any()
+#define GST_CAPS_NONE gst_caps_new_empty()
-#define GST_STATIC_CAPS2_ANY GST_STATIC_CAPS("ANY")
-#define GST_STATIC_CAPS2_NONE GST_STATIC_CAPS("NONE")
+#define GST_STATIC_CAPS_ANY GST_STATIC_CAPS("ANY")
+#define GST_STATIC_CAPS_NONE GST_STATIC_CAPS("NONE")
-#define GST_TYPE_CAPS2 gst_caps2_get_type()
+#define GST_TYPE_CAPS gst_caps_get_type()
/* FIXME Company should decide the best way to do this */
#define GST_DEBUG_CAPS(string, caps) do { \
- char *s = gst_caps2_to_string(caps); \
+ char *s = gst_caps_to_string(caps); \
GST_DEBUG ( "%s: %s", (string), s); \
g_free(s); \
}while(0)
-void _gst_caps2_initialize (void);
-GType gst_caps2_get_type (void);
+void _gst_caps_initialize (void);
+GType gst_caps_get_type (void);
/* creation/deletion */
-GstCaps2 *gst_caps2_new_empty (void);
-GstCaps2 *gst_caps2_new_any (void);
-GstCaps2 *gst_caps2_new_simple (const char *media_type, const char *fieldname, ...);
-GstCaps2 *gst_caps2_new_full (GstStructure *struct1, ...);
-GstCaps2 *gst_caps2_new_full_valist (GstStructure *structure, va_list var_args);
-GstCaps2 *gst_caps2_copy (const GstCaps2 *caps);
-void gst_caps2_free (GstCaps2 *caps);
-G_CONST_RETURN GstCaps2 *gst_static_caps2_get (GstStaticCaps2 *caps);
+GstCaps *gst_caps_new_empty (void);
+GstCaps *gst_caps_new_any (void);
+GstCaps *gst_caps_new_simple (const char *media_type, const char *fieldname, ...);
+GstCaps *gst_caps_new_full (GstStructure *struct1, ...);
+GstCaps *gst_caps_new_full_valist (GstStructure *structure, va_list var_args);
+GstCaps *gst_caps_copy (const GstCaps *caps);
+void gst_caps_free (GstCaps *caps);
+G_CONST_RETURN GstCaps *gst_static_caps_get (GstStaticCaps *caps);
/* manipulation */
-void gst_caps2_append (GstCaps2 *caps1, GstCaps2 *caps2);
-void gst_caps2_append_cap (GstCaps2 *caps1, GstStructure *structure);
-GstCaps2 *gst_caps2_split_one (GstCaps2 *caps);
-int gst_caps2_get_n_structures (const GstCaps2 *caps);
-GstStructure *gst_caps2_get_nth_cap (const GstCaps2 *caps, int index);
-GstCaps2 *gst_caps2_copy_1 (const GstCaps2 *caps);
-void gst_caps2_set_simple (GstCaps2 *caps, char *field, ...);
-void gst_caps2_set_simple_valist (GstCaps2 *caps, char *field, va_list varargs);
+void gst_caps_append (GstCaps *caps1, GstCaps *caps2);
+void gst_caps_append_structure (GstCaps *caps1, GstStructure *structure);
+GstCaps *gst_caps_split_one (GstCaps *caps);
+int gst_caps_get_size (const GstCaps *caps);
+GstStructure *gst_caps_get_structure (const GstCaps *caps, int index);
+GstCaps *gst_caps_copy_1 (const GstCaps *caps);
+void gst_caps_set_simple (GstCaps *caps, char *field, ...);
+void gst_caps_set_simple_valist (GstCaps *caps, char *field, va_list varargs);
/* tests */
-gboolean gst_caps2_is_any (const GstCaps2 *caps);
-gboolean gst_caps2_is_empty (const GstCaps2 *caps);
-gboolean gst_caps2_is_chained (const GstCaps2 *caps);
-gboolean gst_caps2_is_fixed (const GstCaps2 *caps);
-gboolean gst_caps2_is_always_compatible (const GstCaps2 *caps1,
- const GstCaps2 *caps2);
+gboolean gst_caps_is_any (const GstCaps *caps);
+gboolean gst_caps_is_empty (const GstCaps *caps);
+gboolean gst_caps_is_chained (const GstCaps *caps);
+gboolean gst_caps_is_fixed (const GstCaps *caps);
+gboolean gst_caps_is_always_compatible (const GstCaps *caps1,
+ const GstCaps *caps2);
/* operations */
-GstCaps2 *gst_caps2_intersect (const GstCaps2 *caps1, const GstCaps2 *caps2);
-GstCaps2 *gst_caps2_union (const GstCaps2 *caps1, const GstCaps2 *caps2);
-GstCaps2 *gst_caps2_normalize (const GstCaps2 *caps);
+GstCaps *gst_caps_intersect (const GstCaps *caps1, const GstCaps *caps2);
+GstCaps *gst_caps_union (const GstCaps *caps1, const GstCaps *caps2);
+GstCaps *gst_caps_normalize (const GstCaps *caps);
#ifndef GST_DISABLE_LOADSAVE
-xmlNodePtr gst_caps2_save_thyself (const GstCaps2 *caps, xmlNodePtr parent);
-GstCaps2 *gst_caps2_load_thyself (xmlNodePtr parent);
+xmlNodePtr gst_caps_save_thyself (const GstCaps *caps, xmlNodePtr parent);
+GstCaps *gst_caps_load_thyself (xmlNodePtr parent);
#endif
/* utility */
-void gst_caps2_replace (GstCaps2 **caps, GstCaps2 *newcaps);
-gchar *gst_caps2_to_string (const GstCaps2 *caps);
-GstCaps2 *gst_caps2_from_string (const gchar *string);
-void gst_caps2_debug (const GstCaps2 *caps, const gchar *string);
+void gst_caps_replace (GstCaps **caps, GstCaps *newcaps);
+gchar *gst_caps_to_string (const GstCaps *caps);
+GstCaps *gst_caps_from_string (const gchar *string);
+void gst_caps_debug (const GstCaps *caps, const gchar *string);
-gboolean gst_caps2_structure_fixate_field_nearest_int (GstStructure *structure,
+gboolean gst_caps_structure_fixate_field_nearest_int (GstStructure *structure,
const char *field_name, int target);
-gboolean gst_caps2_structure_fixate_field_nearest_double (GstStructure
+gboolean gst_caps_structure_fixate_field_nearest_double (GstStructure
*structure, const char *field_name, double target);
G_END_DECLS
-#endif /* __GST_CAPS2_H__ */
+#endif /* __GST_CAPS_H__ */
if (padtempl->direction == GST_PAD_SRC &&
compattempl->direction == GST_PAD_SINK) {
GST_CAT_DEBUG (GST_CAT_CAPS, "compatible direction: found src pad template");
- comp = gst_caps2_is_always_compatible (GST_PAD_TEMPLATE_CAPS (compattempl),
+ comp = gst_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (compattempl),
GST_PAD_TEMPLATE_CAPS (padtempl));
GST_CAT_DEBUG (GST_CAT_CAPS, "caps are %scompatible", (comp ? "" : "not "));
} else if (padtempl->direction == GST_PAD_SINK &&
compattempl->direction == GST_PAD_SRC) {
GST_CAT_DEBUG (GST_CAT_CAPS, "compatible direction: found sink pad template");
- comp = gst_caps2_is_always_compatible (GST_PAD_TEMPLATE_CAPS (compattempl),
+ comp = gst_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (compattempl),
GST_PAD_TEMPLATE_CAPS (padtempl));
GST_CAT_DEBUG (GST_CAT_CAPS, "caps are %scompatible", (comp ? "" : "not "));
}
* gst_element_get_compatible_pad_filtered:
* @element: a #GstElement in which the pad should be found.
* @pad: the #GstPad to find a compatible one for.
- * @filtercaps: the #GstCaps2 to use as a filter.
+ * @filtercaps: the #GstCaps to use as a filter.
*
* Looks for an unlinked pad to which the given pad can link to.
* It is not guaranteed that linking the pads will work, though
*/
GstPad*
gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad,
- const GstCaps2 *filtercaps)
+ const GstCaps *filtercaps)
{
const GList *pads;
GstPadTemplate *templ;
- GstCaps2 *templcaps;
+ GstCaps *templcaps;
GstPad *foundpad = NULL;
/* checks */
/* try to create a new one */
/* requesting is a little crazy, we need a template. Let's create one */
if (filtercaps != NULL) {
- templcaps = gst_caps2_intersect (filtercaps, (GstCaps2 *) GST_RPAD_CAPS (pad));
+ templcaps = gst_caps_intersect (filtercaps, (GstCaps *) GST_RPAD_CAPS (pad));
/* FIXME */
if (templcaps == NULL)
return NULL;
} else {
- templcaps = gst_caps2_copy (gst_pad_get_caps (pad));
+ templcaps = gst_caps_copy (gst_pad_get_caps (pad));
}
templ = gst_pad_template_new ((gchar *) GST_PAD_NAME (pad), GST_RPAD_DIRECTION (pad),
have caps on their source padtemplates (spider) can link... */
if (!foundpad && !filtercaps) {
templ = gst_pad_template_new ((gchar *) GST_PAD_NAME (pad), GST_RPAD_DIRECTION (pad),
- GST_PAD_ALWAYS, gst_caps2_new_any());
+ GST_PAD_ALWAYS, gst_caps_new_any());
foundpad = gst_element_request_compatible_pad (element, templ);
gst_object_unref (GST_OBJECT (templ));
}
* @srcpadname: the name of the #GstPad in source element or NULL for any pad.
* @dest: the #GstElement containing the destination pad.
* @destpadname: the name of the #GstPad in destination element or NULL for any pad.
- * @filtercaps: the #GstCaps2 to use as a filter.
+ * @filtercaps: the #GstCaps to use as a filter.
*
* Links the two named pads of the source and destination elements.
* Side effect is that if one of the pads has no parent, it becomes a
gboolean
gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname,
- const GstCaps2 *filtercaps)
+ const GstCaps *filtercaps)
{
const GList *srcpads, *destpads, *srctempls, *desttempls, *l;
GstPad *srcpad, *destpad;
desttempl = (GstPadTemplate*) l->data;
if (desttempl->presence == GST_PAD_REQUEST &&
desttempl->direction != srctempl->direction) {
- if (gst_caps2_is_always_compatible (gst_pad_template_get_caps (srctempl),
+ if (gst_caps_is_always_compatible (gst_pad_template_get_caps (srctempl),
gst_pad_template_get_caps (desttempl))) {
srcpad = gst_element_get_request_pad (src,
srctempl->name_template);
* gst_element_link_filtered:
* @src: a #GstElement containing the source pad.
* @dest: the #GstElement containing the destination pad.
- * @filtercaps: the #GstCaps2 to use as a filter.
+ * @filtercaps: the #GstCaps to use as a filter.
*
* Links the source to the destination element using the filtercaps.
* The link must be from source to destination, the other
*/
gboolean
gst_element_link_filtered (GstElement *src, GstElement *dest,
- const GstCaps2 *filtercaps)
+ const GstCaps *filtercaps)
{
return gst_element_link_pads_filtered (src, NULL, dest, NULL, filtercaps);
}
while (pads) {
GstRealPad *pad = GST_PAD_REALIZE (pads->data);
- gst_caps2_replace (&GST_PAD_CAPS (pad), NULL);
+ gst_caps_replace (&GST_PAD_CAPS (pad), NULL);
pads = g_list_next (pads);
}
gst_element_get_pad_list (GstElement *element);
GstPad* gst_element_get_compatible_pad (GstElement *element, GstPad *pad);
GstPad* gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad,
- const GstCaps2 *filtercaps);
+ const GstCaps *filtercaps);
GstPadTemplate* gst_element_class_get_pad_template (GstElementClass *element_class, const gchar *name);
GList* gst_element_class_get_pad_template_list (GstElementClass *element_class);
gboolean gst_element_link_many (GstElement *element_1,
GstElement *element_2, ...);
gboolean gst_element_link_filtered (GstElement *src, GstElement *dest,
- const GstCaps2 *filtercaps);
+ const GstCaps *filtercaps);
void gst_element_unlink (GstElement *src, GstElement *dest);
void gst_element_unlink_many (GstElement *element_1,
GstElement *element_2, ...);
GstElement *dest, const gchar *destpadname);
gboolean gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname,
- const GstCaps2 *filtercaps);
+ const GstCaps *filtercaps);
void gst_element_unlink_pads (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname);
GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
gboolean gst_element_factory_can_src_caps (GstElementFactory *factory,
- const GstCaps2 *caps);
+ const GstCaps *caps);
gboolean gst_element_factory_can_sink_caps (GstElementFactory *factory,
- const GstCaps2 *caps);
+ const GstCaps *caps);
void __gst_element_factory_add_pad_template (GstElementFactory *elementfactory,
GstPadTemplate *templ);
*/
gboolean
gst_element_factory_can_src_caps (GstElementFactory *factory,
- const GstCaps2 *caps)
+ const GstCaps *caps)
{
GList *templates;
GstPadTemplate *template = (GstPadTemplate *)templates->data;
if (template->direction == GST_PAD_SRC) {
- if (gst_caps2_is_always_compatible (GST_PAD_TEMPLATE_CAPS (template), caps))
+ if (gst_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (template), caps))
return TRUE;
}
templates = g_list_next (templates);
*/
gboolean
gst_element_factory_can_sink_caps (GstElementFactory *factory,
- const GstCaps2 *caps)
+ const GstCaps *caps)
{
GList *templates;
GstPadTemplate *template = (GstPadTemplate *)templates->data;
if (template->direction == GST_PAD_SINK) {
- if (gst_caps2_is_always_compatible (caps, GST_PAD_TEMPLATE_CAPS (template)))
+ if (gst_caps_is_always_compatible (caps, GST_PAD_TEMPLATE_CAPS (template)))
return TRUE;
}
templates = g_list_next (templates);
#include "gstvalue.h"
/* FIXME */
-#define gst_caps2_debug(a,b) GST_DEBUG_CAPS(b,a)
+#define gst_caps_debug(a,b) GST_DEBUG_CAPS(b,a)
enum {
static void gst_pad_dispose (GObject *object);
static gboolean gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
- const GstCaps2 *caps, gboolean clear);
+ const GstCaps *caps, gboolean clear);
static void gst_pad_set_pad_template (GstPad *pad, GstPadTemplate *templ);
-static GstCaps2 * _gst_pad_try_fixate_caps (GstRealPad *pad, GstCaps2 *caps);
-static GstCaps2 * _gst_pad_default_fixate_func (GstPad *pad, GstCaps2 *caps, gpointer unused);
+static GstCaps * _gst_pad_try_fixate_caps (GstRealPad *pad, GstCaps *caps);
+static GstCaps * _gst_pad_default_fixate_func (GstPad *pad, GstCaps *caps, gpointer unused);
#ifndef GST_DISABLE_LOADSAVE
static xmlNodePtr gst_pad_save_thyself (GstObject *object, xmlNodePtr parent);
g_signal_new ("caps_nego_failed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRealPadClass, caps_nego_failed), NULL, NULL,
gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
- GST_TYPE_CAPS2);
+ GST_TYPE_CAPS);
gst_real_pad_signals[REAL_LINKED] =
g_signal_new ("linked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstRealPadClass, linked), NULL, NULL,
TRUE, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), REAL_ARG_CAPS,
g_param_spec_boxed ("caps", "Caps", "The capabilities of the pad",
- GST_TYPE_CAPS2, G_PARAM_READABLE));
+ GST_TYPE_CAPS, G_PARAM_READABLE));
#ifndef GST_DISABLE_LOADSAVE
gstobject_class->save_thyself = GST_DEBUG_FUNCPTR (gst_pad_save_thyself);
* gst_pad_can_link_filtered:
* @srcpad: the source #GstPad to link.
* @sinkpad: the sink #GstPad to link.
- * @filtercaps: the filter #GstCaps2.
+ * @filtercaps: the filter #GstCaps.
*
* Checks if the source pad and the sink pad can be linked when constrained
* by the given filter caps.
*/
gboolean
gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad,
- const GstCaps2 *filtercaps)
+ const GstCaps *filtercaps)
{
GstRealPad *realsrc, *realsink;
* gst_pad_link_filtered:
* @srcpad: the source #GstPad to link.
* @sinkpad: the sink #GstPad to link.
- * @filtercaps: the filter #GstCaps2.
+ * @filtercaps: the filter #GstCaps.
*
* Links the source pad and the sink pad, constrained
* by the given filter caps. This function sinks the caps.
*/
gboolean
gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad,
- const GstCaps2 *filtercaps)
+ const GstCaps *filtercaps)
{
GstRealPad *realsrc, *realsink;
GstScheduler *src_sched, *sink_sched;
* 3. sets fixed caps on the pad.
*/
static GstPadLinkReturn
-gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps2 *caps, gboolean notify)
+gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify)
{
- GstCaps2 *allowed = NULL;
+ GstCaps *allowed = NULL;
GstElement *parent = GST_PAD_PARENT (pad);
g_return_val_if_fail (pad != NULL, GST_PAD_LINK_REFUSED);
/* do we have to check the caps against something? */
if (allowed) {
- GstCaps2 *intersection;
+ GstCaps *intersection;
/* check against calculated caps */
- intersection = gst_caps2_intersect (caps, allowed);
+ intersection = gst_caps_intersect (caps, allowed);
/* oops, empty intersection, caps don't have anything in common */
- if (gst_caps2_is_empty (intersection)) {
+ if (gst_caps_is_empty (intersection)) {
GST_CAT_INFO (GST_CAT_CAPS, "caps did not intersect with %s:%s's allowed caps",
GST_DEBUG_PAD_NAME (pad));
- gst_caps2_debug (caps, "caps themselves (attemped to set)");
- gst_caps2_debug (allowed,
+ gst_caps_debug (caps, "caps themselves (attemped to set)");
+ gst_caps_debug (allowed,
"allowed caps that did not agree with caps");
- gst_caps2_free (allowed);
+ gst_caps_free (allowed);
return GST_PAD_LINK_REFUSED;
}
/* caps checks out fine, we can unref the intersection now */
- gst_caps2_free (intersection);
- gst_caps2_free (allowed);
+ gst_caps_free (intersection);
+ gst_caps_free (allowed);
/* given that the caps are fixed, we know that their intersection with the
* padtemplate caps is the same as caps itself */
}
gboolean negotiating;
gchar *s;
- s = gst_caps2_to_string (caps);
+ s = gst_caps_to_string (caps);
GST_CAT_INFO (GST_CAT_CAPS, "calling link function on pad %s:%s with caps %s",
GST_DEBUG_PAD_NAME (pad), s);
g_free (s);
}
}
/* we can only set caps on the pad if they are fixed */
- if (gst_caps2_is_fixed (caps)) {
+ if (gst_caps_is_fixed (caps)) {
GST_CAT_INFO (GST_CAT_CAPS, "setting caps on pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
/* if we got this far all is ok, remove the old caps, set the new one */
- gst_caps2_replace (&GST_PAD_CAPS (pad), gst_caps2_copy (caps));
+ gst_caps_replace (&GST_PAD_CAPS (pad), gst_caps_copy (caps));
g_object_notify (G_OBJECT (pad), "caps");
}
return GST_PAD_LINK_OK;
}
-static GstCaps2 *
-_gst_pad_try_fixate_caps (GstRealPad *pad, GstCaps2 *caps)
+static GstCaps *
+_gst_pad_try_fixate_caps (GstRealPad *pad, GstCaps *caps)
{
GstRealPad *srcpad;
GstRealPad *sinkpad;
GstPadFixateFunction app_fixate = NULL;
- GstCaps2 *newcaps;
+ GstCaps *newcaps;
g_return_val_if_fail (caps != NULL, NULL);
- g_return_val_if_fail (!gst_caps2_is_empty(caps), NULL);
+ g_return_val_if_fail (!gst_caps_is_empty(caps), NULL);
if (GST_PAD_IS_SRC (pad)) {
srcpad = pad;
srcpad = GST_RPAD_PEER (pad);
}
- while (!gst_caps2_is_fixed (caps)) {
+ while (!gst_caps_is_fixed (caps)) {
if (app_fixate) {
newcaps = (app_fixate) (GST_PAD (srcpad), caps, NULL);
if (newcaps) {
return TRUE;
}
-static GstCaps2 *
-_gst_pad_default_fixate_func (GstPad *pad, GstCaps2 *caps, gpointer unused)
+static GstCaps *
+_gst_pad_default_fixate_func (GstPad *pad, GstCaps *caps, gpointer unused)
{
- static GstStaticCaps2 octetcaps = GST_STATIC_CAPS (
+ static GstStaticCaps octetcaps = GST_STATIC_CAPS (
"application/octet-stream");
GstStructure *structure;
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (caps != NULL, NULL);
- g_return_val_if_fail (!gst_caps2_is_empty (caps), NULL);
+ g_return_val_if_fail (!gst_caps_is_empty (caps), NULL);
- if (gst_caps2_is_any (caps)) {
- gst_caps2_free (caps);
- return gst_caps2_copy (gst_static_caps2_get (&octetcaps));
+ if (gst_caps_is_any (caps)) {
+ gst_caps_free (caps);
+ return gst_caps_copy (gst_static_caps_get (&octetcaps));
}
if (caps->structs->len > 1) {
- GstCaps2 *retcaps = gst_caps2_copy_1 (caps);
- gst_caps2_free (caps);
+ GstCaps *retcaps = gst_caps_copy_1 (caps);
+ gst_caps_free (caps);
return retcaps;
}
- structure = gst_caps2_get_nth_cap (caps, 0);
+ structure = gst_caps_get_structure (caps, 0);
gst_structure_foreach (structure, _gst_pad_default_fixate_foreach,
structure);
/**
* gst_pad_try_set_caps:
* @pad: a #GstPad to try to set the caps on.
- * @caps: the #GstCaps2 to set.
+ * @caps: the #GstCaps to set.
*
* Tries to set the caps on the given pad. Ownership is always taken
* of the caps, so you will need to unref non-floating caps.
* could be set.
*/
GstPadLinkReturn
-gst_pad_try_set_caps (GstPad *pad, const GstCaps2 *caps)
+gst_pad_try_set_caps (GstPad *pad, const GstCaps *caps)
{
GstRealPad *peer, *realpad;
- GstCaps2 *mycaps;
+ GstCaps *mycaps;
GstPadLinkReturn set_retval;
realpad = GST_PAD_REALIZE (pad);
GST_CAT_INFO (GST_CAT_CAPS, "trying to set caps %p on pad %s:%s",
caps, GST_DEBUG_PAD_NAME (realpad));
- gst_caps2_debug (caps, "caps that we are trying to set");
+ gst_caps_debug (caps, "caps that we are trying to set");
/* try to take ownership */
- mycaps = gst_caps2_copy (caps);
+ mycaps = gst_caps_copy (caps);
/* setting non fixed caps on a pad is not allowed */
- if (!gst_caps2_is_fixed (mycaps)) {
+ if (!gst_caps_is_fixed (mycaps)) {
GST_CAT_INFO (GST_CAT_CAPS,
"trying to set unfixed caps on pad %s:%s, not allowed",
GST_DEBUG_PAD_NAME (realpad));
g_warning ("trying to set non fixed caps on pad %s:%s, not allowed",
GST_DEBUG_PAD_NAME (realpad));
- gst_caps2_debug (mycaps, "unfixed caps");
+ gst_caps_debug (mycaps, "unfixed caps");
set_retval = GST_PAD_LINK_DELAYED;
goto done;
}
done:
/* if we took ownership, the caps will be freed */
- //gst_caps2_free (caps);
+ //gst_caps_free (caps);
return set_retval;
}
*/
static gboolean
gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
- const GstCaps2 *filtercaps, gboolean clear)
+ const GstCaps *filtercaps, gboolean clear)
{
- GstCaps2 *srccaps, *sinkcaps;
- GstCaps2 *intersection = NULL;
+ GstCaps *srccaps, *sinkcaps;
+ GstCaps *intersection = NULL;
GstRealPad *realsrc, *realsink;
realsrc = GST_PAD_REALIZE (srcpad);
"start relink filtered %s:%s and %s:%s, clearing caps",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
- gst_caps2_replace (&GST_PAD_CAPS (GST_PAD (realsrc)), NULL);
- gst_caps2_replace (&GST_PAD_CAPS (GST_PAD (realsink)), NULL);
+ gst_caps_replace (&GST_PAD_CAPS (GST_PAD (realsrc)), NULL);
+ gst_caps_replace (&GST_PAD_CAPS (GST_PAD (realsink)), NULL);
}
else {
GST_CAT_INFO (GST_CAT_PADS, "start relink filtered %s:%s and %s:%s",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
}
- srccaps = gst_caps2_copy(gst_pad_get_caps (GST_PAD (realsrc)));
+ srccaps = gst_caps_copy(gst_pad_get_caps (GST_PAD (realsrc)));
GST_CAT_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s",
GST_DEBUG_PAD_NAME (realsrc));
- gst_caps2_debug (srccaps, "caps of src pad (pre-relink)");
- sinkcaps = gst_caps2_copy(gst_pad_get_caps (GST_PAD (realsink)));
+ gst_caps_debug (srccaps, "caps of src pad (pre-relink)");
+ sinkcaps = gst_caps_copy(gst_pad_get_caps (GST_PAD (realsink)));
GST_CAT_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s",
GST_DEBUG_PAD_NAME (realsink));
- gst_caps2_debug (sinkcaps, "caps of sink pad (pre-relink)");
+ gst_caps_debug (sinkcaps, "caps of sink pad (pre-relink)");
/* first take the intersection of the pad caps */
- intersection = gst_caps2_intersect (srccaps, sinkcaps);
- gst_caps2_debug (intersection, "caps of intersection");
+ intersection = gst_caps_intersect (srccaps, sinkcaps);
+ gst_caps_debug (intersection, "caps of intersection");
/* if we have no intersection but one of the caps was not NULL.. */
- if (gst_caps2_is_empty(intersection)) {
+ if (gst_caps_is_empty(intersection)) {
/* the intersection is EMPTY, they have no common format */
GST_CAT_INFO (GST_CAT_PADS, "pads %s:%s and %s:%s have no common type",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
/* make sure any floating caps from gst_pad_get_caps are freed here */
- gst_caps2_free (srccaps);
- gst_caps2_free (sinkcaps);
+ gst_caps_free (srccaps);
+ gst_caps_free (sinkcaps);
return FALSE;
} else {
GST_CAT_INFO (GST_CAT_PADS, "pads %s:%s and %s:%s intersected to %s caps",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink),
(intersection ?
- (gst_caps2_is_fixed (intersection) ? "fixed" : "variable") :
+ (gst_caps_is_fixed (intersection) ? "fixed" : "variable") :
"NULL"));
/* we don't need those anymore, as the caps can be floating */
- gst_caps2_free (srccaps);
- gst_caps2_free (sinkcaps);
+ gst_caps_free (srccaps);
+ gst_caps_free (sinkcaps);
/* then filter this against the app filter */
if (filtercaps) {
- GstCaps2 *filtered_intersection;
+ GstCaps *filtered_intersection;
GST_DEBUG_CAPS ("filter caps are ", filtercaps);
- filtered_intersection = gst_caps2_intersect (intersection, filtercaps);
+ filtered_intersection = gst_caps_intersect (intersection, filtercaps);
- gst_caps2_free (intersection);
+ gst_caps_free (intersection);
- if (gst_caps2_is_empty(filtered_intersection)) {
+ if (gst_caps_is_empty(filtered_intersection)) {
GST_CAT_INFO (GST_CAT_PADS,
"filtered link between pads %s:%s and %s:%s is empty",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
intersection = filtered_intersection;
/* keep a reference to the app caps */
- gst_caps2_replace (&GST_RPAD_APPFILTER (realsink),
- gst_caps2_copy (filtercaps));
- gst_caps2_replace (&GST_RPAD_APPFILTER (realsrc),
- gst_caps2_copy (filtercaps));
+ gst_caps_replace (&GST_RPAD_APPFILTER (realsink),
+ gst_caps_copy (filtercaps));
+ gst_caps_replace (&GST_RPAD_APPFILTER (realsrc),
+ gst_caps_copy (filtercaps));
}
}
GST_CAT_DEBUG (GST_CAT_CAPS, "setting filter for link to:");
- gst_caps2_debug (intersection, "filter for link");
+ gst_caps_debug (intersection, "filter for link");
- gst_caps2_free (intersection);
+ gst_caps_free (intersection);
return gst_pad_perform_negotiate (GST_PAD (realsrc), GST_PAD (realsink));
}
gboolean
gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad)
{
- GstCaps2 *intersection, *filtered_intersection;
+ GstCaps *intersection, *filtered_intersection;
GstRealPad *realsrc, *realsink;
- GstCaps2 *srccaps, *sinkcaps, *filter;
+ GstCaps *srccaps, *sinkcaps, *filter;
gboolean res = TRUE;
GstElement *parent;
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
filter = GST_RPAD_APPFILTER (realsrc);
- if (filter == NULL) filter = gst_caps2_new_any ();
+ if (filter == NULL) filter = gst_caps_new_any ();
if (filter) {
GST_CAT_INFO (GST_CAT_PADS, "dumping filter for link %s:%s-%s:%s",
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
- gst_caps2_debug (filter, "link filter caps");
+ gst_caps_debug (filter, "link filter caps");
}
/* calculate the new caps here */
srccaps = gst_pad_get_caps (GST_PAD (realsrc));
GST_CAT_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s",
GST_DEBUG_PAD_NAME (realsrc));
- gst_caps2_debug (srccaps,
+ gst_caps_debug (srccaps,
"src caps, awaiting negotiation, before applying filter");
sinkcaps = gst_pad_get_caps (GST_PAD (realsink));
GST_CAT_DEBUG (GST_CAT_PADS, "dumping caps of pad %s:%s",
GST_DEBUG_PAD_NAME (realsink));
- gst_caps2_debug (sinkcaps,
+ gst_caps_debug (sinkcaps,
"sink caps, awaiting negotiation, before applying filter");
- intersection = gst_caps2_intersect (srccaps, sinkcaps);
- gst_caps2_debug (intersection, "intersection of srccaps and sinkcaps");
- filtered_intersection = gst_caps2_intersect (intersection, filter);
- gst_caps2_free (intersection);
+ intersection = gst_caps_intersect (srccaps, sinkcaps);
+ gst_caps_debug (intersection, "intersection of srccaps and sinkcaps");
+ filtered_intersection = gst_caps_intersect (intersection, filter);
+ gst_caps_free (intersection);
- gst_caps2_debug (filtered_intersection,
+ gst_caps_debug (filtered_intersection,
"intersection of srccaps, sinkcaps, and filter");
- if (!gst_caps2_is_fixed (filtered_intersection)) {
- GstCaps2 *newcaps = _gst_pad_try_fixate_caps (realsrc, filtered_intersection);
+ if (!gst_caps_is_fixed (filtered_intersection)) {
+ GstCaps *newcaps = _gst_pad_try_fixate_caps (realsrc, filtered_intersection);
if (newcaps == NULL) {
- gst_caps2_free (filtered_intersection);
+ gst_caps_free (filtered_intersection);
g_critical("caps are not fixed, refusing");
GST_CAT_INFO (GST_CAT_CAPS, "caps are not fixed, refusing");
return GST_PAD_LINK_REFUSED;
}
/* no negotiation is performed if the pads have filtercaps */
- if (!gst_caps2_is_empty(filtered_intersection)) {
+ if (!gst_caps_is_empty(filtered_intersection)) {
GstPadLinkReturn link_res;
link_res = gst_pad_try_set_caps_func (realsrc, filtered_intersection, TRUE);
success:
cleanup:
- gst_caps2_free (srccaps);
- gst_caps2_free (sinkcaps);
- gst_caps2_free (filtered_intersection);
+ gst_caps_free (srccaps);
+ gst_caps_free (sinkcaps);
+ gst_caps_free (filtered_intersection);
return res;
error:
*/
gboolean
gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad,
- const GstCaps2 *filtercaps)
+ const GstCaps *filtercaps)
{
GstRealPad *realsrc, *realsink;
*/
gboolean
gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad,
- const GstCaps2 *filtercaps)
+ const GstCaps *filtercaps)
{
GstRealPad *realsrc, *realsink;
/**
* gst_pad_proxy_link:
* @pad: a #GstPad to proxy to.
- * @caps: the #GstCaps2 to use in proxying.
+ * @caps: the #GstCaps to use in proxying.
*
* Proxies the link function to the specified pad.
*
* Returns: TRUE if the peer pad accepted the caps, FALSE otherwise.
*/
GstPadLinkReturn
-gst_pad_proxy_link (GstPad *pad, const GstCaps2 *caps)
+gst_pad_proxy_link (GstPad *pad, const GstCaps *caps)
{
GstRealPad *peer, *realpad;
- GstCaps2 *mycaps;
+ GstCaps *mycaps;
realpad = GST_PAD_REALIZE (pad);
GST_CAT_INFO (GST_CAT_CAPS, "proxy link to pad %s:%s",
GST_DEBUG_PAD_NAME (realpad));
- mycaps = gst_caps2_copy(caps);
+ mycaps = gst_caps_copy(caps);
if (peer && gst_pad_try_set_caps_func (peer, mycaps, TRUE) < 0)
return GST_PAD_LINK_REFUSED;
*
* Gets the capabilities of this pad.
*
- * Returns: the #GstCaps2 of this pad. This function returns a new caps, so use
- * gst_caps2_free to get rid of it.
+ * Returns: the #GstCaps of this pad. This function returns a new caps, so use
+ * gst_caps_free to get rid of it.
*/
-GstCaps2*
+GstCaps*
gst_pad_get_caps (GstPad *pad)
{
GstRealPad *realpad;
GST_DEBUG_PAD_NAME (realpad), realpad);
if (GST_RPAD_GETCAPSFUNC (realpad)) {
- GstCaps2 *caps;
+ GstCaps *caps;
GST_CAT_DEBUG (GST_CAT_CAPS, "using pad get function");
caps = GST_RPAD_GETCAPSFUNC (realpad) (GST_PAD (realpad));
g_critical ("pad %s:%s returned NULL caps from getcaps function\n",
GST_ELEMENT_NAME(GST_PAD_PARENT(GST_PAD (realpad))),
GST_PAD_NAME(realpad));
- caps = gst_caps2_new_any ();
+ caps = gst_caps_new_any ();
}
return caps;
GstPadTemplate *templ = GST_PAD_PAD_TEMPLATE (realpad);
GST_CAT_DEBUG (GST_CAT_CAPS, "using pad template %p with caps %p",
templ, GST_PAD_TEMPLATE_CAPS (templ));
- return gst_caps2_copy (GST_PAD_TEMPLATE_CAPS (templ));
+ return gst_caps_copy (GST_PAD_TEMPLATE_CAPS (templ));
}
GST_CAT_DEBUG (GST_CAT_CAPS, "pad has no caps");
GST_DEBUG_PAD_NAME (realpad), realpad);
#endif
- return gst_caps2_new_any();
+ return gst_caps_new_any();
}
/**
*
* Gets the template capabilities of this pad.
*
- * Returns: the template #GstCaps2 of this pad, unref the caps
+ * Returns: the template #GstCaps of this pad, unref the caps
* if you no longer need it.
*/
-const GstCaps2*
+const GstCaps*
gst_pad_get_pad_template_caps (GstPad *pad)
{
- static GstStaticCaps2 anycaps = GST_STATIC_CAPS ("ANY");
+ static GstStaticCaps anycaps = GST_STATIC_CAPS ("ANY");
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
GST_DEBUG_PAD_NAME (realpad), realpad);
#endif
- return gst_static_caps2_get(&anycaps);
+ return gst_static_caps_get(&anycaps);
}
/**
*
* Gets the capability with the given name from this pad template.
*
- * Returns: the #GstCaps2, or NULL if not found or in case of an error. unref
+ * Returns: the #GstCaps, or NULL if not found or in case of an error. unref
* the caps if you no longer need it.
*/
-const GstCaps2*
+const GstCaps*
gst_pad_template_get_caps_by_name (GstPadTemplate *templ, const gchar *name)
{
- GstCaps2 *caps;
+ GstCaps *caps;
g_return_val_if_fail (templ != NULL, NULL);
return NULL;
/* FIXME */
- //return gst_caps2_copy (gst_caps2_get_by_name (caps, name));
+ //return gst_caps_copy (gst_caps_get_by_name (caps, name));
return NULL;
}
g_return_val_if_fail (GST_IS_PAD (sinkpad), FALSE);
if (GST_PAD_CAPS (srcpad) && GST_PAD_CAPS (sinkpad)) {
- if (!gst_caps2_is_always_compatible (GST_PAD_CAPS (srcpad),
+ if (!gst_caps_is_always_compatible (GST_PAD_CAPS (srcpad),
GST_PAD_CAPS (sinkpad))) {
return FALSE;
}
* Gets the capabilities of the allowed media types that can
* flow through this pad. The caller must free the resulting caps.
*
- * Returns: the allowed #GstCaps2 of the pad link. Free the caps when
+ * Returns: the allowed #GstCaps of the pad link. Free the caps when
* you no longer need it.
*/
-GstCaps2*
+GstCaps*
gst_pad_get_allowed_caps (GstPad *pad)
{
GstRealPad *realpad;
- GstCaps2 *mycaps;
- GstCaps2 *caps;
- GstCaps2 *filtercaps;
- GstCaps2 *peercaps;
+ GstCaps *mycaps;
+ GstCaps *caps;
+ GstCaps *filtercaps;
+ GstCaps *peercaps;
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
}
peercaps = gst_pad_get_caps (GST_PAD_PEER (realpad));
- caps = gst_caps2_intersect (mycaps, peercaps);
- gst_caps2_free (mycaps);
- gst_caps2_free (peercaps);
+ caps = gst_caps_intersect (mycaps, peercaps);
+ gst_caps_free (mycaps);
+ gst_caps_free (peercaps);
filtercaps = GST_RPAD_APPFILTER (realpad);
if (filtercaps) {
- return gst_caps2_intersect (caps, filtercaps);
+ return gst_caps_intersect (caps, filtercaps);
} else {
- return gst_caps2_copy (caps);
+ return gst_caps_copy (caps);
}
}
* on the console and returns FALSE otherwise.
*/
gboolean
-gst_pad_recover_caps_error (GstPad *pad, const GstCaps2 *allowed)
+gst_pad_recover_caps_error (GstPad *pad, const GstCaps *allowed)
{
GstElement *parent;
gst_real_pad_signals[REAL_CAPS_NEGO_FAILED], 0, FALSE))
{
/* clear pad caps first */
- gst_caps2_replace (&GST_PAD_CAPS (pad), NULL);
+ gst_caps_replace (&GST_PAD_CAPS (pad), NULL);
/* lets hope some signal manages to set the caps again */
g_signal_emit (G_OBJECT (pad), gst_real_pad_signals[REAL_CAPS_NEGO_FAILED], 0, allowed);
g_list_free (GST_REAL_PAD(pad)->ghostpads);
}
- gst_caps2_replace (&GST_PAD_CAPS (pad), NULL);
- gst_caps2_replace (&GST_RPAD_APPFILTER (pad), NULL);
+ gst_caps_replace (&GST_PAD_CAPS (pad), NULL);
+ gst_caps_replace (&GST_RPAD_APPFILTER (pad), NULL);
if (GST_IS_ELEMENT (GST_OBJECT_PARENT (pad))) {
GST_CAT_DEBUG (GST_CAT_REFCOUNTING, "removing pad from element '%s'",
g_free (GST_PAD_TEMPLATE_NAME_TEMPLATE (templ));
if (GST_PAD_TEMPLATE_CAPS (templ)) {
- gst_caps2_free (GST_PAD_TEMPLATE_CAPS (templ));
+ gst_caps_free (GST_PAD_TEMPLATE_CAPS (templ));
}
G_OBJECT_CLASS (padtemplate_parent_class)->dispose (object);
GST_PAD_TEMPLATE_DIRECTION (new) = pad_template->direction;
GST_PAD_TEMPLATE_PRESENCE (new) = pad_template->presence;
- GST_PAD_TEMPLATE_CAPS (new) = gst_caps2_copy (
- gst_static_caps2_get (&pad_template->static_caps));
+ GST_PAD_TEMPLATE_CAPS (new) = gst_caps_copy (
+ gst_static_caps_get (&pad_template->static_caps));
return new;
}
* @name_template: the name template.
* @direction: the #GstPadDirection of the template.
* @presence: the #GstPadPresence of the pad.
- * @caps: a #GstCaps2 set for the template. The caps are taken ownership of.
+ * @caps: a #GstCaps set for the template. The caps are taken ownership of.
*
* Creates a new pad template with a name according to the given template
* and with the given arguments. This functions takes ownership of the provided
GstPadTemplate*
gst_pad_template_new (const gchar *name_template,
GstPadDirection direction, GstPadPresence presence,
- GstCaps2 *caps)
+ GstCaps *caps)
{
GstPadTemplate *new;
*
* Gets the capabilities of the pad template.
*
- * Returns: the #GstCaps2 of the pad template. unref the caps
+ * Returns: the #GstCaps of the pad template. unref the caps
* after use.
*/
-const GstCaps2*
+const GstCaps*
gst_pad_template_get_caps (GstPadTemplate *templ)
{
g_return_val_if_fail (templ != NULL, NULL);
typedef const GstEventMask* (*GstPadEventMaskFunction) (GstPad *pad);
typedef const GstQueryType* (*GstPadQueryTypeFunction) (GstPad *pad);
-typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, const GstCaps2 *caps);
+typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, const GstCaps *caps);
typedef void (*GstPadUnlinkFunction) (GstPad *pad);
-typedef GstCaps2* (*GstPadGetCapsFunction) (GstPad *pad);
-typedef GstCaps2* (*GstPadFixateFunction) (GstPad *pad, const GstCaps2 *caps, gpointer user_data);
+typedef GstCaps* (*GstPadGetCapsFunction) (GstPad *pad);
+typedef GstCaps* (*GstPadFixateFunction) (GstPad *pad, const GstCaps *caps, gpointer user_data);
typedef GstBuffer* (*GstPadBufferAllocFunction) (GstPad *pad, guint64 offset, guint size);
typedef gboolean (*GstPadDispatcherFunction) (GstPad *pad, gpointer data);
GstPad pad;
/* the pad capabilities */
- GstCaps2 *caps;
+ GstCaps *caps;
GstPadFixateFunction appfixatefunc;
- GstCaps2 *appfilter;
+ GstCaps *appfilter;
GstPadGetCapsFunction getcapsfunc;
GstPadFixateFunction fixatefunc;
GstPadClass parent_class;
/* signal callbacks */
- void (*caps_nego_failed) (GstPad *pad, GstCaps2 *caps);
+ void (*caps_nego_failed) (GstPad *pad, GstCaps *caps);
void (*linked) (GstPad *pad, GstPad *peer);
void (*unlinked) (GstPad *pad, GstPad *peer);
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
- GstCaps2 *caps;
+ GstCaps *caps;
gpointer _gst_reserved[GST_PADDING];
};
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
- GstStaticCaps2 static_caps;
+ GstStaticCaps static_caps;
};
#define GST_STATIC_PAD_TEMPLATE(padname, dir, pres, caps) \
/* pad links */
void gst_pad_set_link_function (GstPad *pad, GstPadLinkFunction link);
gboolean gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad);
-gboolean gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps2 *filtercaps);
+gboolean gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
void gst_pad_set_unlink_function (GstPad *pad, GstPadUnlinkFunction unlink);
gboolean gst_pad_link (GstPad *srcpad, GstPad *sinkpad);
-gboolean gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps2 *filtercaps);
+gboolean gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
void gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
GstPad* gst_pad_get_peer (GstPad *pad);
/* capsnego functions */
-GstCaps2* gst_pad_get_caps (GstPad *pad);
-const GstCaps2* gst_pad_get_pad_template_caps (GstPad *pad);
-GstPadLinkReturn gst_pad_try_set_caps (GstPad *pad, const GstCaps2 *caps);
+GstCaps* gst_pad_get_caps (GstPad *pad);
+const GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
+GstPadLinkReturn gst_pad_try_set_caps (GstPad *pad, const GstCaps *caps);
gboolean gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad);
void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps);
void gst_pad_set_fixate_function (GstPad *pad, GstPadFixateFunction fixate);
-GstPadLinkReturn gst_pad_proxy_link (GstPad *pad, const GstCaps2 *caps);
-gboolean gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps2 *filtercaps);
+GstPadLinkReturn gst_pad_proxy_link (GstPad *pad, const GstCaps *caps);
+gboolean gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
gboolean gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad);
-gboolean gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps2 *filtercaps);
-GstCaps2* gst_pad_get_allowed_caps (GstPad *pad);
+gboolean gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps *filtercaps);
+GstCaps* gst_pad_get_allowed_caps (GstPad *pad);
void gst_pad_caps_change_notify (GstPad *pad);
-gboolean gst_pad_recover_caps_error (GstPad *pad, const GstCaps2 *allowed);
+gboolean gst_pad_recover_caps_error (GstPad *pad, const GstCaps *allowed);
/* data passing functions */
void gst_pad_push (GstPad *pad, GstData *data);
GstPadTemplate* gst_pad_template_new (const gchar *name_template,
GstPadDirection direction, GstPadPresence presence,
- GstCaps2 *caps);
+ GstCaps *caps);
GstPadTemplate * gst_static_pad_template_get (GstStaticPadTemplate *templ);
-const GstCaps2* gst_pad_template_get_caps (GstPadTemplate *templ);
-const GstCaps2* gst_pad_template_get_caps_by_name (GstPadTemplate *templ, const gchar *name);
+const GstCaps* gst_pad_template_get_caps (GstPadTemplate *templ);
+const GstCaps* gst_pad_template_get_caps_by_name (GstPadTemplate *templ, const gchar *name);
#ifndef GST_DISABLE_LOADSAVE
xmlNodePtr gst_ghost_pad_save_thyself (GstPad *pad,
GValue *value,
GParamSpec *pspec);
-static GstCaps2 *gst_queue_getcaps (GstPad *pad);
+static GstCaps *gst_queue_getcaps (GstPad *pad);
static GstPadLinkReturn
gst_queue_link (GstPad *pad,
- const GstCaps2 *caps);
+ const GstCaps *caps);
static void gst_queue_chain (GstPad *pad,
GstData *data);
static GstData *gst_queue_get (GstPad *pad);
}
static GstPadLinkReturn
-gst_queue_link (GstPad *pad, const GstCaps2 *caps)
+gst_queue_link (GstPad *pad, const GstCaps *caps)
{
return gst_pad_proxy_link (gst_queue_otherpad (pad), caps);
}
-static GstCaps2 *
+static GstCaps *
gst_queue_getcaps (GstPad *pad)
{
GstPad *otherpad = GST_PAD_PEER (gst_queue_otherpad (pad));
if (otherpad)
return gst_pad_get_caps (otherpad);
- return gst_caps2_new_any ();
+ return gst_caps_new_any ();
}
static void
GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (object);
if (factory->caps) {
- gst_caps2_free (factory->caps);
+ gst_caps_free (factory->caps);
factory->caps = NULL;
}
if (factory->extensions) {
*
* Gets the caps associated with a typefind factory.
*
- * Returns: the #GstCaps2 associated with this factory
+ * Returns: the #GstCaps associated with this factory
*/
-const GstCaps2 *
+const GstCaps *
gst_type_find_factory_get_caps (const GstTypeFindFactory *factory)
{
g_return_val_if_fail (GST_IS_TYPE_FIND_FACTORY (factory), NULL);
gboolean
gst_type_find_register (GstPlugin *plugin, const gchar *name, guint rank,
GstTypeFindFunction func, gchar **extensions,
- const GstCaps2 *possible_caps, gpointer data)
+ const GstCaps *possible_caps, gpointer data)
{
GstTypeFindFactory *factory;
g_strfreev (factory->extensions);
factory->extensions = g_strdupv (extensions);
- gst_caps2_replace (&factory->caps, gst_caps2_copy(possible_caps));
+ gst_caps_replace (&factory->caps, gst_caps_copy(possible_caps));
factory->function = func;
factory->user_data = data;
* It is up to the caller of the typefind function to interpret these values.
*/
void
-gst_type_find_suggest (GstTypeFind *find, guint probability, const GstCaps2 *caps)
+gst_type_find_suggest (GstTypeFind *find, guint probability, const GstCaps *caps)
{
g_return_if_fail (find->suggest != NULL);
g_return_if_fail (probability <= 100);
g_return_if_fail (caps != NULL);
- g_return_if_fail (gst_caps2_is_fixed (caps));
+ g_return_if_fail (gst_caps_is_fixed (caps));
find->suggest (find->data, probability, caps);
}
guint size);
void (* suggest) (gpointer data,
guint probability,
- const GstCaps2 * caps);
+ const GstCaps * caps);
gpointer data;
GstTypeFindFunction function;
gchar ** extensions;
- GstCaps2 * caps; /* FIXME: not yet saved in registry */
+ GstCaps * caps; /* FIXME: not yet saved in registry */
gpointer user_data;
guint size);
void gst_type_find_suggest (GstTypeFind * find,
guint probability,
- const GstCaps2 * caps);
+ const GstCaps * caps);
guint64 gst_type_find_get_length (GstTypeFind * find);
/* registration interface */
guint rank,
GstTypeFindFunction func,
gchar ** extensions,
- const GstCaps2 * possible_caps,
+ const GstCaps * possible_caps,
gpointer data);
/* typefinding interface */
GList * gst_type_find_factory_get_list (void);
gchar ** gst_type_find_factory_get_extensions (const GstTypeFindFactory *factory);
-const GstCaps2 * gst_type_find_factory_get_caps (const GstTypeFindFactory *factory);
+const GstCaps * gst_type_find_factory_get_caps (const GstTypeFindFactory *factory);
void gst_type_find_factory_call_function (const GstTypeFindFactory *factory,
GstTypeFind *find);
gst_print_pad_caps (GString * buf, gint indent, GstPad * pad)
{
GstRealPad *realpad;
- GstCaps2 *caps;
+ GstCaps *caps;
realpad = GST_PAD_REALIZE (pad);
caps = realpad->caps;
else {
char *s;
- s = gst_caps2_to_string(caps);
+ s = gst_caps_to_string(caps);
g_string_append(buf, s);
g_free(s);
}
/* GstCaps */
void
-gst_value_set_caps (GValue *value, const GstCaps2 *caps)
+gst_value_set_caps (GValue *value, const GstCaps *caps)
{
g_return_if_fail (GST_VALUE_HOLDS_CAPS (value));
- value->data[0].v_pointer = gst_caps2_copy (caps);
+ value->data[0].v_pointer = gst_caps_copy (caps);
}
-const GstCaps2 *
+const GstCaps *
gst_value_get_caps (const GValue *value)
{
g_return_val_if_fail (GST_VALUE_HOLDS_CAPS (value), 0);
double gst_value_get_double_range_min (const GValue *value);
double gst_value_get_double_range_max (const GValue *value);
-G_CONST_RETURN GstCaps2 *gst_value_get_caps (const GValue *value);
-void gst_value_set_caps (GValue *calue, const GstCaps2 *caps);
+G_CONST_RETURN GstCaps *gst_value_get_caps (const GValue *value);
+void gst_value_set_caps (GValue *calue, const GstCaps *caps);
void gst_value_list_prepend_value (GValue *value, const GValue *prepend_value);
void gst_value_list_append_value (GValue *value, const GValue *append_value);
gchar *src_pad;
gchar *sink_pad;
GstElement *sink;
- GstCaps2 *caps;
+ GstCaps *caps;
gulong signal_id;
/* FIXME: need to connect to "disposed" signal to clean up, but there is no such signal */
} DelayedLink;
g_slist_foreach (link->sink_pads, (GFunc) gst_parse_strfree, NULL);
g_slist_free (link->src_pads);
g_slist_free (link->sink_pads);
- if (link->caps) gst_caps2_free (link->caps);
+ if (link->caps) gst_caps_free (link->caps);
gst_parse_link_free (link);
}
static void
g_signal_handler_disconnect (src, link->signal_id);
g_free (link->src_pad);
g_free (link->sink_pad);
- if (link->caps) gst_caps2_free (link->caps);
+ if (link->caps) gst_caps_free (link->caps);
if (!gst_element_is_locked_state (src))
gst_parse_element_lock (link->sink, FALSE);
g_free (link);
/* both padnames and the caps may be NULL */
static gboolean
gst_parse_perform_delayed_link (GstElement *src, const gchar *src_pad,
- GstElement *sink, const gchar *sink_pad, GstCaps2 *caps)
+ GstElement *sink, const gchar *sink_pad, GstCaps *caps)
{
GList *templs = gst_element_get_pad_template_list (src);
data->src_pad = g_strdup (src_pad);
data->sink = sink;
data->sink_pad = g_strdup (sink_pad);
- data->caps = gst_caps2_copy (caps);
+ data->caps = gst_caps_copy (caps);
data->signal_id = g_signal_connect (G_OBJECT (src), "new_pad",
G_CALLBACK (gst_parse_found_pad), data);
return TRUE;
GST_CAT_INFO (GST_CAT_PIPELINE, "linking %s(%s):%u to %s(%s):%u with caps \"%s\"",
GST_ELEMENT_NAME (src), link->src_name ? link->src_name : "---", g_slist_length (srcs),
GST_ELEMENT_NAME (sink), link->sink_name ? link->sink_name : "---", g_slist_length (sinks),
- link->caps ? gst_caps2_to_string (link->caps) : "-");
+ link->caps ? gst_caps_to_string (link->caps) : "-");
if (!srcs || !sinks) {
if (gst_element_link_pads_filtered (src, srcs ? (const gchar *) srcs->data : NULL,
link: linkpart LINK linkpart { $$ = $1;
if ($2) {
- $$->caps = gst_caps2_from_string ($2);
+ $$->caps = gst_caps_from_string ($2);
if (!$$->caps)
ERROR (GST_PARSE_ERROR_LINK, "could not parse caps \"%s\"", $2);
gst_parse_strfree ($2);
gchar *sink_name;
GSList *src_pads;
GSList *sink_pads;
- GstCaps2 *caps;
+ GstCaps *caps;
} link_t;
typedef struct {
char *s;
s = g_strndup (text, text_len);
- registry->caps = gst_caps2_from_string (s);
+ registry->caps = gst_caps_from_string (s);
if (registry->caps == NULL) {
g_critical ("Could not parse caps: %d %*s\n", text_len, text_len, text);
}
static gboolean
-gst_xml_registry_save_caps (GstXMLRegistry *xmlregistry, const GstCaps2 *caps)
+gst_xml_registry_save_caps (GstXMLRegistry *xmlregistry, const GstCaps *caps)
{
- char *s = gst_caps2_to_string (caps);
+ char *s = gst_caps_to_string (caps);
PUT_ESCAPED ("caps", s);
return TRUE;
}
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
- GstCaps2 *caps;
+ GstCaps *caps;
gchar *caps_name;
gchar *structure_name;
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
#define GST_TYPE_AGGREGATOR_SCHED (gst_aggregator_sched_get_type())
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
#define GST_TYPE_FAKESINK_STATE_ERROR (gst_fakesink_state_error_get_type())
"src%d",
GST_PAD_SRC,
GST_PAD_REQUEST,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type())
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property);
}
-static GstCaps2*
+static GstCaps*
gst_identity_getcaps (GstPad *pad)
{
GstIdentity *identity;
if (peer) {
return gst_pad_get_caps (peer);
} else {
- return gst_caps2_new_any ();
+ return gst_caps_new_any ();
}
}
static GstPadLinkReturn
-gst_identity_link (GstPad *pad, const GstCaps2 *caps)
+gst_identity_link (GstPad *pad, const GstCaps *caps)
{
GstIdentity *identity;
identity = GST_IDENTITY (gst_pad_get_parent (pad));
- if (gst_caps2_is_fixed (caps)) {
+ if (gst_caps_is_fixed (caps)) {
if (identity->delay_capsnego && GST_PAD_IS_SINK (pad)) {
- identity->srccaps = gst_caps2_copy (caps);
+ identity->srccaps = gst_caps_copy (caps);
return GST_PAD_LINK_OK;
}
gboolean dump;
gchar *last_message;
gboolean delay_capsnego;
- GstCaps2 *srccaps;
+ GstCaps *srccaps;
};
struct _GstIdentityClass {
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
/* GObject stuff */
GValue *value,
GParamSpec *pspec);
-static GstCaps2 *gst_queue_getcaps (GstPad *pad);
+static GstCaps *gst_queue_getcaps (GstPad *pad);
static GstPadLinkReturn
gst_queue_link (GstPad *pad,
- const GstCaps2 *caps);
+ const GstCaps *caps);
static void gst_queue_chain (GstPad *pad,
GstData *data);
static GstData *gst_queue_get (GstPad *pad);
}
static GstPadLinkReturn
-gst_queue_link (GstPad *pad, const GstCaps2 *caps)
+gst_queue_link (GstPad *pad, const GstCaps *caps)
{
return gst_pad_proxy_link (gst_queue_otherpad (pad), caps);
}
-static GstCaps2 *
+static GstCaps *
gst_queue_getcaps (GstPad *pad)
{
GstPad *otherpad = GST_PAD_PEER (gst_queue_otherpad (pad));
if (otherpad)
return gst_pad_get_caps (otherpad);
- return gst_caps2_new_any ();
+ return gst_caps_new_any ();
}
static void
"src%d",
GST_PAD_SRC,
GST_PAD_SOMETIMES,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
GstStaticPadTemplate shaper_sink_template = GST_STATIC_PAD_TEMPLATE (
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
#define GST_TYPE_SHAPER_POLICY (gst_shaper_policy_get_type())
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR (gst_shaper_request_new_pad);
}
-static GstCaps2*
+static GstCaps*
gst_shaper_getcaps (GstPad *pad)
{
GstPad *otherpad;
otherpad = (pad == connection->srcpad ? connection->sinkpad : connection->srcpad);
- return gst_caps2_copy (gst_pad_get_allowed_caps (otherpad));
+ return gst_caps_copy (gst_pad_get_allowed_caps (otherpad));
}
static GList*
}
static GstPadLinkReturn
-gst_shaper_link (GstPad *pad, const GstCaps2 *caps)
+gst_shaper_link (GstPad *pad, const GstCaps *caps)
{
GstPad *otherpad;
GstShaperConnection *connection;
"src%d",
GST_PAD_SRC,
GST_PAD_REQUEST,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
static void gst_tee_base_init (gpointer g_class);
}
static GstPadLinkReturn
-gst_tee_sinklink (GstPad *pad, const GstCaps2 *caps)
+gst_tee_sinklink (GstPad *pad, const GstCaps *caps)
{
GstTee *tee;
const GList *pads;
GstPadLinkReturn set_retval;
- GST_DEBUG ( "gst_tee_sinklink caps=%s", gst_caps2_to_string(caps));
+ GST_DEBUG ( "gst_tee_sinklink caps=%s", gst_caps_to_string(caps));
tee = GST_TEE (gst_pad_get_parent (pad));
- if (!gst_caps2_is_fixed (caps)) {
+ if (!gst_caps_is_fixed (caps)) {
return GST_PAD_LINK_DELAYED;
}
}
static GstPadLinkReturn
-gst_tee_srclink (GstPad *pad, const GstCaps2 *caps)
+gst_tee_srclink (GstPad *pad, const GstCaps *caps)
{
GstTee *tee;
- GST_DEBUG ( "gst_tee_srclink caps=%s", gst_caps2_to_string(caps));
+ GST_DEBUG ( "gst_tee_srclink caps=%s", gst_caps_to_string(caps));
tee = GST_TEE (gst_pad_get_parent (pad));
return gst_pad_proxy_link (tee->sinkpad, caps);
}
-static GstCaps2*
+static GstCaps*
gst_tee_getcaps (GstPad *pad)
{
- GstCaps2 *caps = GST_CAPS2_ANY;
+ GstCaps *caps = GST_CAPS_ANY;
GstTee *tee;
const GList *pads;
while (pads) {
GstPad *srcpad = GST_PAD (pads->data);
GstPad *peer;
- const GstCaps2 *peercaps;
- GstCaps2 *newcaps;
+ const GstCaps *peercaps;
+ GstCaps *newcaps;
pads = g_list_next (pads);
}
peercaps = gst_pad_get_caps (peer);
- newcaps = gst_caps2_intersect (caps, peercaps);
- gst_caps2_free (caps);
+ newcaps = gst_caps_intersect (caps, peercaps);
+ gst_caps_free (caps);
caps = newcaps;
}
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
GstStaticPadTemplate type_find_element_src_template = GST_STATIC_PAD_TEMPLATE (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
/* TypeFind signals and args */
return typefind_type;
}
static void
-gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps2 *caps)
+gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps *caps)
{
gchar *caps_str;
g_assert (typefind->caps == NULL);
g_assert (caps != NULL);
- caps_str = gst_caps2_to_string (caps);
+ caps_str = gst_caps_to_string (caps);
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
g_free (caps_str);
- gst_caps2_replace (&typefind->caps, caps);
+ gst_caps_replace (&typefind->caps, caps);
if (gst_pad_try_set_caps (typefind->src, caps) < GST_PAD_LINK_OK) {
gst_element_error (GST_ELEMENT (typefind), "could not set caps on source pad");
}
g_object_class_install_property (gobject_class, ARG_CAPS,
g_param_spec_boxed ("caps", _("caps"), _("detected capabilities in stream"),
- gst_caps2_get_type(), G_PARAM_READABLE));
+ gst_caps_get_type(), G_PARAM_READABLE));
g_object_class_install_property (gobject_class, ARG_MINIMUM,
g_param_spec_uint ("minimum", _("minimum"), "minimum probability required to accept caps",
GST_TYPE_FIND_MINIMUM, GST_TYPE_FIND_MAXIMUM, GST_TYPE_FIND_MINIMUM, G_PARAM_READWRITE));
G_TYPE_FROM_CLASS (g_class), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstTypeFindElementClass, have_type), NULL, NULL,
gst_marshal_VOID__UINT_BOXED, G_TYPE_NONE, 2,
- G_TYPE_UINT, gst_caps2_get_type());
+ G_TYPE_UINT, gst_caps_get_type());
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state);
}
typedef struct {
GstTypeFindFactory * factory;
gint probability;
- GstCaps2 * caps;
+ GstCaps * caps;
gint64 requested_offset;
guint requested_size;
free_entry_buffers (entry);
if (entry->caps)
- gst_caps2_free (entry->caps);
+ gst_caps_free (entry->caps);
g_free (entry);
}
static void
}
}
static void
-find_suggest (gpointer data, guint probability, const GstCaps2 *caps)
+find_suggest (gpointer data, guint probability, const GstCaps *caps)
{
gchar *str;
TypeFindEntry *entry = (TypeFindEntry *) data;
- str = gst_caps2_to_string (caps);
+ str = gst_caps_to_string (caps);
GST_LOG_OBJECT (entry->self, "'%s' called suggest (%u, %s)",
GST_PLUGIN_FEATURE_NAME (entry->factory), probability, str);
g_free (str);
if (((gint) probability) > entry->probability) {
entry->probability = probability;
- gst_caps2_replace (&entry->caps, gst_caps2_copy (caps));
+ gst_caps_replace (&entry->caps, gst_caps_copy (caps));
}
}
static gint
free_entry (entry);
} else if (entry->probability >= typefind->max_probability) {
/* wooha, got caps */
- GstCaps2 *found_caps = entry->caps;
+ GstCaps *found_caps = entry->caps;
guint probability = entry->probability;
- found_caps = gst_caps2_copy (found_caps);
+ found_caps = gst_caps_copy (found_caps);
GST_INFO_OBJECT (typefind, "'%s' returned %u/%u probability, using it NOW",
GST_PLUGIN_FEATURE_NAME (entry->factory), probability, typefind->max_probability);
while (walk) {
typefind->possibilities = NULL;
g_list_free (typefind->possibilities);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, probability, found_caps);
- gst_caps2_free (found_caps);
+ gst_caps_free (found_caps);
} else {
typefind->possibilities = g_list_prepend (typefind->possibilities, entry);
}
break;
case GST_STATE_PAUSED_TO_READY:
stop_typefinding (typefind);
- gst_caps2_replace (&typefind->caps, NULL);
+ gst_caps_replace (&typefind->caps, NULL);
break;
default:
break;
guint min_probability;
guint max_probability;
- GstCaps2 * caps;
+ GstCaps * caps;
guint mode;
GstBufferStore * store;
/* signals */
void (*have_type) (GstTypeFindElement *element,
guint probability,
- GstCaps2 * caps);
+ GstCaps * caps);
};
GType gst_type_find_element_get_type (void);
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
GstStaticPadTemplate type_find_element_src_template = GST_STATIC_PAD_TEMPLATE (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS2_ANY
+ GST_STATIC_CAPS_ANY
);
/* TypeFind signals and args */
return typefind_type;
}
static void
-gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps2 *caps)
+gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps *caps)
{
gchar *caps_str;
g_assert (typefind->caps == NULL);
g_assert (caps != NULL);
- caps_str = gst_caps2_to_string (caps);
+ caps_str = gst_caps_to_string (caps);
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
g_free (caps_str);
- gst_caps2_replace (&typefind->caps, caps);
+ gst_caps_replace (&typefind->caps, caps);
if (gst_pad_try_set_caps (typefind->src, caps) < GST_PAD_LINK_OK) {
gst_element_error (GST_ELEMENT (typefind), "could not set caps on source pad");
}
g_object_class_install_property (gobject_class, ARG_CAPS,
g_param_spec_boxed ("caps", _("caps"), _("detected capabilities in stream"),
- gst_caps2_get_type(), G_PARAM_READABLE));
+ gst_caps_get_type(), G_PARAM_READABLE));
g_object_class_install_property (gobject_class, ARG_MINIMUM,
g_param_spec_uint ("minimum", _("minimum"), "minimum probability required to accept caps",
GST_TYPE_FIND_MINIMUM, GST_TYPE_FIND_MAXIMUM, GST_TYPE_FIND_MINIMUM, G_PARAM_READWRITE));
G_TYPE_FROM_CLASS (g_class), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstTypeFindElementClass, have_type), NULL, NULL,
gst_marshal_VOID__UINT_BOXED, G_TYPE_NONE, 2,
- G_TYPE_UINT, gst_caps2_get_type());
+ G_TYPE_UINT, gst_caps_get_type());
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state);
}
typedef struct {
GstTypeFindFactory * factory;
gint probability;
- GstCaps2 * caps;
+ GstCaps * caps;
gint64 requested_offset;
guint requested_size;
free_entry_buffers (entry);
if (entry->caps)
- gst_caps2_free (entry->caps);
+ gst_caps_free (entry->caps);
g_free (entry);
}
static void
}
}
static void
-find_suggest (gpointer data, guint probability, const GstCaps2 *caps)
+find_suggest (gpointer data, guint probability, const GstCaps *caps)
{
gchar *str;
TypeFindEntry *entry = (TypeFindEntry *) data;
- str = gst_caps2_to_string (caps);
+ str = gst_caps_to_string (caps);
GST_LOG_OBJECT (entry->self, "'%s' called suggest (%u, %s)",
GST_PLUGIN_FEATURE_NAME (entry->factory), probability, str);
g_free (str);
if (((gint) probability) > entry->probability) {
entry->probability = probability;
- gst_caps2_replace (&entry->caps, gst_caps2_copy (caps));
+ gst_caps_replace (&entry->caps, gst_caps_copy (caps));
}
}
static gint
free_entry (entry);
} else if (entry->probability >= typefind->max_probability) {
/* wooha, got caps */
- GstCaps2 *found_caps = entry->caps;
+ GstCaps *found_caps = entry->caps;
guint probability = entry->probability;
- found_caps = gst_caps2_copy (found_caps);
+ found_caps = gst_caps_copy (found_caps);
GST_INFO_OBJECT (typefind, "'%s' returned %u/%u probability, using it NOW",
GST_PLUGIN_FEATURE_NAME (entry->factory), probability, typefind->max_probability);
while (walk) {
typefind->possibilities = NULL;
g_list_free (typefind->possibilities);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, probability, found_caps);
- gst_caps2_free (found_caps);
+ gst_caps_free (found_caps);
} else {
typefind->possibilities = g_list_prepend (typefind->possibilities, entry);
}
break;
case GST_STATE_PAUSED_TO_READY:
stop_typefinding (typefind);
- gst_caps2_replace (&typefind->caps, NULL);
+ gst_caps_replace (&typefind->caps, NULL);
break;
default:
break;
guint min_probability;
guint max_probability;
- GstCaps2 * caps;
+ GstCaps * caps;
guint mode;
GstBufferStore * store;
/* signals */
void (*have_type) (GstTypeFindElement *element,
guint probability,
- GstCaps2 * caps);
+ GstCaps * caps);
};
GType gst_type_find_element_get_type (void);
/* playing = FALSE; */
}
-G_GNUC_UNUSED static GstCaps2*
+G_GNUC_UNUSED static GstCaps*
gst_play_type_find (GstBin *bin, GstElement *element)
{
GstElement *typefind;
GstElement *pipeline;
- GstCaps2 *caps = NULL;
+ GstCaps *caps = NULL;
GST_DEBUG ("GstPipeline: typefind for element \"%s\"",
GST_ELEMENT_NAME(element));
char buffer[20]; /* hold the names */
/* GstAutoplug *autoplug;
- GstCaps2 *srccaps; */
+ GstCaps *srccaps; */
GstElement *new_element;
GstElement *decoder;
#endif
new_element = gst_autoplug_to_caps (autoplug, srccaps,
- gst_caps2_new ("audio/raw", NULL), NULL);
+ gst_caps_new ("audio/raw", NULL), NULL);
if (!new_element) {
g_print ("could not autoplug, no suitable codecs found...\n");
#include <gst/gst.h>
void
-type_found (GstElement *typefind, const GstCaps2 * caps)
+type_found (GstElement *typefind, const GstCaps * caps)
{
xmlDocPtr doc;
xmlNodePtr parent;
parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
/* FIXME */
- //gst_caps2_save_thyself (caps, parent);
+ //gst_caps_save_thyself (caps, parent);
xmlDocDump (stdout, doc);
}
}
-static GstCaps2 *
+static GstCaps *
gst_bstest_getcaps (GstPad *pad)
{
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
#include <gst/gst.h>
/* these caps all have a non empty intersection */
-GstStaticCaps2 sinkcaps = GST_STATIC_CAPS(
+GstStaticCaps sinkcaps = GST_STATIC_CAPS(
"video/mpeg, "
"mpegtype=(int)[1,2]"
);
-GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS(
+GstStaticCaps mp1parsecaps = GST_STATIC_CAPS(
"video/mpeg, "
"mpegtype=(int)1"
);
-GstStaticCaps2 rawcaps = GST_STATIC_CAPS(
+GstStaticCaps rawcaps = GST_STATIC_CAPS(
"video/raw, "
"fourcc=(fourcc){YV12,YUY2}, "
"width=(int)[16,4096], "
"height=(int)[16,4096]"
);
-GstStaticCaps2 rawcaps2 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps2 = GST_STATIC_CAPS(
"video/raw, "
"fourcc=(fourcc)YUY2, "
"height=(int)[16,256]"
);
-GstStaticCaps2 rawcaps3 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps3 = GST_STATIC_CAPS(
"video/raw, "
"fourcc=(fourcc){YV12,YUY2}, "
"height=(int)[16,4096]"
#if 0
/* these caps aren't used yet */
-GstStaticCaps2 rawcaps4 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps4 = GST_STATIC_CAPS(
"video/raw, "
"fourcc=(fourcc){\"YV12\", \"YUYV\"}, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 rawcaps4 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps4 = GST_STATIC_CAPS(
"video/raw, "
"fourcc=(fourcc){\"YUYV\", \"YUY2\"}, "
"height=(int)[16,4096]"
);
#endif
-GstStaticCaps2 rawcaps6 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps6 = GST_STATIC_CAPS(
"video/raw, "
"format=(fourcc)\"I420\"; "
"video/raw, "
"format=(fourcc)\"YUYV\""
);
-GstStaticCaps2 rawcaps7 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps7 = GST_STATIC_CAPS(
"video/raw, "
"format=(fourcc)\"I420\"; "
"video/raw, "
gst_init (&argc, &argv);
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&mp1parsecaps),
- gst_static_caps2_get (&rawcaps));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&mp1parsecaps),
+ gst_static_caps_get (&rawcaps));
g_print ("4 <-> 2 == %d (invalid, wrong major type)\n", testret);
ret = ret + (testret == FALSE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&mp1parsecaps),
- gst_static_caps2_get (&sinkcaps));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&mp1parsecaps),
+ gst_static_caps_get (&sinkcaps));
g_print ("4 <-> 1 == %d (valid, subset)\n", testret);
ret = ret + (testret == TRUE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&sinkcaps),
- gst_static_caps2_get (&mp1parsecaps));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&sinkcaps),
+ gst_static_caps_get (&mp1parsecaps));
g_print ("1 <-> 4 == %d (invalid, superset)\n", testret);
ret = ret + (testret == FALSE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps),
- gst_static_caps2_get (&rawcaps2));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps),
+ gst_static_caps_get (&rawcaps2));
g_print ("2 <-> 3 == %d (invalid, ranges)\n", testret);
ret = ret + (testret == FALSE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps),
- gst_static_caps2_get (&rawcaps3));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps),
+ gst_static_caps_get (&rawcaps3));
g_print ("2 <-> 5 == %d (valid)\n", testret);
ret = ret + (testret == TRUE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps3),
- gst_static_caps2_get (&rawcaps));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps3),
+ gst_static_caps_get (&rawcaps));
g_print ("5 <-> 2 == %d (invalid)\n", testret);
ret = ret + (testret == FALSE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps2),
- gst_static_caps2_get (&rawcaps3));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps2),
+ gst_static_caps_get (&rawcaps3));
g_print ("3 <-> 5 == %d (valid)\n", testret);
ret = ret + (testret == TRUE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps2),
- gst_static_caps2_get (&rawcaps));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps2),
+ gst_static_caps_get (&rawcaps));
g_print ("3 <-> 2 == %d (invalid, property missing in source)\n", testret);
ret = ret + (testret == FALSE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps),
- gst_static_caps2_get (&rawcaps));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps),
+ gst_static_caps_get (&rawcaps));
g_print ("2 <-> 2 == %d (valid, same caps)\n", testret);
ret = ret + (testret == TRUE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps6),
- gst_static_caps2_get (&rawcaps7));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps6),
+ gst_static_caps_get (&rawcaps7));
g_print ("6 <-> 7 == %d (invalid, second caps doesn't fit)\n", testret);
ret = ret + (testret == FALSE) ? 0 : 1;
main (gint argc, gchar *argv[])
{
#if 0
- GstCaps2 *caps;
+ GstCaps *caps;
gst_init (&argc, &argv);
#include <gst/gst.h>
-GstStaticCaps2 rawcaps1 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps1 = GST_STATIC_CAPS(
"video/x-raw-yuv, "
"fourcc:fourcc=\"YUYV\", "
"height:int=640, "
"framerate:float=30.0"
);
-GstStaticCaps2 rawcaps2 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps2 = GST_STATIC_CAPS(
"video/x-raw-yuv"
);
-GstStaticCaps2 rawcaps3 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps3 = GST_STATIC_CAPS(
"video/x-raw-yuv, height=(int) [ 0, MAX ]"
);
-GstStaticCaps2 rawcaps4 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps4 = GST_STATIC_CAPS(
"video/x-raw-yuv, format=(fourcc)YUY2; video/x-raw-yuv, format=(fourcc)UYVY"
);
-GstStaticCaps2 rawcaps5 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps5 = GST_STATIC_CAPS(
"video/x-raw-yuv, format=(fourcc)YUY2, framerate=(double)[0,1.79769e+308], width=(int)[0,2147483647], height=(int)[0,2147483647]; video/x-raw-yuv, format=(fourcc)UYVY, framerate=(double)[0,1.79769e+308], width=(int)[0,2147483647], height=(int)[0,2147483647]"
);
-GstStaticCaps2 rawcaps6 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps6 = GST_STATIC_CAPS(
"video/x-raw-yuv, format=(fourcc)YUY2, width=(int)320, height=(int)240"
);
-GstStaticCaps2 rawcaps7 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps7 = GST_STATIC_CAPS(
"video/x-raw-yuv, format=(fourcc)YUY2, width=(int)[0,2147483647], height=(int)[0,2147483647], framerate=(double)[0,1.79769e+308]"
);
-GstStaticCaps2 rawcaps8 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps8 = GST_STATIC_CAPS(
"video/x-raw-yuv, format=(fourcc)YUY2, width=(int)320, height=(int)240"
);
int
main (int argc, char *argv[])
{
- GstCaps2 *caps1;
- GstCaps2 *caps2;
- GstCaps2 *caps3;
- GstCaps2 *caps4;
- GstCaps2 *caps;
+ GstCaps *caps1;
+ GstCaps *caps2;
+ GstCaps *caps3;
+ GstCaps *caps4;
+ GstCaps *caps;
gst_init (&argc, &argv);
- caps1 = gst_caps2_copy( gst_static_caps2_get (&rawcaps1));
- caps2 = gst_caps2_copy_1 (gst_static_caps2_get (&rawcaps1));
+ caps1 = gst_caps_copy( gst_static_caps_get (&rawcaps1));
+ caps2 = gst_caps_copy_1 (gst_static_caps_get (&rawcaps1));
#if 0
- gst_caps2_set(caps1, "height", GST_PROPS_INT(640));
- gst_caps2_set(caps1, "width", GST_PROPS_INT(480));
- gst_caps2_set(caps1, "framerate", GST_PROPS_FLOAT(30.0));
+ gst_caps_set(caps1, "height", GST_PROPS_INT(640));
+ gst_caps_set(caps1, "width", GST_PROPS_INT(480));
+ gst_caps_set(caps1, "framerate", GST_PROPS_FLOAT(30.0));
#endif
- caps = gst_caps2_intersect(caps1, caps2);
- g_print("caps %s\n", gst_caps2_to_string(caps));
- if (gst_caps2_is_empty (caps)) return 1;
- gst_caps2_free(caps1);
- gst_caps2_free(caps2);
-
- caps1 = gst_caps2_copy( gst_static_caps2_get (&rawcaps2));
- caps2 = gst_caps2_copy( gst_static_caps2_get (&rawcaps3));
- caps = gst_caps2_intersect(caps1, caps2);
- g_print("caps %s\n", gst_caps2_to_string(caps));
- if (gst_caps2_is_empty (caps)) return 1;
- gst_caps2_free(caps1);
- gst_caps2_free(caps2);
-
- caps1 = gst_caps2_copy( gst_static_caps2_get (&rawcaps4));
- caps2 = gst_caps2_copy( gst_static_caps2_get (&rawcaps5));
- caps3 = gst_caps2_copy( gst_static_caps2_get (&rawcaps6));
- caps4 = gst_caps2_intersect(caps1, caps2);
- caps = gst_caps2_intersect(caps3, caps4);
- g_print("caps4 %s\n", gst_caps2_to_string(caps4));
- g_print("caps %s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps1);
- gst_caps2_free(caps2);
- gst_caps2_free(caps3);
- gst_caps2_free(caps4);
-
- caps1 = gst_caps2_copy( gst_static_caps2_get (&rawcaps7));
- caps2 = gst_caps2_copy( gst_static_caps2_get (&rawcaps8));
- caps = gst_caps2_intersect(caps1, caps2);
- g_print("caps %s\n", gst_caps2_to_string(caps));
- if (gst_caps2_is_empty (caps)) return 1;
- gst_caps2_free(caps1);
- gst_caps2_free(caps2);
+ caps = gst_caps_intersect(caps1, caps2);
+ g_print("caps %s\n", gst_caps_to_string(caps));
+ if (gst_caps_is_empty (caps)) return 1;
+ gst_caps_free(caps1);
+ gst_caps_free(caps2);
+
+ caps1 = gst_caps_copy( gst_static_caps_get (&rawcaps2));
+ caps2 = gst_caps_copy( gst_static_caps_get (&rawcaps3));
+ caps = gst_caps_intersect(caps1, caps2);
+ g_print("caps %s\n", gst_caps_to_string(caps));
+ if (gst_caps_is_empty (caps)) return 1;
+ gst_caps_free(caps1);
+ gst_caps_free(caps2);
+
+ caps1 = gst_caps_copy( gst_static_caps_get (&rawcaps4));
+ caps2 = gst_caps_copy( gst_static_caps_get (&rawcaps5));
+ caps3 = gst_caps_copy( gst_static_caps_get (&rawcaps6));
+ caps4 = gst_caps_intersect(caps1, caps2);
+ caps = gst_caps_intersect(caps3, caps4);
+ g_print("caps4 %s\n", gst_caps_to_string(caps4));
+ g_print("caps %s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps1);
+ gst_caps_free(caps2);
+ gst_caps_free(caps3);
+ gst_caps_free(caps4);
+
+ caps1 = gst_caps_copy( gst_static_caps_get (&rawcaps7));
+ caps2 = gst_caps_copy( gst_static_caps_get (&rawcaps8));
+ caps = gst_caps_intersect(caps1, caps2);
+ g_print("caps %s\n", gst_caps_to_string(caps));
+ if (gst_caps_is_empty (caps)) return 1;
+ gst_caps_free(caps1);
+ gst_caps_free(caps2);
return 0;
}
#include <gst/gst.h>
/* these caps all have a non empty intersection */
-GstStaticCaps2 sinkcaps = GST_STATIC_CAPS (
+GstStaticCaps sinkcaps = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype=(int)1, "
"foo1=(int)[20,40], "
"foo3=(int)[10,20]"
);
-GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS (
+GstStaticCaps mp1parsecaps = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype=(int)1, "
"foo1=(int)30, "
-GstStaticCaps2 rawcaps = GST_STATIC_CAPS (
+GstStaticCaps rawcaps = GST_STATIC_CAPS (
"video/raw, "
"width=(int)[16,4096], "
"height=(int)[16,4096]"
);
-GstStaticCaps2 rawcaps2 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps2 = GST_STATIC_CAPS (
"video/raw, "
"height=(int)[16,256], "
"depth=(int)16"
);
-GstStaticCaps2 rawcaps3 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps3 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YUY2\", \"YV12\" }, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 rawcaps4 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps4 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YUY2\",\"YV12\",\"YUYV\" }, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 rawcaps5 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps5 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YUYV\",\"YUY2\"}, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 rawcaps6 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps6 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc)\"YUYV\", "
"height=(int)640, "
{
xmlDocPtr doc;
xmlNodePtr parent;
- GstCaps2 *caps;
+ GstCaps *caps;
gst_init (&argc, &argv);
/*
g_mem_chunk_info ();
for (i = 0; i<100000; i++) {
- caps = gst_caps2_intersect (gst_static_caps2_get (rawcaps3), GST_CAPS_GET (rawcaps4));
- gst_caps2_unref (caps);
+ caps = gst_caps_intersect (gst_static_caps_get (rawcaps3), GST_CAPS_GET (rawcaps4));
+ gst_caps_unref (caps);
}
g_mem_chunk_info ();
*/
- caps = gst_caps2_intersect (gst_static_caps2_get (&sinkcaps),
- gst_static_caps2_get (&mp1parsecaps));
+ caps = gst_caps_intersect (gst_static_caps_get (&sinkcaps),
+ gst_static_caps_get (&mp1parsecaps));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_intersect (gst_static_caps2_get (&rawcaps),
- gst_static_caps2_get (&rawcaps2));
+ caps = gst_caps_intersect (gst_static_caps_get (&rawcaps),
+ gst_static_caps_get (&rawcaps2));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities2", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_intersect (gst_static_caps2_get (&rawcaps3),
- gst_static_caps2_get (&rawcaps4));
+ caps = gst_caps_intersect (gst_static_caps_get (&rawcaps3),
+ gst_static_caps_get (&rawcaps4));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities3", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_intersect (gst_static_caps2_get (&rawcaps3),
- gst_static_caps2_get (&rawcaps5));
+ caps = gst_caps_intersect (gst_static_caps_get (&rawcaps3),
+ gst_static_caps_get (&rawcaps5));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities4", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_intersect (gst_static_caps2_get (&rawcaps6),
- gst_caps2_copy_1(gst_static_caps2_get (&rawcaps6)));
+ caps = gst_caps_intersect (gst_static_caps_get (&rawcaps6),
+ gst_caps_copy_1(gst_static_caps_get (&rawcaps6)));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities5", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
xmlDocDump(stdout, doc);
#include <gst/gst.h>
/* these caps all have a non empty intersection */
-GstStaticCaps2 sinkcaps = GST_STATIC_CAPS (
+GstStaticCaps sinkcaps = GST_STATIC_CAPS (
"video/mpeg, "
"fourcc=(fourcc){\"YV12\",\"YUY2\"}, "
"foo1=(int)[20,40], "
"foo3=(int)[10,20]"
);
-GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS (
+GstStaticCaps mp1parsecaps = GST_STATIC_CAPS (
"video/mpeg, "
"fourcc=(fourcc){\"YV12\",\"YUY2\"}, "
"foo4=(fourcc){\"YV12\",\"YUY2\"}"
);
-GstStaticCaps2 rawcaps = GST_STATIC_CAPS (
+GstStaticCaps rawcaps = GST_STATIC_CAPS (
"video/raw, "
"width=(int)[16,4096], "
"height=(int)[16,4096], "
"fourcc=(fourcc){\"YV12\",\"YUY2\"}"
);
-GstStaticCaps2 rawcaps2 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps2 = GST_STATIC_CAPS (
"video/raw, "
"width=(int)[16,256], "
"height=(int)16; "
"height=(int)16"
);
-GstStaticCaps2 rawcaps3 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps3 = GST_STATIC_CAPS (
"video/raw, "
"width=(int)[16,256], "
"height=(int)16; "
{
xmlDocPtr doc;
xmlNodePtr parent;
- GstCaps2 *caps;
+ GstCaps *caps;
gst_init (&argc, &argv);
doc = xmlNewDoc ("1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
- caps = gst_caps2_normalize (gst_static_caps2_get (&sinkcaps));
+ caps = gst_caps_normalize (gst_static_caps_get (&sinkcaps));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_normalize (gst_static_caps2_get (&mp1parsecaps));
+ caps = gst_caps_normalize (gst_static_caps_get (&mp1parsecaps));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_normalize (gst_static_caps2_get (&rawcaps));
+ caps = gst_caps_normalize (gst_static_caps_get (&rawcaps));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_normalize (gst_static_caps2_get (&rawcaps2));
+ caps = gst_caps_normalize (gst_static_caps_get (&rawcaps2));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_normalize (gst_static_caps2_get (&rawcaps3));
+ caps = gst_caps_normalize (gst_static_caps_get (&rawcaps3));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
xmlDocDump(stdout, doc);
#include <gst/gst.h>
#include <string.h>
-GstStaticCaps2 caps1 = GST_STATIC_CAPS (
+GstStaticCaps caps1 = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype=(int){1,2}"
);
-GstStaticCaps2 caps2 = GST_STATIC_CAPS (
+GstStaticCaps caps2 = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype=(int){1}"
);
-GstStaticCaps2 caps3 = GST_STATIC_CAPS (
+GstStaticCaps caps3 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YV12\",\"YUY2\"}, "
"width=(int)[16,4096], "
"height=(int)[16,4096]"
);
-GstStaticCaps2 caps4 = GST_STATIC_CAPS (
+GstStaticCaps caps4 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc)\"YV12\", "
"height=(int)[16,256]"
);
-GstStaticCaps2 caps5 = GST_STATIC_CAPS (
+GstStaticCaps caps5 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YV12\",\"YUY2\"}, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 caps6 = GST_STATIC_CAPS (
+GstStaticCaps caps6 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YV12\",\"YUYV\"}, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 caps7 = GST_STATIC_CAPS (
+GstStaticCaps caps7 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YVYV\",\"YUY2\"}, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 caps8 = GST_STATIC_CAPS (
+GstStaticCaps caps8 = GST_STATIC_CAPS (
"video/raw, "
"format=(fourcc)\"I420\"; "
"video/raw, "
"format=(fourcc)\"YUYV\""
);
-GstStaticCaps2 caps9 = GST_STATIC_CAPS (
+GstStaticCaps caps9 = GST_STATIC_CAPS (
"video/raw, "
"format=(fourcc)\"I420\"; "
"video/raw, "
} \
}G_STMT_END
static void
-test_caps_func (const GstCaps2 *caps)
+test_caps_func (const GstCaps *caps)
{
gchar *str1, *str2;
gboolean ret = FALSE;
- str1 = gst_caps2_to_string (caps);
- caps = gst_caps2_from_string (str1);
+ str1 = gst_caps_to_string (caps);
+ caps = gst_caps_from_string (str1);
if (!caps) {
g_print ("%3d, INFO : no caps from %s\n", test, str1);
TEST_END (ret);
return;
}
- str2 = gst_caps2_to_string (caps);
+ str2 = gst_caps_to_string (caps);
g_print ("%3d, INFO : %s <==> %s\n", test, str1, str2);
ret = strcmp (str1, str2) == 0;
g_free (str1);
TEST_END (ret);
}
static void
-test_caps (const GstCaps2 *caps)
+test_caps (const GstCaps *caps)
{
TEST_START;
test_caps_func (caps);
static void
test_string (gchar *str)
{
- GstCaps2 *caps;
+ GstCaps *caps;
TEST_START;
g_print ("%3d, INFO : checking %s\n", test, str);
- caps = gst_caps2_from_string (str);
+ caps = gst_caps_from_string (str);
if (!caps) {
g_print ("%3d, INFO : no caps from %s\n", test, str);
TEST_FAIL;
static void
test_string_fail (gchar *str)
{
- GstCaps2 *caps;
+ GstCaps *caps;
TEST_START;
g_print ("%3d, INFO : checking %s for failure\n", test, str);
- caps = gst_caps2_from_string (str);
+ caps = gst_caps_from_string (str);
g_print("got %p\n", caps);
TEST_END (caps == NULL);
}
goto bla;
bla:
/* stupidity tests */
- test_caps (gst_caps2_new_simple ("audio/raw", NULL));
+ test_caps (gst_caps_new_simple ("audio/raw", NULL));
/* all sorts of caps */
- test_caps (gst_static_caps2_get (&caps1));
- test_caps (gst_static_caps2_get (&caps2));
- test_caps (gst_static_caps2_get (&caps3));
- test_caps (gst_static_caps2_get (&caps4));
- test_caps (gst_static_caps2_get (&caps5));
- test_caps (gst_static_caps2_get (&caps6));
- test_caps (gst_static_caps2_get (&caps7));
- test_caps (gst_static_caps2_get (&caps8));
- test_caps (gst_static_caps2_get (&caps9));
+ test_caps (gst_static_caps_get (&caps1));
+ test_caps (gst_static_caps_get (&caps2));
+ test_caps (gst_static_caps_get (&caps3));
+ test_caps (gst_static_caps_get (&caps4));
+ test_caps (gst_static_caps_get (&caps5));
+ test_caps (gst_static_caps_get (&caps6));
+ test_caps (gst_static_caps_get (&caps7));
+ test_caps (gst_static_caps_get (&caps8));
+ test_caps (gst_static_caps_get (&caps9));
/* mime types */
test_string ("audio/raw");
#include <gst/gst.h>
/* these caps all have a non empty intersection */
-GstStaticCaps2 sinkcaps = GST_STATIC_CAPS (
+GstStaticCaps sinkcaps = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype:int=1, "
"foo1:int=[20,40], "
"foo3:int=[10,20]"
);
-GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS (
+GstStaticCaps mp1parsecaps = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype:int=1, "
"foo1:int=30, "
{
xmlDocPtr doc;
xmlNodePtr parent;
- GstCaps2 *caps;
+ GstCaps *caps;
gst_init (&argc, &argv);
doc = xmlNewDoc ("1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
- caps = gst_caps2_union (gst_static_caps2_get (&sinkcaps),
- gst_static_caps2_get (&mp1parsecaps));
+ caps = gst_caps_union (gst_static_caps_get (&sinkcaps),
+ gst_static_caps_get (&mp1parsecaps));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
xmlDocDump(stdout, doc);
void test1(void)
{
- GstCaps2 *caps;
- GstCaps2 *caps2;
+ GstCaps *caps;
+ GstCaps *caps2;
- g_print("type is %d\n", (int)gst_caps2_get_type());
+ g_print("type is %d\n", (int)gst_caps_get_type());
- caps = gst_caps2_new_empty();
+ caps = gst_caps_new_empty();
g_assert(caps != NULL);
- gst_caps2_free(caps);
+ gst_caps_free(caps);
- caps = gst_caps2_new_any();
+ caps = gst_caps_new_any();
g_assert(caps != NULL);
- gst_caps2_free(caps);
+ gst_caps_free(caps);
- caps = gst_caps2_new_simple("audio/raw",
+ caps = gst_caps_new_simple("audio/raw",
"_int", G_TYPE_INT, 100, NULL);
g_assert(caps != NULL);
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==FALSE);
- g_assert(gst_caps2_is_fixed(caps)==TRUE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
-
- caps = gst_caps2_new_simple("audio/raw",
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==FALSE);
+ g_assert(gst_caps_is_fixed(caps)==TRUE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+
+ caps = gst_caps_new_simple("audio/raw",
"_double", G_TYPE_DOUBLE, 100.0, NULL);
g_assert(caps != NULL);
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==FALSE);
- g_assert(gst_caps2_is_fixed(caps)==TRUE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
-
- caps = gst_caps2_new_simple("audio/raw",
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==FALSE);
+ g_assert(gst_caps_is_fixed(caps)==TRUE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+
+ caps = gst_caps_new_simple("audio/raw",
"_fourcc", GST_TYPE_FOURCC, GST_MAKE_FOURCC('a','b','c','d'), NULL);
g_assert(caps != NULL);
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==FALSE);
- g_assert(gst_caps2_is_fixed(caps)==TRUE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
-
- caps = gst_caps2_new_simple("audio/raw",
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==FALSE);
+ g_assert(gst_caps_is_fixed(caps)==TRUE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+
+ caps = gst_caps_new_simple("audio/raw",
"_boolean", G_TYPE_BOOLEAN, TRUE, NULL);
g_assert(caps != NULL);
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==FALSE);
- g_assert(gst_caps2_is_fixed(caps)==TRUE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
-
- caps = gst_caps2_new_full(
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==FALSE);
+ g_assert(gst_caps_is_fixed(caps)==TRUE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+
+ caps = gst_caps_new_full(
gst_structure_new("audio/raw", "_int", G_TYPE_INT, 100, NULL),
gst_structure_new("audio/raw2", "_int", G_TYPE_INT, 100, NULL),
NULL);
g_assert(caps != NULL);
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==TRUE);
- g_assert(gst_caps2_is_fixed(caps)==FALSE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
-
- caps = gst_caps2_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==TRUE);
+ g_assert(gst_caps_is_fixed(caps)==FALSE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+
+ caps = gst_caps_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
g_assert(caps != NULL);
- caps2 = gst_caps2_copy(caps);
+ caps2 = gst_caps_copy(caps);
g_assert(caps2 != NULL);
- g_assert(gst_caps2_is_empty(caps2)==FALSE);
- g_assert(gst_caps2_is_any(caps2)==FALSE);
- g_assert(gst_caps2_is_chained(caps2)==FALSE);
- g_assert(gst_caps2_is_fixed(caps2)==TRUE);
- g_print("%s\n", gst_caps2_to_string(caps));
- g_print("%s\n", gst_caps2_to_string(caps2));
- gst_caps2_free(caps);
- gst_caps2_free(caps2);
-
- caps = gst_caps2_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
- gst_caps2_append (caps,
- gst_caps2_new_simple("audio/raw", "_int", G_TYPE_INT, 200, NULL));
+ g_assert(gst_caps_is_empty(caps2)==FALSE);
+ g_assert(gst_caps_is_any(caps2)==FALSE);
+ g_assert(gst_caps_is_chained(caps2)==FALSE);
+ g_assert(gst_caps_is_fixed(caps2)==TRUE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ g_print("%s\n", gst_caps_to_string(caps2));
+ gst_caps_free(caps);
+ gst_caps_free(caps2);
+
+ caps = gst_caps_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
+ gst_caps_append (caps,
+ gst_caps_new_simple("audio/raw", "_int", G_TYPE_INT, 200, NULL));
g_assert(caps != NULL);
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==TRUE);
- g_assert(gst_caps2_is_fixed(caps)==FALSE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
-
- caps = gst_caps2_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==TRUE);
+ g_assert(gst_caps_is_fixed(caps)==FALSE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+
+ caps = gst_caps_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
g_assert(caps != NULL);
- gst_caps2_append_cap (caps,
+ gst_caps_append_structure (caps,
gst_structure_new("audio/raw", "_int", G_TYPE_INT, 200, NULL));
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==TRUE);
- g_assert(gst_caps2_is_fixed(caps)==FALSE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==TRUE);
+ g_assert(gst_caps_is_fixed(caps)==FALSE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
}
void test2(void)
{
- GstCaps2 *caps1;
- GstCaps2 *caps2;
- GstCaps2 *caps;
+ GstCaps *caps1;
+ GstCaps *caps2;
+ GstCaps *caps;
- caps1 = gst_caps2_new_full(
+ caps1 = gst_caps_new_full(
gst_structure_new("audio/raw", "_int", G_TYPE_INT, 100, NULL),
gst_structure_new("audio/raw", "_int", G_TYPE_INT, 200, NULL),
NULL);
- caps2 = gst_caps2_new_full(
+ caps2 = gst_caps_new_full(
gst_structure_new("audio/raw", "_int", G_TYPE_INT, 100, NULL),
gst_structure_new("audio/raw", "_int", G_TYPE_INT, 300, NULL),
NULL);
- caps = gst_caps2_intersect(caps1, caps2);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
- gst_caps2_free(caps1);
- gst_caps2_free(caps2);
+ caps = gst_caps_intersect(caps1, caps2);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+ gst_caps_free(caps1);
+ gst_caps_free(caps2);
}
GstElement *pipeline = NULL;
GstElement *tee, *src, *sink1, *sink2;
GstPad *tee_src1, *tee_src2;
- GstCaps2 *src_caps = NULL;
- GstCaps2 *sink_caps = NULL;
+ GstCaps *src_caps = NULL;
+ GstCaps *sink_caps = NULL;
GstStructure *structure = NULL;
GstPad *pad = NULL;
/* now we try setting caps on the src pad */
/* FIXME: should we set to pause here ? */
- src_caps = gst_caps2_from_string ("audio/raw, format=(s)\"int\", "
+ src_caps = gst_caps_from_string ("audio/raw, format=(s)\"int\", "
"rate=(i)44100");
g_assert (src_caps != NULL);
/* now iterate and see if it proxies caps ok */
gst_bin_iterate (GST_BIN (pipeline));
sink_caps = gst_pad_get_caps (gst_element_get_pad (sink1, "sink"));
- if (sink_caps && gst_caps2_is_fixed (sink_caps)) {
- structure = gst_caps2_get_nth_cap (sink_caps, 0);
+ if (sink_caps && gst_caps_is_fixed (sink_caps)) {
+ structure = gst_caps_get_structure (sink_caps, 0);
}else {
structure = NULL;
g_print ("sink_caps is not fixed\n");
g_print ("Rate of pad on sink1 : %d\n", rate);
}
sink_caps = gst_pad_get_caps (gst_element_get_pad (sink2, "sink"));
- structure = gst_caps2_get_nth_cap (sink_caps, 0);
+ structure = gst_caps_get_structure (sink_caps, 0);
if (structure != NULL && ! (gst_structure_has_field (structure, "rate"))) {
g_print ("Hm, rate has not been propagated to sink2.\n");
return 1;
}
-static GstCaps2 *
+static GstCaps *
gst_bstest_getcaps (GstPad *pad)
{
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));
#include <gst/gst.h>
/* these caps all have a non empty intersection */
-GstStaticCaps2 sinkcaps = GST_STATIC_CAPS(
+GstStaticCaps sinkcaps = GST_STATIC_CAPS(
"video/mpeg, "
"mpegtype=(int)[1,2]"
);
-GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS(
+GstStaticCaps mp1parsecaps = GST_STATIC_CAPS(
"video/mpeg, "
"mpegtype=(int)1"
);
-GstStaticCaps2 rawcaps = GST_STATIC_CAPS(
+GstStaticCaps rawcaps = GST_STATIC_CAPS(
"video/raw, "
"fourcc=(fourcc){YV12,YUY2}, "
"width=(int)[16,4096], "
"height=(int)[16,4096]"
);
-GstStaticCaps2 rawcaps2 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps2 = GST_STATIC_CAPS(
"video/raw, "
"fourcc=(fourcc)YUY2, "
"height=(int)[16,256]"
);
-GstStaticCaps2 rawcaps3 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps3 = GST_STATIC_CAPS(
"video/raw, "
"fourcc=(fourcc){YV12,YUY2}, "
"height=(int)[16,4096]"
#if 0
/* these caps aren't used yet */
-GstStaticCaps2 rawcaps4 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps4 = GST_STATIC_CAPS(
"video/raw, "
"fourcc=(fourcc){\"YV12\", \"YUYV\"}, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 rawcaps4 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps4 = GST_STATIC_CAPS(
"video/raw, "
"fourcc=(fourcc){\"YUYV\", \"YUY2\"}, "
"height=(int)[16,4096]"
);
#endif
-GstStaticCaps2 rawcaps6 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps6 = GST_STATIC_CAPS(
"video/raw, "
"format=(fourcc)\"I420\"; "
"video/raw, "
"format=(fourcc)\"YUYV\""
);
-GstStaticCaps2 rawcaps7 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps7 = GST_STATIC_CAPS(
"video/raw, "
"format=(fourcc)\"I420\"; "
"video/raw, "
gst_init (&argc, &argv);
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&mp1parsecaps),
- gst_static_caps2_get (&rawcaps));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&mp1parsecaps),
+ gst_static_caps_get (&rawcaps));
g_print ("4 <-> 2 == %d (invalid, wrong major type)\n", testret);
ret = ret + (testret == FALSE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&mp1parsecaps),
- gst_static_caps2_get (&sinkcaps));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&mp1parsecaps),
+ gst_static_caps_get (&sinkcaps));
g_print ("4 <-> 1 == %d (valid, subset)\n", testret);
ret = ret + (testret == TRUE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&sinkcaps),
- gst_static_caps2_get (&mp1parsecaps));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&sinkcaps),
+ gst_static_caps_get (&mp1parsecaps));
g_print ("1 <-> 4 == %d (invalid, superset)\n", testret);
ret = ret + (testret == FALSE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps),
- gst_static_caps2_get (&rawcaps2));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps),
+ gst_static_caps_get (&rawcaps2));
g_print ("2 <-> 3 == %d (invalid, ranges)\n", testret);
ret = ret + (testret == FALSE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps),
- gst_static_caps2_get (&rawcaps3));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps),
+ gst_static_caps_get (&rawcaps3));
g_print ("2 <-> 5 == %d (valid)\n", testret);
ret = ret + (testret == TRUE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps3),
- gst_static_caps2_get (&rawcaps));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps3),
+ gst_static_caps_get (&rawcaps));
g_print ("5 <-> 2 == %d (invalid)\n", testret);
ret = ret + (testret == FALSE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps2),
- gst_static_caps2_get (&rawcaps3));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps2),
+ gst_static_caps_get (&rawcaps3));
g_print ("3 <-> 5 == %d (valid)\n", testret);
ret = ret + (testret == TRUE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps2),
- gst_static_caps2_get (&rawcaps));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps2),
+ gst_static_caps_get (&rawcaps));
g_print ("3 <-> 2 == %d (invalid, property missing in source)\n", testret);
ret = ret + (testret == FALSE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps),
- gst_static_caps2_get (&rawcaps));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps),
+ gst_static_caps_get (&rawcaps));
g_print ("2 <-> 2 == %d (valid, same caps)\n", testret);
ret = ret + (testret == TRUE) ? 0 : 1;
- testret = gst_caps2_is_always_compatible (gst_static_caps2_get (&rawcaps6),
- gst_static_caps2_get (&rawcaps7));
+ testret = gst_caps_is_always_compatible (gst_static_caps_get (&rawcaps6),
+ gst_static_caps_get (&rawcaps7));
g_print ("6 <-> 7 == %d (invalid, second caps doesn't fit)\n", testret);
ret = ret + (testret == FALSE) ? 0 : 1;
main (gint argc, gchar *argv[])
{
#if 0
- GstCaps2 *caps;
+ GstCaps *caps;
gst_init (&argc, &argv);
#include <gst/gst.h>
-GstStaticCaps2 rawcaps1 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps1 = GST_STATIC_CAPS(
"video/x-raw-yuv, "
"fourcc:fourcc=\"YUYV\", "
"height:int=640, "
"framerate:float=30.0"
);
-GstStaticCaps2 rawcaps2 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps2 = GST_STATIC_CAPS(
"video/x-raw-yuv"
);
-GstStaticCaps2 rawcaps3 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps3 = GST_STATIC_CAPS(
"video/x-raw-yuv, height=(int) [ 0, MAX ]"
);
-GstStaticCaps2 rawcaps4 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps4 = GST_STATIC_CAPS(
"video/x-raw-yuv, format=(fourcc)YUY2; video/x-raw-yuv, format=(fourcc)UYVY"
);
-GstStaticCaps2 rawcaps5 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps5 = GST_STATIC_CAPS(
"video/x-raw-yuv, format=(fourcc)YUY2, framerate=(double)[0,1.79769e+308], width=(int)[0,2147483647], height=(int)[0,2147483647]; video/x-raw-yuv, format=(fourcc)UYVY, framerate=(double)[0,1.79769e+308], width=(int)[0,2147483647], height=(int)[0,2147483647]"
);
-GstStaticCaps2 rawcaps6 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps6 = GST_STATIC_CAPS(
"video/x-raw-yuv, format=(fourcc)YUY2, width=(int)320, height=(int)240"
);
-GstStaticCaps2 rawcaps7 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps7 = GST_STATIC_CAPS(
"video/x-raw-yuv, format=(fourcc)YUY2, width=(int)[0,2147483647], height=(int)[0,2147483647], framerate=(double)[0,1.79769e+308]"
);
-GstStaticCaps2 rawcaps8 = GST_STATIC_CAPS(
+GstStaticCaps rawcaps8 = GST_STATIC_CAPS(
"video/x-raw-yuv, format=(fourcc)YUY2, width=(int)320, height=(int)240"
);
int
main (int argc, char *argv[])
{
- GstCaps2 *caps1;
- GstCaps2 *caps2;
- GstCaps2 *caps3;
- GstCaps2 *caps4;
- GstCaps2 *caps;
+ GstCaps *caps1;
+ GstCaps *caps2;
+ GstCaps *caps3;
+ GstCaps *caps4;
+ GstCaps *caps;
gst_init (&argc, &argv);
- caps1 = gst_caps2_copy( gst_static_caps2_get (&rawcaps1));
- caps2 = gst_caps2_copy_1 (gst_static_caps2_get (&rawcaps1));
+ caps1 = gst_caps_copy( gst_static_caps_get (&rawcaps1));
+ caps2 = gst_caps_copy_1 (gst_static_caps_get (&rawcaps1));
#if 0
- gst_caps2_set(caps1, "height", GST_PROPS_INT(640));
- gst_caps2_set(caps1, "width", GST_PROPS_INT(480));
- gst_caps2_set(caps1, "framerate", GST_PROPS_FLOAT(30.0));
+ gst_caps_set(caps1, "height", GST_PROPS_INT(640));
+ gst_caps_set(caps1, "width", GST_PROPS_INT(480));
+ gst_caps_set(caps1, "framerate", GST_PROPS_FLOAT(30.0));
#endif
- caps = gst_caps2_intersect(caps1, caps2);
- g_print("caps %s\n", gst_caps2_to_string(caps));
- if (gst_caps2_is_empty (caps)) return 1;
- gst_caps2_free(caps1);
- gst_caps2_free(caps2);
-
- caps1 = gst_caps2_copy( gst_static_caps2_get (&rawcaps2));
- caps2 = gst_caps2_copy( gst_static_caps2_get (&rawcaps3));
- caps = gst_caps2_intersect(caps1, caps2);
- g_print("caps %s\n", gst_caps2_to_string(caps));
- if (gst_caps2_is_empty (caps)) return 1;
- gst_caps2_free(caps1);
- gst_caps2_free(caps2);
-
- caps1 = gst_caps2_copy( gst_static_caps2_get (&rawcaps4));
- caps2 = gst_caps2_copy( gst_static_caps2_get (&rawcaps5));
- caps3 = gst_caps2_copy( gst_static_caps2_get (&rawcaps6));
- caps4 = gst_caps2_intersect(caps1, caps2);
- caps = gst_caps2_intersect(caps3, caps4);
- g_print("caps4 %s\n", gst_caps2_to_string(caps4));
- g_print("caps %s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps1);
- gst_caps2_free(caps2);
- gst_caps2_free(caps3);
- gst_caps2_free(caps4);
-
- caps1 = gst_caps2_copy( gst_static_caps2_get (&rawcaps7));
- caps2 = gst_caps2_copy( gst_static_caps2_get (&rawcaps8));
- caps = gst_caps2_intersect(caps1, caps2);
- g_print("caps %s\n", gst_caps2_to_string(caps));
- if (gst_caps2_is_empty (caps)) return 1;
- gst_caps2_free(caps1);
- gst_caps2_free(caps2);
+ caps = gst_caps_intersect(caps1, caps2);
+ g_print("caps %s\n", gst_caps_to_string(caps));
+ if (gst_caps_is_empty (caps)) return 1;
+ gst_caps_free(caps1);
+ gst_caps_free(caps2);
+
+ caps1 = gst_caps_copy( gst_static_caps_get (&rawcaps2));
+ caps2 = gst_caps_copy( gst_static_caps_get (&rawcaps3));
+ caps = gst_caps_intersect(caps1, caps2);
+ g_print("caps %s\n", gst_caps_to_string(caps));
+ if (gst_caps_is_empty (caps)) return 1;
+ gst_caps_free(caps1);
+ gst_caps_free(caps2);
+
+ caps1 = gst_caps_copy( gst_static_caps_get (&rawcaps4));
+ caps2 = gst_caps_copy( gst_static_caps_get (&rawcaps5));
+ caps3 = gst_caps_copy( gst_static_caps_get (&rawcaps6));
+ caps4 = gst_caps_intersect(caps1, caps2);
+ caps = gst_caps_intersect(caps3, caps4);
+ g_print("caps4 %s\n", gst_caps_to_string(caps4));
+ g_print("caps %s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps1);
+ gst_caps_free(caps2);
+ gst_caps_free(caps3);
+ gst_caps_free(caps4);
+
+ caps1 = gst_caps_copy( gst_static_caps_get (&rawcaps7));
+ caps2 = gst_caps_copy( gst_static_caps_get (&rawcaps8));
+ caps = gst_caps_intersect(caps1, caps2);
+ g_print("caps %s\n", gst_caps_to_string(caps));
+ if (gst_caps_is_empty (caps)) return 1;
+ gst_caps_free(caps1);
+ gst_caps_free(caps2);
return 0;
}
#include <gst/gst.h>
/* these caps all have a non empty intersection */
-GstStaticCaps2 sinkcaps = GST_STATIC_CAPS (
+GstStaticCaps sinkcaps = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype=(int)1, "
"foo1=(int)[20,40], "
"foo3=(int)[10,20]"
);
-GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS (
+GstStaticCaps mp1parsecaps = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype=(int)1, "
"foo1=(int)30, "
-GstStaticCaps2 rawcaps = GST_STATIC_CAPS (
+GstStaticCaps rawcaps = GST_STATIC_CAPS (
"video/raw, "
"width=(int)[16,4096], "
"height=(int)[16,4096]"
);
-GstStaticCaps2 rawcaps2 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps2 = GST_STATIC_CAPS (
"video/raw, "
"height=(int)[16,256], "
"depth=(int)16"
);
-GstStaticCaps2 rawcaps3 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps3 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YUY2\", \"YV12\" }, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 rawcaps4 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps4 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YUY2\",\"YV12\",\"YUYV\" }, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 rawcaps5 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps5 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YUYV\",\"YUY2\"}, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 rawcaps6 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps6 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc)\"YUYV\", "
"height=(int)640, "
{
xmlDocPtr doc;
xmlNodePtr parent;
- GstCaps2 *caps;
+ GstCaps *caps;
gst_init (&argc, &argv);
/*
g_mem_chunk_info ();
for (i = 0; i<100000; i++) {
- caps = gst_caps2_intersect (gst_static_caps2_get (rawcaps3), GST_CAPS_GET (rawcaps4));
- gst_caps2_unref (caps);
+ caps = gst_caps_intersect (gst_static_caps_get (rawcaps3), GST_CAPS_GET (rawcaps4));
+ gst_caps_unref (caps);
}
g_mem_chunk_info ();
*/
- caps = gst_caps2_intersect (gst_static_caps2_get (&sinkcaps),
- gst_static_caps2_get (&mp1parsecaps));
+ caps = gst_caps_intersect (gst_static_caps_get (&sinkcaps),
+ gst_static_caps_get (&mp1parsecaps));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_intersect (gst_static_caps2_get (&rawcaps),
- gst_static_caps2_get (&rawcaps2));
+ caps = gst_caps_intersect (gst_static_caps_get (&rawcaps),
+ gst_static_caps_get (&rawcaps2));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities2", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_intersect (gst_static_caps2_get (&rawcaps3),
- gst_static_caps2_get (&rawcaps4));
+ caps = gst_caps_intersect (gst_static_caps_get (&rawcaps3),
+ gst_static_caps_get (&rawcaps4));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities3", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_intersect (gst_static_caps2_get (&rawcaps3),
- gst_static_caps2_get (&rawcaps5));
+ caps = gst_caps_intersect (gst_static_caps_get (&rawcaps3),
+ gst_static_caps_get (&rawcaps5));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities4", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_intersect (gst_static_caps2_get (&rawcaps6),
- gst_caps2_copy_1(gst_static_caps2_get (&rawcaps6)));
+ caps = gst_caps_intersect (gst_static_caps_get (&rawcaps6),
+ gst_caps_copy_1(gst_static_caps_get (&rawcaps6)));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities5", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
xmlDocDump(stdout, doc);
#include <gst/gst.h>
/* these caps all have a non empty intersection */
-GstStaticCaps2 sinkcaps = GST_STATIC_CAPS (
+GstStaticCaps sinkcaps = GST_STATIC_CAPS (
"video/mpeg, "
"fourcc=(fourcc){\"YV12\",\"YUY2\"}, "
"foo1=(int)[20,40], "
"foo3=(int)[10,20]"
);
-GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS (
+GstStaticCaps mp1parsecaps = GST_STATIC_CAPS (
"video/mpeg, "
"fourcc=(fourcc){\"YV12\",\"YUY2\"}, "
"foo4=(fourcc){\"YV12\",\"YUY2\"}"
);
-GstStaticCaps2 rawcaps = GST_STATIC_CAPS (
+GstStaticCaps rawcaps = GST_STATIC_CAPS (
"video/raw, "
"width=(int)[16,4096], "
"height=(int)[16,4096], "
"fourcc=(fourcc){\"YV12\",\"YUY2\"}"
);
-GstStaticCaps2 rawcaps2 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps2 = GST_STATIC_CAPS (
"video/raw, "
"width=(int)[16,256], "
"height=(int)16; "
"height=(int)16"
);
-GstStaticCaps2 rawcaps3 = GST_STATIC_CAPS (
+GstStaticCaps rawcaps3 = GST_STATIC_CAPS (
"video/raw, "
"width=(int)[16,256], "
"height=(int)16; "
{
xmlDocPtr doc;
xmlNodePtr parent;
- GstCaps2 *caps;
+ GstCaps *caps;
gst_init (&argc, &argv);
doc = xmlNewDoc ("1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
- caps = gst_caps2_normalize (gst_static_caps2_get (&sinkcaps));
+ caps = gst_caps_normalize (gst_static_caps_get (&sinkcaps));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_normalize (gst_static_caps2_get (&mp1parsecaps));
+ caps = gst_caps_normalize (gst_static_caps_get (&mp1parsecaps));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_normalize (gst_static_caps2_get (&rawcaps));
+ caps = gst_caps_normalize (gst_static_caps_get (&rawcaps));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_normalize (gst_static_caps2_get (&rawcaps2));
+ caps = gst_caps_normalize (gst_static_caps_get (&rawcaps2));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
- caps = gst_caps2_normalize (gst_static_caps2_get (&rawcaps3));
+ caps = gst_caps_normalize (gst_static_caps_get (&rawcaps3));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
xmlDocDump(stdout, doc);
#include <gst/gst.h>
#include <string.h>
-GstStaticCaps2 caps1 = GST_STATIC_CAPS (
+GstStaticCaps caps1 = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype=(int){1,2}"
);
-GstStaticCaps2 caps2 = GST_STATIC_CAPS (
+GstStaticCaps caps2 = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype=(int){1}"
);
-GstStaticCaps2 caps3 = GST_STATIC_CAPS (
+GstStaticCaps caps3 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YV12\",\"YUY2\"}, "
"width=(int)[16,4096], "
"height=(int)[16,4096]"
);
-GstStaticCaps2 caps4 = GST_STATIC_CAPS (
+GstStaticCaps caps4 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc)\"YV12\", "
"height=(int)[16,256]"
);
-GstStaticCaps2 caps5 = GST_STATIC_CAPS (
+GstStaticCaps caps5 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YV12\",\"YUY2\"}, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 caps6 = GST_STATIC_CAPS (
+GstStaticCaps caps6 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YV12\",\"YUYV\"}, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 caps7 = GST_STATIC_CAPS (
+GstStaticCaps caps7 = GST_STATIC_CAPS (
"video/raw, "
"fourcc=(fourcc){\"YVYV\",\"YUY2\"}, "
"height=(int)[16,4096]"
);
-GstStaticCaps2 caps8 = GST_STATIC_CAPS (
+GstStaticCaps caps8 = GST_STATIC_CAPS (
"video/raw, "
"format=(fourcc)\"I420\"; "
"video/raw, "
"format=(fourcc)\"YUYV\""
);
-GstStaticCaps2 caps9 = GST_STATIC_CAPS (
+GstStaticCaps caps9 = GST_STATIC_CAPS (
"video/raw, "
"format=(fourcc)\"I420\"; "
"video/raw, "
} \
}G_STMT_END
static void
-test_caps_func (const GstCaps2 *caps)
+test_caps_func (const GstCaps *caps)
{
gchar *str1, *str2;
gboolean ret = FALSE;
- str1 = gst_caps2_to_string (caps);
- caps = gst_caps2_from_string (str1);
+ str1 = gst_caps_to_string (caps);
+ caps = gst_caps_from_string (str1);
if (!caps) {
g_print ("%3d, INFO : no caps from %s\n", test, str1);
TEST_END (ret);
return;
}
- str2 = gst_caps2_to_string (caps);
+ str2 = gst_caps_to_string (caps);
g_print ("%3d, INFO : %s <==> %s\n", test, str1, str2);
ret = strcmp (str1, str2) == 0;
g_free (str1);
TEST_END (ret);
}
static void
-test_caps (const GstCaps2 *caps)
+test_caps (const GstCaps *caps)
{
TEST_START;
test_caps_func (caps);
static void
test_string (gchar *str)
{
- GstCaps2 *caps;
+ GstCaps *caps;
TEST_START;
g_print ("%3d, INFO : checking %s\n", test, str);
- caps = gst_caps2_from_string (str);
+ caps = gst_caps_from_string (str);
if (!caps) {
g_print ("%3d, INFO : no caps from %s\n", test, str);
TEST_FAIL;
static void
test_string_fail (gchar *str)
{
- GstCaps2 *caps;
+ GstCaps *caps;
TEST_START;
g_print ("%3d, INFO : checking %s for failure\n", test, str);
- caps = gst_caps2_from_string (str);
+ caps = gst_caps_from_string (str);
g_print("got %p\n", caps);
TEST_END (caps == NULL);
}
goto bla;
bla:
/* stupidity tests */
- test_caps (gst_caps2_new_simple ("audio/raw", NULL));
+ test_caps (gst_caps_new_simple ("audio/raw", NULL));
/* all sorts of caps */
- test_caps (gst_static_caps2_get (&caps1));
- test_caps (gst_static_caps2_get (&caps2));
- test_caps (gst_static_caps2_get (&caps3));
- test_caps (gst_static_caps2_get (&caps4));
- test_caps (gst_static_caps2_get (&caps5));
- test_caps (gst_static_caps2_get (&caps6));
- test_caps (gst_static_caps2_get (&caps7));
- test_caps (gst_static_caps2_get (&caps8));
- test_caps (gst_static_caps2_get (&caps9));
+ test_caps (gst_static_caps_get (&caps1));
+ test_caps (gst_static_caps_get (&caps2));
+ test_caps (gst_static_caps_get (&caps3));
+ test_caps (gst_static_caps_get (&caps4));
+ test_caps (gst_static_caps_get (&caps5));
+ test_caps (gst_static_caps_get (&caps6));
+ test_caps (gst_static_caps_get (&caps7));
+ test_caps (gst_static_caps_get (&caps8));
+ test_caps (gst_static_caps_get (&caps9));
/* mime types */
test_string ("audio/raw");
#include <gst/gst.h>
/* these caps all have a non empty intersection */
-GstStaticCaps2 sinkcaps = GST_STATIC_CAPS (
+GstStaticCaps sinkcaps = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype:int=1, "
"foo1:int=[20,40], "
"foo3:int=[10,20]"
);
-GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS (
+GstStaticCaps mp1parsecaps = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype:int=1, "
"foo1:int=30, "
{
xmlDocPtr doc;
xmlNodePtr parent;
- GstCaps2 *caps;
+ GstCaps *caps;
gst_init (&argc, &argv);
doc = xmlNewDoc ("1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
- caps = gst_caps2_union (gst_static_caps2_get (&sinkcaps),
- gst_static_caps2_get (&mp1parsecaps));
+ caps = gst_caps_union (gst_static_caps_get (&sinkcaps),
+ gst_static_caps_get (&mp1parsecaps));
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
- gst_caps2_save_thyself (caps, parent);
+ gst_caps_save_thyself (caps, parent);
xmlDocDump(stdout, doc);
void test1(void)
{
- GstCaps2 *caps;
- GstCaps2 *caps2;
+ GstCaps *caps;
+ GstCaps *caps2;
- g_print("type is %d\n", (int)gst_caps2_get_type());
+ g_print("type is %d\n", (int)gst_caps_get_type());
- caps = gst_caps2_new_empty();
+ caps = gst_caps_new_empty();
g_assert(caps != NULL);
- gst_caps2_free(caps);
+ gst_caps_free(caps);
- caps = gst_caps2_new_any();
+ caps = gst_caps_new_any();
g_assert(caps != NULL);
- gst_caps2_free(caps);
+ gst_caps_free(caps);
- caps = gst_caps2_new_simple("audio/raw",
+ caps = gst_caps_new_simple("audio/raw",
"_int", G_TYPE_INT, 100, NULL);
g_assert(caps != NULL);
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==FALSE);
- g_assert(gst_caps2_is_fixed(caps)==TRUE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
-
- caps = gst_caps2_new_simple("audio/raw",
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==FALSE);
+ g_assert(gst_caps_is_fixed(caps)==TRUE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+
+ caps = gst_caps_new_simple("audio/raw",
"_double", G_TYPE_DOUBLE, 100.0, NULL);
g_assert(caps != NULL);
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==FALSE);
- g_assert(gst_caps2_is_fixed(caps)==TRUE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
-
- caps = gst_caps2_new_simple("audio/raw",
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==FALSE);
+ g_assert(gst_caps_is_fixed(caps)==TRUE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+
+ caps = gst_caps_new_simple("audio/raw",
"_fourcc", GST_TYPE_FOURCC, GST_MAKE_FOURCC('a','b','c','d'), NULL);
g_assert(caps != NULL);
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==FALSE);
- g_assert(gst_caps2_is_fixed(caps)==TRUE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
-
- caps = gst_caps2_new_simple("audio/raw",
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==FALSE);
+ g_assert(gst_caps_is_fixed(caps)==TRUE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+
+ caps = gst_caps_new_simple("audio/raw",
"_boolean", G_TYPE_BOOLEAN, TRUE, NULL);
g_assert(caps != NULL);
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==FALSE);
- g_assert(gst_caps2_is_fixed(caps)==TRUE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
-
- caps = gst_caps2_new_full(
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==FALSE);
+ g_assert(gst_caps_is_fixed(caps)==TRUE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+
+ caps = gst_caps_new_full(
gst_structure_new("audio/raw", "_int", G_TYPE_INT, 100, NULL),
gst_structure_new("audio/raw2", "_int", G_TYPE_INT, 100, NULL),
NULL);
g_assert(caps != NULL);
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==TRUE);
- g_assert(gst_caps2_is_fixed(caps)==FALSE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
-
- caps = gst_caps2_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==TRUE);
+ g_assert(gst_caps_is_fixed(caps)==FALSE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+
+ caps = gst_caps_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
g_assert(caps != NULL);
- caps2 = gst_caps2_copy(caps);
+ caps2 = gst_caps_copy(caps);
g_assert(caps2 != NULL);
- g_assert(gst_caps2_is_empty(caps2)==FALSE);
- g_assert(gst_caps2_is_any(caps2)==FALSE);
- g_assert(gst_caps2_is_chained(caps2)==FALSE);
- g_assert(gst_caps2_is_fixed(caps2)==TRUE);
- g_print("%s\n", gst_caps2_to_string(caps));
- g_print("%s\n", gst_caps2_to_string(caps2));
- gst_caps2_free(caps);
- gst_caps2_free(caps2);
-
- caps = gst_caps2_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
- gst_caps2_append (caps,
- gst_caps2_new_simple("audio/raw", "_int", G_TYPE_INT, 200, NULL));
+ g_assert(gst_caps_is_empty(caps2)==FALSE);
+ g_assert(gst_caps_is_any(caps2)==FALSE);
+ g_assert(gst_caps_is_chained(caps2)==FALSE);
+ g_assert(gst_caps_is_fixed(caps2)==TRUE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ g_print("%s\n", gst_caps_to_string(caps2));
+ gst_caps_free(caps);
+ gst_caps_free(caps2);
+
+ caps = gst_caps_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
+ gst_caps_append (caps,
+ gst_caps_new_simple("audio/raw", "_int", G_TYPE_INT, 200, NULL));
g_assert(caps != NULL);
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==TRUE);
- g_assert(gst_caps2_is_fixed(caps)==FALSE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
-
- caps = gst_caps2_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==TRUE);
+ g_assert(gst_caps_is_fixed(caps)==FALSE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+
+ caps = gst_caps_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
g_assert(caps != NULL);
- gst_caps2_append_cap (caps,
+ gst_caps_append_structure (caps,
gst_structure_new("audio/raw", "_int", G_TYPE_INT, 200, NULL));
- g_assert(gst_caps2_is_empty(caps)==FALSE);
- g_assert(gst_caps2_is_any(caps)==FALSE);
- g_assert(gst_caps2_is_chained(caps)==TRUE);
- g_assert(gst_caps2_is_fixed(caps)==FALSE);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
+ g_assert(gst_caps_is_empty(caps)==FALSE);
+ g_assert(gst_caps_is_any(caps)==FALSE);
+ g_assert(gst_caps_is_chained(caps)==TRUE);
+ g_assert(gst_caps_is_fixed(caps)==FALSE);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
}
void test2(void)
{
- GstCaps2 *caps1;
- GstCaps2 *caps2;
- GstCaps2 *caps;
+ GstCaps *caps1;
+ GstCaps *caps2;
+ GstCaps *caps;
- caps1 = gst_caps2_new_full(
+ caps1 = gst_caps_new_full(
gst_structure_new("audio/raw", "_int", G_TYPE_INT, 100, NULL),
gst_structure_new("audio/raw", "_int", G_TYPE_INT, 200, NULL),
NULL);
- caps2 = gst_caps2_new_full(
+ caps2 = gst_caps_new_full(
gst_structure_new("audio/raw", "_int", G_TYPE_INT, 100, NULL),
gst_structure_new("audio/raw", "_int", G_TYPE_INT, 300, NULL),
NULL);
- caps = gst_caps2_intersect(caps1, caps2);
- g_print("%s\n", gst_caps2_to_string(caps));
- gst_caps2_free(caps);
- gst_caps2_free(caps1);
- gst_caps2_free(caps2);
+ caps = gst_caps_intersect(caps1, caps2);
+ g_print("%s\n", gst_caps_to_string(caps));
+ gst_caps_free(caps);
+ gst_caps_free(caps1);
+ gst_caps_free(caps2);
}
GstElement *pipeline = NULL;
GstElement *tee, *src, *sink1, *sink2;
GstPad *tee_src1, *tee_src2;
- GstCaps2 *src_caps = NULL;
- GstCaps2 *sink_caps = NULL;
+ GstCaps *src_caps = NULL;
+ GstCaps *sink_caps = NULL;
GstStructure *structure = NULL;
GstPad *pad = NULL;
/* now we try setting caps on the src pad */
/* FIXME: should we set to pause here ? */
- src_caps = gst_caps2_from_string ("audio/raw, format=(s)\"int\", "
+ src_caps = gst_caps_from_string ("audio/raw, format=(s)\"int\", "
"rate=(i)44100");
g_assert (src_caps != NULL);
/* now iterate and see if it proxies caps ok */
gst_bin_iterate (GST_BIN (pipeline));
sink_caps = gst_pad_get_caps (gst_element_get_pad (sink1, "sink"));
- if (sink_caps && gst_caps2_is_fixed (sink_caps)) {
- structure = gst_caps2_get_nth_cap (sink_caps, 0);
+ if (sink_caps && gst_caps_is_fixed (sink_caps)) {
+ structure = gst_caps_get_structure (sink_caps, 0);
}else {
structure = NULL;
g_print ("sink_caps is not fixed\n");
g_print ("Rate of pad on sink1 : %d\n", rate);
}
sink_caps = gst_pad_get_caps (gst_element_get_pad (sink2, "sink"));
- structure = gst_caps2_get_nth_cap (sink_caps, 0);
+ structure = gst_caps_get_structure (sink_caps, 0);
if (structure != NULL && ! (gst_structure_has_field (structure, "rate"))) {
g_print ("Hm, rate has not been propagated to sink2.\n");
return 1;
#include <string.h>
static void
-print_caps (const GstCaps2 *caps, const gchar *pfx)
+print_caps (const GstCaps *caps, const gchar *pfx)
{
char *s;
- s = gst_caps2_to_string (caps);
+ s = gst_caps_to_string (caps);
g_print ("%s%s\n", pfx, s);
g_free(s);
}
if (param->value_type == GST_TYPE_URI) {
g_print("%-23.23s URI", "");
}
- if (param->value_type == GST_TYPE_CAPS2) {
- const GstCaps2 *caps = gst_value_get_caps (&value);
+ if (param->value_type == GST_TYPE_CAPS) {
+ const GstCaps *caps = gst_value_get_caps (&value);
if (!caps)
g_print("%-23.23s Caps (NULL)", "");
gchar *filename = NULL;
void
-gst_caps_print (const char *filename, const GstCaps2 *caps)
+gst_caps_print (const char *filename, const GstCaps *caps)
{
- gchar *caps_str = gst_caps2_to_string (caps);
+ gchar *caps_str = gst_caps_to_string (caps);
g_print ("%s - %s\n", filename, caps_str);
g_free (caps_str);
}
void
-have_type_handler (GstElement *typefind, guint probability, const GstCaps2 *caps, gpointer unused)
+have_type_handler (GstElement *typefind, guint probability, const GstCaps *caps, gpointer unused)
{
gst_caps_print (filename, caps);
FOUND = TRUE;
#endif
static void
-print_caps (const GstCaps2 *caps, gint pfx)
+print_caps (const GstCaps *caps, gint pfx)
{
if (!caps)
return;
#if 0
/* FIXME */
if (param->value_type == GST_TYPE_CAPS) {
- GstCaps2 *caps = g_value_peek_pointer (&value);
+ GstCaps *caps = g_value_peek_pointer (&value);
if (!caps)
PUT_ESCAPED (pfx + 2, "default", "NULL");