Global change from "caps2" to "caps". Script is: #!/bin/sh find . -name '*.[chy]' -exec perl -i -p \

Original commit message from CVS:
Global change from "caps2" to "caps".  Script is:
#!/bin/sh

find . -name '*.[chy]' -exec perl -i -p \
-e 's/gst_static_caps2_/gst_static_caps_/g;\
s/GST_CAPS2_/GST_CAPS_/g;\
s/gst_caps2_/gst_caps_/g;\
s/GstCaps2/GstCaps/g;\
s/GstStaticCaps2/GstStaticCaps/g;\
s/GST_STATIC_CAPS2_/GST_STATIC_CAPS_/g;\
s/GST_TYPE_CAPS2/GST_TYPE_CAPS/g;\
s/gst_caps_get_nth_cap/gst_caps_get_structure/g;\
s/gst_caps_get_n_structures/gst_caps_get_size/g;\
s/gst_caps_append_cap/gst_caps_append_structure/g;\
s/GST_CAPS2_/GST_CAPS_/g;' \
{} \;
This commit is contained in:
David Schleef 2003-12-21 22:33:42 +00:00
parent e1eb5e2d92
commit 63ee736634
75 changed files with 1069 additions and 1069 deletions

View file

@ -40,12 +40,12 @@ void eos(GstElement *element)
/* 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));
@ -238,7 +238,7 @@ create_input_channel (int id, char* location)
char buffer[20]; /* hold the names */
/* GstAutoplug *autoplug;
GstCaps2 *srccaps; */
GstCaps *srccaps; */
GstElement *new_element;
GstElement *decoder;
@ -330,7 +330,7 @@ create_input_channel (int id, char* location)
#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");

View file

@ -1,7 +1,7 @@
#include <gst/gst.h>
void
type_found (GstElement *typefind, const GstCaps2 * caps)
type_found (GstElement *typefind, const GstCaps * caps)
{
xmlDocPtr doc;
xmlNodePtr parent;
@ -11,7 +11,7 @@ type_found (GstElement *typefind, const GstCaps2 * caps)
parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
/* FIXME */
//gst_caps2_save_thyself (caps, parent);
//gst_caps_save_thyself (caps, parent);
xmlDocDump (stdout, doc);
}

View file

@ -58,23 +58,23 @@ g_list_free_list_and_elements (GList *list)
* 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;
}
@ -88,7 +88,7 @@ gst_autoplug_caps_intersect (const GstCaps2 *src, const GstCaps2 *sink)
* 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;
@ -117,7 +117,7 @@ gst_autoplug_can_connect_src (GstElementFactory *fac, const GstCaps2 *src)
* 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;
@ -125,7 +125,7 @@ gst_autoplug_can_connect_sink (GstElementFactory *fac, const GstCaps2 *sink)
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))
{
@ -320,8 +320,8 @@ gst_autoplug_factories_at_most_templates(GList *factories, GstPadDirection dir,
*/
/**
* 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
@ -331,7 +331,7 @@ gst_autoplug_factories_at_most_templates(GList *factories, GstPadDirection dir,
* 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 */
@ -341,7 +341,7 @@ gst_autoplug_sp (const GstCaps2 *srccaps, const GstCaps2 *sinkcaps, GList *facto
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 */

View file

@ -40,9 +40,9 @@ struct _GstAutoplugNode {
};
/* 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)
@ -59,6 +59,6 @@ GList * gst_autoplug_factories_filters_with_sink_caps(GList *factories);
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__ */

View file

@ -70,7 +70,7 @@ GST_STATIC_PAD_TEMPLATE (
"src_%d",
GST_PAD_SRC,
GST_PAD_REQUEST,
GST_STATIC_CAPS2_ANY
GST_STATIC_CAPS_ANY
);
/* standard GObject stuff */

View file

@ -46,7 +46,7 @@ GST_STATIC_PAD_TEMPLATE (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS2_ANY
GST_STATIC_CAPS_ANY
);
static GstStaticPadTemplate spider_sink_factory =
@ -54,7 +54,7 @@ GST_STATIC_PAD_TEMPLATE (
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS2_ANY
GST_STATIC_CAPS_ANY
);
/* SpiderIdentity signals and args */
@ -75,8 +75,8 @@ static void gst_spider_identity_init (GstSpiderIdentity *spider_identity);
/* 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);
@ -222,7 +222,7 @@ gst_spider_identity_new_sink (gchar *name)
/* 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;
@ -238,7 +238,7 @@ gst_spider_identity_link (GstPad *pad, const GstCaps2 *caps)
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));
@ -256,7 +256,7 @@ gst_spider_identity_getcaps (GstPad *pad)
if (peer)
return gst_pad_get_caps (peer);
}
return gst_caps2_new_any ();
return gst_caps_new_any ();
}
GstPad*
@ -411,7 +411,7 @@ gst_spider_identity_src_loop (GstSpiderIdentity *ident)
typedef struct {
GstBuffer *buffer;
guint best_probability;
GstCaps2 *caps;
GstCaps *caps;
} SpiderTypeFind;
guint8 *
spider_find_peek (gpointer data, gint64 offset, guint size)
@ -429,16 +429,16 @@ 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;
}
}
@ -500,8 +500,8 @@ end:
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);

View file

@ -53,7 +53,7 @@ struct _GstSpiderIdentity {
gboolean plugged;
/* Caps from typefinding */
GstCaps2 *caps;
GstCaps *caps;
};

View file

@ -55,7 +55,7 @@ GstStaticPadTemplate aggregator_src_template = GST_STATIC_PAD_TEMPLATE (
"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())

View file

@ -60,7 +60,7 @@ GstStaticPadTemplate fakesink_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_FAKESINK_STATE_ERROR (gst_fakesink_state_error_get_type())

View file

@ -77,7 +77,7 @@ GstStaticPadTemplate fakesrc_src_template = GST_STATIC_PAD_TEMPLATE (
"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())

View file

@ -152,7 +152,7 @@ gst_identity_class_init (GstIdentityClass *klass)
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property);
}
static GstCaps2*
static GstCaps*
gst_identity_getcaps (GstPad *pad)
{
GstIdentity *identity;
@ -171,20 +171,20 @@ gst_identity_getcaps (GstPad *pad)
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;
}

View file

@ -59,7 +59,7 @@ struct _GstIdentity {
gboolean dump;
gchar *last_message;
gboolean delay_capsnego;
GstCaps2 *srccaps;
GstCaps *srccaps;
};
struct _GstIdentityClass {

View file

@ -58,7 +58,7 @@ GstStaticPadTemplate md5_sink_template = GST_STATIC_PAD_TEMPLATE (
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS2_ANY
GST_STATIC_CAPS_ANY
);
/* GObject stuff */

View file

@ -64,14 +64,14 @@ GstStaticPadTemplate shaper_src_template = GST_STATIC_PAD_TEMPLATE (
"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())
@ -170,7 +170,7 @@ gst_shaper_class_init (GstShaperClass *klass)
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR (gst_shaper_request_new_pad);
}
static GstCaps2*
static GstCaps*
gst_shaper_getcaps (GstPad *pad)
{
GstPad *otherpad;
@ -180,7 +180,7 @@ gst_shaper_getcaps (GstPad *pad)
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*
@ -200,7 +200,7 @@ gst_shaper_get_internal_link (GstPad *pad)
}
static GstPadLinkReturn
gst_shaper_link (GstPad *pad, const GstCaps2 *caps)
gst_shaper_link (GstPad *pad, const GstCaps *caps)
{
GstPad *otherpad;
GstShaperConnection *connection;

View file

@ -57,7 +57,7 @@ GstStaticPadTemplate tee_src_template = GST_STATIC_PAD_TEMPLATE (
"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);
@ -138,17 +138,17 @@ gst_tee_class_init (GstTeeClass *klass)
}
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;
}
@ -170,21 +170,21 @@ gst_tee_sinklink (GstPad *pad, const GstCaps2 *caps)
}
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;
@ -197,8 +197,8 @@ gst_tee_getcaps (GstPad *pad)
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);
@ -208,8 +208,8 @@ gst_tee_getcaps (GstPad *pad)
}
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;
}

