GstDParamManager

GstDParamManager —

Synopsis




#define     GST_DPMAN_NAME                  (dpman)
#define     GST_DPMAN_PARENT                (dpman)
#define     GST_DPMAN_DPARAMS               (dpman)
#define     GST_DPMAN_DPARAMS_LIST          (dpman)
#define     GST_DPMAN_MODE_NAME             (dpman)
#define     GST_DPMAN_MODE                  (dpman)
#define     GST_DPMAN_RATE                  (dpman)
#define     GST_DPMAN_FRAMES_TO_PROCESS     (dpman)
#define     GST_DPMAN_NEXT_UPDATE_FRAME     (dpman)
enum        GstDPMUpdateMethod;
struct      GstDPMMode;
struct      GstDParamWrapper;
struct      GstDParamAsyncToUpdate;
gboolean    (*GstDPMModePreProcessFunction) (GstDParamManager *dpman,
                                             guint frames,
                                             gint64 timestamp);
gboolean    (*GstDPMModeProcessFunction)    (GstDParamManager *dpman,
                                             guint frame_count);
void        (*GstDPMModeSetupFunction)      (GstDParamManager *dpman);
void        (*GstDPMModeTeardownFunction)   (GstDParamManager *dpman);
void        (*GstDPMUpdateFunction)         (const GValue *value,
                                             gpointer data);
#define     GST_DPMAN_PREPROCESSFUNC        (dpman)
#define     GST_DPMAN_PROCESSFUNC           (dpman)
#define     GST_DPMAN_SETUPFUNC             (dpman)
#define     GST_DPMAN_TEARDOWNFUNC          (dpman)
#define     GST_DPMAN_PREPROCESS            (dpman, buffer_size, timestamp)
#define     GST_DPMAN_PROCESS               (dpman, frame_count)
#define     GST_DPMAN_CALLBACK_UPDATE       (dpwrap, value)
GstDParamManager* gst_dpman_new             (gchar *name,
                                             GstElement *parent);
void        gst_dpman_set_parent            (GstDParamManager *dpman,
                                             GstElement *parent);
GstDParamManager* gst_dpman_get_manager     (GstElement *parent);
gboolean    gst_dpman_add_required_dparam_callback
                                            (GstDParamManager *dpman,
                                             GParamSpec *param_spec,
                                             gchar *unit_name,
                                             GstDPMUpdateFunction update_func,
                                             gpointer update_data);
gboolean    gst_dpman_add_required_dparam_direct
                                            (GstDParamManager *dpman,
                                             GParamSpec *param_spec,
                                             gchar *unit_name,
                                             gpointer update_data);
gboolean    gst_dpman_add_required_dparam_array
                                            (GstDParamManager *dpman,
                                             GParamSpec *param_spec,
                                             gchar *unit_name,
                                             gpointer update_data);
void        gst_dpman_remove_required_dparam
                                            (GstDParamManager *dpman,
                                             gchar *dparam_name);
gboolean    gst_dpman_attach_dparam         (GstDParamManager *dpman,
                                             gchar *dparam_name,
                                             GstDParam *dparam);
void        gst_dpman_detach_dparam         (GstDParamManager *dpman,
                                             gchar *dparam_name);
GstDParam*  gst_dpman_get_dparam            (GstDParamManager *dpman,
                                             gchar *name);
GType       gst_dpman_get_dparam_type       (GstDParamManager *dpman,
                                             gchar *name);
GParamSpec** gst_dpman_list_dparam_specs    (GstDParamManager *dpman);
GParamSpec* gst_dpman_get_param_spec        (GstDParamManager *dpman,
                                             gchar *dparam_name);
void        gst_dpman_dparam_spec_has_changed
                                            (GstDParamManager *dpman,
                                             gchar *dparam_name);
void        gst_dpman_set_rate              (GstDParamManager *dpman,
                                             gint rate);
void        gst_dpman_bypass_dparam         (GstDParamManager *dpman,
                                             gchar *dparam_name);
gboolean    gst_dpman_set_mode              (GstDParamManager *dpman,
                                             gchar *modename);
void        gst_dpman_register_mode         (GstDParamManagerClass *klass,
                                             gchar *modename,
                                             GstDPMModePreProcessFunction preprocessfunc,
                                             GstDPMModeProcessFunction processfunc,
                                             GstDPMModeSetupFunction setupfunc,
                                             GstDPMModeTeardownFunction teardownfunc);

Description

Details

GST_DPMAN_NAME()

#define GST_DPMAN_NAME(dpman)			(GST_OBJECT_NAME(dpman))

dpman :

GST_DPMAN_PARENT()

#define GST_DPMAN_PARENT(dpman)		(GST_OBJECT_PARENT(dpman))

dpman :

GST_DPMAN_DPARAMS()

