Brute force porting of core to GstCaps2

Original commit message from CVS:
Brute force porting of core to GstCaps2
This commit is contained in:
David Schleef 2003-11-11 19:19:58 +00:00
parent 2fa95b4fac
commit b4482a888c
57 changed files with 550 additions and 635 deletions

View file

@ -91,6 +91,7 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
gstbuffer.c \
gstbufferpool-default.c \
gstcaps.c \
gstcaps2.c \
gstclock.c \
gstcpu.c \
gstdata.c \
@ -152,6 +153,7 @@ gst_headers = \
gstbuffer.h \
gstbufferpool-default.h \
gstcaps.h \
gstcaps2.h \
gstclock.h \
gstcompat.h \
gstcpu.h \

View file

@ -55,7 +55,7 @@ GST_PAD_TEMPLATE_FACTORY (aggregator_src_factory,
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_CAPS_ANY
GST_CAPS2_ANY
);
#define GST_TYPE_AGGREGATOR_SCHED (gst_aggregator_sched_get_type())

View file

@ -215,12 +215,10 @@ gst_buffer_store_add_buffer_func (GstBufferStore *store, GstBuffer *buffer)
/* we have data to insert */
if (start_offset > GST_BUFFER_OFFSET (buffer) ||
GST_BUFFER_OFFSET (buffer) + GST_BUFFER_SIZE (buffer) > GST_BUFFER_OFFSET (current)) {
GstBuffer *sub;
/* need a subbuffer */
start_offset = GST_BUFFER_OFFSET (buffer) > start_offset ? 0 :
start_offset - GST_BUFFER_OFFSET (buffer);
sub = gst_buffer_create_sub (buffer, start_offset,
GstBuffer* sub = gst_buffer_create_sub (buffer, start_offset,
MIN (GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (current) - start_offset - GST_BUFFER_OFFSET (buffer)));
g_assert (sub);
GST_BUFFER_OFFSET (sub) = start_offset + GST_BUFFER_OFFSET (buffer);

View file

@ -60,7 +60,7 @@ GST_PAD_TEMPLATE_FACTORY (fakesink_sink_factory,
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_CAPS_ANY
GST_CAPS2_ANY
);
#define GST_TYPE_FAKESINK_STATE_ERROR (gst_fakesink_state_error_get_type())

View file

@ -77,7 +77,7 @@ GST_PAD_TEMPLATE_FACTORY (fakesrc_src_factory,
"src%d",
GST_PAD_SRC,
GST_PAD_REQUEST,
GST_CAPS_ANY
GST_CAPS2_ANY
);
#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type())

View file

@ -162,8 +162,8 @@ gst_identity_get_bufferpool (GstPad *pad)
return gst_pad_get_bufferpool (identity->srcpad);
}
static GstCaps*
gst_identity_getcaps (GstPad *pad, GstCaps *caps)
static GstCaps2*
gst_identity_getcaps (GstPad *pad, const GstCaps2 *caps)
{
GstIdentity *identity;
GstPad *otherpad;
@ -176,19 +176,19 @@ gst_identity_getcaps (GstPad *pad, GstCaps *caps)
otherpad = (pad == identity->srcpad ? identity->sinkpad : identity->srcpad);
return gst_pad_get_allowed_caps (otherpad);
return gst_caps2_copy (gst_pad_get_allowed_caps (otherpad));
}
static GstPadLinkReturn
gst_identity_link (GstPad *pad, GstCaps *caps)
gst_identity_link (GstPad *pad, const GstCaps2 *caps)
{
GstIdentity *identity;
identity = GST_IDENTITY (gst_pad_get_parent (pad));
if (GST_CAPS_IS_FIXED (caps)) {
if (gst_caps2_is_fixed (caps)) {
if (identity->delay_capsnego && GST_PAD_IS_SINK (pad)) {
identity->srccaps = gst_caps_ref (caps);
identity->srccaps = gst_caps2_copy (caps);
return GST_PAD_LINK_OK;
}

View file

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

View file

@ -58,7 +58,7 @@ GST_PAD_TEMPLATE_FACTORY (md5_sink_factory,
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_CAPS_ANY
GST_CAPS2_ANY
);
/* GObject stuff */

View file

@ -64,14 +64,14 @@ GST_PAD_TEMPLATE_FACTORY (shaper_src_factory,
"src%d",
GST_PAD_SRC,
GST_PAD_SOMETIMES,
GST_CAPS_ANY
GST_CAPS2_ANY
);
GST_PAD_TEMPLATE_FACTORY (shaper_sink_factory,
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_CAPS_ANY
GST_CAPS2_ANY
);
#define GST_TYPE_SHAPER_POLICY (gst_shaper_policy_get_type())
@ -177,8 +177,8 @@ gst_shaper_get_bufferpool (GstPad *pad)
return gst_pad_get_bufferpool (connection->srcpad);
}
static GstCaps*
gst_shaper_getcaps (GstPad *pad, GstCaps *caps)
static GstCaps2*
gst_shaper_getcaps (GstPad *pad, const GstCaps2 *caps)
{
GstPad *otherpad;
GstShaperConnection *connection;
@ -187,7 +187,7 @@ gst_shaper_getcaps (GstPad *pad, GstCaps *caps)
otherpad = (pad == connection->srcpad ? connection->sinkpad : connection->srcpad);
return gst_pad_get_allowed_caps (otherpad);
return gst_caps2_copy (gst_pad_get_allowed_caps (otherpad));
}
static GList*
@ -207,7 +207,7 @@ gst_shaper_get_internal_link (GstPad *pad)
}
static GstPadLinkReturn
gst_shaper_link (GstPad *pad, GstCaps *caps)
gst_shaper_link (GstPad *pad, const GstCaps2 *caps)
{
GstPad *otherpad;
GstShaperConnection *connection;

View file

@ -57,7 +57,7 @@ GST_PAD_TEMPLATE_FACTORY (tee_src_factory,
"src%d",
GST_PAD_SRC,
GST_PAD_REQUEST,
GST_CAPS_ANY
GST_CAPS2_ANY
);
static void gst_tee_base_init (gpointer g_class);
@ -137,26 +137,20 @@ gst_tee_class_init (GstTeeClass *klass)
}
static GstPadLinkReturn
gst_tee_sinklink (GstPad *pad, GstCaps *caps)
gst_tee_sinklink (GstPad *pad, const GstCaps2 *caps)
{
GstTee *tee;
const GList *pads;
GstPadLinkReturn set_retval;
GstCaps *caps1;
GST_DEBUG ( "gst_tee_sinklink caps=%s", gst_caps_to_string(caps));
GST_DEBUG ( "gst_tee_sinklink caps=%s", gst_caps2_to_string(caps));
tee = GST_TEE (gst_pad_get_parent (pad));
if (!GST_CAPS_IS_FIXED (caps)) {
if (!gst_caps2_is_fixed (caps)) {
return GST_PAD_LINK_DELAYED;
}
if (GST_CAPS_IS_CHAINED (caps)) {
caps1 = gst_caps_copy_1(caps);
caps = caps1;
}
/* go through all the src pads */
pads = gst_element_get_pad_list (GST_ELEMENT (tee));
@ -175,21 +169,21 @@ gst_tee_sinklink (GstPad *pad, GstCaps *caps)
}
static GstPadLinkReturn
gst_tee_srclink (GstPad *pad, GstCaps *caps)
gst_tee_srclink (GstPad *pad, const GstCaps2 *caps)
{
GstTee *tee;
GST_DEBUG ( "gst_tee_srclink caps=%s", gst_caps_to_string(caps));
GST_DEBUG ( "gst_tee_srclink caps=%s", gst_caps2_to_string(caps));
tee = GST_TEE (gst_pad_get_parent (pad));
return gst_pad_proxy_link (tee->sinkpad, caps);
}
static GstCaps*
gst_tee_getcaps (GstPad *pad, GstCaps *filter)
static GstCaps2*
gst_tee_getcaps (GstPad *pad, const GstCaps2 *filter)
{
GstCaps *caps = NULL;
GstCaps2 *caps = GST_CAPS2_ANY;
GstTee *tee;
const GList *pads;
@ -202,8 +196,8 @@ gst_tee_getcaps (GstPad *pad, GstCaps *filter)
while (pads) {
GstPad *srcpad = GST_PAD_CAST (pads->data);
GstPad *peer;
GstCaps *peercaps;
GstCaps *newcaps;
const GstCaps2 *peercaps;
GstCaps2 *newcaps;
pads = g_list_next (pads);
@ -213,9 +207,8 @@ gst_tee_getcaps (GstPad *pad, GstCaps *filter)
}
peercaps = gst_pad_get_caps (peer);
newcaps = gst_caps_intersect (caps, peercaps);
gst_caps_unref (caps);
gst_caps_sink (peercaps);
newcaps = gst_caps2_intersect (caps, peercaps);
gst_caps2_free (caps);
caps = newcaps;
}

View file

@ -58,13 +58,13 @@ GST_PAD_TEMPLATE_FACTORY (type_find_element_sink_factory,
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_CAPS_ANY
GST_CAPS2_ANY
);
GST_PAD_TEMPLATE_FACTORY (type_find_element_src_factory,
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_CAPS_ANY
GST_CAPS2_ANY
);
/* TypeFind signals and args */
@ -140,17 +140,17 @@ gst_type_find_element_get_type (void)
return typefind_type;
}
static void
gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps *caps)
gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps2 *caps)
{
gchar *caps_str;
g_assert (typefind->caps == NULL);
g_assert (caps != NULL);
caps_str = gst_caps_to_string (caps);
caps_str = gst_caps2_to_string (caps);
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
g_free (caps_str);
gst_caps_replace (&typefind->caps, caps);
gst_caps2_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");
}
@ -183,7 +183,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_TYPE_CAPS, G_PARAM_READABLE));
gst_caps2_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));
@ -195,7 +195,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_TYPE_CAPS);
G_TYPE_UINT, gst_caps2_get_type());
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state);
}
@ -312,7 +312,7 @@ gst_type_find_element_src_event (GstPad *pad, GstEvent *event)
typedef struct {
GstTypeFindFactory * factory;
gint probability;
GstCaps * caps;
GstCaps2 * caps;
gint64 requested_offset;
guint requested_size;
@ -332,7 +332,7 @@ free_entry (TypeFindEntry *entry)
free_entry_buffers (entry);
if (entry->caps)
gst_caps_unref (entry->caps);
gst_caps2_free (entry->caps);
g_free (entry);
}
static void
@ -471,18 +471,18 @@ find_peek (gpointer data, gint64 offset, guint size)
}
}
static void
find_suggest (gpointer data, guint probability, GstCaps *caps)
find_suggest (gpointer data, guint probability, const GstCaps2 *caps)
{
gchar *str;
TypeFindEntry *entry = (TypeFindEntry *) data;
str = gst_caps_to_string (caps);
str = gst_caps2_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_caps_replace (&entry->caps, caps);
gst_caps2_replace (&entry->caps, caps);
}
}
static gint
@ -561,10 +561,10 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
free_entry (entry);
} else if (entry->probability >= typefind->max_probability) {
/* wooha, got caps */
GstCaps *found_caps = entry->caps;
GstCaps2 *found_caps = entry->caps;
guint probability = entry->probability;
gst_caps_ref (found_caps);
found_caps = gst_caps2_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) {
@ -579,7 +579,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_caps_unref (found_caps);
gst_caps2_free (found_caps);
} else {
typefind->possibilities = g_list_prepend (typefind->possibilities, entry);
}
@ -667,7 +667,7 @@ gst_type_find_element_change_state (GstElement *element)
break;
case GST_STATE_PAUSED_TO_READY:
stop_typefinding (typefind);
gst_caps_replace (&typefind->caps, NULL);
gst_caps2_replace (&typefind->caps, NULL);
break;
default:
break;

View file

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

View file

@ -58,13 +58,13 @@ GST_PAD_TEMPLATE_FACTORY (type_find_element_sink_factory,
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_CAPS_ANY
GST_CAPS2_ANY
);
GST_PAD_TEMPLATE_FACTORY (type_find_element_src_factory,
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_CAPS_ANY
GST_CAPS2_ANY
);
/* TypeFind signals and args */
@ -140,17 +140,17 @@ gst_type_find_element_get_type (void)
return typefind_type;
}
static void
gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps *caps)
gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps2 *caps)
{
gchar *caps_str;
g_assert (typefind->caps == NULL);
g_assert (caps != NULL);
caps_str = gst_caps_to_string (caps);
caps_str = gst_caps2_to_string (caps);
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
g_free (caps_str);
gst_caps_replace (&typefind->caps, caps);
gst_caps2_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");
}
@ -183,7 +183,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_TYPE_CAPS, G_PARAM_READABLE));
gst_caps2_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));
@ -195,7 +195,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_TYPE_CAPS);
G_TYPE_UINT, gst_caps2_get_type());
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state);
}
@ -312,7 +312,7 @@ gst_type_find_element_src_event (GstPad *pad, GstEvent *event)
typedef struct {
GstTypeFindFactory * factory;
gint probability;
GstCaps * caps;
GstCaps2 * caps;
gint64 requested_offset;
guint requested_size;
@ -332,7 +332,7 @@ free_entry (TypeFindEntry *entry)
free_entry_buffers (entry);
if (entry->caps)
gst_caps_unref (entry->caps);
gst_caps2_free (entry->caps);
g_free (entry);
}
static void
@ -471,18 +471,18 @@ find_peek (gpointer data, gint64 offset, guint size)
}
}
static void
find_suggest (gpointer data, guint probability, GstCaps *caps)
find_suggest (gpointer data, guint probability, const GstCaps2 *caps)
{
gchar *str;
TypeFindEntry *entry = (TypeFindEntry *) data;
str = gst_caps_to_string (caps);
str = gst_caps2_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_caps_replace (&entry->caps, caps);
gst_caps2_replace (&entry->caps, caps);
}
}
static gint
@ -561,10 +561,10 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
free_entry (entry);
} else if (entry->probability >= typefind->max_probability) {
/* wooha, got caps */
GstCaps *found_caps = entry->caps;
GstCaps2 *found_caps = entry->caps;
guint probability = entry->probability;
gst_caps_ref (found_caps);
found_caps = gst_caps2_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) {
@ -579,7 +579,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_caps_unref (found_caps);
gst_caps2_free (found_caps);
} else {
typefind->possibilities = g_list_prepend (typefind->possibilities, entry);
}
@ -667,7 +667,7 @@ gst_type_find_element_change_state (GstElement *element)
break;
case GST_STATE_PAUSED_TO_READY:
stop_typefinding (typefind);
gst_caps_replace (&typefind->caps, NULL);
gst_caps2_replace (&typefind->caps, NULL);
break;
default:
break;

