GstGhostPad
gst_ghost_pad_new
-GstPadFactoryEntry
-GstPadFactory[]
-GST_PAD_FACTORY_SOMETIMES
-GST_PAD_FACTORY_ALWAYS
-GST_PAD_FACTORY_REQUEST
-GST_PAD_FACTORY_SINK
-GST_PAD_FACTORY_SRC
-GST_PAD_FACTORY_CAPS
-
GstPadPresence
GstPadTemplate
GST_PADTEMPLATE_CAPS
GST_PADTEMPLATE_NAME_TEMPLATE
GST_PADTEMPLATE_PRESENCE
gst_padtemplate_new
-gst_padtemplate_create
gst_padtemplate_load_thyself
gst_padtemplate_save_thyself
gst_padtemplate_get_caps
GST_IS_PADTEMPLATE
GST_IS_PADTEMPLATE_CLASS
gst_padtemplate_get_type
-GST_PAD_FACTORY_CAPS_ID
</SECTION>
<SECTION>
GST_CAPS_TRYLOCK
GST_CAPS_UNLOCK
GstCaps
-GstCapsFactory
-GstCapsFactoryEntry
-GstCapsFactory[]
gst_caps_new
-gst_caps_new_with_props
gst_caps_destroy
gst_caps_ref
gst_caps_unref
-gst_caps_register
-gst_caps_register_count
gst_caps_copy
gst_caps_copy_on_write
gst_caps_append
<FILE>gstprops</FILE>
<TITLE>GstProps</TITLE>
GstProps
-GstPropsFactoryEntry
-GstPropsFactory[]
GST_MAKE_FOURCC
GST_PROPS_LIST
GST_PROPS_INT
GST_PROPS_STRING
GST_PROPS_FLOAT
GST_PROPS_FLOAT_RANGE
-GST_PROPS_FLOAT_STRING
-GST_PROPS_FLOAT_RANGE_STRING
-gst_props_register
-gst_props_register_count
gst_props_new
+gst_props_newv
gst_props_merge
gst_props_copy
gst_props_copy_on_write
gst_props_load_thyself
<SUBSECTION Standard>
GstPropsEntry
-GstPropsListFactory[]
GstPropsId
-GST_PROPS_END_ID
-GST_PROPS_LIST_ID
-GST_PROPS_INT_ID
-GST_PROPS_INT_RANGE_ID
-GST_PROPS_FOURCC_ID
-GST_PROPS_BOOL_ID
-GST_PROPS_STRING_ID
-GST_PROPS_LAST_ID
-GST_PROPS_FLOAT_ID
-GST_PROPS_FLOAT_RANGE_ID
</SECTION>
<SECTION>
@properties: the properties of the capability
@next: a pointer to the next caps.
-<!-- ##### TYPEDEF GstCapsFactory ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### TYPEDEF GstCapsFactoryEntry ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### TYPEDEF GstCapsFactory[] ##### -->
-<para>
-
-</para>
-
-
<!-- ##### FUNCTION gst_caps_new ##### -->
<para>
</para>
-@name:
-@mime:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_caps_new_with_props ##### -->
-<para>
-
-</para>
-
@name:
@mime:
@props:
@caps:
-<!-- ##### FUNCTION gst_caps_register ##### -->
-<para>
-
-</para>
-
-@factory:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_caps_register_count ##### -->
-<para>
-
-</para>
-
-@factory:
-@counter:
-@Returns:
-<!-- # Unused Parameters # -->
-@count:
-
-
<!-- ##### FUNCTION gst_caps_copy ##### -->
<para>
@Returns:
-<!-- ##### TYPEDEF GstPadFactoryEntry ##### -->
-<para>
-Defines an entry for a padfactory.
-</para>
-
-
-<!-- ##### TYPEDEF GstPadFactory[] ##### -->
-<para>
-The padfactory.
-</para>
-
-
-<!-- ##### MACRO GST_PAD_FACTORY_SOMETIMES ##### -->
-<para>
-Indicate that this pad will become available depending
-on the media type. Use this in the factory definition.
-</para>
-
-
-
-<!-- ##### MACRO GST_PAD_FACTORY_ALWAYS ##### -->
-<para>
-Indicate that this pad will always be available.
-Use this in the factory definition.
-</para>
-
-
-
-<!-- ##### MACRO GST_PAD_FACTORY_REQUEST ##### -->
-<para>
-Indicates that this pad will be available on request. Use
-this in the factory definition.
-</para>
-
-
-
-<!-- ##### MACRO GST_PAD_FACTORY_SINK ##### -->
-<para>
-Indicates a sinkpad for the padfactory.
-</para>
-
-
-
-<!-- ##### MACRO GST_PAD_FACTORY_SRC ##### -->
-<para>
-Indicates a srcpad for the padfactory.
-</para>
-
-
-
-<!-- ##### MACRO GST_PAD_FACTORY_CAPS ##### -->
-<para>
-Starts the declaration of a the capabilities for this padtemplate.
-</para>
-
-@a...: a capability factory
-
-
<!-- ##### ENUM GstPadPresence ##### -->
<para>
Indicates when this pad will become available.
</para>
-@factory:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_padtemplate_create ##### -->
-<para>
-
-</para>
-
@name_template:
@direction:
@presence:
@caps:
+@Varargs:
@Returns:
+<!-- # Unused Parameters # -->
+@factory:
<!-- ##### FUNCTION gst_padtemplate_load_thyself ##### -->
@lock:
@properties: the properties
-<!-- ##### TYPEDEF GstPropsFactoryEntry ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### TYPEDEF GstPropsFactory[] ##### -->
-<para>
-
-</para>
-
-
<!-- ##### MACRO GST_MAKE_FOURCC ##### -->
<para>
@b:
-<!-- ##### MACRO GST_PROPS_FLOAT_STRING ##### -->
-<para>
-
-</para>
-
-@a:
-
-
-<!-- ##### MACRO GST_PROPS_FLOAT_RANGE_STRING ##### -->
-<para>
-
-</para>
-
-@a:
-@b:
-
-
-<!-- ##### FUNCTION gst_props_register ##### -->
-<para>
-
-</para>
-
-@factory:
-@Returns:
-
-
-<!-- ##### FUNCTION gst_props_register_count ##### -->
+<!-- ##### FUNCTION gst_props_new ##### -->
<para>
</para>
-@factory:
-@counter:
+@firstname:
+@Varargs:
@Returns:
+<!-- # Unused Parameters # -->
+@entry:
-<!-- ##### FUNCTION gst_props_new ##### -->
+<!-- ##### FUNCTION gst_props_newv ##### -->
<para>
</para>
-@entry:
-@Varargs:
+@firstname:
+@var_args:
@Returns:
@props:
@name:
-@entry:
@Varargs:
@Returns:
<!-- # Unused Parameters # -->
+@entry:
@value:
@Returns:
+<!-- ##### TYPEDEF GstCapsFactoryEntry ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO GST_IS_DISKSRC_CLASS ##### -->
<para>
</para>
+<!-- ##### FUNCTION gst_padtemplate_create ##### -->
+<para>
+
+</para>
+
+@name_template:
+@direction:
+@presence:
+@caps:
+@Returns:
+
<!-- ##### MACRO GST_IS_ESDSINK_CLASS ##### -->
<para>
@Returns:
+<!-- ##### TYPEDEF GstCapsFactory[] ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO GST_PROPS_BOOL_ID ##### -->
<para>
@obj:
+<!-- ##### TYPEDEF GstPropsFactory[] ##### -->
+<para>
+
+</para>
+
+
<!-- ##### SIGNAL GstAudioSink::handoff ##### -->
<para>
The buffer is sent to the sound card.
</para>
+<!-- ##### FUNCTION gst_caps_register_count ##### -->
+<para>
+
+</para>
+
+@factory:
+@counter:
+@Returns:
+@count:
+
<!-- ##### MACRO GST_TYPE_HTTPSRC ##### -->
<para>
GstColorSpace
+<!-- ##### TYPEDEF GstPadFactoryEntry ##### -->
+<para>
+Defines an entry for a padfactory.
+</para>
+
+
<!-- ##### ENUM GstAsyncDiskSrcFlags ##### -->
<para>
<informaltable pgwide=1 frame="none" role="enum">
@Returns:
+<!-- ##### MACRO GST_PAD_FACTORY_SINK ##### -->
+<para>
+Indicates a sinkpad for the padfactory.
+</para>
+
+
<!-- ##### MACRO GST_SRC_CLASS ##### -->
<para>
</para>
+<!-- ##### MACRO GST_PROPS_FLOAT_STRING ##### -->
+<para>
+
+</para>
+
+@a:
+
<!-- ##### FUNCTION gst_filter_get_type ##### -->
<para>
</para>
+<!-- ##### MACRO GST_PAD_FACTORY_SRC ##### -->
+<para>
+Indicates a srcpad for the padfactory.
+</para>
+
+
<!-- ##### MACRO GST_IS_SINK_CLASS ##### -->
<para>
@name:
@Returns:
+<!-- ##### MACRO GST_PAD_FACTORY_CAPS ##### -->
+<para>
+Starts the declaration of a the capabilities for this padtemplate.
+</para>
+
+@a...: a capability factory
+
<!-- ##### SECTION ./tmpl/gstsrc.sgml:Title ##### -->
GstSrc
@pad:
@buf:
+<!-- ##### FUNCTION gst_caps_new_with_props ##### -->
+<para>
+
+</para>
+
+@name:
+@mime:
+@props:
+@Returns:
+
<!-- ##### MACRO GST_TYPE_AUDIOSRC ##### -->
<para>
</para>
+<!-- ##### FUNCTION gst_props_register ##### -->
+<para>
+
+</para>
+
+@factory:
+@Returns:
+
<!-- ##### STRUCT GstThreadClass ##### -->
<para>
@klass:
+<!-- ##### TYPEDEF GstPropsFactoryEntry ##### -->
+<para>
+
+</para>
+
+
<!-- ##### MACRO GST_IS_FILTER_CLASS ##### -->
<para>
@src:
+<!-- ##### FUNCTION gst_props_register_count ##### -->
+<para>
+
+</para>
+
+@factory:
+@counter:
+@Returns:
+
+<!-- ##### MACRO GST_PROPS_FLOAT_RANGE_STRING ##### -->
+<para>
+
+</para>
+
+@a:
+@b:
+
<!-- ##### MACRO GST_FAKESRC_CLASS ##### -->
<para>
@klass: <<<<<<< gstreamer-unused.sgml
+<!-- ##### MACRO GST_PAD_FACTORY_REQUEST ##### -->
+<para>
+Indicates that this pad will be available on request. Use
+this in the factory definition.
+</para>
+
+
<!-- ##### FUNCTION gst_audiosink_sync_parms ##### -->
<para>
@pad:
@id:
+<!-- ##### MACRO GST_PAD_FACTORY_ALWAYS ##### -->
+<para>
+Indicate that this pad will always be available.
+Use this in the factory definition.
+</para>
+
+
<!-- ##### FUNCTION gst_pad_add_ghost_parent ##### -->
<para>
Take data in and spit data out
+<!-- ##### TYPEDEF GstPadFactory[] ##### -->
+<para>
+The padfactory.
+</para>
+
+
<!-- ##### MACRO GST_SRC_ASYNC ##### -->
<para>
This macro checks to see if the GST_SRC_ASYNC flag is set.
</para>
+<!-- ##### TYPEDEF GstCapsFactory ##### -->
+<para>
+
+</para>
+
+
<!-- ##### STRUCT GstFdSrcClass ##### -->
<para>
</para>
+<!-- ##### FUNCTION gst_caps_register ##### -->
+<para>
+
+</para>
+
+@factory:
+@Returns:
+
<!-- ##### FUNCTION plugin_initialize ##### -->
<para>
GstAudioSrc
+<!-- ##### MACRO GST_PAD_FACTORY_SOMETIMES ##### -->
+<para>
+Indicate that this pad will become available depending
+on the media type. Use this in the factory definition.
+</para>
+
+
<!-- ##### MACRO INFO ##### -->
<para>
+++ /dev/null
-<!-- ##### SECTION Title ##### -->
-videoraw
-
-<!-- ##### SECTION Short_Description ##### -->
-Information about video buffers.
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-Information about video buffers.
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### STRUCT MetaVideoRaw ##### -->
-<para>
-
-</para>
-
-@meta:
-@format:
-@visual:
-@width:
-@height:
-@overlay_info:
-@dga_info:
-
-<!-- ##### STRUCT MetaDGA ##### -->
-<para>
-
-</para>
-
-@base:
-@swidth:
-@sheight:
-@bytes_per_line:
-
-<!-- ##### STRUCT MetaOverlay ##### -->
-<para>
-
-</para>
-
-@wx:
-@wy:
-@overlay_element:
-@clip_count:
-@overlay_clip:
-@width:
-@height:
-@did_overlay:
-@fully_obscured:
-
-<!-- ##### STRUCT OverlayClip ##### -->
-<para>
-
-</para>
-
-@x1:
-@x2:
-@y1:
-@y2:
-
gst_editor_props_show_func (GstPropsEntry *entry)
{
switch (entry->propstype) {
- case GST_PROPS_INT_ID_NUM:
+ case GST_PROPS_INT_ID:
return g_strdup_printf ("%d", entry->data.int_data);
break;
- case GST_PROPS_INT_RANGE_ID_NUM:
+ case GST_PROPS_INT_RANGE_ID:
return g_strdup_printf ("%d-%d", entry->data.int_range_data.min, entry->data.int_range_data.max);
break;
- case GST_PROPS_FOURCC_ID_NUM:
+ case GST_PROPS_FOURCC_ID:
return g_strdup_printf ("%4.4s", (gchar *)&entry->data.fourcc_data);
break;
- case GST_PROPS_BOOL_ID_NUM:
+ case GST_PROPS_BOOL_ID:
return g_strdup_printf ("%s", (entry->data.bool_data ? "TRUE" : "FALSE"));
break;
default:
if (caps) {
GstProps *props = gst_caps_get_props (caps);
if (props) {
- GSList *propslist = props->properties;
+ GList *propslist = props->properties;
while (propslist) {
gchar *data[2];
data[0] = g_quark_to_string (entry->propid);
switch (entry->propstype) {
- case GST_PROPS_LIST_ID_NUM:
+ case GST_PROPS_LIST_ID:
{
GList *list;
guint count = 0;
gtk_ctree_insert_node (GTK_CTREE (tree), padnode, NULL, data, 0,
NULL, NULL, NULL, NULL, TRUE, TRUE);
- propslist = g_slist_next (propslist);
+ propslist = g_list_next (propslist);
}
}
}
pads = gst_element_get_padtemplate_list(realelement);
while (pads) {
GstPadTemplate *templ = (GstPadTemplate *)pads->data;
- GList *caps = templ->caps;
+ GstCaps *caps = templ->caps;
gchar *mime;
gchar *data[2];
GtkCTreeNode *padnode;
if (caps) {
GstType *type;
- type = gst_type_find_by_id (((GstCaps *)caps->data)->id);
+ type = gst_type_find_by_id (((GstCaps *)caps)->id);
mime = type->mime;
}
else {
NULL, NULL, NULL, NULL, FALSE, TRUE);
while (caps) {
- GstCaps *cap = (GstCaps *)caps->data;
+ GstCaps *cap = (GstCaps *)caps;
gst_editor_add_caps_to_tree (cap, tree, padnode);
- caps = g_list_next (caps);
+ caps = (caps)->next;
}
pads = g_list_next (pads);
* can have. They can be quite complex, but for this example plugin
* they are rather simple.
*/
-static GstPadFactory sink_factory = {
- "sink", /* The name of the pad */
- GST_PAD_FACTORY_SINK, /* Direction of the pad */
- GST_PAD_FACTORY_ALWAYS, /* The pad exists for every instance */
- GST_PAD_FACTORY_CAPS( /* This factory has specific capabilities */
- "example_sink", /* The name of the caps */
- "unknown/unknown", /* The overall MIME/type */
- "foo", GST_PROPS_INT (1), /* An integer property */
- "bar", GST_PROPS_BOOLEAN (TRUE), /* A boolean */
- "baz", GST_PROPS_LIST ( /* A list of values for */
- GST_PROPS_INT (1),
- GST_PROPS_INT (3)
- )
- ),
- NULL /* All factories must be NULL-terminated */
-};
+static GstPadTemplate*
+sink_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "sink", /* The name of the pad */
+ GST_PAD_SINK, /* Direction of the pad */
+ GST_PAD_ALWAYS, /* The pad exists for every instance */
+ gst_caps_new (
+ "example_sink", /* The name of the caps */
+ "unknown/unknown", /* The overall MIME/type */
+ gst_props_new (
+ "foo", GST_PROPS_INT (1), /* An integer property */
+ "bar", GST_PROPS_BOOLEAN (TRUE), /* A boolean */
+ "baz", GST_PROPS_LIST ( /* A list of values for */
+ GST_PROPS_INT (1),
+ GST_PROPS_INT (3)
+ ),
+ NULL)));
+}
/* This factory is much simpler, and defines the source pad. */
-static GstPadFactory src_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "example_src",
- "unknown/unknown"
- ),
- NULL
-};
+static GstPadTemplate*
+src_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "example_src",
+ "unknown/unknown",
+ NULL));
+}
/* A number of functon prototypes are given so we can refer to them later. */
* Note that the generated padtemplates are stored in static global
* variables, for the gst_example_init function to use later on.
*/
- sink_template = gst_padtemplate_new (&sink_factory);
+ sink_template = sink_factory ();
gst_elementfactory_add_padtemplate (factory, sink_template);
- src_template = gst_padtemplate_new (&src_factory);
+ src_template = src_factory ();
gst_elementfactory_add_padtemplate (factory, src_template);
/* The very last thing is to register the elementfactory with the plugin. */
/* FILL ME */
};
-static GstPadFactory tee_src_factory = {
- "src%d",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_REQUEST,
- NULL, /* no caps */
- NULL,
-};
+static GstPadTemplate*
+tee_src_factory_create (void)
+{
+ return
+ gst_padtemplate_new (
+ "src%d",
+ GST_PAD_SRC,
+ GST_PAD_REQUEST,
+ NULL /* no caps */
+ );
+}
static void gst_tee_class_init (GstTeeClass *klass);
gboolean
gst_tee_factory_init (GstElementFactory *factory)
{
- gst_tee_src_template = gst_padtemplate_new (&tee_src_factory);
+ gst_tee_src_template = tee_src_factory_create ();
gst_elementfactory_add_padtemplate (factory, gst_tee_src_template);
return TRUE;
* gst_caps_new:
* @name: the name of this capability
* @mime: the mime type to attach to the capability
+ * @props: the properties to add to this capability
*
- * Create a new capability with the given mime type.
+ * Create a new capability with the given mime typei and properties.
*
* Returns: a new capability
*/
GstCaps*
-gst_caps_new (const gchar *name, const gchar *mime)
+gst_caps_new (const gchar *name, const gchar *mime, GstProps *props)
{
GstCaps *caps;
caps->name = g_strdup (name);
caps->id = get_type_for_mime (mime);
- caps->properties = NULL;
+ caps->properties = props;
caps->next = NULL;
caps->refcount = 1;
caps->lock = g_mutex_new ();
return caps;
}
-/**
- * gst_caps_new_with_props:
- * @name: the name of this capability
- * @mime: the mime type to attach to the capability
- * @props: the properties for this capability
- *
- * Create a new capability with the given mime type and the given properties.
- *
- * Returns: a new capability
- */
-GstCaps*
-gst_caps_new_with_props (const gchar *name, const gchar *mime, GstProps *props)
-{
- GstCaps *caps;
-
- caps = gst_caps_new (name, mime);
- caps->properties = props;
-
- return caps;
-}
-
-/**
- * gst_caps_register:
- * @factory: the factory to register
- *
- * Register the factory.
- *
- * Returns: the registered capability
- */
-GstCaps*
-gst_caps_register (GstCapsFactory *factory)
-{
- guint dummy;
-
- return gst_caps_register_count (factory, &dummy);
-}
-
-/**
- * gst_caps_register_count:
- * @factory: the factory to register
- * @counter: count how many entries were consumed
- *
- * Register the factory.
- *
- * Returns: the registered capability
- */
-GstCaps*
-gst_caps_register_count (GstCapsFactory *factory, guint *counter)
-{
- GstCapsFactoryEntry tag;
- gint i = 0;
- gchar *name;
- GstCaps *caps;
-
- g_return_val_if_fail (factory != NULL, NULL);
-
- tag = (*factory)[i++];
- g_return_val_if_fail (tag != NULL, NULL);
-
- name = tag;
-
- tag = (*factory)[i++];
- g_return_val_if_fail (tag != NULL, NULL);
-
- caps = gst_caps_new_with_props (name, (gchar *)tag,
- gst_props_register_count (&(*factory)[i], counter));
-
- *counter += 2;
-
- return caps;
-}
-
/**
* gst_caps_destroy:
* @caps: the caps to destroy
g_return_val_if_fail (caps != NULL, NULL);
GST_CAPS_LOCK (caps);
- new = gst_caps_new_with_props (
+ new = gst_caps_new (
caps->name,
(gst_type_find_by_id (caps->id))->mime,
gst_props_copy (caps->properties));
#include <gst/gstprops.h>
typedef struct _GstCaps GstCaps;
-typedef gpointer GstCapsFactoryEntry;
-#ifdef __cplusplus
-typedef GstCapsFactoryEntry * GstCapsFactory;
-#else // C++ was unable to compile with this
-typedef GstCapsFactoryEntry GstCapsFactory[];
-#endif
#define GST_CAPS(caps) \
((GstCaps *)(caps))
/* initialize the subsystem */
void _gst_caps_initialize (void);
-GstCaps* gst_caps_new (const gchar *name, const gchar *mime);
-GstCaps* gst_caps_new_with_props (const gchar *name, const gchar *mime, GstProps *props);
-GstCaps* gst_caps_register (GstCapsFactory *factory);
-GstCaps* gst_caps_register_count (GstCapsFactory *factory, guint *counter);
+GstCaps* gst_caps_new (const gchar *name, const gchar *mime, GstProps *props);
void gst_caps_unref (GstCaps *caps);
void gst_caps_ref (GstCaps *caps);
{
}
-/**
- * gst_padtemplate_new:
- * @factory: the padfactory to use
- *
- * Creates a new padtemplate from the factory.
- *
- * Returns: the new padtemplate
- */
-GstPadTemplate*
-gst_padtemplate_new (GstPadFactory *factory)
-{
- GstPadTemplate *new;
- GstPadFactoryEntry tag;
- gint i = 0;
- guint counter = 0;
-
- g_return_val_if_fail (factory != NULL, NULL);
-
- new = gtk_type_new (gst_padtemplate_get_type ());
-
- tag = (*factory)[i++];
- g_return_val_if_fail (tag != NULL, new);
- new->name_template = g_strdup ((gchar *)tag);
-
- tag = (*factory)[i++];
- new->direction = GPOINTER_TO_UINT (tag);
-
- tag = (*factory)[i++];
- new->presence = GPOINTER_TO_UINT (tag);
-
- tag = (*factory)[i++];
-
- while (GPOINTER_TO_INT (tag) == GST_PAD_FACTORY_CAPS_ID) {
- GST_PADTEMPLATE_CAPS (new) = gst_caps_append (GST_PADTEMPLATE_CAPS (new),
- gst_caps_register_count ((GstCapsFactory *)&(*factory)[i], &counter));
- i+=counter;
- tag = (*factory)[i++];
- }
-
- return new;
-}
-
/**
* gst_padtemplate_create:
* @name_template: the name template
* Returns: the new padtemplate
*/
GstPadTemplate*
-gst_padtemplate_create (gchar *name_template,
- GstPadDirection direction, GstPadPresence presence,
- GstCaps *caps)
+gst_padtemplate_new (gchar *name_template,
+ GstPadDirection direction, GstPadPresence presence,
+ GstCaps *caps, ...)
{
GstPadTemplate *new;
+ va_list var_args;
+ GstCaps *thecaps = NULL;
g_return_val_if_fail (name_template != NULL, NULL);
GST_PADTEMPLATE_NAME_TEMPLATE (new) = name_template;
GST_PADTEMPLATE_DIRECTION (new) = direction;
GST_PADTEMPLATE_PRESENCE (new) = presence;
- GST_PADTEMPLATE_CAPS (new) = caps;
+
+ va_start (var_args, caps);
+
+ while (caps) {
+ thecaps = gst_caps_append (thecaps, caps);
+ caps = va_arg (var_args, GstCaps*);
+ }
+ va_end (var_args);
+
+ GST_PADTEMPLATE_CAPS (new) = thecaps;
return new;
}
field = field->next;
}
- factory = gst_padtemplate_create (name_template, direction, presence, caps);
+ factory = gst_padtemplate_new (name_template, direction, presence, caps, NULL);
return factory;
}
};
-/* factory */
-typedef gpointer GstPadFactoryEntry;
-typedef GstPadFactoryEntry GstPadFactory[];
-
-#define GST_PAD_FACTORY_ALWAYS GINT_TO_POINTER(GST_PAD_ALWAYS)
-#define GST_PAD_FACTORY_SOMETIMES GINT_TO_POINTER(GST_PAD_SOMETIMES)
-#define GST_PAD_FACTORY_REQUEST GINT_TO_POINTER(GST_PAD_REQUEST)
-
-#define GST_PAD_FACTORY_SRC GINT_TO_POINTER(GST_PAD_SRC)
-#define GST_PAD_FACTORY_SINK GINT_TO_POINTER(GST_PAD_SINK)
-
-#define GST_PAD_FACTORY_CAPS_ID 1
-#define GST_PAD_FACTORY_CAPS(a...) GINT_TO_POINTER(GST_PAD_FACTORY_CAPS_ID),##a,NULL
-
-
GtkType gst_pad_get_type (void);
GtkType gst_real_pad_get_type (void);
GtkType gst_ghost_pad_get_type (void);
/* templates and factories */
GtkType gst_padtemplate_get_type (void);
-GstPadTemplate* gst_padtemplate_new (GstPadFactory *factory);
-GstPadTemplate* gst_padtemplate_create (gchar *name_template,
+GstPadTemplate* gst_padtemplate_new (gchar *name_template,
GstPadDirection direction, GstPadPresence presence,
- GstCaps *caps);
+ GstCaps *caps, ...);
GstCaps* gst_padtemplate_get_caps (GstPadTemplate *templ);
GstCaps* gst_padtemplate_get_caps_by_name (GstPadTemplate *templ, const gchar *name);
module = g_module_open(name,G_MODULE_BIND_LAZY);
if (module != NULL) {
if (g_module_symbol(module,"plugin_init",(gpointer *)&initfunc)) {
+ GST_INFO (GST_CAT_PLUGIN_LOADING,"loading plugin \"%s\"...",
+ name);
if ((plugin = (initfunc)(module))) {
GST_INFO (GST_CAT_PLUGIN_LOADING,"plugin \"%s\" loaded: %d elements, %d types",
plugin->name,plugin->numelements,plugin->numtypes);
static gboolean gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry2);
-static guint _arg_len[] = {
- 0, // GST_PROPS_END_ID_NUM = 0,
- 0, // GST_PROPS_LIST_ID_NUM,
- 1, // GST_PROPS_INT_ID_NUM,
- 2, // GST_PROPS_INT_RANGE_ID_NUM,
- 1, // GST_PROPS_FLOAT_ID_NUM,
- 2, // GST_PROPS_FLOAT_RANGE_ID_NUM,
- 1, // GST_PROPS_FOURCC_ID_NUM,
- 1, // GST_PROPS_BOOL_ID_NUM,
- 1, // GST_PROPS_STRING_ID_NUM,
-};
-
void
_gst_props_initialize (void)
{
case GST_PROPS_INT_ID:
GST_DEBUG (0, "%d\n", entry->data.int_data);
break;
- case GST_PROPS_FOURCC_ID_NUM:
+ case GST_PROPS_FOURCC_ID:
GST_DEBUG (0, "%4.4s\n", (gchar*)&entry->data.fourcc_data);
break;
- case GST_PROPS_BOOL_ID_NUM:
+ case GST_PROPS_BOOL_ID:
GST_DEBUG (0, "%d\n", entry->data.bool_data);
break;
- case GST_PROPS_STRING_ID_NUM:
+ case GST_PROPS_STRING_ID:
GST_DEBUG (0, "%s\n", entry->data.string_data.string);
break;
- case GST_PROPS_INT_RANGE_ID_NUM:
+ case GST_PROPS_INT_RANGE_ID:
GST_DEBUG (0, "%d-%d\n", entry->data.int_range_data.min,
entry->data.int_range_data.max);
break;
}
}
-static GstPropsEntry*
-gst_props_create_entry (GstPropsFactory factory, gint *skipped)
-{
- GstPropsFactoryEntry tag;
- GstPropsEntry *entry;
- guint i=0;
-
- g_mutex_lock (_gst_props_entries_chunk_lock);
- entry = g_mem_chunk_alloc (_gst_props_entries_chunk);
- g_mutex_unlock (_gst_props_entries_chunk_lock);
-
- tag = factory[i++];
- switch (GPOINTER_TO_INT (tag)) {
- case GST_PROPS_INT_ID_NUM:
- entry->propstype = GST_PROPS_INT_ID_NUM;
- entry->data.int_data = GPOINTER_TO_INT (factory[i++]);
- break;
- case GST_PROPS_INT_RANGE_ID_NUM:
- entry->propstype = GST_PROPS_INT_RANGE_ID_NUM;
- entry->data.int_range_data.min = GPOINTER_TO_INT (factory[i++]);
- entry->data.int_range_data.max = GPOINTER_TO_INT (factory[i++]);
- break;
- case GST_PROPS_FLOAT_ID_NUM:
- entry->propstype = GST_PROPS_FLOAT_ID_NUM;
- entry->data.float_data = *(gfloat*)factory[i++];
- break;
- case GST_PROPS_FLOAT_RANGE_ID_NUM:
- entry->propstype = GST_PROPS_FLOAT_RANGE_ID_NUM;
- entry->data.float_range_data.min = *(gfloat*)factory[i++];
- entry->data.float_range_data.max = *(gfloat*)factory[i++];
- break;
- case GST_PROPS_FOURCC_ID_NUM:
- entry->propstype = GST_PROPS_FOURCC_ID_NUM;
- entry->data.fourcc_data = GPOINTER_TO_INT (factory[i++]);
- break;
- case GST_PROPS_LIST_ID_NUM:
- g_warning ("gstprops: list not allowed in list\n");
- break;
- case GST_PROPS_BOOL_ID_NUM:
- entry->propstype = GST_PROPS_BOOL_ID_NUM;
- entry->data.bool_data = GPOINTER_TO_INT (factory[i++]);
- break;
- case GST_PROPS_STRING_ID_NUM:
- entry->propstype = GST_PROPS_STRING_ID_NUM;
- entry->data.string_data.string = g_strdup (factory[i++]);
- break;
- default:
- g_warning ("gstprops: unknown props id found\n");
- g_mutex_lock (_gst_props_entries_chunk_lock);
- g_mem_chunk_free (_gst_props_entries_chunk, entry);
- g_mutex_unlock (_gst_props_entries_chunk_lock);
- entry = NULL;
- break;
- }
-
- *skipped = i;
-
- return entry;
-}
-
-
static gint
props_compare_func (gconstpointer a,
gconstpointer b)
return (entry1 - entry2->propid);
}
-/**
- * gst_props_register:
- * @factory: the factory to register
- *
- * Register the factory.
- *
- * Returns: the new property created from the factory
- */
-GstProps *
-gst_props_register (GstPropsFactory factory)
+static void
+gst_props_entry_fill (GstPropsEntry *entry, va_list *var_args)
{
- guint dummy;
+ entry->propstype = va_arg (*var_args, GstPropsId);
- return gst_props_register_count (factory, &dummy);
+ switch (entry->propstype) {
+ case GST_PROPS_INT_ID:
+ entry->data.int_data = va_arg (*var_args, gint);
+ break;
+ case GST_PROPS_INT_RANGE_ID:
+ entry->data.int_range_data.min = va_arg (*var_args, gint);
+ entry->data.int_range_data.max = va_arg (*var_args, gint);
+ break;
+ case GST_PROPS_FLOAT_ID:
+ entry->data.float_data = va_arg (*var_args, gfloat);
+ break;
+ case GST_PROPS_FLOAT_RANGE_ID:
+ entry->data.float_range_data.min = va_arg (*var_args, gfloat);
+ entry->data.float_range_data.max = va_arg (*var_args, gfloat);
+ break;
+ case GST_PROPS_FOURCC_ID:
+ entry->data.fourcc_data = va_arg (*var_args, gulong);
+ break;
+ case GST_PROPS_BOOL_ID:
+ entry->data.bool_data = va_arg (*var_args, gboolean);
+ break;
+ case GST_PROPS_STRING_ID:
+ entry->data.string_data.string = g_strdup (va_arg (*var_args, gchar*));
+ break;
+ default:
+ break;
+ }
}
/**
- * gst_props_register_count:
- * @factory: the factory to register
- * @counter: count how many fields were consumed
+ * gst_props_new:
+ * @firstname: the first property name
+ * @...: the property values
*
- * Register the factory.
+ * Create a new property from the given key/value pairs
*
- * Returns: the new property created from the factory
+ * Returns: the new property
*/
-GstProps *
-gst_props_register_count (GstPropsFactory factory, guint *counter)
+GstProps*
+gst_props_new (const gchar *firstname, ...)
{
- GstPropsFactoryEntry tag;
- gint i = 0;
- GstProps *props = NULL;
- gint skipped;
+ GstProps *props;
+ va_list var_args;
- g_return_val_if_fail (factory != NULL, NULL);
-
- tag = factory[i++];
-
- if (!tag) goto end;
-
- g_mutex_lock (_gst_props_chunk_lock);
- props = g_mem_chunk_alloc (_gst_props_chunk);
- g_mutex_unlock (_gst_props_chunk_lock);
+ va_start (var_args, firstname);
- g_return_val_if_fail (props != NULL, NULL);
-
- props->properties = NULL;
- props->refcount = 1;
+ props = gst_props_newv (firstname, var_args);
+
+ va_end (var_args);
- while (tag) {
- GQuark quark;
- GstPropsEntry *entry;
-
- if (tag < GST_PROPS_LAST_ID) {
- g_warning ("properties seem to be wrong\n");
- return NULL;
- }
-
- quark = g_quark_from_string ((gchar *)tag);
-
- tag = factory[i];
- switch (GPOINTER_TO_INT (tag)) {
- case GST_PROPS_LIST_ID_NUM:
- {
- GstPropsEntry *list_entry;
-
- g_mutex_lock (_gst_props_entries_chunk_lock);
- entry = g_mem_chunk_alloc (_gst_props_entries_chunk);
- g_mutex_unlock (_gst_props_entries_chunk_lock);
-
- entry->propid = quark;
- entry->propstype = GST_PROPS_LIST_ID_NUM;
- entry->data.list_data.entries = NULL;
-
- i++; // skip list tag
- tag = factory[i];
- while (tag) {
- list_entry = gst_props_create_entry (&factory[i], &skipped);
- list_entry->propid = quark;
- i += skipped;
- tag = factory[i];
- entry->data.list_data.entries = g_list_prepend (entry->data.list_data.entries, list_entry);
- }
- entry->data.list_data.entries = g_list_reverse (entry->data.list_data.entries);
- i++; //skip NULL (list end)
- break;
- }
- default:
- {
- entry = gst_props_create_entry (&factory[i], &skipped);
- entry->propid = quark;
- i += skipped;
- break;
- }
- }
- props->properties = g_list_insert_sorted (props->properties, entry, props_compare_func);
-
- tag = factory[i++];
- }
-
-end:
- *counter = i;
-
return props;
}
/**
- * gst_props_new:
- * @entry: the property entries for the property
- * @...: the property entries for the property
+ * gst_props_newv:
+ * @firstname: the first property name
+ * @var_args: the property values
*
* Create a new property from the list of entries.
*
* Returns: the new property created from the list of entries
*/
GstProps*
-gst_props_new (GstPropsFactoryEntry entry, ...)
+gst_props_newv (const gchar *firstname, va_list var_args)
{
- va_list var_args;
- GstPropsFactoryEntry value;
- gint i = 0;
- gint size, skip;
- GstPropsFactoryEntry *factory;
- gboolean inlist = FALSE;
GstProps *props;
+ gboolean inlist = FALSE;
+ const gchar *prop_name;
+ GstPropsEntry *list_entry = NULL;
-#define add_value(value) {\
- GST_DEBUG (0,"%d %p\n", i, value);\
- factory[i++] = value; \
- if (i >= size) { \
- size += 16; \
- factory = (GstPropsFactoryEntry *) g_realloc (factory, size*sizeof(GstPropsFactoryEntry));\
- }\
-}
+ g_mutex_lock (_gst_props_chunk_lock);
+ props = g_mem_chunk_alloc (_gst_props_chunk);
+ g_mutex_unlock (_gst_props_chunk_lock);
+
+ props->properties = NULL;
+ props->refcount = 1;
- size = 16;
- factory = (GstPropsFactoryEntry *) g_malloc (size*sizeof(GstPropsFactoryEntry));
+ prop_name = firstname;
- va_start (var_args, entry);
- // property name
- value = (GstPropsFactoryEntry) entry;
-
// properties
- while (value) {
- if (!inlist) {
- // add name
- add_value (value);
+ while (prop_name) {
+ GstPropsEntry *entry;
+
+ g_mutex_lock (_gst_props_entries_chunk_lock);
+ entry = g_mem_chunk_alloc (_gst_props_entries_chunk);
+ g_mutex_unlock (_gst_props_entries_chunk_lock);
- // get value
- value = va_arg (var_args, GstPropsFactoryEntry);
- }
- switch (GPOINTER_TO_INT (value)) {
- case GST_PROPS_END_ID_NUM:
- g_assert (inlist == TRUE);
+ entry->propid = g_quark_from_string (prop_name);
+ gst_props_entry_fill (entry, &var_args);
- inlist = FALSE;
- skip = 0;
+ switch (entry->propstype) {
+ case GST_PROPS_INT_ID:
+ case GST_PROPS_INT_RANGE_ID:
+ case GST_PROPS_FLOAT_ID:
+ case GST_PROPS_FLOAT_RANGE_ID:
+ case GST_PROPS_FOURCC_ID:
+ case GST_PROPS_BOOL_ID:
+ case GST_PROPS_STRING_ID:
break;
- case GST_PROPS_LIST_ID_NUM:
- {
- g_assert (inlist == FALSE);
-
- skip = 0;
+ case GST_PROPS_LIST_ID:
+ g_return_val_if_fail (inlist == FALSE, NULL);
inlist = TRUE;
+ list_entry = entry;
+ list_entry->data.list_data.entries = NULL;
break;
- }
+ case GST_PROPS_END_ID:
+ g_return_val_if_fail (inlist == TRUE, NULL);
+ inlist = FALSE;
+ list_entry = NULL;
+ prop_name = va_arg (var_args, gchar*);
+ continue;
default:
- skip = _arg_len[GPOINTER_TO_INT (value)];
- break;
+ g_mutex_lock (_gst_props_entries_chunk_lock);
+ g_mem_chunk_free (_gst_props_entries_chunk, entry);
+ g_mutex_unlock (_gst_props_entries_chunk_lock);
+ g_assert_not_reached ();
+ break;
}
- do {
- add_value (value);
- value = va_arg (var_args, GstPropsFactoryEntry);
+
+ if (inlist && (list_entry != entry)) {
+ list_entry->data.list_data.entries = g_list_prepend (list_entry->data.list_data.entries, entry);
}
- while (skip--);
+ else {
+ props->properties = g_list_insert_sorted (props->properties, entry, props_compare_func);
+ }
+ if (!inlist)
+ prop_name = va_arg (var_args, gchar*);
}
- factory[i++] = NULL;
-
- props = gst_props_register (factory);
return props;
}
* gst_props_set:
* @props: the props to modify
* @name: the name of the entry to modify
- * @entry: The new value of the property entry
* @...: More property entries.
*
* Modifies the value of the given entry in the props struct.
* Returns: the new modified property structure.
*/
GstProps*
-gst_props_set (GstProps *props, const gchar *name, GstPropsFactoryEntry entry, ...)
+gst_props_set (GstProps *props, const gchar *name, ...)
{
GQuark quark;
GList *lentry;
lentry = g_list_find_custom (props->properties, GINT_TO_POINTER (quark), props_find_func);
if (lentry) {
- GstPropsEntry *thisentry;
- GstPropsFactoryEntry value;
+ GstPropsEntry *entry;
- thisentry = (GstPropsEntry *)lentry->data;
+ entry = (GstPropsEntry *)lentry->data;
- va_start (var_args, entry);
- // property name
- value = (GstPropsFactoryEntry) entry;
+ va_start (var_args, name);
- switch (GPOINTER_TO_INT (value)) {
- case GST_PROPS_INT_ID:
- thisentry->propstype = GST_PROPS_INT_ID_NUM;
- value = va_arg (var_args, GstPropsFactoryEntry);
- thisentry->data.int_data = GPOINTER_TO_INT (value);
- break;
- case GST_PROPS_FLOAT_ID:
- thisentry->propstype = GST_PROPS_FLOAT_ID_NUM;
- value = va_arg (var_args, GstPropsFactoryEntry);
- thisentry->data.float_data = *(gfloat*)value;
- break;
- case GST_PROPS_FOURCC_ID_NUM:
- thisentry->propstype = GST_PROPS_FOURCC_ID_NUM;
- value = va_arg (var_args, GstPropsFactoryEntry);
- thisentry->data.fourcc_data = GPOINTER_TO_INT (value);
- break;
- case GST_PROPS_BOOL_ID_NUM:
- thisentry->propstype = GST_PROPS_BOOL_ID_NUM;
- value = va_arg (var_args, GstPropsFactoryEntry);
- thisentry->data.bool_data = GPOINTER_TO_INT (value);
- break;
- case GST_PROPS_STRING_ID_NUM:
- thisentry->propstype = GST_PROPS_STRING_ID_NUM;
- value = va_arg (var_args, GstPropsFactoryEntry);
- thisentry->data.string_data.string = g_strdup (value);
- break;
- default:
- g_print("gstprops: type not allowed\n");
- break;
- }
+ gst_props_entry_fill (entry, &var_args);
+
+ va_end (var_args);
}
else {
g_print("gstprops: no property '%s' to change\n", name);
GST_DEBUG (0,"compare: %s %s\n", g_quark_to_string (entry1->propid),
g_quark_to_string (entry2->propid));
switch (entry1->propstype) {
- case GST_PROPS_LIST_ID_NUM:
+ case GST_PROPS_LIST_ID:
{
GList *entrylist = entry1->data.list_data.entries;
gboolean valid = TRUE; // innocent until proven guilty
return valid;
}
- case GST_PROPS_INT_RANGE_ID_NUM:
+ case GST_PROPS_INT_RANGE_ID:
switch (entry2->propstype) {
// a - b <---> a - c
- case GST_PROPS_INT_RANGE_ID_NUM:
+ case GST_PROPS_INT_RANGE_ID:
return (entry2->data.int_range_data.min <= entry1->data.int_range_data.min &&
entry2->data.int_range_data.max >= entry1->data.int_range_data.max);
- case GST_PROPS_LIST_ID_NUM:
+ case GST_PROPS_LIST_ID:
return gst_props_entry_check_list_compatibility (entry1, entry2);
default:
return FALSE;
}
break;
- case GST_PROPS_FLOAT_RANGE_ID_NUM:
+ case GST_PROPS_FLOAT_RANGE_ID:
switch (entry2->propstype) {
// a - b <---> a - c
- case GST_PROPS_FLOAT_RANGE_ID_NUM:
+ case GST_PROPS_FLOAT_RANGE_ID:
return (entry2->data.float_range_data.min <= entry1->data.float_range_data.min &&
entry2->data.float_range_data.max >= entry1->data.float_range_data.max);
- case GST_PROPS_LIST_ID_NUM:
+ case GST_PROPS_LIST_ID:
return gst_props_entry_check_list_compatibility (entry1, entry2);
default:
return FALSE;
}
break;
- case GST_PROPS_FOURCC_ID_NUM:
+ case GST_PROPS_FOURCC_ID:
switch (entry2->propstype) {
// b <---> a
- case GST_PROPS_FOURCC_ID_NUM:
+ case GST_PROPS_FOURCC_ID:
return (entry2->data.fourcc_data == entry1->data.fourcc_data);
// b <---> a,b,c
- case GST_PROPS_LIST_ID_NUM:
+ case GST_PROPS_LIST_ID:
return gst_props_entry_check_list_compatibility (entry1, entry2);
default:
return FALSE;
}
break;
- case GST_PROPS_INT_ID_NUM:
+ case GST_PROPS_INT_ID:
switch (entry2->propstype) {
// b <---> a - d
- case GST_PROPS_INT_RANGE_ID_NUM:
+ case GST_PROPS_INT_RANGE_ID:
return (entry2->data.int_range_data.min <= entry1->data.int_data &&
entry2->data.int_range_data.max >= entry1->data.int_data);
// b <---> a
- case GST_PROPS_INT_ID_NUM:
+ case GST_PROPS_INT_ID:
return (entry2->data.int_data == entry1->data.int_data);
// b <---> a,b,c
- case GST_PROPS_LIST_ID_NUM:
+ case GST_PROPS_LIST_ID:
return gst_props_entry_check_list_compatibility (entry1, entry2);
default:
return FALSE;
}
break;
- case GST_PROPS_FLOAT_ID_NUM:
+ case GST_PROPS_FLOAT_ID:
switch (entry2->propstype) {
// b <---> a - d
- case GST_PROPS_FLOAT_RANGE_ID_NUM:
+ case GST_PROPS_FLOAT_RANGE_ID:
return (entry2->data.float_range_data.min <= entry1->data.float_data &&
entry2->data.float_range_data.max >= entry1->data.float_data);
// b <---> a
- case GST_PROPS_FLOAT_ID_NUM:
+ case GST_PROPS_FLOAT_ID:
return (entry2->data.float_data == entry1->data.float_data);
// b <---> a,b,c
- case GST_PROPS_LIST_ID_NUM:
+ case GST_PROPS_LIST_ID:
return gst_props_entry_check_list_compatibility (entry1, entry2);
default:
return FALSE;
}
break;
- case GST_PROPS_BOOL_ID_NUM:
+ case GST_PROPS_BOOL_ID:
switch (entry2->propstype) {
// t <---> t
- case GST_PROPS_BOOL_ID_NUM:
+ case GST_PROPS_BOOL_ID:
return (entry2->data.bool_data == entry1->data.bool_data);
- case GST_PROPS_LIST_ID_NUM:
+ case GST_PROPS_LIST_ID:
return gst_props_entry_check_list_compatibility (entry1, entry2);
default:
return FALSE;
}
- case GST_PROPS_STRING_ID_NUM:
+ case GST_PROPS_STRING_ID:
switch (entry2->propstype) {
// t <---> t
- case GST_PROPS_STRING_ID_NUM:
+ case GST_PROPS_STRING_ID:
return (!strcmp (entry2->data.string_data.string, entry1->data.string_data.string));
- case GST_PROPS_LIST_ID_NUM:
+ case GST_PROPS_LIST_ID:
return gst_props_entry_check_list_compatibility (entry1, entry2);
default:
return FALSE;
gchar *str;
switch (entry->propstype) {
- case GST_PROPS_INT_ID_NUM:
+ case GST_PROPS_INT_ID:
subtree = xmlNewChild (parent, NULL, "int", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
str = g_strdup_printf ("%d", entry->data.int_data);
xmlNewProp (subtree, "value", str);
g_free(str);
break;
- case GST_PROPS_INT_RANGE_ID_NUM:
+ case GST_PROPS_INT_RANGE_ID:
subtree = xmlNewChild (parent, NULL, "range", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
str = g_strdup_printf ("%d", entry->data.int_range_data.min);
xmlNewProp (subtree, "max", str);
g_free(str);
break;
- case GST_PROPS_FLOAT_ID_NUM:
+ case GST_PROPS_FLOAT_ID:
subtree = xmlNewChild (parent, NULL, "float", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
str = g_strdup_printf ("%f", entry->data.float_data);
xmlNewProp (subtree, "value", str);
g_free(str);
break;
- case GST_PROPS_FLOAT_RANGE_ID_NUM:
+ case GST_PROPS_FLOAT_RANGE_ID:
subtree = xmlNewChild (parent, NULL, "floatrange", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
str = g_strdup_printf ("%f", entry->data.float_range_data.min);
xmlNewProp (subtree, "max", str);
g_free(str);
break;
- case GST_PROPS_FOURCC_ID_NUM:
+ case GST_PROPS_FOURCC_ID:
str = g_strdup_printf ("%4.4s", (gchar *)&entry->data.fourcc_data);
xmlAddChild (parent, xmlNewComment (str));
g_free(str);
xmlNewProp (subtree, "hexvalue", str);
g_free(str);
break;
- case GST_PROPS_BOOL_ID_NUM:
+ case GST_PROPS_BOOL_ID:
subtree = xmlNewChild (parent, NULL, "boolean", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
xmlNewProp (subtree, "value", (entry->data.bool_data ? "true" : "false"));
break;
- case GST_PROPS_STRING_ID_NUM:
+ case GST_PROPS_STRING_ID:
subtree = xmlNewChild (parent, NULL, "string", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
xmlNewProp (subtree, "value", entry->data.string_data.string);
GstPropsEntry *entry = (GstPropsEntry *) proplist->data;
switch (entry->propstype) {
- case GST_PROPS_LIST_ID_NUM:
+ case GST_PROPS_LIST_ID:
subtree = xmlNewChild (parent, NULL, "list", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
g_list_foreach (entry->data.list_data.entries, (GFunc) gst_props_save_thyself_func, subtree);
g_mutex_unlock (_gst_props_entries_chunk_lock);
if (!strcmp(field->name, "int")) {
- entry->propstype = GST_PROPS_INT_ID_NUM;
+ entry->propstype = GST_PROPS_INT_ID;
prop = xmlGetProp(field, "name");
entry->propid = g_quark_from_string (prop);
g_free (prop);
g_free (prop);
}
else if (!strcmp(field->name, "range")) {
- entry->propstype = GST_PROPS_INT_RANGE_ID_NUM;
+ entry->propstype = GST_PROPS_INT_RANGE_ID;
prop = xmlGetProp(field, "name");
entry->propid = g_quark_from_string (prop);
g_free (prop);
g_free (prop);
}
else if (!strcmp(field->name, "float")) {
- entry->propstype = GST_PROPS_FLOAT_ID_NUM;
+ entry->propstype = GST_PROPS_FLOAT_ID;
prop = xmlGetProp(field, "name");
entry->propid = g_quark_from_string (prop);
g_free (prop);
g_free (prop);
}
else if (!strcmp(field->name, "floatrange")) {
- entry->propstype = GST_PROPS_FLOAT_RANGE_ID_NUM;
+ entry->propstype = GST_PROPS_FLOAT_RANGE_ID;
prop = xmlGetProp(field, "name");
entry->propid = g_quark_from_string (prop);
g_free (prop);
g_free (prop);
}
else if (!strcmp(field->name, "boolean")) {
- entry->propstype = GST_PROPS_BOOL_ID_NUM;
+ entry->propstype = GST_PROPS_BOOL_ID;
prop = xmlGetProp(field, "name");
entry->propid = g_quark_from_string (prop);
g_free (prop);
g_free (prop);
}
else if (!strcmp(field->name, "fourcc")) {
- entry->propstype = GST_PROPS_FOURCC_ID_NUM;
+ entry->propstype = GST_PROPS_FOURCC_ID;
prop = xmlGetProp(field, "name");
entry->propid = g_quark_from_string (prop);
g_free (prop);
g_free (prop);
}
else if (!strcmp(field->name, "string")) {
- entry->propstype = GST_PROPS_STRING_ID_NUM;
+ entry->propstype = GST_PROPS_STRING_ID;
prop = xmlGetProp(field, "name");
entry->propid = g_quark_from_string (prop);
g_free (prop);
entry = g_mem_chunk_alloc (_gst_props_entries_chunk);
g_mutex_unlock (_gst_props_entries_chunk_lock);
- entry->propstype = GST_PROPS_LIST_ID_NUM;
+ entry->propstype = GST_PROPS_LIST_ID;
entry->data.list_data.entries = NULL;
prop = xmlGetProp (field, "name");
entry->propid = g_quark_from_string (prop);
return props;
}
-
-gfloat* _gst_props_floatpointer (gfloat f)
-{
- return &f;
-}
typedef struct _GstProps GstProps;
-typedef gpointer GstPropsFactoryEntry;
-typedef GstPropsFactoryEntry GstPropsFactory[];
-typedef GstPropsFactory *GstPropsListFactory[];
typedef enum {
- GST_PROPS_END_ID_NUM = 0,
- GST_PROPS_LIST_ID_NUM,
- GST_PROPS_INT_ID_NUM,
- GST_PROPS_INT_RANGE_ID_NUM,
- GST_PROPS_FLOAT_ID_NUM,
- GST_PROPS_FLOAT_RANGE_ID_NUM,
- GST_PROPS_FOURCC_ID_NUM,
- GST_PROPS_BOOL_ID_NUM,
- GST_PROPS_STRING_ID_NUM,
- GST_PROPS_LAST_ID_NUM = GST_PROPS_END_ID_NUM + 16,
+ GST_PROPS_END_ID = 0,
+ GST_PROPS_LIST_ID,
+ GST_PROPS_INT_ID,
+ GST_PROPS_INT_RANGE_ID,
+ GST_PROPS_FLOAT_ID,
+ GST_PROPS_FLOAT_RANGE_ID,
+ GST_PROPS_FOURCC_ID,
+ GST_PROPS_BOOL_ID,
+ GST_PROPS_STRING_ID,
+ GST_PROPS_LAST_ID = GST_PROPS_END_ID + 16,
} GstPropsId;
-#define GST_PROPS_END_ID GINT_TO_POINTER(GST_PROPS_END_ID_NUM)
-#define GST_PROPS_LIST_ID GINT_TO_POINTER(GST_PROPS_LIST_ID_NUM)
-#define GST_PROPS_INT_ID GINT_TO_POINTER(GST_PROPS_INT_ID_NUM)
-#define GST_PROPS_INT_RANGE_ID GINT_TO_POINTER(GST_PROPS_INT_RANGE_ID_NUM)
-#define GST_PROPS_FLOAT_ID GINT_TO_POINTER(GST_PROPS_FLOAT_ID_NUM)
-#define GST_PROPS_FLOAT_RANGE_ID GINT_TO_POINTER(GST_PROPS_FLOAT_RANGE_ID_NUM)
-#define GST_PROPS_FOURCC_ID GINT_TO_POINTER(GST_PROPS_FOURCC_ID_NUM)
-#define GST_PROPS_BOOL_ID GINT_TO_POINTER(GST_PROPS_BOOL_ID_NUM)
-#define GST_PROPS_STRING_ID GINT_TO_POINTER(GST_PROPS_STRING_ID_NUM)
-#define GST_PROPS_LAST_ID GINT_TO_POINTER(GST_PROPS_LAST_ID_NUM)
-
#define GST_MAKE_FOURCC(a,b,c,d) ((a)|(b)<<8|(c)<<16|(d)<<24)
#define GST_PROPS_LIST(a...) GST_PROPS_LIST_ID,##a,NULL
-#define GST_PROPS_INT(a) GST_PROPS_INT_ID,(GINT_TO_POINTER(a))
-#define GST_PROPS_INT_RANGE(a,b) GST_PROPS_INT_RANGE_ID,(GINT_TO_POINTER(a)),(GINT_TO_POINTER(b))
-#define GST_PROPS_FLOAT_STRING(a) GST_PROPS_FLOAT_ID,(a)
-#define GST_PROPS_FLOAT_RANGE_STRING(a,b) GST_PROPS_FLOAT_RANGE_ID,(a),(b)
-#define GST_PROPS_FLOAT(a) GST_PROPS_FLOAT_ID,(&(a))
-#define GST_PROPS_FLOAT_RANGE(a,b) GST_PROPS_FLOAT_RANGE_ID,(&(a)),(&(b))
-#define GST_PROPS_FOURCC(a) GST_PROPS_FOURCC_ID,(GINT_TO_POINTER(a))
-#define GST_PROPS_BOOLEAN(a) GST_PROPS_BOOL_ID,(GINT_TO_POINTER(a))
+#define GST_PROPS_INT(a) GST_PROPS_INT_ID,(a)
+#define GST_PROPS_INT_RANGE(a,b) GST_PROPS_INT_RANGE_ID,(a),(b)
+#define GST_PROPS_FLOAT(a) GST_PROPS_FLOAT_ID,(a)
+#define GST_PROPS_FLOAT_RANGE(a,b) GST_PROPS_FLOAT_RANGE_ID,(a),(b)
+#define GST_PROPS_FOURCC(a) GST_PROPS_FOURCC_ID,(a)
+#define GST_PROPS_BOOLEAN(a) GST_PROPS_BOOL_ID,(a)
#define GST_PROPS_STRING(a) GST_PROPS_STRING_ID,(a)
/* initialize the subsystem */
void _gst_props_initialize (void);
-GstProps* gst_props_register (GstPropsFactory factory);
-GstProps* gst_props_register_count (GstPropsFactory factory, guint *counter);
-
-GstProps* gst_props_new (GstPropsFactoryEntry entry, ...);
+GstProps* gst_props_new (const gchar *firstname, ...);
+GstProps* gst_props_newv (const gchar *firstname, va_list var_args);
void gst_props_unref (GstProps *props);
void gst_props_ref (GstProps *props);
gboolean gst_props_check_compatibility (GstProps *fromprops, GstProps *toprops);
-GstProps* gst_props_set (GstProps *props, const gchar *name, GstPropsFactoryEntry entry, ...);
+GstProps* gst_props_set (GstProps *props, const gchar *name, ...);
gint gst_props_get_int (GstProps *props, const gchar *name);
gulong gst_props_get_fourcc_int (GstProps *props, const gchar *name);
metaincludedir = $(includedir)/gst/meta
metainclude_HEADERS = \
- videoraw.h.old
+ spectrum.h
gstmediaplay_SOURCES = \
main.c
+libgstmediaplayincludedir = $(includedir)/gstplay
+libgstmediaplayinclude_HEADERS = \
+ gstplay.h
+
noinst_HEADERS = \
gstmediaplay.h \
gststatusarea.h \
callbacks.h \
- gstplay.h \
gstplayprivate.h
g_return_if_fail (GST_IS_PLAY (widget));
+ //g_print ("realize\n");
+
play = GST_PLAY (widget);
priv = (GstPlayPrivate *)play->priv;
/* FILL ME */
};
-static GstPadFactory tee_src_factory = {
- "src%d",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_REQUEST,
- NULL, /* no caps */
- NULL,
-};
+static GstPadTemplate*
+tee_src_factory_create (void)
+{
+ return
+ gst_padtemplate_new (
+ "src%d",
+ GST_PAD_SRC,
+ GST_PAD_REQUEST,
+ NULL /* no caps */
+ );
+}
static void gst_tee_class_init (GstTeeClass *klass);
gboolean
gst_tee_factory_init (GstElementFactory *factory)
{
- gst_tee_src_template = gst_padtemplate_new (&tee_src_factory);
+ gst_tee_src_template = tee_src_factory_create ();
gst_elementfactory_add_padtemplate (factory, gst_tee_src_template);
return TRUE;
g_assert (videosink != NULL);
testcaps = g_list_append (NULL,
- gst_caps_new_with_props ("test_caps",
+ gst_caps_new ("test_caps",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
static GstElement*
autoplug_caps (GstAutoplug *autoplug, gchar *mime1, gchar *mime2)
{
- GList *caps1, *caps2;
+ GstCaps *caps1, *caps2;
- caps1 = g_list_append (NULL, gst_caps_new ("tescaps1", mime1));
- caps2 = g_list_append (NULL, gst_caps_new ("tescaps2", mime2));
+ caps1 = gst_caps_new ("tescaps1", mime1, NULL);
+ caps2 = gst_caps_new ("tescaps2", mime2, NULL);
return gst_autoplug_to_caps (autoplug, caps1, caps2, NULL);
}
xmlSaveFile ("autoplug2_2.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug,
- g_list_append (NULL, gst_caps_new_with_props(
+ gst_caps_new(
"testcaps3",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (TRUE),
- NULL))),
- g_list_append (NULL, gst_caps_new("testcaps4","audio/raw")),
+ NULL)),
+ gst_caps_new("testcaps4","audio/raw", NULL),
NULL);
xmlSaveFile ("autoplug2_3.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug,
- g_list_append (NULL, gst_caps_new_with_props(
+ gst_caps_new(
"testcaps5",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (FALSE),
- NULL))),
- g_list_append (NULL, gst_caps_new("testcaps6", "video/raw")),
+ NULL)),
+ gst_caps_new("testcaps6", "video/raw", NULL),
NULL);
xmlSaveFile ("autoplug2_4.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug,
- g_list_append (NULL, gst_caps_new(
+ gst_caps_new(
"testcaps7",
- "video/avi")),
- g_list_append (NULL, gst_caps_new("testcaps8", "video/raw")),
- g_list_append (NULL, gst_caps_new("testcaps9", "audio/raw")),
+ "video/avi", NULL),
+ gst_caps_new("testcaps8", "video/raw", NULL),
+ gst_caps_new("testcaps9", "audio/raw", NULL),
NULL);
xmlSaveFile ("autoplug2_5.gst", gst_xml_write (element));
element = gst_autoplug_to_caps (autoplug,
- g_list_append (NULL, gst_caps_new_with_props(
+ gst_caps_new(
"testcaps10",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (TRUE),
- NULL))),
- g_list_append (NULL, gst_caps_new("testcaps10", "video/raw")),
- g_list_append (NULL, gst_caps_new("testcaps11", "audio/raw")),
+ NULL)),
+ gst_caps_new("testcaps10", "video/raw", NULL),
+ gst_caps_new("testcaps11", "audio/raw", NULL),
NULL);
xmlSaveFile ("autoplug2_6.gst", gst_xml_write (element));
autoplug2 = gst_autoplugfactory_make ("static");
element = gst_autoplug_to_renderers (autoplug,
- g_list_append (NULL, gst_caps_new ("mp3caps", "audio/mp3")), sink2, NULL);
+ gst_caps_new ("mp3caps", "audio/mp3", NULL), sink2, NULL);
xmlSaveFile ("autoplug3_1.gst", gst_xml_write (element));
element = gst_autoplug_to_renderers (autoplug,
- g_list_append (NULL, gst_caps_new ("mpeg1caps", "video/mpeg")), sink1, NULL);
+ gst_caps_new ("mpeg1caps", "video/mpeg", NULL), sink1, NULL);
if (element) {
xmlSaveFile ("autoplug3_2.gst", gst_xml_write (element));
}
element = gst_autoplug_to_caps (autoplug2,
- g_list_append (NULL, gst_caps_new_with_props(
+ gst_caps_new(
"testcaps3",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (TRUE),
- NULL))),
- g_list_append (NULL, gst_caps_new("testcaps4","audio/raw")),
+ NULL)),
+ gst_caps_new("testcaps4","audio/raw", NULL),
NULL);
if (element) {
xmlSaveFile ("autoplug3_3.gst", gst_xml_write (element));
}
element = gst_autoplug_to_caps (autoplug2,
- g_list_append (NULL, gst_caps_new_with_props(
+ gst_caps_new(
"testcaps5",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (FALSE),
- NULL))),
- g_list_append (NULL, gst_caps_new("testcaps6", "video/raw")),
+ NULL)),
+ gst_caps_new("testcaps6", "video/raw", NULL),
NULL);
if (element) {
xmlSaveFile ("autoplug3_4.gst", gst_xml_write (element));
}
element = gst_autoplug_to_caps (autoplug2,
- g_list_append (NULL, gst_caps_new(
+ gst_caps_new(
"testcaps7",
- "video/avi")),
- g_list_append (NULL, gst_caps_new("testcaps8", "video/raw")),
- g_list_append (NULL, gst_caps_new("testcaps9", "audio/raw")),
+ "video/avi", NULL),
+ gst_caps_new("testcaps8", "video/raw", NULL),
+ gst_caps_new("testcaps9", "audio/raw", NULL),
NULL);
if (element) {
xmlSaveFile ("autoplug3_5.gst", gst_xml_write (element));
}
element = gst_autoplug_to_caps (autoplug2,
- g_list_append (NULL, gst_caps_new_with_props(
+ gst_caps_new(
"testcaps10",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (TRUE),
- NULL))),
- g_list_append (NULL, gst_caps_new("testcaps10", "video/raw")),
- g_list_append (NULL, gst_caps_new("testcaps11", "audio/raw")),
+ NULL)),
+ gst_caps_new("testcaps10", "video/raw", NULL),
+ gst_caps_new("testcaps11", "audio/raw", NULL),
NULL);
if (element) {
xmlSaveFile ("autoplug3_6.gst", gst_xml_write (element));
sink2 = gst_elementfactory_make ("osssink", "osssink");
element = gst_autoplug_to_renderers (autoplug,
- g_list_append (NULL, gst_caps_new_with_props(
+ gst_caps_new(
"testcaps10",
"video/mpeg",
gst_props_new (
"mpegversion", GST_PROPS_INT (1),
"systemstream", GST_PROPS_BOOLEAN (TRUE),
- NULL))),
+ NULL)),
sink1,
sink2,
NULL);
#include <gst/gst.h>
-static GstCapsFactory mpeg2dec_sink_caps = {
- "mpeg2dec_sink",
- "video/mpeg",
- "mpegtype", GST_PROPS_LIST (
- GST_PROPS_INT(1),
- GST_PROPS_INT(2)
- ),
- NULL
-};
-
-static GstCapsFactory mp1parse_src_caps = {
- "mp1parse_src",
- "video/mpeg",
- "mpegtype", GST_PROPS_LIST (
- GST_PROPS_INT(1)
- ),
- NULL
-};
-
-static GstCapsFactory mpeg2dec_src_caps = {
- "mpeg2dec_src",
- "video/raw",
- "fourcc", GST_PROPS_LIST (
- GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','V','1','2')),
- GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','U','Y','2'))
- ),
- "width", GST_PROPS_INT_RANGE (16, 4096),
- "height", GST_PROPS_INT_RANGE (16, 4096),
- NULL
-};
-
-static GstCapsFactory raw_sink_caps = {
- "raw_sink_caps",
- "video/raw",
- "fourcc", GST_PROPS_LIST (
- GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','V','1','2'))
+static GstCaps*
+mpeg2dec_sink_caps (void)
+{
+ return
+ gst_caps_new (
+ "mpeg2dec_sink",
+ "video/mpeg",
+ gst_props_new (
+ "mpegtype", GST_PROPS_LIST (
+ GST_PROPS_INT(1),
+ GST_PROPS_INT(2)
+ ),
+ NULL
+ )
+ );
+}
+
+static GstCaps*
+mp1parse_src_caps (void)
+{
+ return
+ gst_caps_new (
+ "mp1parse_src",
+ "video/mpeg",
+ gst_props_new (
+ "mpegtype", GST_PROPS_LIST (
+ GST_PROPS_INT(1)
+ ),
+ NULL
+ )
+ );
+}
+
+static GstCaps*
+mpeg2dec_src_caps (void)
+{
+ return
+ gst_caps_new (
+ "mpeg2dec_src",
+ "video/raw",
+ gst_props_new (
+ "fourcc", GST_PROPS_LIST (
+ GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','V','1','2')),
+ GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','U','Y','2'))
),
- "height", GST_PROPS_INT_RANGE (16, 256),
- NULL
-};
-
-static GstCapsFactory raw2_sink_caps = {
- "raw2_sink_caps",
- "video/raw",
- "fourcc", GST_PROPS_LIST (
+ "width", GST_PROPS_INT_RANGE (16, 4096),
+ "height", GST_PROPS_INT_RANGE (16, 4096),
+ NULL
+ )
+ );
+}
+
+static GstCaps*
+raw_sink_caps (void)
+{
+ return
+ gst_caps_new (
+ "raw_sink_caps",
+ "video/raw",
+ gst_props_new (
+ "fourcc", GST_PROPS_LIST (
+ GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','V','1','2'))
+ ),
+ "height", GST_PROPS_INT_RANGE (16, 256),
+ NULL
+ )
+ );
+}
+
+static GstCaps*
+raw2_sink_caps (void)
+{
+ return
+ gst_caps_new (
+ "raw2_sink_caps",
+ "video/raw",
+ gst_props_new (
+ "fourcc", GST_PROPS_LIST (
GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','V','1','2')),
- GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','U','Y','V'))
- ),
- "height", GST_PROPS_INT_RANGE (16, 4096),
- NULL
-};
+ GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','U','Y','2'))
+ ),
+ "height", GST_PROPS_INT_RANGE (16, 4096),
+ NULL
+ )
+ );
+}
+
+static GstCaps*
+get_testcaps (void)
+{
+ return
+ gst_caps_new (
+ "raw2_sink_caps",
+ "video/raw",
+ gst_props_new (
+ "fourcc", GST_PROPS_LIST (
+ GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','V','1','2')),
+ GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','U','Y','V'))
+ ),
+ "height", GST_PROPS_INT_RANGE (16, 4096),
+ NULL
+ )
+ );
+}
static GstCaps *sinkcaps = NULL,
*rawcaps = NULL,
*rawcaps3 = NULL,
*mp1parsecaps = NULL;
-int main(int argc,char *argv[])
+int
+main (int argc, char *argv[])
{
gboolean testret;
xmlDocPtr doc;
doc = xmlNewDoc ("1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
+ g_thread_init (NULL);
_gst_type_initialize ();
+ _gst_props_initialize ();
+ _gst_caps_initialize ();
- sinkcaps = gst_caps_register (&mpeg2dec_sink_caps);
+ sinkcaps = mpeg2dec_sink_caps ();
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities1", NULL);
gst_caps_save_thyself (sinkcaps, parent);
- rawcaps = gst_caps_register (&mpeg2dec_src_caps);
+ rawcaps = mpeg2dec_src_caps ();
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities2", NULL);
gst_caps_save_thyself (rawcaps, parent);
- rawcaps2 = gst_caps_register (&raw_sink_caps);
+ rawcaps2 = raw_sink_caps ();
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities3", NULL);
gst_caps_save_thyself (rawcaps2, parent);
- mp1parsecaps = gst_caps_register (&mp1parse_src_caps);
+ mp1parsecaps = mp1parse_src_caps ();
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities4", NULL);
gst_caps_save_thyself (mp1parsecaps, parent);
- rawcaps3 = gst_caps_register (&raw2_sink_caps);
+ rawcaps3 = raw2_sink_caps ();
parent = xmlNewChild (doc->xmlRootNode, NULL, "Capabilities5", NULL);
gst_caps_save_thyself (rawcaps3, parent);
* can have. They can be quite complex, but for this example plugin
* they are rather simple.
*/
-static GstPadFactory sink_factory = {
- "sink", /* The name of the pad */
- GST_PAD_FACTORY_SINK, /* Direction of the pad */
- GST_PAD_FACTORY_ALWAYS, /* The pad exists for every instance */
- GST_PAD_FACTORY_CAPS( /* This factory has specific capabilities */
- "example_sink", /* The name of the caps */
- "unknown/unknown", /* The overall MIME/type */
- "foo", GST_PROPS_INT (1), /* An integer property */
- "bar", GST_PROPS_BOOLEAN (TRUE), /* A boolean */
- "baz", GST_PROPS_LIST ( /* A list of values for */
- GST_PROPS_INT (1),
- GST_PROPS_INT (3)
- )
- ),
- NULL /* All factories must be NULL-terminated */
-};
+static GstPadTemplate*
+sink_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "sink", /* The name of the pad */
+ GST_PAD_SINK, /* Direction of the pad */
+ GST_PAD_ALWAYS, /* The pad exists for every instance */
+ gst_caps_new (
+ "example_sink", /* The name of the caps */
+ "unknown/unknown", /* The overall MIME/type */
+ gst_props_new (
+ "foo", GST_PROPS_INT (1), /* An integer property */
+ "bar", GST_PROPS_BOOLEAN (TRUE), /* A boolean */
+ "baz", GST_PROPS_LIST ( /* A list of values for */
+ GST_PROPS_INT (1),
+ GST_PROPS_INT (3)
+ ),
+ NULL)));
+}
/* This factory is much simpler, and defines the source pad. */
-static GstPadFactory src_factory = {
- "src",
- GST_PAD_FACTORY_SRC,
- GST_PAD_FACTORY_ALWAYS,
- GST_PAD_FACTORY_CAPS(
- "example_src",
- "unknown/unknown"
- ),
- NULL
-};
+static GstPadTemplate*
+src_factory (void)
+{
+ return
+ gst_padtemplate_new (
+ "src",
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ gst_caps_new (
+ "example_src",
+ "unknown/unknown",
+ NULL));
+}
/* A number of functon prototypes are given so we can refer to them later. */
* Note that the generated padtemplates are stored in static global
* variables, for the gst_example_init function to use later on.
*/
- sink_template = gst_padtemplate_new (&sink_factory);
+ sink_template = sink_factory ();
gst_elementfactory_add_padtemplate (factory, sink_template);
- src_template = gst_padtemplate_new (&src_factory);
+ src_template = src_factory ();
gst_elementfactory_add_padtemplate (factory, src_template);
/* The very last thing is to register the elementfactory with the plugin. */
#include <gst/gst.h>
-static GstPropsFactory mpeg2dec_sink_props = {
- "mpegtype", GST_PROPS_LIST (
+static GstProps* mpeg2dec_sink_props_register (void) {
+ return gst_props_new (
+ "mpegtype", GST_PROPS_LIST (
GST_PROPS_INT(1),
GST_PROPS_INT(2)
),
- NULL
-};
+ NULL);
+}
-static GstPropsFactory mpeg2dec_src_props = {
- "fourcc", GST_PROPS_LIST (
+static GstProps* mpeg2dec_src_props_register (void) {
+ return gst_props_new (
+ "fourcc", GST_PROPS_LIST (
GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','V','1','2')),
GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','U','Y','2'))
),
- "width", GST_PROPS_INT_RANGE (16, 4096),
- "height", GST_PROPS_INT_RANGE (16, 4096),
- NULL
-};
+ "width", GST_PROPS_INT_RANGE (16, 4096),
+ "height", GST_PROPS_INT_RANGE (16, 4096),
+ NULL);
+}
static GstProps *sinkprops = NULL,
*rawprops = NULL,
doc = xmlNewDoc ("1.0");
doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Properties", NULL);
- _gst_type_initialize ();
+ g_thread_init (NULL);
+ _gst_props_initialize ();
- sinkprops = gst_props_register (mpeg2dec_sink_props);
+ sinkprops = mpeg2dec_sink_props_register ();
parent = xmlNewChild (doc->xmlRootNode, NULL, "Props1", NULL);
gst_props_save_thyself (sinkprops, parent);
- rawprops = gst_props_register (mpeg2dec_src_props);
+ rawprops = mpeg2dec_src_props_register ();
parent = xmlNewChild (doc->xmlRootNode, NULL, "Props2", NULL);
gst_props_save_thyself (rawprops, parent);
printf(pfx);
switch (prop->propstype) {
- case GST_PROPS_INT_ID_NUM:
+ case GST_PROPS_INT_ID:
printf("Integer: %d\n",prop->data.int_data);
break;
- case GST_PROPS_INT_RANGE_ID_NUM:
+ case GST_PROPS_INT_RANGE_ID:
printf("Integer range: %d - %d\n",prop->data.int_range_data.min,
prop->data.int_range_data.max);
break;
- case GST_PROPS_BOOL_ID_NUM:
+ case GST_PROPS_BOOL_ID:
printf("Boolean: %s\n",prop->data.bool_data ? "TRUE" : "FALSE");
break;
- case GST_PROPS_STRING_ID_NUM:
+ case GST_PROPS_STRING_ID:
printf("String: %s\n",prop->data.string_data.string);
break;
- case GST_PROPS_FOURCC_ID_NUM:
+ case GST_PROPS_FOURCC_ID:
printf("FourCC: %c%c%c%c\n",
prop->data.fourcc_data & 0xff,prop->data.fourcc_data>>8 & 0xff,
prop->data.fourcc_data>>16 & 0xff,prop->data.fourcc_data>>24 & 0xff);
break;
- case GST_PROPS_LIST_ID_NUM:
+ case GST_PROPS_LIST_ID:
printf("List:\n");
longprefix = g_strdup_printf("%s ",pfx);
list = prop->data.list_data.entries;