View file

@ -58,14 +58,14 @@ GstStaticPadTemplate type_find_element_sink_template = GST_STATIC_PAD_TEMPLATE (
"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 */
@ -141,17 +141,17 @@ gst_type_find_element_get_type (void)
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");
}
@ -184,7 +184,7 @@ gst_type_find_element_class_init (gpointer g_class, gpointer class_data)
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));
@ -196,7 +196,7 @@ gst_type_find_element_class_init (gpointer g_class, gpointer class_data)
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);
}
@ -313,7 +313,7 @@ gst_type_find_element_src_event (GstPad *pad, GstEvent *event)
typedef struct {
GstTypeFindFactory * factory;
gint probability;
GstCaps2 * caps;
GstCaps * caps;
gint64 requested_offset;
guint requested_size;
@ -333,7 +333,7 @@ free_entry (TypeFindEntry *entry)
free_entry_buffers (entry);
if (entry->caps)
gst_caps2_free (entry->caps);
gst_caps_free (entry->caps);
g_free (entry);
}
static void
@ -473,18 +473,18 @@ find_peek (gpointer data, gint64 offset, guint size)
}
}
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
@ -563,10 +563,10 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
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) {
@ -581,7 +581,7 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
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);
}
@ -669,7 +669,7 @@ gst_type_find_element_change_state (GstElement *element)
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;

View file

@ -50,7 +50,7 @@ struct _GstTypeFindElement {
guint min_probability;
guint max_probability;
GstCaps2 * caps;
GstCaps * caps;
guint mode;
GstBufferStore * store;
@ -66,7 +66,7 @@ struct _GstTypeFindElementClass {
/* signals */
void (*have_type) (GstTypeFindElement *element,
guint probability,
GstCaps2 * caps);
GstCaps * caps);
};
GType gst_type_find_element_get_type (void);

View file

@ -58,14 +58,14 @@ GstStaticPadTemplate type_find_element_sink_template = GST_STATIC_PAD_TEMPLATE (
"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 */
@ -141,17 +141,17 @@ gst_type_find_element_get_type (void)
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");
}
@ -184,7 +184,7 @@ gst_type_find_element_class_init (gpointer g_class, gpointer class_data)
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));
@ -196,7 +196,7 @@ gst_type_find_element_class_init (gpointer g_class, gpointer class_data)
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);
}
@ -313,7 +313,7 @@ gst_type_find_element_src_event (GstPad *pad, GstEvent *event)
typedef struct {
GstTypeFindFactory * factory;
gint probability;
GstCaps2 * caps;
GstCaps * caps;
gint64 requested_offset;
guint requested_size;
@ -333,7 +333,7 @@ free_entry (TypeFindEntry *entry)
free_entry_buffers (entry);
if (entry->caps)
gst_caps2_free (entry->caps);
gst_caps_free (entry->caps);
g_free (entry);
}
static void
@ -473,18 +473,18 @@ find_peek (gpointer data, gint64 offset, guint size)
}
}
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
@ -563,10 +563,10 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
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) {
@ -581,7 +581,7 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
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);
}
@ -669,7 +669,7 @@ gst_type_find_element_change_state (GstElement *element)
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;

View file

@ -50,7 +50,7 @@ struct _GstTypeFindElement {
guint min_probability;
guint max_probability;
GstCaps2 * caps;
GstCaps * caps;
guint mode;
GstBufferStore * store;
@ -66,7 +66,7 @@ struct _GstTypeFindElementClass {
/* signals */
void (*have_type) (GstTypeFindElement *element,
guint probability,
GstCaps2 * caps);
GstCaps * caps);
};
GType gst_type_find_element_get_type (void);

