GstProps

Name

GstProps -- Properties

Synopsis


#include <gst/gst.h>


struct      GstProps;
#define     GST_MAKE_FOURCC                 (a,b,c,d)
#define     GST_STR_FOURCC                  (f)
#define     GST_PROPS_LIST                  (a...)
#define     GST_PROPS_INT                   (a)
#define     GST_PROPS_INT_ANY
#define     GST_PROPS_INT_RANGE             (a,b)
#define     GST_PROPS_INT_NEGATIVE
#define     GST_PROPS_FOURCC                (a)
#define     GST_PROPS_BOOLEAN               (a)
#define     GST_PROPS_STRING                (a)
#define     GST_PROPS_FLOAT                 (a)
#define     GST_PROPS_FLOAT_RANGE           (a,b)
#define     GST_PROPS_INT_POSITIVE
#define     GST_PROPS_ENTRY_IS_VARIABLE     (a)
GstProps*   gst_props_new                   (const gchar *firstname,
                                             ...);
GstProps*   gst_props_newv                  (const gchar *firstname,
                                             va_list var_args);
GstProps*   gst_props_merge                 (GstProps *props,
                                             GstProps *tomerge);
GstProps*   gst_props_copy                  (GstProps *props);
GstProps*   gst_props_copy_on_write         (GstProps *props);
void        gst_props_destroy               (GstProps *props);
void        gst_props_ref                   (GstProps *props);
void        gst_props_unref                 (GstProps *props);
gboolean    gst_props_check_compatibility   (GstProps *fromprops,
                                             GstProps *toprops);
gboolean    gst_props_has_property          (GstProps *props,
                                             const gchar *name);
GList*      gst_props_normalize             (GstProps *props);
GstProps*   gst_props_set                   (GstProps *props,
                                             const gchar *name,
                                             ...);
gboolean    gst_props_get_boolean           (GstProps *props,
                                             const gchar *name);
gulong      gst_props_get_fourcc_int        (GstProps *props,
                                             const gchar *name);
gint        gst_props_get_int               (GstProps *props,
                                             const gchar *name);
const gchar* gst_props_get_string           (GstProps *props,
                                             const gchar *name);
gfloat      gst_props_get_float             (GstProps *props,
                                             const gchar *name);
GstProps*   gst_props_intersect             (GstProps *props1,
                                             GstProps *props2);
void        gst_props_debug                 (GstProps *props);
xmlNodePtr  gst_props_save_thyself          (GstProps *props,
                                             xmlNodePtr parent);
GstProps*   gst_props_load_thyself          (xmlNodePtr parent);

Description

GstProps is used to attach certain properties to a pad. Properties are usually used in conjunction with GstCaps.

Details

struct GstProps

struct GstProps {
  gint refcount;
  GMutex *lock;
  gboolean fixed;

  GList *properties;		/* real properties for this property */
};

gint refcount 
GMutex *lock 
gboolean fixed 
GList *propertiesthe properties


GST_MAKE_FOURCC()

#define GST_MAKE_FOURCC(a,b,c,d) 	((a)|(b)<<8|(c)<<16|(d)<<24)

Create a FOURCC value that can easily be used to construct a fourcc property.
  ...
  "format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y','U','Y','2')),
  ...

a :first fourcc byte
b :second fourcc byte
c :third fourcc byte
d :fourth fourcc byte


GST_STR_FOURCC()

#define GST_STR_FOURCC(f)		(((f)[0])|((f)[1]<<8)|((f)[2]<<16)|((f)[3]<<24))

Create a FOURCC value from a string. example:
  ...
  "format", GST_PROPS_FOURCC (GST_STR_FOURCC ("YUY2")),
  ...

f :the string describing the fourcc value.


GST_PROPS_LIST()

#define GST_PROPS_LIST(a...) 		GST_PROPS_LIST_ID,##a,NULL

Create a list of properties.

a... :the list of GstProps


GST_PROPS_INT()

#define GST_PROPS_INT(a) 		GST_PROPS_INT_ID,(a)

Create an integer property.

a :the integer property


GST_PROPS_INT_ANY

#define GST_PROPS_INT_ANY		GST_PROPS_INT_RANGE(G_MININT,G_MAXINT)


GST_PROPS_INT_RANGE()

#define GST_PROPS_INT_RANGE(a,b) 	GST_PROPS_INT_RANGE_ID,(a),(b)

Create an integer range property.

a :the min value for the range
b :the max value for the range


GST_PROPS_INT_NEGATIVE

#define GST_PROPS_INT_NEGATIVE		GST_PROPS_INT_RANGE(G_MININT,0)


GST_PROPS_FOURCC()

#define GST_PROPS_FOURCC(a) 		GST_PROPS_FOURCC_ID,(a)

Construct a fourcc property out of four bytes.

a :a fourcc value usualy created with GST_FOURCC_MAKE()


GST_PROPS_BOOLEAN()

#define GST_PROPS_BOOLEAN(a) 		GST_PROPS_BOOL_ID,(a)

Create a boolean property.

a :the boolean property


GST_PROPS_STRING()

#define GST_PROPS_STRING(a) 		GST_PROPS_STRING_ID,(a)

Create a string value.

a :the string value.


GST_PROPS_FLOAT()

#define GST_PROPS_FLOAT(a) 		GST_PROPS_FLOAT_ID,(a)

Create a floating point value.