View file

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

View file

@ -530,6 +530,7 @@ init_post (void)
_gst_value_initialize ();
_gst_props_initialize ();
_gst_caps_initialize ();
_gst_caps2_initialize ();
_gst_plugin_initialize ();
_gst_event_initialize ();
_gst_buffer_initialize ();

View file

@ -44,6 +44,7 @@
#include <gst/gsttypefind.h>
#include <gst/gstautoplug.h>
#include <gst/gstcaps.h>
#include <gst/gstcaps2.h>
#include <gst/gststructure.h>
#include <gst/gstprops.h>
#include <gst/gstplugin.h>

View file

@ -120,7 +120,8 @@ gst_autoplug_signal_new_object (GstAutoplug *autoplug, GstObject *object)
* Returns: A new #GstElement that connects the src caps to the sink caps.
*/
GstElement*
gst_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *sinkcaps, ...)
gst_autoplug_to_caps (GstAutoplug *autoplug, const GstCaps2 *srccaps,
const GstCaps2 *sinkcaps, ...)
{
GstAutoplugClass *oclass;
GstElement *element = NULL;
@ -150,7 +151,8 @@ gst_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *sinkcaps
* Returns: A new #GstElement that connects the src caps to the sink caps.
*/
GstElement*
gst_autoplug_to_caps_valist (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *sinkcaps, va_list args)
gst_autoplug_to_caps_valist (GstAutoplug *autoplug, const GstCaps2 *srccaps,
const GstCaps2 *sinkcaps, va_list args)
{
GstAutoplugClass *oclass;
GstElement *element = NULL;
@ -175,7 +177,8 @@ gst_autoplug_to_caps_valist (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
* Returns: A new #GstElement that connects the src caps to the target elements.
*/
GstElement*
gst_autoplug_to_renderers (GstAutoplug *autoplug, GstCaps *srccaps, GstElement *target, ...)
gst_autoplug_to_renderers (GstAutoplug *autoplug, const GstCaps2 *srccaps,
GstElement *target, ...)
{
GstAutoplugClass *oclass;
GstElement *element = NULL;
@ -205,7 +208,8 @@ gst_autoplug_to_renderers (GstAutoplug *autoplug, GstCaps *srccaps, GstElement *
* Returns: A new #GstElement that connects the src caps to the target elements.
*/
GstElement*
gst_autoplug_to_renderers_valist (GstAutoplug *autoplug, GstCaps *srccaps, GstElement *target, va_list args)
gst_autoplug_to_renderers_valist (GstAutoplug *autoplug,
const GstCaps2 *srccaps, GstElement *target, va_list args)
{
GstAutoplugClass *oclass;
GstElement *element = NULL;

View file

@ -65,8 +65,8 @@ struct _GstAutoplugClass {
void (*new_object) (GstAutoplug *autoplug, GstObject *object);
/* perform the autoplugging */
GstElement* (*autoplug_to_caps) (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *sinkcaps, va_list args);
GstElement* (*autoplug_to_renderers) (GstAutoplug *autoplug, GstCaps *srccaps, GstElement *target, va_list args);
GstElement* (*autoplug_to_caps) (GstAutoplug *autoplug, const GstCaps2 *srccaps, const GstCaps2 *sinkcaps, va_list args);
GstElement* (*autoplug_to_renderers) (GstAutoplug *autoplug, const GstCaps2 *srccaps, GstElement *target, va_list args);
GST_CLASS_PADDING
};
@ -76,11 +76,11 @@ GType gst_autoplug_get_type (void);
void gst_autoplug_signal_new_object (GstAutoplug *autoplug, GstObject *object);
GstElement* gst_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *sinkcaps, ...);
GstElement* gst_autoplug_to_caps_valist (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *sinkcaps, va_list args);
GstElement* gst_autoplug_to_renderers (GstAutoplug *autoplug, GstCaps *srccaps,
GstElement* gst_autoplug_to_caps (GstAutoplug *autoplug, const GstCaps2 *srccaps, const GstCaps2 *sinkcaps, ...);
GstElement* gst_autoplug_to_caps_valist (GstAutoplug *autoplug, const GstCaps2 *srccaps, const GstCaps2 *sinkcaps, va_list args);
GstElement* gst_autoplug_to_renderers (GstAutoplug *autoplug, const GstCaps2 *srccaps,
GstElement *target, ...);
GstElement* gst_autoplug_to_renderers_valist (GstAutoplug *autoplug, GstCaps *srccaps,
GstElement* gst_autoplug_to_renderers_valist (GstAutoplug *autoplug, const GstCaps2 *srccaps,
GstElement *target, va_list args);

View file

@ -86,13 +86,10 @@ gst_caps_to_string (GstCaps *caps)
g_value_set_boxed (&value, caps->properties);
props = g_strdup_value_contents (&value);
/* this happens with empty (but existing) caps->properties */
if (props[0] != '\0') {
g_value_unset (&value);
g_string_append (result, ", ");
g_string_append (result, props);
g_free (props);
}
g_value_unset (&value);
g_string_append (result, ", ");
g_string_append (result, props);
g_free (props);
}
caps = caps->next;

View file

@ -1178,16 +1178,12 @@ void
gst_element_class_add_pad_template (GstElementClass *klass,
GstPadTemplate *templ)
{
GstPadTemplate *templ_copy;
g_return_if_fail (klass != NULL);
g_return_if_fail (GST_IS_ELEMENT_CLASS (klass));
g_return_if_fail (templ != NULL);
g_return_if_fail (GST_IS_PAD_TEMPLATE (templ));
templ_copy = g_memdup(templ, sizeof(GstPadTemplate));
klass->padtemplates = g_list_append (klass->padtemplates, templ_copy);
klass->padtemplates = g_list_append (klass->padtemplates, templ);
klass->numpadtemplates++;
}
@ -1208,63 +1204,11 @@ gst_element_class_set_details (GstElementClass *klass, GstElementDetails *detail
__gst_element_details_set (&klass->details, details);
}
/**
* gst_element_class_get_pad_template_list:
* @element: a #GstElementClass to get pad templates of.
*
* Retrieves a list of the pad templates associated with the element.
*
* Returns: the #GList of padtemplates.
*/
GList*
gst_element_class_get_pad_template_list (GstElementClass *element_class)
{
g_return_val_if_fail (element_class != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT_CLASS (element_class), NULL);
return element_class->padtemplates;
}
/**
* gst_element_class_get_pad_template:
* @element: a #GstElementClass to get the pad template of.
* @name: the name of the #GstPadTemplate to get.
*
* Retrieves a padtemplate from this element with the
* given name.
*
* Returns: the #GstPadTemplate with the given name, or NULL if none was found.
* No unreferencing is necessary.
*/
GstPadTemplate*
gst_element_class_get_pad_template (GstElementClass *element_class, const gchar *name)
{
GList *padlist;
g_return_val_if_fail (element_class != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT_CLASS (element_class), NULL);
g_return_val_if_fail (name != NULL, NULL);
padlist = gst_element_class_get_pad_template_list (element_class);
while (padlist) {
GstPadTemplate *padtempl = (GstPadTemplate*) padlist->data;
if (strcmp (padtempl->name_template, name) == 0)
return padtempl;
padlist = g_list_next (padlist);
}
return NULL;
}
/**
* gst_element_get_pad_template_list:
* @element: a #GstElement to get pad templates of.
*
* Retrieves a list of the pad templates associated with the element.
* (FIXME: Should be deprecated in favor of gst_element_class_get_pad_template_list).
*
* Returns: the #GList of padtemplates.
*/
@ -1284,7 +1228,6 @@ gst_element_get_pad_template_list (GstElement *element)
*
* Retrieves a padtemplate from this element with the
* given name.
* (FIXME: Should be deprecated in favor of gst_element_class_get_pad_template).
*
* Returns: the #GstPadTemplate with the given name, or NULL if none was found.
* No unreferencing is necessary.
@ -1352,13 +1295,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_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (compattempl),
comp = gst_caps2_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_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (compattempl),
comp = gst_caps2_is_always_compatible (GST_PAD_TEMPLATE_CAPS (compattempl),
GST_PAD_TEMPLATE_CAPS (padtempl));
GST_CAT_DEBUG (GST_CAT_CAPS, "caps are %scompatible", (comp ? "" : "not "));
}
@ -1408,7 +1351,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 #GstCaps to use as a filter.
* @filtercaps: the #GstCaps2 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
@ -1418,11 +1361,11 @@ gst_element_request_compatible_pad (GstElement *element, GstPadTemplate *templ)
*/
GstPad*
gst_element_get_compatible_pad_filtered (GstElement *element, GstPad *pad,
GstCaps *filtercaps)
const GstCaps2 *filtercaps)
{
const GList *pads;
GstPadTemplate *templ;
GstCaps *templcaps;
GstCaps2 *templcaps;
GstPad *foundpad = NULL;
/* checks */
@ -1450,11 +1393,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_caps_intersect (filtercaps, (GstCaps *) GST_RPAD_CAPS (pad));
templcaps = gst_caps2_intersect (filtercaps, (GstCaps2 *) GST_RPAD_CAPS (pad));
/* FIXME */
if (templcaps == NULL)
return NULL;
} else {
templcaps = gst_pad_get_caps (pad);
templcaps = gst_caps2_copy (gst_pad_get_caps (pad));
}
templ = gst_pad_template_new ((gchar *) GST_PAD_NAME (pad), GST_RPAD_DIRECTION (pad),
@ -1498,7 +1442,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 #GstCaps to use as a filter.
* @filtercaps: the #GstCaps2 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
@ -1510,7 +1454,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,
GstCaps *filtercaps)
const GstCaps2 *filtercaps)
{
const GList *srcpads, *destpads, *srctempls, *desttempls, *l;
GstPad *srcpad, *destpad;
@ -1638,10 +1582,10 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
srctempl = (GstPadTemplate*) srctempls->data;
if (srctempl->presence == GST_PAD_REQUEST) {
for (l=desttempls; l; l=l->next) {
desttempl = (GstPadTemplate*) l->data;
desttempl = (GstPadTemplate*) desttempls->data;
if (desttempl->presence == GST_PAD_REQUEST &&
desttempl->direction != srctempl->direction) {
if (gst_caps_is_always_compatible (gst_pad_template_get_caps (srctempl),
if (gst_caps2_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);
@ -1654,9 +1598,7 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
GST_DEBUG_PAD_NAME (destpad));
return TRUE;
}
/* it failed, so we release the request pads */
gst_element_release_request_pad (src, srcpad);
gst_element_release_request_pad (dest, destpad);
/* FIXME: we have extraneous request pads lying around */
}
}
}
@ -1673,7 +1615,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 #GstCaps to use as a filter.
* @filtercaps: the #GstCaps2 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
@ -1686,7 +1628,7 @@ gst_element_link_pads_filtered (GstElement *src, const gchar *srcpadname,
*/
gboolean
gst_element_link_filtered (GstElement *src, GstElement *dest,
GstCaps *filtercaps)
const GstCaps2 *filtercaps)
{
return gst_element_link_pads_filtered (src, NULL, dest, NULL, filtercaps);
}
@ -2495,7 +2437,7 @@ gst_element_clear_pad_caps (GstElement *element)
while (pads) {
GstRealPad *pad = GST_PAD_REALIZE (pads->data);
gst_caps_replace (&GST_PAD_CAPS (pad), NULL);
gst_caps2_replace (&GST_PAD_CAPS (pad), NULL);
pads = g_list_next (pads);
}

View file

@ -313,10 +313,8 @@ void gst_element_release_request_pad (GstElement *element, GstPad *pad);
const 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,
GstCaps *filtercaps);
const GstCaps2 *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);
GstPadTemplate* gst_element_get_pad_template (GstElement *element, const gchar *name);
GList* gst_element_get_pad_template_list (GstElement *element);
GstPadTemplate* gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl);
@ -325,7 +323,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,
GstCaps *filtercaps);
const GstCaps2 *filtercaps);
void gst_element_unlink (GstElement *src, GstElement *dest);
void gst_element_unlink_many (GstElement *element_1,
GstElement *element_2, ...);
@ -334,7 +332,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,
GstCaps *filtercaps);
const GstCaps2 *filtercaps);
void gst_element_unlink_pads (GstElement *src, const gchar *srcpadname,
GstElement *dest, const gchar *destpadname);
@ -417,17 +415,17 @@ G_CONST_RETURN gchar * gst_element_factory_get_klass (GstElementFactory *factor
G_CONST_RETURN gchar * gst_element_factory_get_description (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_version (GstElementFactory *factory);
G_CONST_RETURN gchar * gst_element_factory_get_author (GstElementFactory *factory);
guint gst_element_factory_get_num_pad_templates (GstElementFactory *factory);
G_CONST_RETURN GList * gst_element_factory_get_pad_templates (GstElementFactory *factory);
guint gst_element_factory_get_num_padtemplates (GstElementFactory *factory);
G_CONST_RETURN GList * gst_element_factory_get_padtemplates (GstElementFactory *factory);
GstElement* gst_element_factory_create (GstElementFactory *factory,
const gchar *name);
GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
gboolean gst_element_factory_can_src_caps (GstElementFactory *factory,
GstCaps *caps);
const GstCaps2 *caps);
gboolean gst_element_factory_can_sink_caps (GstElementFactory *factory,
GstCaps *caps);
const GstCaps2 *caps);
void __gst_element_factory_add_pad_template (GstElementFactory *elementfactory,
GstPadTemplate *templ);