View file

@ -533,7 +533,7 @@ init_post (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 ();

View file

@ -24,25 +24,25 @@
#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,
@ -61,111 +61,111 @@ void _gst_caps2_initialize (void)
&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;
@ -173,25 +173,25 @@ void gst_caps2_free (GstCaps2 *caps)
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);
@ -202,23 +202,23 @@ const GstCaps2 *gst_static_caps2_get (GstStaticCaps2 *static_caps)
}
/* 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);
@ -227,21 +227,21 @@ void gst_caps2_append_cap (GstCaps2 *caps, GstStructure *structure)
}
}
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);
@ -250,27 +250,27 @@ GstStructure *gst_caps2_get_nth_cap (const GstCaps2 *caps, int index)
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;
@ -278,43 +278,43 @@ void gst_caps2_set_simple (GstCaps2 *caps, char *field, ...)
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);
@ -322,7 +322,7 @@ gboolean gst_caps2_is_chained (const GstCaps2 *caps)
}
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;
@ -330,7 +330,7 @@ _gst_caps2_is_fixed_foreach (GQuark field_id, GValue *value, gpointer unused)
return FALSE;
}
gboolean gst_caps2_is_fixed (const GstCaps2 *caps)
gboolean gst_caps_is_fixed (const GstCaps *caps)
{
GstStructure *structure;
@ -338,9 +338,9 @@ gboolean gst_caps2_is_fixed (const GstCaps2 *caps)
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
@ -374,13 +374,13 @@ _gst_cap_is_always_compatible (const GstStructure *struct1,
}
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;
@ -391,25 +391,25 @@ _gst_caps2_cap_is_always_compatible (const GstStructure *struct1,
}
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;
}
@ -425,7 +425,7 @@ typedef struct {
} 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 };
@ -445,7 +445,7 @@ gst_caps2_structure_intersect_field (GQuark id, GValue *val1, gpointer data)
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;
@ -459,13 +459,13 @@ static GstStructure *gst_caps2_structure_intersect (const GstStructure *struct1,
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;
@ -476,7 +476,7 @@ error:
}
#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;
@ -514,32 +514,32 @@ static GstStructure *gst_caps2_structure_union (const GstStructure *struct1,
#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);
}
}
@ -548,14 +548,14 @@ GstCaps2 *gst_caps2_intersect (const GstCaps2 *caps1, const GstCaps2 *caps2)
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 */
@ -563,20 +563,20 @@ GstCaps2 *gst_caps2_union (const GstCaps2 *caps1, const GstCaps2 *caps2)
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;
@ -584,15 +584,15 @@ GstCaps2 *gst_caps2_load_thyself (xmlNodePtr parent)
#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;
@ -603,18 +603,18 @@ gchar *gst_caps2_to_string (const GstCaps2 *caps)
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));
@ -623,14 +623,14 @@ gchar *gst_caps2_to_string (const GstCaps2 *caps)
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) {
@ -641,7 +641,7 @@ static gboolean _gst_caps2_from_string_inplace (GstCaps2 *caps,
if (structure == NULL) {
return FALSE;
}
gst_caps2_append_cap (caps, structure);
gst_caps_append_structure (caps, structure);
while (*s == ';') {
s++;
@ -650,7 +650,7 @@ static gboolean _gst_caps2_from_string_inplace (GstCaps2 *caps,
if (structure == NULL) {
return FALSE;
}
gst_caps2_append_cap (caps, structure);
gst_caps_append_structure (caps, structure);
while (g_ascii_isspace(*s))s++;
}
@ -661,57 +661,57 @@ static gboolean _gst_caps2_from_string_inplace (GstCaps2 *caps,
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;
@ -758,7 +758,7 @@ gboolean gst_caps2_structure_fixate_field_nearest_int (GstStructure *structure,
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;

View file

@ -17,30 +17,30 @@
* 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;
};
@ -50,77 +50,77 @@ struct _GstStaticCaps2 {
/* 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__ */

View file

@ -1363,13 +1363,13 @@ gst_element_get_compatible_pad_template (GstElement *element,
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 "));
}
@ -1419,7 +1419,7 @@ gst_element_request_compatible_pad (GstElement *element, GstPadTemplate *templ)
* 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
@ -1429,11 +1429,11 @@ gst_element_request_compatible_pad (GstElement *element, GstPadTemplate *templ)
*/
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 */
@ -1461,12 +1461,12 @@ gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad,
/* 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),
@ -1478,7 +1478,7 @@ gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *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));
}
@ -1510,7 +1510,7 @@ gst_element_get_compatible_pad (GstElement *element, GstPad *pad)
* @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
@ -1522,7 +1522,7 @@ gst_element_get_compatible_pad (GstElement *element, GstPad *pad)
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;
@ -1653,7 +1653,7 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
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);
@ -1685,7 +1685,7 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
* 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
@ -1698,7 +1698,7 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
*/
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);
}
@ -2510,7 +2510,7 @@ gst_element_clear_pad_caps (GstElement *element)
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);
}

View file

@ -305,7 +305,7 @@ G_CONST_RETURN GList*
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);
@ -317,7 +317,7 @@ gboolean gst_element_link (GstElement *src, GstElement *dest);
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, ...);
@ -326,7 +326,7 @@ gboolean gst_element_link_pads (GstElement *src, const gchar *srcpadname,
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);
@ -432,9 +432,9 @@ GstElement* gst_element_factory_create (GstElementFactory *factory,
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);

View file