a :the float value


GST_PROPS_FLOAT_RANGE()

#define GST_PROPS_FLOAT_RANGE(a,b) 	GST_PROPS_FLOAT_RANGE_ID,(a),(b)

Create a float range value.

a :lower float bounds
b :upper float bounds


GST_PROPS_INT_POSITIVE

#define GST_PROPS_INT_POSITIVE		GST_PROPS_INT_RANGE(0,G_MAXINT)


GST_PROPS_ENTRY_IS_VARIABLE()

#define GST_PROPS_ENTRY_IS_VARIABLE(a)	(((GstPropsEntry*)(a))->propstype > GST_PROPS_VAR_ID)

a : 


gst_props_new ()

GstProps*   gst_props_new                   (const gchar *firstname,
                                             ...);

Create a new property from the given key/value pairs

firstname : the first property name
... : the property values
Returns : the new property


gst_props_newv ()

GstProps*   gst_props_newv                  (const gchar *firstname,
                                             va_list var_args);

Create a new property from the list of entries.

firstname : the first property name
var_args : the property values
Returns : the new property created from the list of entries


gst_props_merge ()

GstProps*   gst_props_merge                 (GstProps *props,
                                             GstProps *tomerge);

Merge the properties of tomerge into props.

props : the property to merge into
tomerge : the property to merge
Returns : the new merged property


gst_props_copy ()

GstProps*   gst_props_copy                  (GstProps *props);

Copy the property structure.

props : the props to copy
Returns : the new property that is a copy of the original one.


gst_props_copy_on_write ()

GstProps*   gst_props_copy_on_write         (GstProps *props);

Copy the property structure if the refcount is >1.

props : the props to copy on write
Returns : A new props that can be safely written to.


gst_props_destroy ()

void        gst_props_destroy               (GstProps *props);

Destroy the property, freeing all the memory that was allocated.

props : the props to destroy


gst_props_ref ()

void        gst_props_ref                   (GstProps *props);

Increase the refcount of the property structure.

props : the props to ref


gst_props_unref ()

void        gst_props_unref                 (GstProps *props);

Decrease the refcount of the property structure, destroying the property if the refcount is 0.

props : the props to unref


gst_props_check_compatibility ()

gboolean    gst_props_check_compatibility   (GstProps *fromprops,
                                             GstProps *toprops);

Checks whether two capabilities are compatible.

fromprops : a property
toprops : a property
Returns : TRUE if compatible, FALSE otherwise


gst_props_has_property ()

gboolean    gst_props_has_property          (GstProps *props,
                                             const gchar *name);

props : 
name : 
Returns : 


gst_props_normalize ()

GList*      gst_props_normalize             (GstProps *props);

props : 
Returns : 


gst_props_set ()

GstProps*   gst_props_set                   (GstProps *props,
                                             const gchar *name,
                                             ...);

Modifies the value of the given entry in the props struct. For the optional args, use GST_PROPS_FOO, where FOO is INT, STRING, etc. This macro expands to a variable number of arguments, hence the lack of precision in the function prototype. No terminating NULL is necessary.

props : the props to modify
name : the name of the entry to modify
... : The prop entry.
Returns : the new modified property structure.


gst_props_get_boolean ()

gboolean    gst_props_get_boolean           (GstProps *props,
                                             const gchar *name);

Get the named entry as a boolean value.

props : the props to get the fourcc value from
name : the name of the props entry to get.
Returns : the boolean value of the named entry, 0 if not found.


gst_props_get_fourcc_int ()

gulong      gst_props_get_fourcc_int        (GstProps *props,
                                             const gchar *name);

Get the named entry as a gulong fourcc.

props : the props to get the fourcc value from
name : the name of the props entry to get.
Returns : the fourcc value of the named entry, 0 if not found.


gst_props_get_int ()

gint        gst_props_get_int               (GstProps *props,
                                             const gchar *name);

Get the named entry as an integer.

props : the props to get the int value from
name : the name of the props entry to get.
Returns : the integer value of the named entry, 0 if not found.


gst_props_get_string ()

const gchar* gst_props_get_string           (GstProps *props,
                                             const gchar *name);

Get the named entry as a string value.

props : the props to get the fourcc value from
name : the name of the props entry to get.
Returns : the string value of the named entry, NULL if not found.


gst_props_get_float ()

gfloat      gst_props_get_float             (GstProps *props,
                                             const gchar *name);

Get the named entry as a float.

props : the props to get the float value from
name : the name of the props entry to get.
Returns : the float value of the named entry, 0.0 if not found.


gst_props_intersect ()

GstProps*   gst_props_intersect             (GstProps *props1,
                                             GstProps *props2);

Calculates the intersection bewteen two GstProps.

props1 : a property
props2 : another property
Returns : a GstProps with the intersection or NULL if the intersection is empty.


gst_props_debug ()

void        gst_props_debug                 (GstProps *props);

props : 


gst_props_save_thyself ()

xmlNodePtr  gst_props_save_thyself          (GstProps *props,
                                             xmlNodePtr parent);

Saves the property into an XML representation.

props : a property to save
parent : the parent XML tree
Returns : the new XML tree


gst_props_load_thyself ()

GstProps*   gst_props_load_thyself          (xmlNodePtr parent);

Creates a new property out of an XML tree.

parent : the XML tree to load from
Returns : the new property

See Also

GstCaps