GstProps

Name

GstProps -- Properties

Synopsis


#include <gst/gst.h>


struct      GstProps;
enum        GstPropsType;
#define     GST_TYPE_PROPS
#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
struct      GstPropsEntry;
GstProps*   gst_props_new                   (const gchar *firstname,
                                             ...);
GstProps*   gst_props_newv                  (const gchar *firstname,
                                             va_list var_args);
GstProps*   gst_props_empty_new             (void);
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                   (GstProps *props,
                                             gchar *first_name,
                                             ...);
gboolean    gst_props_get_safe              (GstProps *props,
                                             gchar *first_name,
                                             ...);
gboolean    gst_props_has_property          (GstProps *props,
                                             const gchar *name);
gboolean    gst_props_has_fixed_property    (GstProps *props,
                                             const gchar *name);
gboolean    gst_props_has_property_typed    (GstProps *props,
                                             const gchar *name,
                                             GstPropsType type);
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);
const GstPropsEntry* gst_props_get_entry    (GstProps *props,
                                             const gchar *name);
void        gst_props_add_entry             (GstProps *props,
                                             GstPropsEntry *entry);
GstPropsEntry* gst_props_entry_new          (const gchar *name,
                                             ...);
gboolean    gst_props_entry_get             (const GstPropsEntry *entry,
                                             ...);
gboolean    gst_props_entry_get_boolean     (const GstPropsEntry *entry,
                                             gboolean *val);
gboolean    gst_props_entry_get_float       (const GstPropsEntry *entry,
                                             gfloat *val);
gboolean    gst_props_entry_get_float_range (const GstPropsEntry *entry,
                                             gfloat *min,
                                             gfloat *max);
gboolean    gst_props_entry_get_fourcc_int  (const GstPropsEntry *entry,
                                             guint32 *val);
gboolean    gst_props_entry_get_int         (const GstPropsEntry *entry,
                                             gint *val);
gboolean    gst_props_entry_get_int_range   (const GstPropsEntry *entry,
                                             gint *min,
                                             gint *max);
gboolean    gst_props_entry_get_list        (const GstPropsEntry *entry,
                                             const GList **val);
const gchar* gst_props_entry_get_name       (const GstPropsEntry *entry);
gboolean    gst_props_entry_get_string      (const GstPropsEntry *entry,
                                             const gchar **val);
GstPropsType gst_props_entry_get_type       (const GstPropsEntry *entry);
gboolean    gst_props_entry_is_fixed        (const GstPropsEntry *entry);

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;
  gboolean fixed;

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


enum GstPropsType

typedef enum {
   GST_PROPS_END_TYPE = 0,

   GST_PROPS_INVALID_TYPE,

   GST_PROPS_INT_TYPE,
   GST_PROPS_FLOAT_TYPE,
   GST_PROPS_FOURCC_TYPE,
   GST_PROPS_BOOL_TYPE,
   GST_PROPS_STRING_TYPE,

   GST_PROPS_VAR_TYPE,   /* after this marker start the variable properties */

   GST_PROPS_LIST_TYPE,
   GST_PROPS_FLOAT_RANGE_TYPE,
   GST_PROPS_INT_RANGE_TYPE,

   GST_PROPS_LAST_TYPE = GST_PROPS_END_TYPE + 16
} GstPropsType;


GST_TYPE_PROPS

#define GST_TYPE_PROPS	(_get_props_type)

The GType of the props boxed type, for use in GValues.


GST_MAKE_FOURCC()

#define GST_MAKE_FOURCC(a,b,c,d) 	(guint32)((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')),
  ...


GST_STR_FOURCC()

#define GST_STR_FOURCC(f)		(guint32)(((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")),
  ...


GST_PROPS_LIST()

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

Create a list of properties.


GST_PROPS_INT()

#define GST_PROPS_INT(a) 		GST_PROPS_INT_TYPE,(a)

Create an integer property.


GST_PROPS_INT_ANY

#define GST_PROPS_INT_ANY		GST_PROPS_INT_RANGE(G_MININT,G_MAXINT)

Create an integer property that can hold any int.


GST_PROPS_INT_RANGE()

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

Create an integer range property.


GST_PROPS_INT_NEGATIVE

#define GST_PROPS_INT_NEGATIVE		GST_PROPS_INT_RANGE(G_MININT,0)

Create an integer property that can hold negative ints.


GST_PROPS_FOURCC()

#define GST_PROPS_FOURCC(a) 		GST_PROPS_FOURCC_TYPE,(a)

Construct a fourcc property out of four bytes.


GST_PROPS_BOOLEAN()

#define GST_PROPS_BOOLEAN(a) 		GST_PROPS_BOOL_TYPE,(a)

Create a boolean property.


GST_PROPS_STRING()

#define GST_PROPS_STRING(a) 		GST_PROPS_STRING_TYPE,(a)

Create a string value.


GST_PROPS_FLOAT()

#define GST_PROPS_FLOAT(a) 		GST_PROPS_FLOAT_TYPE,(a)

Create a floating point value.


GST_PROPS_FLOAT_RANGE()

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

Create a float range value.


GST_PROPS_INT_POSITIVE

#define GST_PROPS_INT_POSITIVE		GST_PROPS_INT_RANGE(0,G_MAXINT)

Create an integer property that can hold positive ints.