#define GST_DPMAN_DPARAMS(dpman)		((dpman)->dparams)

dpman :

GST_DPMAN_DPARAMS_LIST()

#define GST_DPMAN_DPARAMS_LIST(dpman)		((dpman)->dparams_list)

dpman :

GST_DPMAN_MODE_NAME()

#define GST_DPMAN_MODE_NAME(dpman)				 ((dpman)->mode_name)

dpman :

GST_DPMAN_MODE()

#define GST_DPMAN_MODE(dpman)				 ((dpman)->mode)

dpman :

GST_DPMAN_RATE()

#define GST_DPMAN_RATE(dpman)				 ((dpman)->rate)

dpman :

GST_DPMAN_FRAMES_TO_PROCESS()

#define GST_DPMAN_FRAMES_TO_PROCESS(dpman)		 ((dpman)->frames_to_process)

dpman :

GST_DPMAN_NEXT_UPDATE_FRAME()

#define GST_DPMAN_NEXT_UPDATE_FRAME(dpman)		 ((dpman)->next_update_frame)

dpman :

enum GstDPMUpdateMethod

typedef enum {
  GST_DPMAN_CALLBACK,
  GST_DPMAN_DIRECT,
  GST_DPMAN_ARRAY,
} GstDPMUpdateMethod;


struct GstDPMMode

struct GstDPMMode {

	GstDPMModePreProcessFunction preprocessfunc;
	GstDPMModeProcessFunction processfunc;
	GstDPMModeSetupFunction setupfunc;
	GstDPMModeTeardownFunction teardownfunc;
};


struct GstDParamWrapper

struct GstDParamWrapper {

	GParamSpec* param_spec;
	GValue *value;
	GstDParam *dparam;

	guint next_update_frame;
	
	GstDPMUpdateMethod update_method;
	gpointer update_data;
	GstDPMUpdateFunction update_func;
	
	gchar *unit_name;
	GstDParamUpdateInfo update_info;
};


struct GstDParamAsyncToUpdate

struct GstDParamAsyncToUpdate {

	guint frame;
	GValue *value;
	GstDParamWrapper *dpwrap;
};


GstDPMModePreProcessFunction ()

gboolean    (*GstDPMModePreProcessFunction) (GstDParamManager *dpman,
                                             guint frames,
                                             gint64 timestamp);

dpman :
frames :
timestamp :
Returns :

GstDPMModeProcessFunction ()

gboolean    (*GstDPMModeProcessFunction)    (GstDParamManager *dpman,
                                             guint frame_count);

dpman :
frame_count :
Returns :

GstDPMModeSetupFunction ()

void        (*GstDPMModeSetupFunction)      (GstDParamManager *dpman);

dpman :

GstDPMModeTeardownFunction ()

void        (*GstDPMModeTeardownFunction)   (GstDParamManager *dpman);

dpman :

GstDPMUpdateFunction ()

void        (*GstDPMUpdateFunction)         (const GValue *value,
                                             gpointer data);

value :
data :

GST_DPMAN_PREPROCESSFUNC()

#define GST_DPMAN_PREPROCESSFUNC(dpman)		(((dpman)->mode)->preprocessfunc)

dpman :

GST_DPMAN_PROCESSFUNC()

#define GST_DPMAN_PROCESSFUNC(dpman)		(((dpman)->mode)->processfunc)

dpman :

GST_DPMAN_SETUPFUNC()

#define GST_DPMAN_SETUPFUNC(dpman)		(((dpman)->mode)->setupfunc)

dpman :

GST_DPMAN_TEARDOWNFUNC()

#define GST_DPMAN_TEARDOWNFUNC(dpman)		(((dpman)->mode)->teardownfunc)

dpman :

GST_DPMAN_PREPROCESS()

#define     GST_DPMAN_PREPROCESS(dpman, buffer_size, timestamp)

dpman :
buffer_size :
timestamp :

GST_DPMAN_PROCESS()

#define     GST_DPMAN_PROCESS(dpman, frame_count)

dpman :
frame_count :

GST_DPMAN_CALLBACK_UPDATE()

#define GST_DPMAN_CALLBACK_UPDATE(dpwrap, value) ((dpwrap->update_func)(value, dpwrap->update_data))

dpwrap :
value :

gst_dpman_new ()

GstDParamManager* gst_dpman_new             (gchar *name,
                                             GstElement *parent);

name : name of the GstDParamManager instance
parent : element which created this instance
Returns : a new instance of GstDParamManager

gst_dpman_set_parent ()

void        gst_dpman_set_parent            (GstDParamManager *dpman,
                                             GstElement *parent);

dpman : GstDParamManager instance
parent : the element that this GstDParamManager belongs to

gst_dpman_get_manager ()

GstDParamManager* gst_dpman_get_manager     (GstElement *parent);