View file

@ -373,30 +373,30 @@ gst_element_factory_get_author (GstElementFactory *factory)
return factory->details.author;
}
/**
* gst_element_factory_get_num_pad_templates:
* gst_element_factory_get_num_padtemplates:
* @factory: a #GstElementFactory
*
* Gets the number of pad_templates in this factory.
* Gets the number of padtemplates in this factory.
*
* Returns: the number of pad_templates
* Returns: the number of padtemplates
*/
guint
gst_element_factory_get_num_pad_templates (GstElementFactory *factory)
gst_element_factory_get_num_padtemplates (GstElementFactory *factory)
{
g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), 0);
return factory->numpadtemplates;
}
/**
* gst_element_factory_get_pad_templates:
* gst_element_factory_get_padtemplates:
* @factory: a #GstElementFactory
*
* Gets the #Glist of pad templates for this factory.
* Gets the #Glist of padtemplates for this factory.
*
* Returns: the padtemplates
*/
G_CONST_RETURN GList *
gst_element_factory_get_pad_templates (GstElementFactory *factory)
gst_element_factory_get_padtemplates (GstElementFactory *factory)
{
g_return_val_if_fail (GST_IS_ELEMENT_FACTORY (factory), NULL);
@ -413,7 +413,7 @@ gst_element_factory_get_pad_templates (GstElementFactory *factory)
*/
gboolean
gst_element_factory_can_src_caps (GstElementFactory *factory,
GstCaps *caps)
const GstCaps2 *caps)
{
GList *templates;
@ -426,7 +426,7 @@ gst_element_factory_can_src_caps (GstElementFactory *factory,
GstPadTemplate *template = (GstPadTemplate *)templates->data;
if (template->direction == GST_PAD_SRC) {
if (gst_caps_is_always_compatible (GST_PAD_TEMPLATE_CAPS (template), caps))
if (gst_caps2_is_always_compatible (GST_PAD_TEMPLATE_CAPS (template), caps))
return TRUE;
}
templates = g_list_next (templates);
@ -445,7 +445,7 @@ gst_element_factory_can_src_caps (GstElementFactory *factory,
*/
gboolean
gst_element_factory_can_sink_caps (GstElementFactory *factory,
GstCaps *caps)
const GstCaps2 *caps)
{
GList *templates;
@ -458,7 +458,7 @@ gst_element_factory_can_sink_caps (GstElementFactory *factory,
GstPadTemplate *template = (GstPadTemplate *)templates->data;
if (template->direction == GST_PAD_SINK) {
if (gst_caps_is_always_compatible (caps, GST_PAD_TEMPLATE_CAPS (template)))
if (gst_caps2_is_always_compatible (caps, GST_PAD_TEMPLATE_CAPS (template)))
return TRUE;
}
templates = g_list_next (templates);

View file

@ -28,7 +28,7 @@
#include <gst/gstdata.h>
#include <gst/gstformat.h>
#include <gst/gstobject.h>
#include <gst/gststructure.h>
#include <gst/gstcaps2.h>
G_BEGIN_DECLS
@ -181,8 +181,8 @@ struct _GstEvent {
gdouble value;
} rate;
struct {
GstStructure *structure;
} structure;
GstCaps2 *caps;
} caps;
} event_data;
GST_STRUCT_PADDING

View file

@ -30,6 +30,9 @@
#include "gstevent.h"
#include "gstinfo.h"
/* FIXME */
#define gst_caps2_debug(a,b)
enum {
TEMPL_PAD_CREATED,
/* FILL ME */
@ -47,7 +50,7 @@ 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,
GstCaps *caps, gboolean clear);
const GstCaps2 *caps, gboolean clear);
static void gst_pad_set_pad_template (GstPad *pad, GstPadTemplate *templ);
#ifndef GST_DISABLE_LOADSAVE
@ -189,7 +192,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_CAPS, G_PARAM_READABLE));
GST_TYPE_CAPS2, G_PARAM_READABLE));
#ifndef GST_DISABLE_LOADSAVE
gstobject_class->save_thyself = GST_DEBUG_FUNCPTR (gst_pad_save_thyself);
@ -862,11 +865,11 @@ gst_pad_unlink (GstPad *srcpad,
g_return_if_fail ((GST_RPAD_DIRECTION (realsrc) == GST_PAD_SRC) &&
(GST_RPAD_DIRECTION (realsink) == GST_PAD_SINK));
if (GST_RPAD_UNLINKFUNC (realsrc)) {
GST_RPAD_UNLINKFUNC (realsrc) (GST_PAD_CAST (realsrc));
if (GST_RPAD_UNLINKFUNC (srcpad)) {
GST_RPAD_UNLINKFUNC (srcpad) (srcpad);
}
if (GST_RPAD_UNLINKFUNC (realsink)) {
GST_RPAD_UNLINKFUNC (realsink) (GST_PAD_CAST (realsink));
if (GST_RPAD_UNLINKFUNC (sinkpad)) {
GST_RPAD_UNLINKFUNC (sinkpad) (sinkpad);
}
/* get the schedulers before we unlink */
@ -879,8 +882,8 @@ gst_pad_unlink (GstPad *srcpad,
/* reset the filters, both filters are refcounted once */
if (GST_RPAD_FILTER (realsrc)) {
gst_caps_replace (&GST_RPAD_FILTER (realsink), NULL);
gst_caps_replace (&GST_RPAD_FILTER (realsrc), NULL);
gst_caps2_replace (&GST_RPAD_FILTER (realsink), NULL);
gst_caps2_replace (&GST_RPAD_FILTER (realsrc), NULL);
}
/* now tell the scheduler */
@ -934,7 +937,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 #GstCaps.
* @filtercaps: the filter #GstCaps2.
*
* Checks if the source pad and the sink pad can be linked when constrained
* by the given filter caps.
@ -943,7 +946,7 @@ gst_pad_check_schedulers (GstRealPad *realsrc, GstRealPad *realsink)
*/
gboolean
gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad,
GstCaps *filtercaps)
const GstCaps2 *filtercaps)
{
GstRealPad *realsrc, *realsink;
@ -996,7 +999,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 #GstCaps.
* @filtercaps: the filter #GstCaps2.
*
* Links the source pad and the sink pad, constrained
* by the given filter caps. This function sinks the caps.
@ -1004,7 +1007,8 @@ gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad)
* Returns: TRUE if the pads have been linked, FALSE otherwise.
*/
gboolean
gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps)
gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad,
const GstCaps2 *filtercaps)
{
GstRealPad *realsrc, *realsink;
GstScheduler *src_sched, *sink_sched;
@ -1319,9 +1323,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, GstCaps *caps, gboolean notify)
gst_pad_try_set_caps_func (GstRealPad *pad, const GstCaps2 *caps, gboolean notify)
{
GstCaps *allowed = NULL;
GstCaps2 *allowed = NULL;
GstPadTemplate *template;
GstElement *parent = GST_PAD_PARENT (pad);
@ -1342,33 +1346,33 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify)
/* first see if we have to check against a filter, we ref the caps here as we're
* going to unref it later on */
if (!(allowed = gst_caps_ref (GST_RPAD_FILTER (pad)))) {
if (!(allowed = gst_caps2_copy (GST_RPAD_FILTER (pad)))) {
/* no filter, make sure we check against the padtemplate then */
if ((template = gst_pad_get_pad_template (GST_PAD_CAST (pad)))) {
allowed = gst_pad_template_get_caps (template);
allowed = gst_caps2_copy (gst_pad_template_get_caps (template));
}
}
/* do we have to check the caps against something? */
if (allowed) {
GstCaps *intersection;
GstCaps2 *intersection;
/* check against calculated caps */
intersection = gst_caps_intersect (caps, allowed);
intersection = gst_caps2_intersect (caps, allowed);
/* oops, empty intersection, caps don"t have anything in common */
if (!intersection) {
GST_CAT_INFO (GST_CAT_CAPS, "caps did not intersect with %s:%s's allowed caps",
GST_DEBUG_PAD_NAME (pad));
gst_caps_debug (caps, "caps themselves (attemped to set)");
gst_caps_debug (allowed,
gst_caps2_debug (caps, "caps themselves (attemped to set)");
gst_caps2_debug (allowed,
"allowed caps that did not agree with caps");
gst_caps_unref (allowed);
gst_caps2_free (allowed);
return GST_PAD_LINK_REFUSED;
}
/* caps checks out fine, we can unref the intersection now */
gst_caps_unref (intersection);
gst_caps_unref (allowed);
gst_caps2_free (intersection);
gst_caps2_free (allowed);
/* given that the caps are fixed, we know that their intersection with the
* padtemplate caps is the same as caps itself */
}
@ -1431,12 +1435,12 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify)
}
}
/* we can only set caps on the pad if they are fixed */
if (GST_CAPS_IS_FIXED (caps)) {
if (gst_caps2_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_caps_replace_sink (&GST_PAD_CAPS (pad), caps);
gst_caps2_replace (&GST_PAD_CAPS (pad), caps);
g_object_notify (G_OBJECT (pad), "caps");
}
@ -1453,7 +1457,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify)
/**
* gst_pad_try_set_caps:
* @pad: a #GstPad to try to set the caps on.
* @caps: the #GstCaps to set.
* @caps: the #GstCaps2 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.
@ -1462,7 +1466,7 @@ gst_pad_try_set_caps_func (GstRealPad *pad, GstCaps *caps, gboolean notify)
* could be set.
*/
GstPadLinkReturn
gst_pad_try_set_caps (GstPad *pad, GstCaps *caps)
gst_pad_try_set_caps (GstPad *pad, const GstCaps2 *caps)
{
GstRealPad *peer, *realpad;
GstPadLinkReturn set_retval;
@ -1473,21 +1477,20 @@ gst_pad_try_set_caps (GstPad *pad, GstCaps *caps)
GST_CAT_INFO (GST_CAT_CAPS, "trying to set caps %p on pad %s:%s",
caps, GST_DEBUG_PAD_NAME (realpad));
gst_caps_debug (caps, "caps that we are trying to set");
gst_caps2_debug (caps, "caps that we are trying to set");
/* try to take ownership */
gst_caps_ref (caps);
gst_caps_sink (caps);
caps = gst_caps2_copy (caps);
/* setting non fixed caps on a pad is not allowed */
if (!GST_CAPS_IS_FIXED (caps)) {
if (!gst_caps2_is_fixed (caps)) {
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_caps_debug (caps, "unfixed caps");
gst_caps2_debug (caps, "unfixed caps");
set_retval = GST_PAD_LINK_DELAYED;
goto done;
}
@ -1514,7 +1517,7 @@ gst_pad_try_set_caps (GstPad *pad, GstCaps *caps)
done:
/* if we took ownership, the caps will be freed */
gst_caps_unref (caps);
//gst_caps2_free (caps);
return set_retval;
}
@ -1530,10 +1533,10 @@ done:
*/
static gboolean
gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
GstCaps *filtercaps, gboolean clear)
const GstCaps2 *filtercaps, gboolean clear)
{
GstCaps *srccaps, *sinkcaps;
GstCaps *intersection = NULL;
GstCaps2 *srccaps, *sinkcaps;
GstCaps2 *intersection = NULL;
GstRealPad *realsrc, *realsink;
realsrc = GST_PAD_REALIZE (srcpad);
@ -1548,28 +1551,28 @@ 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_caps_replace (&GST_PAD_CAPS (GST_PAD (realsrc)), NULL);
gst_caps_replace (&GST_PAD_CAPS (GST_PAD (realsink)), NULL);
gst_caps_replace (&GST_RPAD_FILTER (realsrc), NULL);
gst_caps_replace (&GST_RPAD_FILTER (realsink), NULL);
gst_caps2_replace (&GST_PAD_CAPS (GST_PAD (realsrc)), NULL);
gst_caps2_replace (&GST_PAD_CAPS (GST_PAD (realsink)), NULL);
gst_caps2_replace (&GST_RPAD_FILTER (realsrc), NULL);
gst_caps2_replace (&GST_RPAD_FILTER (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_pad_get_caps (GST_PAD (realsrc));
srccaps = gst_caps2_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_caps_debug (srccaps, "caps of src pad (pre-relink)");
sinkcaps = gst_pad_get_caps (GST_PAD (realsink));
gst_caps2_debug (srccaps, "caps of src pad (pre-relink)");
sinkcaps = gst_caps2_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_caps_debug (sinkcaps, "caps of sink pad (pre-relink)");
gst_caps2_debug (sinkcaps, "caps of sink pad (pre-relink)");
/* first take the intersection of the pad caps */
intersection = gst_caps_intersect (srccaps, sinkcaps);
gst_caps_debug (intersection, "caps of intersection");
intersection = gst_caps2_intersect (srccaps, sinkcaps);
gst_caps2_debug (intersection, "caps of intersection");
/* if we have no intersection but one of the caps was not NULL.. */
if (!intersection && (srccaps || sinkcaps)) {
@ -1578,28 +1581,28 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
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_caps_sink (srccaps);
gst_caps_sink (sinkcaps);
gst_caps2_free (srccaps);
gst_caps2_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_CAPS_IS_FIXED (intersection) ? "fixed" : "variable") :
(gst_caps2_is_fixed (intersection) ? "fixed" : "variable") :
"NULL"));
/* we don't need those anymore, as the caps can be floating */
gst_caps_sink (srccaps);
gst_caps_sink (sinkcaps);
gst_caps2_free (srccaps);
gst_caps2_free (sinkcaps);
/* then filter this against the app filter */
if (filtercaps) {
GstCaps *filtered_intersection;
GstCaps2 *filtered_intersection;
filtered_intersection = gst_caps_intersect (intersection,
filtered_intersection = gst_caps2_intersect (intersection,
filtercaps);
gst_caps_sink (intersection);
gst_caps2_free (intersection);
if (!filtered_intersection) {
GST_CAT_INFO (GST_CAT_PADS,
@ -1610,18 +1613,18 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
intersection = filtered_intersection;
/* keep a reference to the app caps */
gst_caps_replace_sink (&GST_RPAD_APPFILTER (realsink), filtercaps);
gst_caps_replace_sink (&GST_RPAD_APPFILTER (realsrc), filtercaps);
gst_caps2_replace (&GST_RPAD_APPFILTER (realsink), filtercaps);
gst_caps2_replace (&GST_RPAD_APPFILTER (realsrc), filtercaps);
}
}
GST_CAT_DEBUG (GST_CAT_CAPS, "setting filter for link to:");
gst_caps_debug (intersection, "filter for link");
gst_caps2_debug (intersection, "filter for link");
/* both the app filter and the filter, while stored on both peer pads,
* are equal to the same thing on both */
gst_caps_replace_sink (&GST_RPAD_FILTER (realsrc), intersection);
gst_caps_replace_sink (&GST_RPAD_FILTER (realsink), intersection);
gst_caps_sink (intersection);
gst_caps2_replace (&GST_RPAD_FILTER (realsrc), intersection);
gst_caps2_replace (&GST_RPAD_FILTER (realsink), intersection);
gst_caps2_free (intersection);
return gst_pad_perform_negotiate (GST_PAD (realsrc), GST_PAD (realsink));
}
@ -1638,9 +1641,9 @@ gst_pad_try_relink_filtered_func (GstRealPad *srcpad, GstRealPad *sinkpad,
gboolean
gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad)
{
GstCaps *intersection, *filtered_intersection;
GstCaps2 *intersection, *filtered_intersection;
GstRealPad *realsrc, *realsink;
GstCaps *srccaps, *sinkcaps, *filter;
GstCaps2 *srccaps, *sinkcaps, *filter;
gboolean res = TRUE;
GstElement *parent;
@ -1675,23 +1678,23 @@ gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad)
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_caps_debug (filter, "link filter caps");
gst_caps2_debug (filter, "link filter caps");
}
/* calculate the new caps here */
srccaps = gst_pad_get_caps (GST_PAD (realsrc));
srccaps = gst_caps2_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_caps_debug (srccaps,
gst_caps2_debug (srccaps,
"src caps, awaiting negotiation, after applying filter");
sinkcaps = gst_pad_get_caps (GST_PAD (realsink));
sinkcaps = gst_caps2_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_caps_debug (sinkcaps,
gst_caps2_debug (sinkcaps,
"sink caps, awaiting negotiation, after applying filter");
intersection = gst_caps_intersect (srccaps, sinkcaps);
filtered_intersection = gst_caps_intersect (intersection, filter);
gst_caps_unref (intersection);
intersection = gst_caps2_intersect (srccaps, sinkcaps);
filtered_intersection = gst_caps2_intersect (intersection, filter);
gst_caps2_free (intersection);
/* no negotiation is performed if the pads have filtercaps */
if (filtered_intersection) {
@ -1716,9 +1719,9 @@ gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad)
success:
cleanup:
gst_caps_sink (srccaps);
gst_caps_sink (sinkcaps);
gst_caps_unref (filtered_intersection);
gst_caps2_free (srccaps);
gst_caps2_free (sinkcaps);
gst_caps2_free (filtered_intersection);
return res;
error:
@ -1739,7 +1742,7 @@ error:
*/
gboolean
gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad,
GstCaps *filtercaps)
const GstCaps2 *filtercaps)
{
GstRealPad *realsrc, *realsink;
@ -1770,7 +1773,7 @@ gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad,
*/
gboolean
gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad,
GstCaps *filtercaps)
const GstCaps2 *filtercaps)
{
GstRealPad *realsrc, *realsink;
@ -1795,14 +1798,14 @@ gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad,
/**
* gst_pad_proxy_link:
* @pad: a #GstPad to proxy to.
* @caps: the #GstCaps to use in proxying.
* @caps: the #GstCaps2 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, GstCaps *caps)
gst_pad_proxy_link (GstPad *pad, const GstCaps2 *caps)
{
GstRealPad *peer, *realpad;
@ -1819,13 +1822,13 @@ gst_pad_proxy_link (GstPad *pad, GstCaps *caps)
return GST_PAD_LINK_REFUSED;
if (peer) {
gst_caps_debug (caps, "proxy link filter");
gst_caps2_debug (caps, "proxy link filter");
GST_CAT_INFO (GST_CAT_CAPS, "setting filter on %s:%s and %s:%s",
GST_DEBUG_PAD_NAME (peer), GST_DEBUG_PAD_NAME (realpad));
gst_caps_replace_sink (&GST_RPAD_FILTER (peer), caps);
gst_caps_replace_sink (&GST_RPAD_FILTER (realpad), caps);
gst_caps2_replace (&GST_RPAD_FILTER (peer), caps);
gst_caps2_replace (&GST_RPAD_FILTER (realpad), caps);
}
return GST_PAD_LINK_OK;
@ -1837,11 +1840,11 @@ gst_pad_proxy_link (GstPad *pad, GstCaps *caps)
*
* Gets the capabilities of this pad.
*
* Returns: the #GstCaps of this pad. This function potentially
* returns a floating caps, so use gst_caps_sink to get rid of
* Returns: the #GstCaps2 of this pad. This function potentially
* returns a floating caps, so use gst_caps2_free to get rid of
* it.
*/
GstCaps*
const GstCaps2*
gst_pad_get_caps (GstPad *pad)
{
GstRealPad *realpad;
@ -1861,11 +1864,10 @@ gst_pad_get_caps (GstPad *pad)
return GST_PAD_CAPS (realpad);
}
else if GST_RPAD_GETCAPSFUNC (realpad) {
GstCaps *caps;
GstCaps2 *caps;
GST_CAT_DEBUG (GST_CAT_CAPS, "using pad get function");
caps = GST_RPAD_GETCAPSFUNC (realpad) (GST_PAD_CAST (realpad), NULL);
if(caps)g_return_val_if_fail(caps->refcount > 0, NULL);
return caps;
}
@ -1886,17 +1888,17 @@ gst_pad_get_caps (GstPad *pad)
*
* Gets the template capabilities of this pad.
*
* Returns: the template #GstCaps of this pad, unref the caps
* Returns: the template #GstCaps2 of this pad, unref the caps
* if you no longer need it.
*/
GstCaps*
const GstCaps2*
gst_pad_get_pad_template_caps (GstPad *pad)
{
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
if (GST_PAD_PAD_TEMPLATE (pad))
return gst_caps_ref (GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad)));
return GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad));
return NULL;
}
@ -1908,13 +1910,13 @@ gst_pad_get_pad_template_caps (GstPad *pad)
*
* Gets the capability with the given name from this pad template.
*
* Returns: the #GstCaps, or NULL if not found or in case of an error. unref
* Returns: the #GstCaps2, or NULL if not found or in case of an error. unref
* the caps if you no longer need it.
*/
GstCaps*
const GstCaps2*
gst_pad_template_get_caps_by_name (GstPadTemplate *templ, const gchar *name)
{
GstCaps *caps;
GstCaps2 *caps;
g_return_val_if_fail (templ != NULL, NULL);
@ -1922,7 +1924,9 @@ gst_pad_template_get_caps_by_name (GstPadTemplate *templ, const gchar *name)
if (!caps)
return NULL;
return gst_caps_ref (gst_caps_get_by_name (caps, name));
/* FIXME */
//return gst_caps2_copy (gst_caps2_get_by_name (caps, name));
return NULL;
}
/**
@ -1944,7 +1948,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_caps_is_always_compatible (GST_PAD_CAPS (srcpad),
if (!gst_caps2_is_always_compatible (GST_PAD_CAPS (srcpad),
GST_PAD_CAPS (sinkpad))) {
return FALSE;
}
@ -1985,13 +1989,13 @@ 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 #GstCaps of the pad link. unref the caps if
* Returns: the allowed #GstCaps2 of the pad link. unref the caps if
* you no longer need it.
*/
GstCaps*
GstCaps2*
gst_pad_get_allowed_caps (GstPad *pad)
{
GstCaps *caps;
GstCaps2 *caps;
GstRealPad *realpad;
g_return_val_if_fail (pad != NULL, NULL);
@ -2002,7 +2006,7 @@ gst_pad_get_allowed_caps (GstPad *pad)
GST_CAT_DEBUG (GST_CAT_PROPERTIES, "get allowed caps of %s:%s",
GST_DEBUG_PAD_NAME (pad));
caps = gst_caps_ref (GST_RPAD_FILTER (realpad));
caps = gst_caps2_copy (GST_RPAD_FILTER (realpad));
return caps;
}
@ -2052,7 +2056,7 @@ gst_pad_recalc_allowed_caps (GstPad *pad)
* on the console and returns FALSE otherwise.
*/
gboolean
gst_pad_recover_caps_error (GstPad *pad, GstCaps *allowed)
gst_pad_recover_caps_error (GstPad *pad, const GstCaps2 *allowed)
{
GstElement *parent;
@ -2063,7 +2067,7 @@ gst_pad_recover_caps_error (GstPad *pad, GstCaps *allowed)
gst_real_pad_signals[REAL_CAPS_NEGO_FAILED], 0, FALSE))
{
/* clear pad caps first */
gst_caps_replace (&GST_PAD_CAPS (pad), NULL);
gst_caps2_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);
@ -2152,8 +2156,8 @@ gst_real_pad_dispose (GObject *object)
g_list_free (GST_REAL_PAD(pad)->ghostpads);
}
gst_caps_replace (&GST_PAD_CAPS (pad), NULL);
gst_caps_replace (&GST_RPAD_APPFILTER (pad), NULL);
gst_caps2_replace (&GST_PAD_CAPS (pad), NULL);
gst_caps2_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'",
@ -2535,7 +2539,7 @@ gst_pad_template_dispose (GObject *object)
GstPadTemplate *templ = GST_PAD_TEMPLATE (object);
g_free (GST_PAD_TEMPLATE_NAME_TEMPLATE (templ));
gst_caps_unref (GST_PAD_TEMPLATE_CAPS (templ));
gst_caps2_free (GST_PAD_TEMPLATE_CAPS (templ));
G_OBJECT_CLASS (padtemplate_parent_class)->dispose (object);
}
@ -2586,8 +2590,8 @@ name_is_valid (const gchar *name, GstPadPresence presence)
* @name_template: the name template.
* @direction: the #GstPadDirection of the template.
* @presence: the #GstPadPresence of the pad.
* @caps: a #GstCaps set for the template.
* @var_args: a NULL-terminated list of #GstCaps.
* @caps: a #GstCaps2 set for the template.
* @var_args: a NULL-terminated list of #GstCaps2.
*
* Creates a new pad template with a name according to the given template
* and with the given arguments.
@ -2597,10 +2601,10 @@ name_is_valid (const gchar *name, GstPadPresence presence)
GstPadTemplate*
gst_pad_template_newv (const gchar *name_template,
GstPadDirection direction, GstPadPresence presence,
GstCaps *caps, va_list var_args)
GstCaps2 *caps, va_list var_args)
{
GstPadTemplate *new;
GstCaps *thecaps = NULL;
GstCaps2 *thecaps = gst_caps2_new_empty();
g_return_val_if_fail (name_template != NULL, NULL);
@ -2617,16 +2621,14 @@ gst_pad_template_newv (const gchar *name_template,
GST_FLAG_SET (GST_OBJECT (new), GST_PAD_TEMPLATE_FIXED);
while (caps) {
if (!GST_CAPS_IS_FIXED (caps)) {
if (!gst_caps2_is_fixed (caps)) {
GST_FLAG_UNSET (GST_OBJECT (new), GST_PAD_TEMPLATE_FIXED);
}
thecaps = gst_caps_append (thecaps, caps);
caps = va_arg (var_args, GstCaps*);
gst_caps2_append (thecaps, gst_caps2_copy(caps));
caps = va_arg (var_args, GstCaps2 *);
}
GST_PAD_TEMPLATE_CAPS (new) = thecaps;
gst_caps_ref (thecaps);
gst_caps_sink (thecaps);
return new;
}
@ -2636,8 +2638,8 @@ gst_pad_template_newv (const gchar *name_template,
* @name_template: the name template.
* @direction: the #GstPadDirection of the template.
* @presence: the #GstPadPresence of the pad.
* @caps: a #GstCaps set for the template.
* @...: a NULL-terminated list of #GstCaps.
* @caps: a #GstCaps2 set for the template.
* @...: a NULL-terminated list of #GstCaps2.
*
* Creates a new pad template with a name according to the given template
* and with the given arguments.
@ -2647,7 +2649,7 @@ gst_pad_template_newv (const gchar *name_template,
GstPadTemplate*
gst_pad_template_new (const gchar *name_template,
GstPadDirection direction, GstPadPresence presence,
GstCaps *caps, ...)
GstCaps2 *caps, ...)
{
GstPadTemplate *new;
va_list var_args;
@ -2668,15 +2670,15 @@ gst_pad_template_new (const gchar *name_template,
*
* Gets the capabilities of the pad template.
*
* Returns: the #GstCaps of the pad template. unref the caps
* Returns: the #GstCaps2 of the pad template. unref the caps
* after use.
*/
GstCaps*
const GstCaps2*
gst_pad_template_get_caps (GstPadTemplate *templ)
{
g_return_val_if_fail (templ != NULL, NULL);
return gst_caps_ref (GST_PAD_TEMPLATE_CAPS (templ));
return GST_PAD_TEMPLATE_CAPS (templ);
}
/**

View file

@ -28,7 +28,7 @@
#include <gst/gstobject.h>
#include <gst/gstbuffer.h>
#include <gst/gstcaps.h>
#include <gst/gstcaps2.h>
#include <gst/gstevent.h>
#include <gst/gstprobe.h>
#include <gst/gstquery.h>
@ -146,9 +146,9 @@ typedef const GstFormat* (*GstPadFormatsFunction) (GstPad *pad);
typedef const GstEventMask* (*GstPadEventMaskFunction) (GstPad *pad);
typedef const GstQueryType* (*GstPadQueryTypeFunction) (GstPad *pad);
typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, GstCaps *caps);
typedef GstPadLinkReturn (*GstPadLinkFunction) (GstPad *pad, const GstCaps2 *caps);
typedef void (*GstPadUnlinkFunction) (GstPad *pad);
typedef GstCaps* (*GstPadGetCapsFunction) (GstPad *pad, GstCaps *caps);
typedef GstCaps2* (*GstPadGetCapsFunction) (GstPad *pad, const GstCaps2 *caps);
typedef GstBufferPool* (*GstPadBufferPoolFunction) (GstPad *pad);
typedef gboolean (*GstPadDispatcherFunction) (GstPad *pad, gpointer data);
@ -186,9 +186,9 @@ struct _GstRealPad {
GstPad pad;
/* the pad capabilities */
GstCaps *caps;
GstCaps *filter;
GstCaps *appfilter;
GstCaps2 *caps;
GstCaps2 *filter;
GstCaps2 *appfilter;
GstPadGetCapsFunction getcapsfunc;
GstPadDirection direction;
@ -228,7 +228,7 @@ struct _GstRealPadClass {
GstPadClass parent_class;
/* signal callbacks */
void (*caps_nego_failed) (GstPad *pad, GstCaps *caps);
void (*caps_nego_failed) (GstPad *pad, GstCaps2 *caps);
void (*linked) (GstPad *pad, GstPad *peer);
void (*unlinked) (GstPad *pad, GstPad *peer);
@ -332,7 +332,7 @@ struct _GstPadTemplate {
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
GstCaps *caps;
GstCaps2 *caps;
GST_OBJECT_PADDING
};
@ -444,30 +444,30 @@ const GstEventMask* gst_pad_get_event_masks_default (GstPad *pad);
/* 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, GstCaps *filtercaps);
gboolean gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps2 *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, GstCaps *filtercaps);
gboolean gst_pad_link_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps2 *filtercaps);
void gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
GstPad* gst_pad_get_peer (GstPad *pad);
/* capsnego functions */
GstCaps* gst_pad_get_caps (GstPad *pad);
GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
GstPadLinkReturn gst_pad_try_set_caps (GstPad *pad, GstCaps *caps);
const 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);
gboolean gst_pad_check_compatibility (GstPad *srcpad, GstPad *sinkpad);
void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps);
GstPadLinkReturn gst_pad_proxy_link (GstPad *pad, GstCaps *caps);
gboolean gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
GstPadLinkReturn gst_pad_proxy_link (GstPad *pad, const GstCaps2 *caps);
gboolean gst_pad_relink_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps2 *filtercaps);
gboolean gst_pad_perform_negotiate (GstPad *srcpad, GstPad *sinkpad);
gboolean gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad, GstCaps *filtercaps);
GstCaps* gst_pad_get_allowed_caps (GstPad *pad);
gboolean gst_pad_try_relink_filtered (GstPad *srcpad, GstPad *sinkpad, const GstCaps2 *filtercaps);
GstCaps2* gst_pad_get_allowed_caps (GstPad *pad);
gboolean gst_pad_recalc_allowed_caps (GstPad *pad);
gboolean gst_pad_recover_caps_error (GstPad *pad, GstCaps *allowed);
gboolean gst_pad_recover_caps_error (GstPad *pad, const GstCaps2 *allowed);
/* data passing functions */
void gst_pad_push (GstPad *pad, GstData *data);
@ -528,14 +528,14 @@ GType gst_pad_template_get_type (void);
GstPadTemplate* gst_pad_template_new (const gchar *name_template,
GstPadDirection direction, GstPadPresence presence,
GstCaps *caps, ...);
GstCaps2 *caps, ...);
GstPadTemplate* gst_pad_template_newv (const gchar *name_template,
GstPadDirection direction, GstPadPresence presence,
GstCaps *caps, va_list var_args);
GstCaps2 *caps, va_list var_args);
GstCaps* gst_pad_template_get_caps (GstPadTemplate *templ);
GstCaps* gst_pad_template_get_caps_by_name (GstPadTemplate *templ, const gchar *name);
const GstCaps2* gst_pad_template_get_caps (GstPadTemplate *templ);
const GstCaps2* 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