@ -502,7 +502,7 @@ gst_element_factory_get_uri_protocols (GstElementFactory *factory)
*/
gboolean
gst_element_factory_can_src_caps (GstElementFactory *factory,
const GstCaps2 *caps)
const GstCaps *caps)
{
GList *templates;
@ -515,7 +515,7 @@ gst_element_factory_can_src_caps (GstElementFactory *factory,
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);
@ -534,7 +534,7 @@ gst_element_factory_can_src_caps (GstElementFactory *factory,
*/
gboolean
gst_element_factory_can_sink_caps (GstElementFactory *factory,
const GstCaps2 *caps)
const GstCaps *caps)
{
GList *templates;
@ -547,7 +547,7 @@ gst_element_factory_can_sink_caps (GstElementFactory *factory,
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);

View file

@ -32,7 +32,7 @@
#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 {
@ -52,10 +52,10 @@ static void gst_pad_init (GstPad *pad);
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);
@ -177,7 +177,7 @@ gst_real_pad_class_init (GstRealPadClass *klass)
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,
@ -196,7 +196,7 @@ gst_real_pad_class_init (GstRealPadClass *klass)
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);
@ -953,7 +953,7 @@ gst_pad_check_schedulers (GstRealPad *realsrc, GstRealPad *realsink)
* 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.
@ -962,7 +962,7 @@ gst_pad_check_schedulers (GstRealPad *realsrc, GstRealPad *realsink)
*/
gboolean
gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad,
const GstCaps2 *filtercaps)
const GstCaps *filtercaps)
{
GstRealPad *realsrc, *realsink;
@ -1015,7 +1015,7 @@ gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad)
* 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.
@ -1024,7 +1024,7 @@ gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad)
*/
gboolean
gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad,
const GstCaps2 *filtercaps)
const GstCaps *filtercaps)
{
GstRealPad *realsrc, *realsink;
GstScheduler *src_sched, *sink_sched;
@ -1339,9 +1339,9 @@ gst_pad_get_ghost_pad_list (GstPad *pad)
* 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);
@ -1363,24 +1363,24 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps2 *caps, gboolean notify)
/* 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 */
}
@ -1392,7 +1392,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps2 *caps, gboolean notify)
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);
@ -1446,12 +1446,12 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps2 *caps, gboolean notify)
}
}
/* 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");
}
@ -1465,16 +1465,16 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps2 *caps, gboolean notify)
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;
@ -1484,7 +1484,7 @@ _gst_pad_try_fixate_caps (GstRealPad *pad, GstCaps2 *caps)
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) {
@ -1543,29 +1543,29 @@ _gst_pad_default_fixate_foreach (GQuark field_id, GValue *value,
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);
@ -1575,7 +1575,7 @@ _gst_pad_default_fixate_func (GstPad *pad, GstCaps2 *caps, gpointer unused)
/**
* 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.
@ -1584,10 +1584,10 @@ _gst_pad_default_fixate_func (GstPad *pad, GstCaps2 *caps, gpointer unused)
* 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);
@ -1596,20 +1596,20 @@ gst_pad_try_set_caps (GstPad *pad, const GstCaps2 *caps)
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;
}
@ -1636,7 +1636,7 @@ gst_pad_try_set_caps (GstPad *pad, const GstCaps2 *caps)
done:
/* if we took ownership, the caps will be freed */
//gst_caps2_free (caps);
//gst_caps_free (caps);
return set_retval;
}
@ -1652,10 +1652,10 @@ done:
*/
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);
@ -1670,57 +1670,57 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
"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));
@ -1729,16 +1729,16 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
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));
}
@ -1755,9 +1755,9 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
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;
@ -1789,36 +1789,36 @@ gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad)
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;
@ -1827,7 +1827,7 @@ gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad)
}
/* 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);
@ -1849,9 +1849,9 @@ gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad)
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:
@ -1872,7 +1872,7 @@ error:
*/
gboolean
gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad,
const GstCaps2 *filtercaps)
const GstCaps *filtercaps)
{
GstRealPad *realsrc, *realsink;
@ -1903,7 +1903,7 @@ gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad,
*/
gboolean
gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad,
const GstCaps2 *filtercaps)
const GstCaps *filtercaps)
{
GstRealPad *realsrc, *realsink;
@ -1928,17 +1928,17 @@ gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad,
/**
* 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);
@ -1947,7 +1947,7 @@ gst_pad_proxy_link (GstPad *pad, const GstCaps2 *caps)
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;
@ -1963,10 +1963,10 @@ gst_pad_proxy_link (GstPad *pad, const GstCaps2 *caps)
*
* 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;
@ -1980,7 +1980,7 @@ gst_pad_get_caps (GstPad *pad)
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));
@ -1989,7 +1989,7 @@ gst_pad_get_caps (GstPad *pad)
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;
@ -1997,7 +1997,7 @@ gst_pad_get_caps (GstPad *pad)
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");
@ -2007,7 +2007,7 @@ gst_pad_get_caps (GstPad *pad)
GST_DEBUG_PAD_NAME (realpad), realpad);
#endif
return gst_caps2_new_any();
return gst_caps_new_any();
}
/**
@ -2016,13 +2016,13 @@ gst_pad_get_caps (GstPad *pad)
*
* 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);
@ -2035,7 +2035,7 @@ gst_pad_get_pad_template_caps (GstPad *pad)
GST_DEBUG_PAD_NAME (realpad), realpad);
#endif
return gst_static_caps2_get(&anycaps);
return gst_static_caps_get(&anycaps);
}
/**
@ -2045,13 +2045,13 @@ gst_pad_get_pad_template_caps (GstPad *pad)
*
* 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);
@ -2060,7 +2060,7 @@ gst_pad_template_get_caps_by_name (GstPadTemplate *templ, const gchar *name)
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;
}
@ -2083,7 +2083,7 @@ gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad)
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;
}
@ -2124,17 +2124,17 @@ gst_pad_get_peer (GstPad *pad)
* 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);
@ -2150,15 +2150,15 @@ gst_pad_get_allowed_caps (GstPad *pad)
}
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);
}
}
@ -2184,7 +2184,7 @@ gst_pad_caps_change_notify (GstPad *pad)
* 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;
@ -2195,7 +2195,7 @@ gst_pad_recover_caps_error (GstPad *pad, const GstCaps2 *allowed)
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);
@ -2283,8 +2283,8 @@ gst_real_pad_dispose (GObject *object)
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'",
@ -2690,7 +2690,7 @@ gst_pad_template_dispose (GObject *object)
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);
@ -2762,8 +2762,8 @@ gst_static_pad_template_get (GstStaticPadTemplate *pad_template)
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;
}
@ -2773,7 +2773,7 @@ gst_static_pad_template_get (GstStaticPadTemplate *pad_template)
* @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
@ -2784,7 +2784,7 @@ gst_static_pad_template_get (GstStaticPadTemplate *pad_template)
GstPadTemplate*
gst_pad_template_new (const gchar *name_template,
GstPadDirection direction, GstPadPresence presence,
GstCaps2 *caps)
GstCaps *caps)
{
GstPadTemplate *new;
@ -2811,10 +2811,10 @@ gst_pad_template_new (const gchar *name_template,
*
* 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);

View file

@ -118,10 +118,10 @@ typedef const GstFormat* (*GstPadFormatsFunction) (GstPad *pad);
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);
@ -159,9 +159,9 @@ struct _GstRealPad {
GstPad pad;
/* the pad capabilities */
GstCaps2 *caps;
GstCaps *caps;
GstPadFixateFunction appfixatefunc;
GstCaps2 *appfilter;
GstCaps *appfilter;
GstPadGetCapsFunction getcapsfunc;
GstPadFixateFunction fixatefunc;
@ -202,7 +202,7 @@ struct _GstRealPadClass {
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);
@ -306,7 +306,7 @@ struct _GstPadTemplate {
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
GstCaps2 *caps;
GstCaps *caps;
gpointer _gst_reserved[GST_PADDING];
};
@ -324,7 +324,7 @@ struct _GstStaticPadTemplate {
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
GstStaticCaps2 static_caps;
GstStaticCaps static_caps;
};
#define GST_STATIC_PAD_TEMPLATE(padname, dir, pres, caps) \
@ -385,31 +385,31 @@ G_CONST_RETURN GstEventMask*
/* 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);
@ -475,11 +475,11 @@ GType gst_pad_template_get_type (void);
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,

View file

@ -83,10 +83,10 @@ static void gst_queue_get_property (GObject *object,
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);
@ -330,12 +330,12 @@ gst_queue_otherpad (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));
@ -343,7 +343,7 @@ gst_queue_getcaps (GstPad *pad)
if (otherpad)
return gst_pad_get_caps (otherpad);
return gst_caps2_new_any ();
return gst_caps_new_any ();
}
static void

View file

@ -92,7 +92,7 @@ gst_type_find_factory_dispose (GObject *object)
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) {
@ -144,9 +144,9 @@ gst_type_find_factory_get_list (void)
*
* 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);
@ -212,7 +212,7 @@ gst_type_find_factory_call_function (const GstTypeFindFactory *factory, GstTypeF
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;
@ -236,7 +236,7 @@ gst_type_find_register (GstPlugin *plugin, const gchar *name, guint rank,
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;
@ -281,12 +281,12 @@ gst_type_find_peek (GstTypeFind *find, gint64 offset, guint size)
* 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);
}

View file

@ -59,7 +59,7 @@ struct _GstTypeFind {
guint size);
void (* suggest) (gpointer data,
guint probability,
const GstCaps2 * caps);
const GstCaps * caps);
gpointer data;
@ -76,7 +76,7 @@ struct _GstTypeFindFactory {
GstTypeFindFunction function;
gchar ** extensions;
GstCaps2 * caps; /* FIXME: not yet saved in registry */
GstCaps * caps; /* FIXME: not yet saved in registry */
gpointer user_data;
@ -96,7 +96,7 @@ guint8 * gst_type_find_peek (GstTypeFind * find,
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 */
@ -105,7 +105,7 @@ gboolean gst_type_find_register (GstPlugin * plugin,
guint rank,
GstTypeFindFunction func,
gchar ** extensions,
const GstCaps2 * possible_caps,
const GstCaps * possible_caps,
gpointer data);
/* typefinding interface */
@ -115,7 +115,7 @@ GType gst_type_find_factory_get_type (void);
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);

View file

@ -386,7 +386,7 @@ void
gst_print_pad_caps (GString * buf, gint indent, GstPad * pad)
{
GstRealPad *realpad;
GstCaps2 *caps;
GstCaps *caps;
realpad = GST_PAD_REALIZE (pad);
caps = realpad->caps;
@ -398,7 +398,7 @@ gst_print_pad_caps (GString * buf, gint indent, GstPad * pad)
else {
char *s;
s = gst_caps2_to_string(caps);
s = gst_caps_to_string(caps);
g_string_append(buf, s);
g_free(s);
}

View file

@ -416,14 +416,14 @@ gst_value_get_double_range_max (const GValue *value)
/* 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);

View file

@ -74,8 +74,8 @@ void gst_value_set_double_range (GValue *value, double start, double end);
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);

View file

@ -83,7 +83,7 @@ typedef struct {
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;
@ -336,7 +336,7 @@ gst_parse_free_link (link_t *link)
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
@ -396,7 +396,7 @@ gst_parse_found_pad (GstElement *src, GstPad *pad, gpointer data)
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);
@ -405,7 +405,7 @@ gst_parse_found_pad (GstElement *src, GstPad *pad, gpointer data)
/* 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);
@ -423,7 +423,7 @@ gst_parse_perform_delayed_link (GstElement *src, const gchar *src_pad,
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;
@ -451,7 +451,7 @@ gst_parse_perform_link (link_t *link, graph_t *graph)
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,
@ -592,7 +592,7 @@ linkpart: reference { $$ = $1; }
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);

View file

@ -15,7 +15,7 @@ typedef struct {
gchar *sink_name;
GSList *src_pads;
GSList *sink_pads;
GstCaps2 *caps;
GstCaps *caps;
} link_t;
typedef struct {

View file

@ -837,7 +837,7 @@ gst_xml_registry_parse_padtemplate (GMarkupParseContext *context, const gchar *t
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);
}
@ -1099,9 +1099,9 @@ G_STMT_START{ \
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;
}

View file

@ -100,7 +100,7 @@ struct _GstXMLRegistry {
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
GstCaps2 *caps;
GstCaps *caps;
gchar *caps_name;
gchar *structure_name;

View file

@ -55,7 +55,7 @@ GstStaticPadTemplate aggregator_src_template = GST_STATIC_PAD_TEMPLATE (
"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())

View file

@ -60,7 +60,7 @@ GstStaticPadTemplate fakesink_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_FAKESINK_STATE_ERROR (gst_fakesink_state_error_get_type())

View file

@ -77,7 +77,7 @@ GstStaticPadTemplate fakesrc_src_template = GST_STATIC_PAD_TEMPLATE (
"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())

View file

@ -152,7 +152,7 @@ gst_identity_class_init (GstIdentityClass *klass)
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_identity_get_property);
}
static GstCaps2*
static GstCaps*
gst_identity_getcaps (GstPad *pad)
{
GstIdentity *identity;
@ -171,20 +171,20 @@ gst_identity_getcaps (GstPad *pad)
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;
}

View file

@ -59,7 +59,7 @@ struct _GstIdentity {
gboolean dump;
gchar *last_message;
gboolean delay_capsnego;
GstCaps2 *srccaps;
GstCaps *srccaps;
};
struct _GstIdentityClass {

View file

@ -58,7 +58,7 @@ GstStaticPadTemplate md5_sink_template = GST_STATIC_PAD_TEMPLATE (
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS2_ANY
GST_STATIC_CAPS_ANY
);
/* GObject stuff */

View file

@ -83,10 +83,10 @@ static void gst_queue_get_property (GObject *object,
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);
@ -330,12 +330,12 @@ gst_queue_otherpad (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));
@ -343,7 +343,7 @@ gst_queue_getcaps (GstPad *pad)
if (otherpad)
return gst_pad_get_caps (otherpad);
return gst_caps2_new_any ();
return gst_caps_new_any ();
}
static void

