mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-01 22:21:13 +00:00
add gst_props_get_float function
Original commit message from CVS: add gst_props_get_float function
This commit is contained in:
parent
dffced240f
commit
368feff16f
3 changed files with 32 additions and 0 deletions
|
@ -105,6 +105,7 @@ GstProps* gst_caps_get_props (GstCaps *caps);
|
||||||
#define gst_caps_set(caps, name, args...) gst_props_set ((caps)->properties, name, args)
|
#define gst_caps_set(caps, name, args...) gst_props_set ((caps)->properties, name, args)
|
||||||
|
|
||||||
#define gst_caps_get_int(caps, name) gst_props_get_int ((caps)->properties, name)
|
#define gst_caps_get_int(caps, name) gst_props_get_int ((caps)->properties, name)
|
||||||
|
#define gst_caps_get_float(caps, name) gst_props_get_float ((caps)->properties, name)
|
||||||
#define gst_caps_get_fourcc_int(caps, name) gst_props_get_fourcc_int ((caps)->properties, name)
|
#define gst_caps_get_fourcc_int(caps, name) gst_props_get_fourcc_int ((caps)->properties, name)
|
||||||
#define gst_caps_get_boolean(caps, name) gst_props_get_boolean ((caps)->properties, name)
|
#define gst_caps_get_boolean(caps, name) gst_props_get_boolean ((caps)->properties, name)
|
||||||
#define gst_caps_get_string(caps, name) gst_props_get_string ((caps)->properties, name)
|
#define gst_caps_get_string(caps, name) gst_props_get_string ((caps)->properties, name)
|
||||||
|
|
|
@ -432,6 +432,36 @@ gst_props_get_int (GstProps *props, const gchar *name)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_props_get_float:
|
||||||
|
* @props: the props to get the float value from
|
||||||
|
* @name: the name of the props entry to get.
|
||||||
|
*
|
||||||
|
* Get the named entry as a float.
|
||||||
|
*
|
||||||
|
* Returns: the float value of the named entry, 0.0 if not found.
|
||||||
|
*/
|
||||||
|
gfloat
|
||||||
|
gst_props_get_float (GstProps *props, const gchar *name)
|
||||||
|
{
|
||||||
|
GList *lentry;
|
||||||
|
GQuark quark;
|
||||||
|
|
||||||
|
quark = g_quark_from_string (name);
|
||||||
|
|
||||||
|
lentry = g_list_find_custom (props->properties, GINT_TO_POINTER (quark), props_find_func);
|
||||||
|
|
||||||
|
if (lentry) {
|
||||||
|
GstPropsEntry *thisentry;
|
||||||
|
|
||||||
|
thisentry = (GstPropsEntry *)lentry->data;
|
||||||
|
|
||||||
|
return thisentry->data.float_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_props_get_fourcc_int:
|
* gst_props_get_fourcc_int:
|
||||||
* @props: the props to get the fourcc value from
|
* @props: the props to get the fourcc value from
|
||||||
|
|
|
@ -90,6 +90,7 @@ gboolean gst_props_check_compatibility (GstProps *fromprops, GstProps *toprops
|
||||||
GstProps* gst_props_set (GstProps *props, const gchar *name, ...);
|
GstProps* gst_props_set (GstProps *props, const gchar *name, ...);
|
||||||
|
|
||||||
gint gst_props_get_int (GstProps *props, const gchar *name);
|
gint gst_props_get_int (GstProps *props, const gchar *name);
|
||||||
|
gfloat gst_props_get_float (GstProps *props, const gchar *name);
|
||||||
gulong gst_props_get_fourcc_int (GstProps *props, const gchar *name);
|
gulong gst_props_get_fourcc_int (GstProps *props, const gchar *name);
|
||||||
gboolean gst_props_get_boolean (GstProps *props, const gchar *name);
|
gboolean gst_props_get_boolean (GstProps *props, const gchar *name);
|
||||||
const gchar* gst_props_get_string (GstProps *props, const gchar *name);
|
const gchar* gst_props_get_string (GstProps *props, const gchar *name);
|
||||||
|
|
Loading…
Reference in a new issue