parent : the element that the desired GstDParamManager belongs to
Returns : the GstDParamManager which belongs to this element or NULL if it doesn't exist

gst_dpman_add_required_dparam_callback ()

gboolean    gst_dpman_add_required_dparam_callback
                                            (GstDParamManager *dpman,
                                             GParamSpec *param_spec,
                                             gchar *unit_name,
                                             GstDPMUpdateFunction update_func,
                                             gpointer update_data);

dpman : GstDParamManager instance
param_spec :
unit_name :
update_func : callback to update the element with the new value
update_data : will be included in the call to update_func
Returns : true if it was successfully added

gst_dpman_add_required_dparam_direct ()

gboolean    gst_dpman_add_required_dparam_direct
                                            (GstDParamManager *dpman,
                                             GParamSpec *param_spec,
                                             gchar *unit_name,
                                             gpointer update_data);

dpman : GstDParamManager instance
param_spec :
unit_name :
update_data : pointer to the member to be updated
Returns : true if it was successfully added

gst_dpman_add_required_dparam_array ()

gboolean    gst_dpman_add_required_dparam_array
                                            (GstDParamManager *dpman,
                                             GParamSpec *param_spec,
                                             gchar *unit_name,
                                             gpointer update_data);

dpman : GstDParamManager instance
param_spec :
unit_name :
update_data : pointer to where the array will be stored
Returns : true if it was successfully added

gst_dpman_remove_required_dparam ()

void        gst_dpman_remove_required_dparam
                                            (GstDParamManager *dpman,
                                             gchar *dparam_name);

dpman : GstDParamManager instance
dparam_name : the name of an existing parameter

gst_dpman_attach_dparam ()

gboolean    gst_dpman_attach_dparam         (GstDParamManager *dpman,
                                             gchar *dparam_name,
                                             GstDParam *dparam);

dpman : GstDParamManager instance
dparam_name : a name previously added with gst_dpman_add_required_dparam
dparam : GstDParam instance to attach
Returns : true if it was successfully attached

gst_dpman_detach_dparam ()

void        gst_dpman_detach_dparam         (GstDParamManager *dpman,
                                             gchar *dparam_name);

dpman : GstDParamManager instance
dparam_name : the name of a parameter with a previously attached GstDParam

gst_dpman_get_dparam ()

GstDParam*  gst_dpman_get_dparam            (GstDParamManager *dpman,
                                             gchar *name);

dpman : GstDParamManager instance
name : the name of an existing dparam instance
Returns : the dparam with the given name - or NULL otherwise

gst_dpman_get_dparam_type ()

GType       gst_dpman_get_dparam_type       (GstDParamManager *dpman,
                                             gchar *name);

dpman : GstDParamManager instance
name : the name of dparam
Returns : the type that this dparam requires/uses

gst_dpman_list_dparam_specs ()

GParamSpec** gst_dpman_list_dparam_specs    (GstDParamManager *dpman);

dpman :
Returns :

gst_dpman_get_param_spec ()

GParamSpec* gst_dpman_get_param_spec        (GstDParamManager *dpman,
                                             gchar *dparam_name);

dpman :
dparam_name :
Returns :

gst_dpman_dparam_spec_has_changed ()

void        gst_dpman_dparam_spec_has_changed
                                            (GstDParamManager *dpman,
                                             gchar *dparam_name);

dpman :
dparam_name :

gst_dpman_set_rate ()

void        gst_dpman_set_rate              (GstDParamManager *dpman,
                                             gint rate);

dpman :
rate :

gst_dpman_bypass_dparam ()

void        gst_dpman_bypass_dparam         (GstDParamManager *dpman,
                                             gchar *dparam_name);

If a dparam is attached to this dparam_name, it will be detached and a warning will be issued. This should be called in the _set_property function of an element if the value it changes is also changed by a dparam.

dpman : GstDParamManager instance
dparam_name : the name of dparam

gst_dpman_set_mode ()

gboolean    gst_dpman_set_mode              (GstDParamManager *dpman,
                                             gchar *modename);

dpman : GstDParamManager instance
modename : the name of the mode to use
Returns : TRUE if the mode was set, FALSE otherwise

gst_dpman_register_mode ()

void        gst_dpman_register_mode         (GstDParamManagerClass *klass,
                                             gchar *modename,
                                             GstDPMModePreProcessFunction preprocessfunc,
                                             GstDPMModeProcessFunction processfunc,
                                             GstDPMModeSetupFunction setupfunc,
                                             GstDPMModeTeardownFunction teardownfunc);

klass : GstDParamManagerClass class instance
modename : the unique name of the new mode
preprocessfunc : the function which will be called before each buffer is processed
processfunc : the function which may be called throughout the processing of a buffer
setupfunc : the function which initialises the mode when activated
teardownfunc : the function which frees any resources the mode uses