View file

@ -64,14 +64,14 @@ GstStaticPadTemplate shaper_src_template = GST_STATIC_PAD_TEMPLATE (
"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())
@ -170,7 +170,7 @@ gst_shaper_class_init (GstShaperClass *klass)
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR (gst_shaper_request_new_pad);
}
static GstCaps2*
static GstCaps*
gst_shaper_getcaps (GstPad *pad)
{
GstPad *otherpad;
@ -180,7 +180,7 @@ gst_shaper_getcaps (GstPad *pad)
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*
@ -200,7 +200,7 @@ gst_shaper_get_internal_link (GstPad *pad)
}
static GstPadLinkReturn
gst_shaper_link (GstPad *pad, const GstCaps2 *caps)
gst_shaper_link (GstPad *pad, const GstCaps *caps)
{
GstPad *otherpad;
GstShaperConnection *connection;

View file

@ -57,7 +57,7 @@ GstStaticPadTemplate tee_src_template = GST_STATIC_PAD_TEMPLATE (
"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);
@ -138,17 +138,17 @@ gst_tee_class_init (GstTeeClass *klass)
}
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;
}
@ -170,21 +170,21 @@ gst_tee_sinklink (GstPad *pad, const GstCaps2 *caps)
}
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;
@ -197,8 +197,8 @@ gst_tee_getcaps (GstPad *pad)
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);
@ -208,8 +208,8 @@ gst_tee_getcaps (GstPad *pad)
}
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;
}