@ -178,7 +178,7 @@ gst_queue_class_init (gpointer g_class, gpointer class_data)
}
static GstPadLinkReturn
gst_queue_link (GstPad *pad, GstCaps *caps)
gst_queue_link (GstPad *pad, const GstCaps2 *caps)
{
GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
GstPad *otherpad;
@ -191,8 +191,8 @@ gst_queue_link (GstPad *pad, GstCaps *caps)
return gst_pad_proxy_link (otherpad, caps);
}
static GstCaps*
gst_queue_getcaps (GstPad *pad, GstCaps *caps)
static GstCaps2 *
gst_queue_getcaps (GstPad *pad, const GstCaps2 *caps)
{
GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
GstPad *otherpad;
@ -203,7 +203,7 @@ gst_queue_getcaps (GstPad *pad, GstCaps *caps)
otherpad = GST_PAD_PEER (queue->srcpad);
if (otherpad)
return gst_pad_get_caps (otherpad);
return gst_pad_get_allowed_caps (otherpad);
return NULL;
}

View file

@ -48,7 +48,7 @@ GType gst_structure_get_type(void)
void _gst_structure_initialize(void)
{
static GTypeValueTable type_value_table = {
static const GTypeValueTable type_value_table = {
_gst_structure_value_init,
_gst_structure_value_free,
_gst_structure_value_copy,
@ -58,7 +58,7 @@ void _gst_structure_initialize(void)
NULL,
NULL,
};
static GTypeInfo structure_info = {
static const GTypeInfo structure_info = {
0,
NULL,
NULL,
@ -83,6 +83,27 @@ void _gst_structure_initialize(void)
_gst_structure_transform_to_string);
}
/**
* gst_structure_id_empty_new:
* @name: name of new structure
*
* Creates a new, empty #GstStructure with the given name.
*
* Returns: a new, empty #GstStructure
*/
GstStructure *gst_structure_id_empty_new(GQuark quark)
{
GstStructure *structure;
g_return_val_if_fail(quark != 0, NULL);
structure = g_new0(GstStructure, 1);
structure->name = quark;
structure->fields = g_array_new(FALSE,TRUE,sizeof(GstStructureField));
return structure;
}
/**
* gst_structure_empty_new:
* @name: name of new structure
@ -262,7 +283,7 @@ void gst_structure_set_name(GstStructure *structure, const gchar *name)
* value is freed.
*/
void gst_structure_id_set_value(GstStructure *structure, GQuark fieldname,
GValue *value)
const GValue *value)
{
GstStructureField field = { 0 };
@ -287,7 +308,7 @@ void gst_structure_id_set_value(GstStructure *structure, GQuark fieldname,
* value is freed.
*/
void gst_structure_set_value(GstStructure *structure, const gchar *field,
GValue *value)
const GValue *value)
{
g_return_if_fail(structure != NULL);
g_return_if_fail(field != NULL);
@ -355,13 +376,6 @@ void gst_structure_set_valist(GstStructure *structure, const gchar *fieldname,
g_value_init(&field.value, G_TYPE_DOUBLE);
g_value_set_double(&field.value, d);
break;
#if 0
case GST_TYPE_FOURCC:
i = va_arg(varargs, int);
g_value_init(&field.value, G_TYPE_FOURCC);
gst_value_set_fourcc(&field.value, i);
break;
#endif
case G_TYPE_BOOLEAN:
i = va_arg(varargs, int);
g_value_init(&field.value, G_TYPE_BOOLEAN);
@ -373,7 +387,14 @@ void gst_structure_set_valist(GstStructure *structure, const gchar *fieldname,
g_value_set_string(&field.value, s);
break;
default:
g_assert_not_reached();
if(type == GST_TYPE_FOURCC){
i = va_arg(varargs, int);
g_value_init(&field.value, GST_TYPE_FOURCC);
gst_value_set_fourcc(&field.value, i);
break;
}else{
g_critical("unimplemented vararg field type %d\n", (int)type);
}
break;
}
@ -383,6 +404,32 @@ void gst_structure_set_valist(GstStructure *structure, const gchar *fieldname,
}
}
/**
* gst_structure_set_field_copy:
* @structure: a #GstStructure
* @field: the #GstStructureField to set
*
* Sets a field in the structure. If the structure currently contains
* a field with the same name, it is replaced with the provided field.
* Otherwise, the field is added to the structure. The field's value
* is deeply copied.
*
* This function is intended mainly for internal use. The function
* #gst_structure_set() is recommended instead of this one.
*/
void gst_structure_set_field_copy (GstStructure *structure,
const GstStructureField *field)
{
GstStructureField f = { 0 };
GType type = G_VALUE_TYPE (&field->value);
f.name = field->name;
g_value_init (&f.value, type);
g_value_copy (&field->value, &f.value);
gst_structure_set_field (structure, &f);
}
/**
* gst_structure_set_field:
* @structure: a #GstStructure
@ -424,7 +471,7 @@ void gst_structure_set_field(GstStructure *structure, GstStructureField *field)
*
* Returns: the #GstStructureField with the given ID
*/
GstStructureField *gst_structure_id_get_field(GstStructure *structure,
GstStructureField *gst_structure_id_get_field(const GstStructure *structure,
GQuark field_id)
{
GstStructureField *field;
@ -452,7 +499,7 @@ GstStructureField *gst_structure_id_get_field(GstStructure *structure,
* Returns: the #GstStructureField with the given name
*/
GstStructureField *
gst_structure_get_field(GstStructure *structure, const gchar *fieldname)
gst_structure_get_field(const GstStructure *structure, const gchar *fieldname)
{
g_return_val_if_fail(structure != NULL, NULL);
g_return_val_if_fail(fieldname != NULL, NULL);
@ -471,7 +518,7 @@ gst_structure_get_field(GstStructure *structure, const gchar *fieldname)
* Returns: the #GValue corresponding to the field with the given name.
*/
const GValue *
gst_structure_get_value(GstStructure *structure, const gchar *fieldname)
gst_structure_get_value(const GstStructure *structure, const gchar *fieldname)
{
GstStructureField *field;
@ -536,7 +583,7 @@ gst_structure_remove_field(GstStructure *structure, const gchar *fieldname)
* Returns: the #GValue of the field
*/
GType
gst_structure_get_field_type(GstStructure *structure, const gchar *fieldname)
gst_structure_get_field_type(const GstStructure *structure, const gchar *fieldname)
{
GstStructureField *field;
@ -558,7 +605,7 @@ gst_structure_get_field_type(GstStructure *structure, const gchar *fieldname)
* Returns: the number of fields in the structure
*/
gint
gst_structure_n_fields(GstStructure *structure)
gst_structure_n_fields(const GstStructure *structure)
{
g_return_val_if_fail(structure != NULL, 0);
@ -597,7 +644,7 @@ gst_structure_field_foreach (GstStructure *structure,
* Returns: TRUE if the structure contains a field with the given name
*/
gboolean
gst_structure_has_field(GstStructure *structure, const gchar *fieldname)
gst_structure_has_field(const GstStructure *structure, const gchar *fieldname)
{
GstStructureField *field;
@ -620,7 +667,7 @@ gst_structure_has_field(GstStructure *structure, const gchar *fieldname)
* Returns: TRUE if the structure contains a field with the given name and type
*/
gboolean
gst_structure_has_field_typed(GstStructure *structure, const gchar *fieldname,
gst_structure_has_field_typed(const GstStructure *structure, const gchar *fieldname,
GType type)
{
GstStructureField *field;
@ -650,7 +697,7 @@ gst_structure_has_field_typed(GstStructure *structure, const gchar *fieldname,
* Returns: TRUE if the value could be set correctly
*/
gboolean
gst_structure_get_boolean(GstStructure *structure, const gchar *fieldname,
gst_structure_get_boolean(const GstStructure *structure, const gchar *fieldname,
gboolean *value)
{
GstStructureField *field;
@ -681,7 +728,7 @@ gst_structure_get_boolean(GstStructure *structure, const gchar *fieldname,
* Returns: TRUE if the value could be set correctly
*/
gboolean
gst_structure_get_int(GstStructure *structure, const gchar *fieldname,
gst_structure_get_int(const GstStructure *structure, const gchar *fieldname,
gint *value)
{
GstStructureField *field;
@ -713,7 +760,7 @@ gst_structure_get_int(GstStructure *structure, const gchar *fieldname,
* Returns: TRUE if the value could be set correctly
*/
gboolean
gst_structure_get_fourcc(GstStructure *structure, const gchar *fieldname,
gst_structure_get_fourcc(const GstStructure *structure, const gchar *fieldname,
guint32 *value)
{
GstStructureField *field;
@ -744,7 +791,7 @@ gst_structure_get_fourcc(GstStructure *structure, const gchar *fieldname,
*
* Returns: TRUE if the value could be set correctly
*/
gboolean gst_structure_get_double(GstStructure *structure,
gboolean gst_structure_get_double(const GstStructure *structure,
const gchar *fieldname, gdouble *value)
{
GstStructureField *field;
@ -779,7 +826,7 @@ gboolean gst_structure_get_double(GstStructure *structure,
* Returns: a pointer to the string
*/
const gchar *
gst_structure_get_string(GstStructure *structure, const gchar *fieldname)
gst_structure_get_string(const GstStructure *structure, const gchar *fieldname)
{
GstStructureField *field;
@ -803,7 +850,7 @@ gst_structure_get_string(GstStructure *structure, const gchar *fieldname)
* Returns: a pointer to string allocated by g_malloc()
*/
gchar *
gst_structure_to_string(GstStructure *structure)
gst_structure_to_string(const GstStructure *structure)
{
GstStructureField *field;
GString *s;

View file

@ -51,6 +51,7 @@ GType gst_structure_get_type(void);
void _gst_structure_initialize(void);
GstStructure *gst_structure_empty_new(const gchar *name);
GstStructure *gst_structure_id_empty_new(GQuark quark);
GstStructure *gst_structure_new(const gchar *name,
const gchar *firstfield, ...);
GstStructure *gst_structure_new_valist(const gchar *name,
@ -60,46 +61,48 @@ void gst_structure_free(GstStructure *structure);
const gchar *gst_structure_get_name(GstStructure *structure);
void gst_structure_set_name(GstStructure *structure, const gchar *name);
void gst_structure_set_field(GstStructure *structure,
void gst_structure_set_field_copy (GstStructure *structure,
const GstStructureField *field);
void gst_structure_set_field (GstStructure *structure,
GstStructureField *field);
void gst_structure_id_set_value(GstStructure *structure, GQuark field,
GValue *value);
const GValue *value);
void gst_structure_set_value(GstStructure *structure, const gchar *field,
GValue *value);
const GValue *value);
void gst_structure_set(GstStructure *structure, const gchar *field, ...);
void gst_structure_set_valist(GstStructure *structure, const gchar *field,
va_list varargs);
const GValue *gst_structure_get_value(GstStructure *structure, const gchar *field);
GstStructureField *gst_structure_get_field(GstStructure *structure,
const GValue *gst_structure_get_value(const GstStructure *structure, const gchar *field);
GstStructureField *gst_structure_get_field(const GstStructure *structure,
const gchar *fieldname);
GstStructureField *gst_structure_id_get_field(GstStructure *structure,
GstStructureField *gst_structure_id_get_field(const GstStructure *structure,
GQuark fieldname);
void gst_structure_remove_field(GstStructure *structure, const gchar *field);
GType gst_structure_get_field_type(GstStructure *structure,
GType gst_structure_get_field_type(const GstStructure *structure,
const gchar *field);
void gst_structure_field_foreach (GstStructure *structure,
GstStructureForeachFunc func, gpointer user_data);
gint gst_structure_n_fields(GstStructure *structure);
gboolean gst_structure_has_field(GstStructure *structure, const gchar *field);
gboolean gst_structure_has_field_typed(GstStructure *structure,
gint gst_structure_n_fields(const GstStructure *structure);
gboolean gst_structure_has_field(const GstStructure *structure, const gchar *field);
gboolean gst_structure_has_field_typed(const GstStructure *structure,
const gchar *field, GType type);
/* utility functions */
gboolean gst_structure_get_boolean(GstStructure *structure, const gchar *field,
gboolean gst_structure_get_boolean(const GstStructure *structure, const gchar *field,
gboolean *value);
gboolean gst_structure_get_int(GstStructure *structure, const gchar *field,
gboolean gst_structure_get_int(const GstStructure *structure, const gchar *field,
gint *value);
gboolean gst_structure_get_fourcc(GstStructure *structure, const gchar *field,
gboolean gst_structure_get_fourcc(const GstStructure *structure, const gchar *field,
guint32 *value);
gboolean gst_structure_get_double(GstStructure *structure, const gchar *field,
gboolean gst_structure_get_double(const GstStructure *structure, const gchar *field,
gdouble *value);
const gchar *gst_structure_get_string(GstStructure *structure,
const gchar *gst_structure_get_string(const GstStructure *structure,
const gchar *field);
gchar * gst_structure_to_string(GstStructure *structure);
gchar * gst_structure_to_string(const GstStructure *structure);
GstStructure * gst_structure_from_string (const gchar *string);

View file

@ -92,7 +92,7 @@ gst_type_find_factory_dispose (GObject *object)
GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (object);
if (factory->caps) {
gst_caps_unref (factory->caps);
gst_caps2_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 #GstCaps associated with this factory
* Returns: the #GstCaps2 associated with this factory
*/
GstCaps *
const GstCaps2 *
gst_type_find_factory_get_caps (const GstTypeFindFactory *factory)
{
g_return_val_if_fail (GST_IS_TYPE_FIND_FACTORY (factory), NULL);
@ -211,8 +211,8 @@ 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, GstCaps *possible_caps,
gpointer data)
GstTypeFindFunction func, gchar **extensions,
const GstCaps2 *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_caps_replace (&factory->caps, possible_caps);
gst_caps2_replace (&factory->caps, possible_caps);
factory->function = func;
factory->user_data = data;
@ -281,17 +281,14 @@ 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, GstCaps *caps)
gst_type_find_suggest (GstTypeFind *find, guint probability, const GstCaps2 *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_CAPS_IS_FIXED (caps));
g_return_if_fail (gst_caps2_is_fixed (caps));
gst_caps_ref (caps);
gst_caps_sink (caps);
find->suggest (find->data, probability, caps);
gst_caps_unref (caps);
}
/**
* gst_type_find_get_length:

View file

@ -24,7 +24,7 @@
#define __GST_TYPE_FIND_H__
#include <gst/gstbuffer.h>
#include <gst/gstcaps.h>
#include <gst/gstcaps2.h>
#include <gst/gstplugin.h>
#include <gst/gstpluginfeature.h>
#include <gst/gsttypes.h>
@ -59,7 +59,7 @@ struct _GstTypeFind {
guint size);
void (* suggest) (gpointer data,
guint probability,
GstCaps * caps);
const GstCaps2 * caps);
gpointer data;
@ -76,7 +76,7 @@ struct _GstTypeFindFactory {
GstTypeFindFunction function;
gchar ** extensions;
GstCaps * caps; /* FIXME: not yet saved in registry */
GstCaps2 * 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,
GstCaps * caps);
const GstCaps2 * 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,
GstCaps * possible_caps,
const GstCaps2 * 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);
GstCaps * gst_type_find_factory_get_caps (const GstTypeFindFactory *factory);
const GstCaps2 * gst_type_find_factory_get_caps (const GstTypeFindFactory *factory);
void gst_type_find_factory_call_function (const GstTypeFindFactory *factory,
GstTypeFind *find);

View file

@ -385,7 +385,7 @@ void
gst_print_pad_caps (GString * buf, gint indent, GstPad * pad)
{
GstRealPad *realpad;
GstCaps *caps;
GstCaps2 *caps;
realpad = GST_PAD_REALIZE (pad);
caps = realpad->caps;
@ -395,20 +395,11 @@ gst_print_pad_caps (GString * buf, gint indent, GstPad * pad)
g_string_printf (buf, "%s:%s has no capabilities", GST_DEBUG_PAD_NAME (pad));
}
else {
gint capx = 0;
char *s;
while (caps) {
string_append_indent (buf, indent);
g_string_append_printf (buf, "Cap[%d]: %s\n", capx++, caps->name);
string_append_indent (buf, indent + 2);
g_string_append_printf (buf, "MIME type: %s\n", gst_caps_get_mime (caps));
if (caps->properties)
gst_print_props (buf, indent + 4, caps->properties->properties, TRUE);
caps = caps->next;
}
s = gst_caps2_to_string(caps);
g_string_append(buf, s);
g_free(s);
}
}

View file

@ -190,26 +190,39 @@ gst_value_transform_int_range_string (const GValue *src_value,
static int
gst_value_compare_int (const GValue *value1, const GValue *value2)
{
return value2->data[0].v_int - value1->data[0].v_int;
if (value1->data[0].v_int > value2->data[0].v_int)
return GST_VALUE_GREATER_THAN;
if (value1->data[0].v_int < value2->data[0].v_int)
return GST_VALUE_LESS_THAN;
return GST_VALUE_EQUAL;
}
static int
gst_value_compare_double (const GValue *value1, const GValue *value2)
{
return (value2->data[0].v_double > value1->data[0].v_double) -
(value2->data[0].v_double < value1->data[0].v_double);
if (value1->data[0].v_double > value2->data[0].v_double)
return GST_VALUE_GREATER_THAN;
if (value1->data[0].v_double < value2->data[0].v_double)
return GST_VALUE_LESS_THAN;
if (value1->data[0].v_double == value2->data[0].v_double)
return GST_VALUE_EQUAL;
return GST_VALUE_UNORDERED;
}
static int
gst_value_compare_string (const GValue *value1, const GValue *value2)
{
return strcmp(value1->data[0].v_pointer, value2->data[0].v_pointer);
int x = strcmp(value1->data[0].v_pointer, value2->data[0].v_pointer);
if(x<0) return GST_VALUE_LESS_THAN;
if(x>0) return GST_VALUE_GREATER_THAN;
return GST_VALUE_EQUAL;
}
static int
gst_value_compare_fourcc (const GValue *value1, const GValue *value2)
{
return value2->data[0].v_int - value1->data[0].v_int;
if (value2->data[0].v_int == value1->data[0].v_int) return GST_VALUE_EQUAL;
return GST_VALUE_UNORDERED;
}
gboolean
@ -275,7 +288,7 @@ gst_value_can_union (const GValue *value1, const GValue *value2)
return FALSE;
}
void
gboolean
gst_value_union (GValue *dest, const GValue *value1, const GValue *value2)
{
GstValueUnionInfo *union_info;
@ -285,10 +298,10 @@ gst_value_union (GValue *dest, const GValue *value1, const GValue *value2)
union_info = &g_array_index(gst_value_union_funcs, GstValueUnionInfo, i);
if(union_info->type1 == G_VALUE_TYPE(value1) &&
union_info->type2 == G_VALUE_TYPE(value2)) {
union_info->func(dest, value1, value2);
return;
return union_info->func(dest, value1, value2);
}
}
return FALSE;
}
void
@ -364,7 +377,7 @@ gst_value_can_intersect (const GValue *value1, const GValue *value2)
return FALSE;
}
void
gboolean
gst_value_intersect (GValue *dest, const GValue *value1, const GValue *value2)
{
GstValueIntersectInfo *intersect_info;
@ -375,10 +388,17 @@ gst_value_intersect (GValue *dest, const GValue *value1, const GValue *value2)
GstValueIntersectInfo, i);
if(intersect_info->type1 == G_VALUE_TYPE(value1) &&
intersect_info->type2 == G_VALUE_TYPE(value2)) {
intersect_info->func(dest, value1, value2);
return;
return intersect_info->func(dest, value1, value2);
}
}
if(gst_value_compare(value1, value2) == GST_VALUE_EQUAL){
g_value_init(dest, G_VALUE_TYPE(value1));
g_value_copy(value1, dest);
return TRUE;
}
return FALSE;
}
void

View file

@ -37,6 +37,11 @@ typedef int (* GstValueIntersectFunc) (GValue *dest, const GValue *value1,
#define GST_TYPE_INT_RANGE gst_type_int_range
#define GST_TYPE_DOUBLE_RANGE gst_type_double_range
#define GST_VALUE_LESS_THAN (-1)
#define GST_VALUE_EQUAL 0
#define GST_VALUE_GREATER_THAN 1
#define GST_VALUE_UNORDERED 2
extern GType gst_type_fourcc;
extern GType gst_type_int_range;
extern GType gst_type_double_range;
@ -54,6 +59,10 @@ double gst_value_get_double_range_end (const GValue *value);
void _gst_value_initialize (void);
int gst_value_compare (const GValue *src1, const GValue *src2);
gboolean gst_value_intersect (GValue *dest, const GValue *src1, const GValue *src2);
gboolean gst_value_union (GValue *dest, const GValue *src1, const GValue *src2);
G_END_DECLS
#endif

View file

@ -81,7 +81,7 @@ typedef struct {
gchar *src_pad;
gchar *sink_pad;
GstElement *sink;
GstCaps *caps;
GstCaps2 *caps;
gulong signal_id;
/* FIXME: need to connect to "disposed" signal to clean up, but there is no such signal */
} DelayedLink;
@ -351,7 +351,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);
gst_caps_unref (link->caps);
gst_caps2_free (link->caps);
gst_parse_link_free (link);
}
static void
@ -411,7 +411,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);
gst_caps_unref (link->caps);
gst_caps2_free (link->caps);
if (!gst_element_is_locked_state (src))
gst_parse_element_lock (link->sink, FALSE);
g_free (link);
@ -420,7 +420,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, GstCaps *caps)
GstElement *sink, const gchar *sink_pad, GstCaps2 *caps)
{
GList *templs = gst_element_get_pad_template_list (src);
@ -438,7 +438,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_caps_ref (caps);
data->caps = gst_caps2_copy (caps);
data->signal_id = g_signal_connect (G_OBJECT (src), "new_pad",
G_CALLBACK (gst_parse_found_pad), data);
return TRUE;
@ -466,7 +466,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_caps_to_string (link->caps) : "-");
link->caps ? gst_caps2_to_string (link->caps) : "-");
if (!srcs || !sinks) {
if (gst_element_link_pads_filtered (src, srcs ? (const gchar *) srcs->data : NULL,
@ -607,12 +607,10 @@ linkpart: reference { $$ = $1; }
link: linkpart LINK linkpart { $$ = $1;
if ($2) {
$$->caps = gst_caps_from_string ($2);
$$->caps = gst_caps2_from_string ($2);
if (!$$->caps)
ERROR (GST_PARSE_ERROR_LINK, "could not parse caps \"%s\"", $2);
gst_parse_strfree ($2);
gst_caps_ref($$->caps);
gst_caps_sink($$->caps);
}
$$->sink_name = $3->src_name;
$$->sink_pads = $3->src_pads;

View file

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

View file

@ -871,6 +871,7 @@ gst_xml_registry_parse_capscomp (GMarkupParseContext *context, const gchar *tag,
return TRUE;
}
#if 0
static gint
find_index_for (const gchar *name, const gchar **attribute_names)
{
@ -883,6 +884,7 @@ find_index_for (const gchar *name, const gchar **attribute_names)
}
return -1;
}
#endif
static void
gst_xml_registry_start_element (GMarkupParseContext *context,
@ -977,11 +979,12 @@ gst_xml_registry_start_element (GMarkupParseContext *context,
xmlregistry->parser = gst_xml_registry_parse_capscomp;
}
break;
#if 0
case GST_XML_REGISTRY_CAPSCOMP:
if (!strncmp (element_name, "properties", 10)) {
xmlregistry->state = GST_XML_REGISTRY_PROPERTIES;
xmlregistry->parser = NULL;
xmlregistry->props = gst_props_empty_new ();
//xmlregistry->props = gst_props_empty_new ();
}
break;
case GST_XML_REGISTRY_PROPERTIES:
@ -1084,6 +1087,7 @@ gst_xml_registry_start_element (GMarkupParseContext *context,
}
break;
}
#endif
default:
break;
}
@ -1148,19 +1152,20 @@ gst_xml_registry_end_element (GMarkupParseContext *context,
break;
case GST_XML_REGISTRY_CAPSCOMP:
if (!strcmp (element_name, "capscomp")) {
GstCaps *caps;
GstCaps2 *caps;
xmlregistry->state = GST_XML_REGISTRY_CAPS;
xmlregistry->parser = gst_xml_registry_parse_padtemplate;
caps = gst_caps_new (xmlregistry->caps_name, xmlregistry->caps_mime, xmlregistry->props);
/* FIXME */
caps = gst_caps2_new_simple (xmlregistry->caps_mime, NULL);
g_free (xmlregistry->caps_mime);
g_free (xmlregistry->caps_name);
xmlregistry->caps = gst_caps_append (xmlregistry->caps, caps);
xmlregistry->props = NULL;
xmlregistry->caps = caps;
}
break;
#if 0
case GST_XML_REGISTRY_PROPERTIES:
if (!strncmp (element_name, "list", 4)) {
GstPropsEntry *entry;
@ -1183,6 +1188,7 @@ gst_xml_registry_end_element (GMarkupParseContext *context,
xmlregistry->parser = NULL;
}
break;
#endif
default:
break;
}
@ -1303,6 +1309,7 @@ G_STMT_START{ \
}G_STMT_END
#if 0
static gboolean
gst_xml_registry_save_props_func (GstPropsEntry *entry,
GstXMLRegistry *xmlregistry)
@ -1369,7 +1376,9 @@ gst_xml_registry_save_props_func (GstPropsEntry *entry,
}
return TRUE;
}
#endif
#if 0
static gboolean
gst_xml_registry_save_props (GstXMLRegistry *xmlregistry, GstProps *props)
{
@ -1400,23 +1409,42 @@ gst_xml_registry_save_props (GstXMLRegistry *xmlregistry, GstProps *props)
}
return TRUE;
}
#endif
static gboolean
gst_xml_registry_save_caps (GstXMLRegistry *xmlregistry, GstCaps *caps)
gst_xml_registry_save_structure (GstXMLRegistry *xmlregistry, const GstStructure *structure)
{
while (caps) {
CLASS (xmlregistry)->save_func (xmlregistry, "<capscomp>\n");
PUT_ESCAPED ("name", caps->name);
PUT_ESCAPED ("type", gst_caps_get_mime (caps));
int i;
if (caps->properties) {
CLASS (xmlregistry)->save_func (xmlregistry, "<properties>\n");
gst_xml_registry_save_props (xmlregistry, caps->properties);
CLASS (xmlregistry)->save_func (xmlregistry, "</properties>\n");
}
CLASS (xmlregistry)->save_func (xmlregistry, "</capscomp>\n");
caps = caps->next;
CLASS (xmlregistry)->save_func (xmlregistry, "<structure>\n");
PUT_ESCAPED ("name", g_quark_to_string(structure->name));
for (i=0;i<structure->fields->len;i++) {
GstStructureField *field = GST_STRUCTURE_FIELD(structure, i);
CLASS (xmlregistry)->save_func (xmlregistry, "<field>\n");
PUT_ESCAPED ("name", g_quark_to_string(field->name));
PUT_ESCAPED ("type", G_VALUE_TYPE_NAME(&field->value));
PUT_ESCAPED ("value", g_strdup_value_contents(&field->value));
CLASS (xmlregistry)->save_func (xmlregistry, "</field>\n");
}
CLASS (xmlregistry)->save_func (xmlregistry, "</structure>\n");
return TRUE;
}
static gboolean
gst_xml_registry_save_caps (GstXMLRegistry *xmlregistry, const GstCaps2 *caps)
{
CLASS (xmlregistry)->save_func (xmlregistry, "<capscomp>\n");
if(gst_caps2_is_any(caps)){
PUT_ESCAPED ("flags", "any");
} else {
int i;
for (i=0;i<caps->structs->len;i++) {
GstStructure *structure = gst_caps2_get_nth_cap (caps, i);
gst_xml_registry_save_structure (xmlregistry, structure);
}
}
CLASS (xmlregistry)->save_func (xmlregistry, "</capscomp>\n");
return TRUE;
}

View file

@ -100,11 +100,11 @@ struct _GstXMLRegistry {
gchar *name_template;
GstPadDirection direction;
GstPadPresence presence;
GstCaps *caps;
GstCaps2 *caps;
gchar *caps_name;
gchar *caps_mime;
GstProps *props;
//GstProps *props;
gboolean in_list;
GList *entry_list;

View file

@ -147,11 +147,11 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%{_libdir}/gstreamer-%{majorminor}/libgstbasicgthreadscheduler*.so
%{_libdir}/gstreamer-%{majorminor}/libgstoptgthreadscheduler*.so
%{_libdir}/gstreamer-%{majorminor}/libgstelements*.so*
%{_libdir}/gstreamer-%{majorminor}/libgsttypes*.so*
%{_libdir}/gstreamer-%{majorminor}/libgststaticautoplug*.so*
%{_libdir}/gstreamer-%{majorminor}/libgstgetbits*.so*
%{_libdir}/gstreamer-%{majorminor}/libgstspider*.so*
%{_libdir}/gstreamer-%{majorminor}/libgstindexers.so*
%{_libdir}/gstreamer-%{majorminor}/libgstbytestream.so
%{_libdir}/gstreamer-%{majorminor}/libgstindexers.so
%{_datadir}/locale/*
%files tools
@ -184,7 +184,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%{_includedir}/%{name}-%{majorminor}/gst/control/*.h
%dir %{_includedir}/%{name}-%{majorminor}/gst/getbits
%{_includedir}/%{name}-%{majorminor}/gst/getbits/getbits.h
%{_includedir}/%{name}-%{majorminor}/gst/bytestream/bytestream.h
# %{_libdir}/libgstreamer.a
%{_libdir}/libgstreamer-%{majorminor}.so
%{_libdir}/libgstcontrol-%{majorminor}.so
@ -209,9 +208,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%changelog
* Sun Nov 09 2003 Christian Schaller <Uraeus@gnome.org>
- Fix spec to handle new bytestream library
* Sun Aug 17 2003 Christian Schaller <uraeus@gnome.org>
- Remove docs build from RPM as the build is broken
- Fix stuff since more files are versioned now

View file

@ -55,7 +55,7 @@ GST_PAD_TEMPLATE_FACTORY (aggregator_src_factory,
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_CAPS_ANY
GST_CAPS2_ANY
);
#define GST_TYPE_AGGREGATOR_SCHED (gst_aggregator_sched_get_type())

View file

@ -215,12 +215,10 @@ gst_buffer_store_add_buffer_func (GstBufferStore *store, GstBuffer *buffer)
/* we have data to insert */
if (start_offset > GST_BUFFER_OFFSET (buffer) ||
GST_BUFFER_OFFSET (buffer) + GST_BUFFER_SIZE (buffer) > GST_BUFFER_OFFSET (current)) {
GstBuffer *sub;
/* need a subbuffer */
start_offset = GST_BUFFER_OFFSET (buffer) > start_offset ? 0 :
start_offset - GST_BUFFER_OFFSET (buffer);
sub = gst_buffer_create_sub (buffer, start_offset,
GstBuffer* sub = gst_buffer_create_sub (buffer, start_offset,
MIN (GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (current) - start_offset - GST_BUFFER_OFFSET (buffer)));
g_assert (sub);
GST_BUFFER_OFFSET (sub) = start_offset + GST_BUFFER_OFFSET (buffer);

View file

@ -60,7 +60,7 @@ GST_PAD_TEMPLATE_FACTORY (fakesink_sink_factory,
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_CAPS_ANY
GST_CAPS2_ANY
);
#define GST_TYPE_FAKESINK_STATE_ERROR (gst_fakesink_state_error_get_type())

View file

@ -77,7 +77,7 @@ GST_PAD_TEMPLATE_FACTORY (fakesrc_src_factory,
"src%d",
GST_PAD_SRC,
GST_PAD_REQUEST,
GST_CAPS_ANY
GST_CAPS2_ANY
);
#define GST_TYPE_FAKESRC_OUTPUT (gst_fakesrc_output_get_type())

View file

@ -162,8 +162,8 @@ gst_identity_get_bufferpool (GstPad *pad)
return gst_pad_get_bufferpool (identity->srcpad);
}
static GstCaps*
gst_identity_getcaps (GstPad *pad, GstCaps *caps)
static GstCaps2*
gst_identity_getcaps (GstPad *pad, const GstCaps2 *caps)
{
GstIdentity *identity;
GstPad *otherpad;
@ -176,19 +176,19 @@ gst_identity_getcaps (GstPad *pad, GstCaps *caps)
otherpad = (pad == identity->srcpad ? identity->sinkpad : identity->srcpad);
return gst_pad_get_allowed_caps (otherpad);
return gst_caps2_copy (gst_pad_get_allowed_caps (otherpad));
}
static GstPadLinkReturn
gst_identity_link (GstPad *pad, GstCaps *caps)
gst_identity_link (GstPad *pad, const GstCaps2 *caps)
{
GstIdentity *identity;
identity = GST_IDENTITY (gst_pad_get_parent (pad));
if (GST_CAPS_IS_FIXED (caps)) {
if (gst_caps2_is_fixed (caps)) {
if (identity->delay_capsnego && GST_PAD_IS_SINK (pad)) {
identity->srccaps = gst_caps_ref (caps);
identity->srccaps = gst_caps2_copy (caps);
return GST_PAD_LINK_OK;
}

View file

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

View file

@ -58,7 +58,7 @@ GST_PAD_TEMPLATE_FACTORY (md5_sink_factory,
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_CAPS_ANY
GST_CAPS2_ANY
);
/* GObject stuff */

View file

@ -178,7 +178,7 @@ gst_queue_class_init (gpointer g_class, gpointer class_data)
}
static GstPadLinkReturn
gst_queue_link (GstPad *pad, GstCaps *caps)
gst_queue_link (GstPad *pad, const GstCaps2 *caps)
{
GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
GstPad *otherpad;
@ -191,8 +191,8 @@ gst_queue_link (GstPad *pad, GstCaps *caps)
return gst_pad_proxy_link (otherpad, caps);
}
static GstCaps*
gst_queue_getcaps (GstPad *pad, GstCaps *caps)
static GstCaps2 *
gst_queue_getcaps (GstPad *pad, const GstCaps2 *caps)
{
GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad));
GstPad *otherpad;
@ -203,7 +203,7 @@ gst_queue_getcaps (GstPad *pad, GstCaps *caps)
otherpad = GST_PAD_PEER (queue->srcpad);
if (otherpad)
return gst_pad_get_caps (otherpad);
return gst_pad_get_allowed_caps (otherpad);
return NULL;
}

View file

@ -64,14 +64,14 @@ GST_PAD_TEMPLATE_FACTORY (shaper_src_factory,
"src%d",
GST_PAD_SRC,
GST_PAD_SOMETIMES,
GST_CAPS_ANY
GST_CAPS2_ANY
);
GST_PAD_TEMPLATE_FACTORY (shaper_sink_factory,
"sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_CAPS_ANY
GST_CAPS2_ANY
);
#define GST_TYPE_SHAPER_POLICY (gst_shaper_policy_get_type())
@ -177,8 +177,8 @@ gst_shaper_get_bufferpool (GstPad *pad)
return gst_pad_get_bufferpool (connection->srcpad);
}
static GstCaps*
gst_shaper_getcaps (GstPad *pad, GstCaps *caps)
static GstCaps2*
gst_shaper_getcaps (GstPad *pad, const GstCaps2 *caps)
{
GstPad *otherpad;
GstShaperConnection *connection;
@ -187,7 +187,7 @@ gst_shaper_getcaps (GstPad *pad, GstCaps *caps)
otherpad = (pad == connection->srcpad ? connection->sinkpad : connection->srcpad);
return gst_pad_get_allowed_caps (otherpad);
return gst_caps2_copy (gst_pad_get_allowed_caps (otherpad));
}
static GList*
@ -207,7 +207,7 @@ gst_shaper_get_internal_link (GstPad *pad)
}
static GstPadLinkReturn
gst_shaper_link (GstPad *pad, GstCaps *caps)
gst_shaper_link (GstPad *pad, const GstCaps2 *caps)
{
GstPad *otherpad;
GstShaperConnection *connection;

View file

@ -57,7 +57,7 @@ GST_PAD_TEMPLATE_FACTORY (tee_src_factory,
"src%d",
GST_PAD_SRC,
GST_PAD_REQUEST,
GST_CAPS_ANY
GST_CAPS2_ANY
);
static void gst_tee_base_init (gpointer g_class);
@ -137,26 +137,20 @@ gst_tee_class_init (GstTeeClass *klass)
}
static GstPadLinkReturn
gst_tee_sinklink (GstPad *pad, GstCaps *caps)
gst_tee_sinklink (GstPad *pad, const GstCaps2 *caps)
{
GstTee *tee;
const GList *pads;
GstPadLinkReturn set_retval;
GstCaps *caps1;
GST_DEBUG ( "gst_tee_sinklink caps=%s", gst_caps_to_string(caps));
GST_DEBUG ( "gst_tee_sinklink caps=%s", gst_caps2_to_string(caps));
tee = GST_TEE (gst_pad_get_parent (pad));
if (!GST_CAPS_IS_FIXED (caps)) {
if (!gst_caps2_is_fixed (caps)) {
return GST_PAD_LINK_DELAYED;
}
if (GST_CAPS_IS_CHAINED (caps)) {
caps1 = gst_caps_copy_1(caps);
caps = caps1;
}
/* go through all the src pads */
pads = gst_element_get_pad_list (GST_ELEMENT (tee));
@ -175,21 +169,21 @@ gst_tee_sinklink (GstPad *pad, GstCaps *caps)
}
static GstPadLinkReturn
gst_tee_srclink (GstPad *pad, GstCaps *caps)
gst_tee_srclink (GstPad *pad, const GstCaps2 *caps)
{
GstTee *tee;
GST_DEBUG ( "gst_tee_srclink caps=%s", gst_caps_to_string(caps));
GST_DEBUG ( "gst_tee_srclink caps=%s", gst_caps2_to_string(caps));
tee = GST_TEE (gst_pad_get_parent (pad));
return gst_pad_proxy_link (tee->sinkpad, caps);
}
static GstCaps*
gst_tee_getcaps (GstPad *pad, GstCaps *filter)
static GstCaps2*
gst_tee_getcaps (GstPad *pad, const GstCaps2 *filter)
{
GstCaps *caps = NULL;
GstCaps2 *caps = GST_CAPS2_ANY;
GstTee *tee;
const GList *pads;
@ -202,8 +196,8 @@ gst_tee_getcaps (GstPad *pad, GstCaps *filter)
while (pads) {
GstPad *srcpad = GST_PAD_CAST (pads->data);
GstPad *peer;
GstCaps *peercaps;
GstCaps *newcaps;
const GstCaps2 *peercaps;
GstCaps2 *newcaps;
pads = g_list_next (pads);
@ -213,9 +207,8 @@ gst_tee_getcaps (GstPad *pad, GstCaps *filter)
}
peercaps = gst_pad_get_caps (peer);
newcaps = gst_caps_intersect (caps, peercaps);
gst_caps_unref (caps);
gst_caps_sink (peercaps);
newcaps = gst_caps2_intersect (caps, peercaps);
gst_caps2_free (caps);
caps = newcaps;
}

View file

@ -58,13 +58,13 @@ GST_PAD_TEMPLATE_FACTORY (type_find_element_sink_factory,
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_CAPS_ANY
GST_CAPS2_ANY
);
GST_PAD_TEMPLATE_FACTORY (type_find_element_src_factory,
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_CAPS_ANY
GST_CAPS2_ANY
);
/* TypeFind signals and args */
@ -140,17 +140,17 @@ gst_type_find_element_get_type (void)
return typefind_type;
}
static void
gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps *caps)
gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps2 *caps)
{
gchar *caps_str;
g_assert (typefind->caps == NULL);
g_assert (caps != NULL);
caps_str = gst_caps_to_string (caps);
caps_str = gst_caps2_to_string (caps);
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
g_free (caps_str);
gst_caps_replace (&typefind->caps, caps);
gst_caps2_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");
}
@ -183,7 +183,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_TYPE_CAPS, G_PARAM_READABLE));
gst_caps2_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));
@ -195,7 +195,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_TYPE_CAPS);
G_TYPE_UINT, gst_caps2_get_type());
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state);
}
@ -312,7 +312,7 @@ gst_type_find_element_src_event (GstPad *pad, GstEvent *event)
typedef struct {
GstTypeFindFactory * factory;
gint probability;
GstCaps * caps;
GstCaps2 * caps;
gint64 requested_offset;
guint requested_size;
@ -332,7 +332,7 @@ free_entry (TypeFindEntry *entry)
free_entry_buffers (entry);
if (entry->caps)
gst_caps_unref (entry->caps);
gst_caps2_free (entry->caps);
g_free (entry);
}
static void
@ -471,18 +471,18 @@ find_peek (gpointer data, gint64 offset, guint size)
}
}
static void
find_suggest (gpointer data, guint probability, GstCaps *caps)
find_suggest (gpointer data, guint probability, const GstCaps2 *caps)
{
gchar *str;
TypeFindEntry *entry = (TypeFindEntry *) data;
str = gst_caps_to_string (caps);
str = gst_caps2_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_caps_replace (&entry->caps, caps);
gst_caps2_replace (&entry->caps, caps);
}
}
static gint
@ -561,10 +561,10 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
free_entry (entry);
} else if (entry->probability >= typefind->max_probability) {
/* wooha, got caps */
GstCaps *found_caps = entry->caps;
GstCaps2 *found_caps = entry->caps;
guint probability = entry->probability;
gst_caps_ref (found_caps);
found_caps = gst_caps2_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) {
@ -579,7 +579,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_caps_unref (found_caps);
gst_caps2_free (found_caps);
} else {
typefind->possibilities = g_list_prepend (typefind->possibilities, entry);
}
@ -667,7 +667,7 @@ gst_type_find_element_change_state (GstElement *element)
break;
case GST_STATE_PAUSED_TO_READY:
stop_typefinding (typefind);
gst_caps_replace (&typefind->caps, NULL);
gst_caps2_replace (&typefind->caps, NULL);
break;
default:
break;

View file

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

View file

@ -58,13 +58,13 @@ GST_PAD_TEMPLATE_FACTORY (type_find_element_sink_factory,
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_CAPS_ANY
GST_CAPS2_ANY
);
GST_PAD_TEMPLATE_FACTORY (type_find_element_src_factory,
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_CAPS_ANY
GST_CAPS2_ANY
);
/* TypeFind signals and args */
@ -140,17 +140,17 @@ gst_type_find_element_get_type (void)
return typefind_type;
}
static void
gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps *caps)
gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability, GstCaps2 *caps)
{
gchar *caps_str;
g_assert (typefind->caps == NULL);
g_assert (caps != NULL);
caps_str = gst_caps_to_string (caps);
caps_str = gst_caps2_to_string (caps);
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
g_free (caps_str);
gst_caps_replace (&typefind->caps, caps);
gst_caps2_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");
}
@ -183,7 +183,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_TYPE_CAPS, G_PARAM_READABLE));
gst_caps2_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));
@ -195,7 +195,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_TYPE_CAPS);
G_TYPE_UINT, gst_caps2_get_type());
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_type_find_element_change_state);
}
@ -312,7 +312,7 @@ gst_type_find_element_src_event (GstPad *pad, GstEvent *event)
typedef struct {
GstTypeFindFactory * factory;
gint probability;
GstCaps * caps;
GstCaps2 * caps;
gint64 requested_offset;
guint requested_size;
@ -332,7 +332,7 @@ free_entry (TypeFindEntry *entry)
free_entry_buffers (entry);
if (entry->caps)
gst_caps_unref (entry->caps);
gst_caps2_free (entry->caps);
g_free (entry);
}
static void
@ -471,18 +471,18 @@ find_peek (gpointer data, gint64 offset, guint size)
}
}
static void
find_suggest (gpointer data, guint probability, GstCaps *caps)
find_suggest (gpointer data, guint probability, const GstCaps2 *caps)
{
gchar *str;
TypeFindEntry *entry = (TypeFindEntry *) data;
str = gst_caps_to_string (caps);
str = gst_caps2_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_caps_replace (&entry->caps, caps);
gst_caps2_replace (&entry->caps, caps);
}
}
static gint
@ -561,10 +561,10 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
free_entry (entry);
} else if (entry->probability >= typefind->max_probability) {
/* wooha, got caps */
GstCaps *found_caps = entry->caps;
GstCaps2 *found_caps = entry->caps;
guint probability = entry->probability;
gst_caps_ref (found_caps);
found_caps = gst_caps2_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) {
@ -579,7 +579,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_caps_unref (found_caps);
gst_caps2_free (found_caps);
} else {
typefind->possibilities = g_list_prepend (typefind->possibilities, entry);
}
@ -667,7 +667,7 @@ gst_type_find_element_change_state (GstElement *element)
break;
case GST_STATE_PAUSED_TO_READY:
stop_typefinding (typefind);
gst_caps_replace (&typefind->caps, NULL);
gst_caps2_replace (&typefind->caps, NULL);
break;
default:
break;