struct GstPropsEntry

struct GstPropsEntry;

An entry hols one key/value pair.


gst_props_new ()

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

Create a new property from the given key/value pairs


gst_props_newv ()

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

Create a new property from the list of entries.


gst_props_empty_new ()

GstProps*   gst_props_empty_new             (void);

Create a new empty property.


gst_props_merge ()

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

Merge the properties of tomerge into props.


gst_props_copy ()

GstProps*   gst_props_copy                  (GstProps *props);

Copy the property structure.


gst_props_copy_on_write ()

GstProps*   gst_props_copy_on_write         (GstProps *props);

Copy the property structure if the refcount is >1.


gst_props_destroy ()

void        gst_props_destroy               (GstProps *props);

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


gst_props_ref ()

void        gst_props_ref                   (GstProps *props);

Increase the refcount of the property structure.


gst_props_unref ()

void        gst_props_unref                 (GstProps *props);

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


gst_props_check_compatibility ()

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

Checks whether two capabilities are compatible.


gst_props_has_property ()

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

Checks if a given props has a property with the given name.


gst_props_normalize ()

GList*      gst_props_normalize             (GstProps *props);

Unrolls all lists in the given GstProps. This is usefull if you want to loop over the props.


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 as only one property can be changed.


gst_props_get ()

gboolean    gst_props_get                   (GstProps *props,
                                             gchar *first_name,
                                             ...);

Gets the contents of the props into given key/value pairs.


gst_props_get_safe ()

gboolean    gst_props_get_safe              (GstProps *props,
                                             gchar *first_name,
                                             ...);

Gets the contents of the props into given key/value pairs.


gst_props_has_property ()

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

Checks if a given props has a property with the given name.


gst_props_has_fixed_property ()

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

Checks if a given props has a property with the given name that is also fixed, ie. is not a list or a range.


gst_props_has_property_typed ()

gboolean    gst_props_has_property_typed    (GstProps *props,
                                             const gchar *name,
                                             GstPropsType type);

Checks if a given props has a property with the given name and the given type.


gst_props_intersect ()

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

Calculates the intersection bewteen two GstProps.


gst_props_debug ()

void        gst_props_debug                 (GstProps *props);

Dump the contents of the given properties into the DEBUG log.


gst_props_save_thyself ()

xmlNodePtr  gst_props_save_thyself          (GstProps *props,
                                             xmlNodePtr parent);

Saves the property into an XML representation.


gst_props_load_thyself ()

GstProps*   gst_props_load_thyself          (xmlNodePtr parent);

Creates a new property out of an XML tree.


gst_props_get_entry ()

const GstPropsEntry* gst_props_get_entry    (GstProps *props,
                                             const gchar *name);

Get the props entry with the geven name


gst_props_add_entry ()

void        gst_props_add_entry             (GstProps *props,
                                             GstPropsEntry *entry);

Addes the given propsentry to the props


gst_props_entry_new ()

GstPropsEntry* gst_props_entry_new          (const gchar *name,
                                             ...);

Create a new property entry with the given key/value.


gst_props_entry_get ()

gboolean    gst_props_entry_get             (const GstPropsEntry *entry,
                                             ...);

Gets the contents of the entry.


gst_props_entry_get_boolean ()

gboolean    gst_props_entry_get_boolean     (const GstPropsEntry *entry,
                                             gboolean *val);

Get the contents of the entry into the given gboolean.


gst_props_entry_get_float ()

gboolean    gst_props_entry_get_float       (const GstPropsEntry *entry,
                                             gfloat *val);

Get the contents of the entry into the given gfloat.


gst_props_entry_get_float_range ()

gboolean    gst_props_entry_get_float_range (const GstPropsEntry *entry,
                                             gfloat *min,
                                             gfloat *max);

Get the contents of the entry into the given gfloats.


gst_props_entry_get_fourcc_int ()

gboolean    gst_props_entry_get_fourcc_int  (const GstPropsEntry *entry,
                                             guint32 *val);

Get the contents of the entry into the given guint32.


gst_props_entry_get_int ()

gboolean    gst_props_entry_get_int         (const GstPropsEntry *entry,
                                             gint *val);

Get the contents of the entry into the given gint.


gst_props_entry_get_int_range ()

gboolean    gst_props_entry_get_int_range   (const GstPropsEntry *entry,
                                             gint *min,
                                             gint *max);

Get the contents of the entry into the given gints.


gst_props_entry_get_list ()

gboolean    gst_props_entry_get_list        (const GstPropsEntry *entry,
                                             const GList **val);

Get the contents of the entry into the given GList.


gst_props_entry_get_name ()

const gchar* gst_props_entry_get_name       (const GstPropsEntry *entry);

Get the name of the given props entry.


gst_props_entry_get_string ()

gboolean    gst_props_entry_get_string      (const GstPropsEntry *entry,
                                             const gchar **val);

Get the contents of the entry into the given gchar*.


gst_props_entry_get_type ()

GstPropsType gst_props_entry_get_type       (const GstPropsEntry *entry);

Get the type of the given props entry.


gst_props_entry_is_fixed ()

gboolean    gst_props_entry_is_fixed        (const GstPropsEntry *entry);

Checks if the props entry is fixe, ie. is not a list or a range.

See Also

GstCaps