View file

@ -58,14 +58,14 @@ GstStaticPadTemplate type_find_element_sink_template = GST_STATIC_PAD_TEMPLATE (
"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 */
@ -141,17 +141,17 @@ gst_type_find_element_get_type (void)
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");
}
@ -184,7 +184,7 @@ gst_type_find_element_class_init (gpointer g_class, gpointer class_data)
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));
@ -196,7 +196,7 @@ gst_type_find_element_class_init (gpointer g_class, gpointer class_data)
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);
}
@ -313,7 +313,7 @@ gst_type_find_element_src_event (GstPad *pad, GstEvent *event)
typedef struct {
GstTypeFindFactory * factory;
gint probability;
GstCaps2 * caps;
GstCaps * caps;
gint64 requested_offset;
guint requested_size;
@ -333,7 +333,7 @@ free_entry (TypeFindEntry *entry)
free_entry_buffers (entry);
if (entry->caps)
gst_caps2_free (entry->caps);
gst_caps_free (entry->caps);
g_free (entry);
}
static void
@ -473,18 +473,18 @@ find_peek (gpointer data, gint64 offset, guint size)
}
}
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
@ -563,10 +563,10 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
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) {
@ -581,7 +581,7 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
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);
}
@ -669,7 +669,7 @@ gst_type_find_element_change_state (GstElement *element)
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;

View file

@ -50,7 +50,7 @@ struct _GstTypeFindElement {
guint min_probability;
guint max_probability;
GstCaps2 * caps;
GstCaps * caps;
guint mode;
GstBufferStore * store;
@ -66,7 +66,7 @@ struct _GstTypeFindElementClass {
/* signals */
void (*have_type) (GstTypeFindElement *element,
guint probability,
GstCaps2 * caps);
GstCaps * caps);
};
GType gst_type_find_element_get_type (void);

View file