View file

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

View file

@ -1,83 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR GStreamer core team
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \"http://bugzilla.gnome.org\"\n"
"POT-Creation-Date: 2003-10-10 14:09-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: gst/gst.c:113
msgid "Print the GStreamer version"
msgstr ""
#: gst/gst.c:114
msgid "Make all warnings fatal"
msgstr ""
#: gst/gst.c:116
msgid ""
"default debug level from 1 (only error) to 5 (anything) or 0 for no output"
msgstr ""
#: gst/gst.c:117
msgid ""
"colon-seperated list of category_name=level pairs to set specific levels for "
"the individual categories.\n"
"Example:GST_AUTOPLUG=5:GST_ELEMENT_*=3"
msgstr ""
#: gst/gst.c:118
msgid "disable color debugging output"
msgstr ""
#: gst/gst.c:119
msgid "disable debugging"
msgstr ""
#: gst/gst.c:120
msgid "print available debug categories and exit"
msgstr ""
#: gst/gst.c:122
msgid "Disable accelerated CPU instructions"
msgstr ""
#: gst/gst.c:123
msgid "enable verbose plugin loading diagnostics"
msgstr ""
#: gst/gst.c:124
msgid "'"
msgstr ""
#: gst/gst.c:124
msgid "'--separated path list for loading plugins"
msgstr ""
#: gst/gst.c:125
msgid ""
"comma-separated list of plugins to preload in addition to the list stored in "
"env variable GST_PLUGIN_PATH"
msgstr ""
#: gst/gst.c:126
msgid "scheduler to use ('"
msgstr ""
#: gst/gst.c:126
msgid "' is the default)"
msgstr ""
#: gst/gst.c:127
msgid "registry to use"
msgstr ""

