added docuementation comments added a few consts to const params a bit of cleanup on the parameter names changed two ...

Original commit message from CVS:
added docuementation comments
added a few consts to const params
a bit of cleanup on the parameter names
changed two calls to the hash_lookup to get_wrapper
This commit is contained in:
Stefan Kost 2004-07-14 14:55:57 +00:00
parent d7ec4cb787
commit 3866e28ab6
2 changed files with 49 additions and 26 deletions

View file

@ -43,7 +43,7 @@ static GstDParamWrapper *gst_dpman_new_wrapper (GstDParamManager * dpman,
GParamSpec * param_spec, gchar * unit_name, GParamSpec * param_spec, gchar * unit_name,
GstDPMUpdateMethod update_method); GstDPMUpdateMethod update_method);
static GstDParamWrapper *gst_dpman_get_wrapper (GstDParamManager * dpman, static GstDParamWrapper *gst_dpman_get_wrapper (GstDParamManager * dpman,
gchar * dparam_name); const gchar * dparam_name);
static void gst_dpman_state_change (GstElement * element, gint old_state, static void gst_dpman_state_change (GstElement * element, gint old_state,
gint new_state, GstDParamManager * dpman); gint new_state, GstDParamManager * dpman);
static gboolean gst_dpman_preprocess_synchronous (GstDParamManager * dpman, static gboolean gst_dpman_preprocess_synchronous (GstDParamManager * dpman,
@ -179,6 +179,8 @@ gst_dpman_dispose (GObject * object)
/** /**
* gst_dpman_add_required_dparam_callback: * gst_dpman_add_required_dparam_callback:
* @dpman: GstDParamManager instance * @dpman: GstDParamManager instance
* @param_spec: the spacification of the new dparam
* @unit_name: the unit name of the dparam
* @update_func: callback to update the element with the new value * @update_func: callback to update the element with the new value
* @update_data: will be included in the call to update_func * @update_data: will be included in the call to update_func
* *
@ -215,6 +217,8 @@ gst_dpman_add_required_dparam_callback (GstDParamManager * dpman,
/** /**
* gst_dpman_add_required_dparam_direct: * gst_dpman_add_required_dparam_direct:
* @dpman: GstDParamManager instance * @dpman: GstDParamManager instance
* @param_spec: the spacification of the new dparam
* @unit_name: the unit name of the dparam
* @update_data: pointer to the member to be updated * @update_data: pointer to the member to be updated
* *
* Returns: true if it was successfully added * Returns: true if it was successfully added
@ -248,7 +252,8 @@ gst_dpman_add_required_dparam_direct (GstDParamManager * dpman,
/** /**
* gst_dpman_add_required_dparam_array: * gst_dpman_add_required_dparam_array:
* @dpman: GstDParamManager instance * @dpman: GstDParamManager instance
* @dparam_name: a parameter name unique to this GstDParamManager * @param_spec: the spacification of the new dparam
* @unit_name: the unit name of the dparam
* @update_data: pointer to where the array will be stored * @update_data: pointer to where the array will be stored
* *
* Returns: true if it was successfully added * Returns: true if it was successfully added
@ -286,7 +291,8 @@ gst_dpman_add_required_dparam_array (GstDParamManager * dpman,
* *
*/ */
void void
gst_dpman_remove_required_dparam (GstDParamManager * dpman, gchar * dparam_name) gst_dpman_remove_required_dparam (GstDParamManager * dpman,
const gchar * dparam_name)
{ {
GstDParamWrapper *dpwrap; GstDParamWrapper *dpwrap;
@ -318,7 +324,7 @@ gst_dpman_remove_required_dparam (GstDParamManager * dpman, gchar * dparam_name)
* Returns: true if it was successfully attached * Returns: true if it was successfully attached
*/ */
gboolean gboolean
gst_dpman_attach_dparam (GstDParamManager * dpman, gchar * dparam_name, gst_dpman_attach_dparam (GstDParamManager * dpman, const gchar * dparam_name,
GstDParam * dparam) GstDParam * dparam)
{ {
GstDParamWrapper *dpwrap; GstDParamWrapper *dpwrap;
@ -350,7 +356,7 @@ gst_dpman_attach_dparam (GstDParamManager * dpman, gchar * dparam_name,
* *
*/ */
void void
gst_dpman_detach_dparam (GstDParamManager * dpman, gchar * dparam_name) gst_dpman_detach_dparam (GstDParamManager * dpman, const gchar * dparam_name)
{ {
GstDParamWrapper *dpwrap; GstDParamWrapper *dpwrap;
@ -359,7 +365,6 @@ gst_dpman_detach_dparam (GstDParamManager * dpman, gchar * dparam_name)
g_return_if_fail (dparam_name != NULL); g_return_if_fail (dparam_name != NULL);
dpwrap = gst_dpman_get_wrapper (dpman, dparam_name); dpwrap = gst_dpman_get_wrapper (dpman, dparam_name);
g_return_if_fail (dpwrap); g_return_if_fail (dpwrap);
gst_dparam_detach (dpwrap->dparam); gst_dparam_detach (dpwrap->dparam);
@ -370,20 +375,20 @@ gst_dpman_detach_dparam (GstDParamManager * dpman, gchar * dparam_name)
/** /**
* gst_dpman_get_dparam: * gst_dpman_get_dparam:
* @dpman: GstDParamManager instance * @dpman: GstDParamManager instance
* @name: the name of an existing dparam instance * @dparam_name: the name of an existing dparam instance
* *
* Returns: the dparam with the given name - or NULL otherwise * Returns: the dparam with the given name - or NULL otherwise
*/ */
GstDParam * GstDParam *
gst_dpman_get_dparam (GstDParamManager * dpman, gchar * name) gst_dpman_get_dparam (GstDParamManager * dpman, const gchar * dparam_name)
{ {
GstDParamWrapper *dpwrap; GstDParamWrapper *dpwrap;
g_return_val_if_fail (dpman != NULL, NULL); g_return_val_if_fail (dpman != NULL, NULL);
g_return_val_if_fail (GST_IS_DPMAN (dpman), NULL); g_return_val_if_fail (GST_IS_DPMAN (dpman), NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (dparam_name != NULL, NULL);
dpwrap = g_hash_table_lookup (GST_DPMAN_DPARAMS (dpman), name); dpwrap = gst_dpman_get_wrapper (dpman, dparam_name);
g_return_val_if_fail (dpwrap != NULL, NULL); g_return_val_if_fail (dpwrap != NULL, NULL);
return dpwrap->dparam; return dpwrap->dparam;
@ -392,25 +397,31 @@ gst_dpman_get_dparam (GstDParamManager * dpman, gchar * name)
/** /**
* gst_dpman_get_dparam_type: * gst_dpman_get_dparam_type:
* @dpman: GstDParamManager instance * @dpman: GstDParamManager instance
* @name: the name of dparam * @dparam_name: the name of dparam
* *
* Returns: the type that this dparam requires/uses * Returns: the type that this dparam requires/uses
*/ */
GType GType
gst_dpman_get_dparam_type (GstDParamManager * dpman, gchar * name) gst_dpman_get_dparam_type (GstDParamManager * dpman, const gchar * dparam_name)
{ {
GstDParamWrapper *dpwrap; GstDParamWrapper *dpwrap;
g_return_val_if_fail (dpman != NULL, 0); g_return_val_if_fail (dpman != NULL, 0);
g_return_val_if_fail (GST_IS_DPMAN (dpman), 0); g_return_val_if_fail (GST_IS_DPMAN (dpman), 0);
g_return_val_if_fail (name != NULL, 0); g_return_val_if_fail (dparam_name != NULL, 0);
dpwrap = g_hash_table_lookup (GST_DPMAN_DPARAMS (dpman), name); dpwrap = gst_dpman_get_wrapper (dpman, dparam_name);
g_return_val_if_fail (dpwrap != NULL, 0); g_return_val_if_fail (dpwrap != NULL, 0);
return G_VALUE_TYPE (dpwrap->value); return G_VALUE_TYPE (dpwrap->value);
} }
/**
* gst_dpman_list_dparam_specs:
* @dpman: GstDParamManager instance
*
* Returns: the the parameter specifications this managers maintains as a NULL terminated array
*/
GParamSpec ** GParamSpec **
gst_dpman_list_dparam_specs (GstDParamManager * dpman) gst_dpman_list_dparam_specs (GstDParamManager * dpman)
{ {
@ -434,8 +445,15 @@ gst_dpman_list_dparam_specs (GstDParamManager * dpman)
return param_specs; return param_specs;
} }
/**
* gst_dpman_get_param_spec:
* @dpman: GstDParamManager instance
* @dparam_name: the name of dparam
*
* Returns: the the parameter specifications for a given name
*/
GParamSpec * GParamSpec *
gst_dpman_get_param_spec (GstDParamManager * dpman, gchar * dparam_name) gst_dpman_get_param_spec (GstDParamManager * dpman, const gchar * dparam_name)
{ {
GstDParamWrapper *dpwrap; GstDParamWrapper *dpwrap;
@ -447,6 +465,11 @@ gst_dpman_get_param_spec (GstDParamManager * dpman, gchar * dparam_name)
return dpwrap->param_spec; return dpwrap->param_spec;
} }
/**
* gst_dpman_set_rate:
* @dpman: GstDParamManager instance
* @rate: the new the frame/sample rate
*/
void void
gst_dpman_set_rate (GstDParamManager * dpman, gint rate) gst_dpman_set_rate (GstDParamManager * dpman, gint rate)
{ {
@ -578,7 +601,7 @@ gst_dpman_get_manager (GstElement * parent)
* *
*/ */
void void
gst_dpman_bypass_dparam (GstDParamManager * dpman, gchar * dparam_name) gst_dpman_bypass_dparam (GstDParamManager * dpman, const gchar * dparam_name)
{ {
GstDParamWrapper *dpwrap; GstDParamWrapper *dpwrap;
@ -597,7 +620,7 @@ gst_dpman_bypass_dparam (GstDParamManager * dpman, gchar * dparam_name)
} }
static GstDParamWrapper * static GstDParamWrapper *
gst_dpman_get_wrapper (GstDParamManager * dpman, gchar * dparam_name) gst_dpman_get_wrapper (GstDParamManager * dpman, const gchar * dparam_name)
{ {
g_return_val_if_fail (dpman != NULL, NULL); g_return_val_if_fail (dpman != NULL, NULL);
g_return_val_if_fail (GST_IS_DPMAN (dpman), NULL); g_return_val_if_fail (GST_IS_DPMAN (dpman), NULL);

View file

@ -90,7 +90,7 @@ struct _GstDParamManagerClass {
GstObjectClass parent_class; GstObjectClass parent_class;
GHashTable *modes; GHashTable *modes;
/* signal callbacks */ /* signal callbacks */
void (*new_required_dparam) (GstDParamManager *dpman, gchar* dparam_name); void (*new_required_dparam) (GstDParamManager *dpman, const gchar* dparam_name);
}; };
struct _GstDPMMode { struct _GstDPMMode {
@ -157,18 +157,18 @@ gboolean gst_dpman_add_required_dparam_array (GstDParamManager *dpman,
gchar *unit_name, gchar *unit_name,
gpointer update_data); gpointer update_data);
void gst_dpman_remove_required_dparam (GstDParamManager *dpman, gchar *dparam_name); void gst_dpman_remove_required_dparam (GstDParamManager *dpman, const gchar *dparam_name);
gboolean gst_dpman_attach_dparam (GstDParamManager *dpman, gchar *dparam_name, GstDParam *dparam); gboolean gst_dpman_attach_dparam (GstDParamManager *dpman, const gchar *dparam_name, GstDParam *dparam);
void gst_dpman_detach_dparam (GstDParamManager *dpman, gchar *dparam_name); void gst_dpman_detach_dparam (GstDParamManager *dpman, const gchar *dparam_name);
GstDParam* gst_dpman_get_dparam(GstDParamManager *dpman, gchar *name); GstDParam* gst_dpman_get_dparam(GstDParamManager *dpman, const gchar *dparam_name);
GType gst_dpman_get_dparam_type (GstDParamManager *dpman, gchar *name); GType gst_dpman_get_dparam_type (GstDParamManager *dpman, const gchar *dparam_name);
GParamSpec** gst_dpman_list_dparam_specs(GstDParamManager *dpman); GParamSpec** gst_dpman_list_dparam_specs(GstDParamManager *dpman);
GParamSpec* gst_dpman_get_param_spec (GstDParamManager *dpman, gchar *dparam_name); GParamSpec* gst_dpman_get_param_spec (GstDParamManager *dpman, const gchar *dparam_name);
void gst_dpman_dparam_spec_has_changed (GstDParamManager *dpman, gchar *dparam_name); void gst_dpman_dparam_spec_has_changed (GstDParamManager *dpman, const gchar *dparam_name);
void gst_dpman_set_rate(GstDParamManager *dpman, gint rate); void gst_dpman_set_rate(GstDParamManager *dpman, gint rate);
void gst_dpman_bypass_dparam(GstDParamManager *dpman, gchar *dparam_name); void gst_dpman_bypass_dparam(GstDParamManager *dpman, const gchar *dparam_name);
gboolean gst_dpman_set_mode(GstDParamManager *dpman, gchar *modename); gboolean gst_dpman_set_mode(GstDParamManager *dpman, gchar *modename);
void gst_dpman_register_mode (GstDParamManagerClass *klass, void gst_dpman_register_mode (GstDParamManagerClass *klass,