@ -58,14 +58,14 @@ GstStaticPadTemplate type_find_element_sink_template = GST_STATIC_PAD_TEMPLATE (
"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 */
@ -141,17 +141,17 @@ gst_type_find_element_get_type (void)
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");
}
@ -184,7 +184,7 @@ gst_type_find_element_class_init (gpointer g_class, gpointer class_data)
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));
@ -196,7 +196,7 @@ gst_type_find_element_class_init (gpointer g_class, gpointer class_data)
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);
}
@ -313,7 +313,7 @@ gst_type_find_element_src_event (GstPad *pad, GstEvent *event)
typedef struct {
GstTypeFindFactory * factory;
gint probability;
GstCaps2 * caps;
GstCaps * caps;
gint64 requested_offset;
guint requested_size;
@ -333,7 +333,7 @@ free_entry (TypeFindEntry *entry)
free_entry_buffers (entry);
if (entry->caps)
gst_caps2_free (entry->caps);
gst_caps_free (entry->caps);
g_free (entry);
}
static void
@ -473,18 +473,18 @@ find_peek (gpointer data, gint64 offset, guint size)
}
}
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
@ -563,10 +563,10 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
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) {
@ -581,7 +581,7 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
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);
}
@ -669,7 +669,7 @@ gst_type_find_element_change_state (GstElement *element)
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;

View file

@ -50,7 +50,7 @@ struct _GstTypeFindElement {
guint min_probability;
guint max_probability;
GstCaps2 * caps;
GstCaps * caps;
guint mode;
GstBufferStore * store;
@ -66,7 +66,7 @@ struct _GstTypeFindElementClass {
/* signals */
void (*have_type) (GstTypeFindElement *element,
guint probability,
GstCaps2 * caps);
GstCaps * caps);
};
GType gst_type_find_element_get_type (void);

View file

@ -40,12 +40,12 @@ void eos(GstElement *element)
/* 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));
@ -238,7 +238,7 @@ create_input_channel (int id, char* location)
char buffer[20]; /* hold the names */
/* GstAutoplug *autoplug;
GstCaps2 *srccaps; */
GstCaps *srccaps; */
GstElement *new_element;
GstElement *decoder;
@ -330,7 +330,7 @@ create_input_channel (int id, char* location)
#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");

View file

@ -1,7 +1,7 @@
#include <gst/gst.h>
void
type_found (GstElement *typefind, const GstCaps2 * caps)
type_found (GstElement *typefind, const GstCaps * caps)
{
xmlDocPtr doc;
xmlNodePtr parent;
@ -11,7 +11,7 @@ type_found (GstElement *typefind, const GstCaps2 * caps)
parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
/* FIXME */
//gst_caps2_save_thyself (caps, parent);
//gst_caps_save_thyself (caps, parent);
xmlDocDump (stdout, doc);
}

View file

@ -171,7 +171,7 @@ gst_bstest_class_init (GstBsTestClass * klass)
}
static GstCaps2 *
static GstCaps *
gst_bstest_getcaps (GstPad *pad)
{
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));

View file

@ -1,30 +1,30 @@
#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]"
@ -32,27 +32,27 @@ GstStaticCaps2 rawcaps3 = GST_STATIC_CAPS(
#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, "
@ -68,53 +68,53 @@ main (int argc, char *argv[])
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;

View file

@ -23,7 +23,7 @@ gint
main (gint argc, gchar *argv[])
{
#if 0
GstCaps2 *caps;
GstCaps *caps;
gst_init (&argc, &argv);

View file

@ -1,6 +1,6 @@
#include <gst/gst.h>
GstStaticCaps2 rawcaps1 = GST_STATIC_CAPS(
GstStaticCaps rawcaps1 = GST_STATIC_CAPS(
"video/x-raw-yuv, "
"fourcc:fourcc=\"YUYV\", "
"height:int=640, "
@ -13,31 +13,31 @@ GstStaticCaps2 rawcaps1 = GST_STATIC_CAPS(
"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"
);
@ -45,56 +45,56 @@ GstStaticCaps2 rawcaps8 = GST_STATIC_CAPS(
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);
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_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_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_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_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_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);
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;
}

View file

@ -1,7 +1,7 @@
#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], "
@ -9,7 +9,7 @@ GstStaticCaps2 sinkcaps = GST_STATIC_CAPS (
"foo3=(int)[10,20]"
);
GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS (
GstStaticCaps mp1parsecaps = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype=(int)1, "
"foo1=(int)30, "
@ -19,37 +19,37 @@ GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS (
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, "
@ -67,7 +67,7 @@ main (int argc, char *argv[])
{
xmlDocPtr doc;
xmlNodePtr parent;
GstCaps2 *caps;
GstCaps *caps;
gst_init (&argc, &argv);
@ -77,36 +77,36 @@ main (int argc, char *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);

View file

@ -1,7 +1,7 @@
#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], "
@ -9,20 +9,20 @@ GstStaticCaps2 sinkcaps = GST_STATIC_CAPS (
"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; "
@ -31,7 +31,7 @@ GstStaticCaps2 rawcaps2 = GST_STATIC_CAPS (
"height=(int)16"
);
GstStaticCaps2 rawcaps3 = GST_STATIC_CAPS (
GstStaticCaps rawcaps3 = GST_STATIC_CAPS (
"video/raw, "
"width=(int)[16,256], "
"height=(int)16; "
@ -75,32 +75,32 @@ main (int argc, char *argv[])
{
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);

View file

@ -1,55 +1,55 @@
#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, "
@ -70,19 +70,19 @@ static gint failures = 0;
} \
}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);
@ -90,7 +90,7 @@ test_caps_func (const GstCaps2 *caps)
TEST_END (ret);
}
static void
test_caps (const GstCaps2 *caps)
test_caps (const GstCaps *caps)
{
TEST_START;
test_caps_func (caps);
@ -98,11 +98,11 @@ test_caps (const GstCaps2 *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;
@ -113,11 +113,11 @@ test_string (gchar *str)
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);
}
@ -128,18 +128,18 @@ main (int argc, char *argv[])
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");

View file

@ -1,7 +1,7 @@
#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], "
@ -9,7 +9,7 @@ GstStaticCaps2 sinkcaps = GST_STATIC_CAPS (
"foo3:int=[10,20]"
);
GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS (
GstStaticCaps mp1parsecaps = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype:int=1, "
"foo1:int=30, "
@ -22,17 +22,17 @@ main (int argc, char *argv[])
{
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);

View file

@ -4,126 +4,126 @@
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);
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_caps2_new_simple("audio/raw",
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);
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_caps2_new_simple("audio/raw",
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);
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_caps2_new_simple("audio/raw",
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);
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_caps2_new_full(
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);
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_caps2_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
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);
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_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));
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);
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_caps2_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
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);
}