View file

@ -11,5 +11,3 @@ intersection
normalisation
union
fixed
string-conversions
intersect2

View file

@ -99,13 +99,6 @@ GST_CAPS_FACTORY(caps9,
"format", GST_PROPS_FOURCC(GST_MAKE_FOURCC('Y','V','1','2'))
)
)
GST_CAPS_FACTORY(caps10,
GST_CAPS_NEW (
"my_caps",
"video/x-jpeg",
NULL
)
)
static gint test = 0;
static gint failures = 0;
@ -192,7 +185,6 @@ bla:
test_caps (GST_PAD_TEMPLATE_GET (caps7));
test_caps (GST_PAD_TEMPLATE_GET (caps8));
test_caps (GST_PAD_TEMPLATE_GET (caps9));
test_caps (GST_PAD_TEMPLATE_GET (caps10));
/* mime types */
test_string ("audio/raw");

View file

@ -11,5 +11,3 @@ intersection
normalisation
union
fixed
string-conversions
intersect2

View file

@ -99,13 +99,6 @@ GST_CAPS_FACTORY(caps9,
"format", GST_PROPS_FOURCC(GST_MAKE_FOURCC('Y','V','1','2'))
)
)
GST_CAPS_FACTORY(caps10,
GST_CAPS_NEW (
"my_caps",
"video/x-jpeg",
NULL
)
)
static gint test = 0;
static gint failures = 0;
@ -192,7 +185,6 @@ bla:
test_caps (GST_PAD_TEMPLATE_GET (caps7));
test_caps (GST_PAD_TEMPLATE_GET (caps8));
test_caps (GST_PAD_TEMPLATE_GET (caps9));
test_caps (GST_PAD_TEMPLATE_GET (caps10));
/* mime types */
test_string ("audio/raw");