View file

@ -42,8 +42,8 @@ main (int argc, char *argv[])
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;
@ -99,7 +99,7 @@ main (int argc, char *argv[])
/* 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);
@ -112,8 +112,8 @@ main (int argc, char *argv[])
/* 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");
@ -127,7 +127,7 @@ main (int argc, char *argv[])
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;

View file

@ -171,7 +171,7 @@ gst_bstest_class_init (GstBsTestClass * klass)
}
static GstCaps2 *
static GstCaps *
gst_bstest_getcaps (GstPad *pad)
{
GstBsTest *bstest = GST_BSTEST (gst_pad_get_parent (pad));

View file

@ -1,30 +1,30 @@
#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]"
@ -32,27 +32,27 @@ GstStaticCaps2 rawcaps3 = GST_STATIC_CAPS(
#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, "
@ -68,53 +68,53 @@ main (int argc, char *argv[])
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;

View file

@ -23,7 +23,7 @@ gint
main (gint argc, gchar *argv[])
{
#if 0
GstCaps2 *caps;
GstCaps *caps;
gst_init (&argc, &argv);

View file

@ -1,6 +1,6 @@
#include <gst/gst.h>
GstStaticCaps2 rawcaps1 = GST_STATIC_CAPS(
GstStaticCaps rawcaps1 = GST_STATIC_CAPS(
"video/x-raw-yuv, "
"fourcc:fourcc=\"YUYV\", "
"height:int=640, "
@ -13,31 +13,31 @@ GstStaticCaps2 rawcaps1 = GST_STATIC_CAPS(
"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"
);
@ -45,56 +45,56 @@ GstStaticCaps2 rawcaps8 = GST_STATIC_CAPS(
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);
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_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_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_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_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_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);
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;
}

View file

@ -1,7 +1,7 @@
#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], "
@ -9,7 +9,7 @@ GstStaticCaps2 sinkcaps = GST_STATIC_CAPS (
"foo3=(int)[10,20]"
);
GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS (
GstStaticCaps mp1parsecaps = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype=(int)1, "
"foo1=(int)30, "
@ -19,37 +19,37 @@ GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS (
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, "
@ -67,7 +67,7 @@ main (int argc, char *argv[])
{
xmlDocPtr doc;
xmlNodePtr parent;
GstCaps2 *caps;
GstCaps *caps;
gst_init (&argc, &argv);
@ -77,36 +77,36 @@ main (int argc, char *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);

View file

@ -1,7 +1,7 @@
#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], "
@ -9,20 +9,20 @@ GstStaticCaps2 sinkcaps = GST_STATIC_CAPS (
"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; "
@ -31,7 +31,7 @@ GstStaticCaps2 rawcaps2 = GST_STATIC_CAPS (
"height=(int)16"
);
GstStaticCaps2 rawcaps3 = GST_STATIC_CAPS (
GstStaticCaps rawcaps3 = GST_STATIC_CAPS (
"video/raw, "
"width=(int)[16,256], "
"height=(int)16; "
@ -75,32 +75,32 @@ main (int argc, char *argv[])
{
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);

View file

@ -1,55 +1,55 @@
#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, "
@ -70,19 +70,19 @@ static gint failures = 0;
} \
}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);
@ -90,7 +90,7 @@ test_caps_func (const GstCaps2 *caps)
TEST_END (ret);
}
static void
test_caps (const GstCaps2 *caps)
test_caps (const GstCaps *caps)
{
TEST_START;
test_caps_func (caps);
@ -98,11 +98,11 @@ test_caps (const GstCaps2 *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;
@ -113,11 +113,11 @@ test_string (gchar *str)
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);
}
@ -128,18 +128,18 @@ main (int argc, char *argv[])
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");

View file

@ -1,7 +1,7 @@
#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], "
@ -9,7 +9,7 @@ GstStaticCaps2 sinkcaps = GST_STATIC_CAPS (
"foo3:int=[10,20]"
);
GstStaticCaps2 mp1parsecaps = GST_STATIC_CAPS (
GstStaticCaps mp1parsecaps = GST_STATIC_CAPS (
"video/mpeg, "
"mpegtype:int=1, "
"foo1:int=30, "
@ -22,17 +22,17 @@ main (int argc, char *argv[])
{
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);

View file

@ -4,126 +4,126 @@
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);
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_caps2_new_simple("audio/raw",
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);
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_caps2_new_simple("audio/raw",
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);
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_caps2_new_simple("audio/raw",
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);
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_caps2_new_full(
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);
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_caps2_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
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);
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_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));
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);
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_caps2_new_simple("audio/raw", "_int", G_TYPE_INT, 100, NULL);
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);
}

View file

@ -42,8 +42,8 @@ main (int argc, char *argv[])
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;
@ -99,7 +99,7 @@ main (int argc, char *argv[])
/* 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);
@ -112,8 +112,8 @@ main (int argc, char *argv[])
/* 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");
@ -127,7 +127,7 @@ main (int argc, char *argv[])
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;

View file

@ -7,11 +7,11 @@
#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);
}
@ -238,8 +238,8 @@ print_element_properties (GstElement *element)
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)", "");

View file

@ -15,15 +15,15 @@ gboolean FOUND = FALSE;
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;

View file

@ -46,7 +46,7 @@ G_STMT_START{ \
#endif
static void
print_caps (const GstCaps2 *caps, gint pfx)
print_caps (const GstCaps *caps, gint pfx)
{
if (!caps)
return;
@ -286,7 +286,7 @@ print_element_properties (GstElement *element, gint pfx)
#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");