![]() | ![]() | ![]() | GStreamer 0.8 Core API Reference (0.8.1) | ![]() |
---|
GstScheduler — Abstract class for objects that manage the scheduling of groups of elements
enum GstSchedulerFlags; #define GST_SCHEDULER_PARENT (sched) #define GST_SCHEDULER_STATE (sched) enum GstSchedulerState; void gst_scheduler_setup (GstScheduler *sched); void gst_scheduler_reset (GstScheduler *sched); void gst_scheduler_add_element (GstScheduler *sched, GstElement *element); void gst_scheduler_remove_element (GstScheduler *sched, GstElement *element); void gst_scheduler_add_scheduler (GstScheduler *sched, GstScheduler *sched2); void gst_scheduler_remove_scheduler (GstScheduler *sched, GstScheduler *sched2); GstElementStateReturn gst_scheduler_state_transition (GstScheduler *sched, GstElement *element, gint transition); void gst_scheduler_scheduling_change (GstScheduler *sched, GstElement *element); void gst_scheduler_lock_element (GstScheduler *sched, GstElement *element); void gst_scheduler_unlock_element (GstScheduler *sched, GstElement *element); gboolean gst_scheduler_yield (GstScheduler *sched, GstElement *element); gboolean gst_scheduler_interrupt (GstScheduler *sched, GstElement *element); void gst_scheduler_error (GstScheduler *sched, GstElement *element); void gst_scheduler_pad_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); void gst_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad); GstPad* gst_scheduler_pad_select (GstScheduler *sched, GList *padlist); GstClockReturn gst_scheduler_clock_wait (GstScheduler *sched, GstElement *element, GstClockID id, GstClockTimeDiff *jitter); gboolean gst_scheduler_iterate (GstScheduler *sched); void gst_scheduler_use_clock (GstScheduler *sched, GstClock *clock); void gst_scheduler_set_clock (GstScheduler *sched, GstClock *clock); GstClock* gst_scheduler_get_clock (GstScheduler *sched); void gst_scheduler_auto_clock (GstScheduler *sched); void gst_scheduler_show (GstScheduler *sched); #define GST_TYPE_SCHEDULER_FACTORY #define GST_SCHEDULER_FACTORY (obj) #define GST_IS_SCHEDULER_FACTORY (obj) #define GST_SCHEDULER_FACTORY_CLASS (klass) #define GST_IS_SCHEDULER_FACTORY_CLASS (klass) #define GST_SCHEDULER_FACTORY_GET_CLASS (obj) #define GST_SCHEDULER_DEFAULT_NAME struct GstSchedulerFactory; struct GstSchedulerFactoryClass; GType gst_scheduler_factory_get_type (void); GstSchedulerFactory* gst_scheduler_factory_new (const gchar *name, const gchar *longdesc, GType type); void gst_scheduler_factory_destroy (GstSchedulerFactory *factory); GstSchedulerFactory* gst_scheduler_factory_find (const gchar *name); GstScheduler* gst_scheduler_factory_create (GstSchedulerFactory *factory, GstElement *parent); GstScheduler* gst_scheduler_factory_make (const gchar *name, GstElement *parent); void gst_scheduler_factory_set_default_name (const gchar *name); G_CONST_RETURN gchar* gst_scheduler_factory_get_default_name (void);
typedef enum { /* this scheduler works with a fixed clock */ GST_SCHEDULER_FLAG_FIXED_CLOCK = GST_OBJECT_FLAG_LAST, /* this scheduler supports select and lock calls */ GST_SCHEDULER_FLAG_NEW_API, /* padding */ GST_SCHEDULER_FLAG_LAST = GST_OBJECT_FLAG_LAST + 4 } GstSchedulerFlags;
Flags for the scheduler
GST_SCHEDULER_FLAG_FIXED_CLOCK | The scheduler has a fixed clock |
GST_SCHEDULER_FLAG_NEW_API | |
GST_SCHEDULER_FLAG_LAST | subclasses can start numbering their flags starting from here. |
#define GST_SCHEDULER_PARENT(sched) ((sched)->parent)
Get the parent object of this scheduler.
sched : | the scheduler to get the parent of. |
#define GST_SCHEDULER_STATE(sched) ((sched)->state)
Get the state of the scheduler.
sched : | the scheduler to get the state of. |
typedef enum { GST_SCHEDULER_STATE_NONE, GST_SCHEDULER_STATE_RUNNING, GST_SCHEDULER_STATE_STOPPED, GST_SCHEDULER_STATE_ERROR } GstSchedulerState;
The state of the scheduler
GST_SCHEDULER_STATE_NONE | no state |
GST_SCHEDULER_STATE_RUNNING | the scheduler is running |
GST_SCHEDULER_STATE_STOPPED | the scheduler is stopped |
GST_SCHEDULER_STATE_ERROR | the scheduler is in error |
void gst_scheduler_setup (GstScheduler *sched);
Prepare the scheduler.
sched : | the scheduler |
void gst_scheduler_reset (GstScheduler *sched);
Reset the schedulers.
sched : | a GstScheduler to reset. |
void gst_scheduler_add_element (GstScheduler *sched, GstElement *element);
Add an element to the scheduler.
sched : | the scheduler |
element : | the element to add to the scheduler |
void gst_scheduler_remove_element (GstScheduler *sched, GstElement *element);
Remove an element from the scheduler.
sched : | the scheduler |
element : | the element to remove |
void gst_scheduler_add_scheduler (GstScheduler *sched, GstScheduler *sched2);
Notifies the scheduler that it has to monitor this scheduler.
sched : | a GstScheduler to add to |
sched2 : | the GstScheduler to add |
void gst_scheduler_remove_scheduler (GstScheduler *sched, GstScheduler *sched2);
a Notifies the scheduler that it can stop monitoring this scheduler.
sched : | the scheduler |
sched2 : | the scheduler to remove |
GstElementStateReturn gst_scheduler_state_transition (GstScheduler *sched, GstElement *element, gint transition);
Tell the scheduler that an element changed its state.
sched : | the scheduler |
element : | the element with the state transition |
transition : | the state transition |
Returns : | a GstElementStateReturn indicating success or failure of the state transition. |
void gst_scheduler_scheduling_change (GstScheduler *sched, GstElement *element);
Tell the scheduler that an element changed its scheduling strategy. An element could, for example, change its loop function or changes from a loop based element to a chain based element.
sched : | the scheduler |
element : | the element that changed its scheduling strategy |
void gst_scheduler_lock_element (GstScheduler *sched, GstElement *element);
Acquire a lock on the given element in the given scheduler.
sched : | the scheduler |
element : | the element to lock |
void gst_scheduler_unlock_element (GstScheduler *sched, GstElement *element);
Release the lock on the given element in the given scheduler.
sched : | the scheduler |
element : | the element to unlock |
gboolean gst_scheduler_yield (GstScheduler *sched, GstElement *element);
Tell the scheduler to schedule another element.
sched : | the scheduler |
element : | the element requesting a yield |
Returns : | TRUE if the element should save its state, FALSE if the scheduler can perform this action itself. |
gboolean gst_scheduler_interrupt (GstScheduler *sched, GstElement *element);
Tell the scheduler to interrupt execution of this element.
sched : | the scheduler |
element : | the element requesting an interrupt |
Returns : | TRUE if the element should return NULL from the chain/get function. |
void gst_scheduler_error (GstScheduler *sched, GstElement *element);
Tell the scheduler an element was in error
sched : | the scheduler |
element : | the element with the error |
void gst_scheduler_pad_link (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad);
Links the srcpad to the given sinkpad.
sched : | the scheduler |
srcpad : | the srcpad to link |
sinkpad : | the sinkpad to link to |
void gst_scheduler_pad_unlink (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad);
Unlinks the srcpad from the given sinkpad.
sched : | the scheduler |
srcpad : | the srcpad to unlink |
sinkpad : | the sinkpad to unlink from |
GstPad* gst_scheduler_pad_select (GstScheduler *sched, GList *padlist);
register the given padlist for a select operation.
sched : | the scheduler |
padlist : | the padlist to select on |
Returns : | the pad which received a buffer. |
GstClockReturn gst_scheduler_clock_wait (GstScheduler *sched, GstElement *element, GstClockID id, GstClockTimeDiff *jitter);
Wait till the clock reaches a specific time. The ClockID can be obtained from gst_clock_new_single_shot_id.
sched : | the scheduler |
element : | the element that wants to wait |
id : | the clockid to use |
jitter : | the time difference between requested time and actual time |
Returns : | the status of the operation |
gboolean gst_scheduler_iterate (GstScheduler *sched);
Perform one iteration on the scheduler.
sched : | the scheduler |
Returns : | a boolean indicating something usefull has happened. |
void gst_scheduler_use_clock (GstScheduler *sched, GstClock *clock);
Force the scheduler to use the given clock. The scheduler will always use the given clock even if new clock providers are added to this scheduler.
sched : | the scheduler |
clock : | the clock to use |
void gst_scheduler_set_clock (GstScheduler *sched, GstClock *clock);
Set the clock for the scheduler. The clock will be distributed to all the elements managed by the scheduler.
sched : | the scheduler |
clock : | the clock to set |
GstClock* gst_scheduler_get_clock (GstScheduler *sched);
Get the current clock used by the scheduler
sched : | the scheduler |
Returns : | a GstClock |
void gst_scheduler_auto_clock (GstScheduler *sched);
Let the scheduler select a clock automatically.
sched : | the scheduler |
void gst_scheduler_show (GstScheduler *sched);
Dump the state of the scheduler
sched : | the scheduler |
#define GST_SCHEDULER_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SCHEDULER_FACTORY, GstSchedulerFactory))
obj : |
#define GST_IS_SCHEDULER_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SCHEDULER_FACTORY))
obj : |
#define GST_SCHEDULER_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SCHEDULER_FACTORY, GstSchedulerFactoryClass))
klass : |
#define GST_IS_SCHEDULER_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SCHEDULER_FACTORY))
klass : |
#define GST_SCHEDULER_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_SCHEDULER_FACTORY, GstSchedulerFactoryClass))
obj : |
struct GstSchedulerFactoryClass { GstPluginFeatureClass parent; gpointer _gst_reserved[GST_PADDING]; };
GstSchedulerFactory* gst_scheduler_factory_new (const gchar *name, const gchar *longdesc, GType type);
Create a new schedulerfactory with the given parameters
name : | name of schedulerfactory to create |
longdesc : | long description of schedulerfactory to create |
type : | the gtk type of the GstScheduler element of this factory |
Returns : | a new GstSchedulerFactory. |
void gst_scheduler_factory_destroy (GstSchedulerFactory *factory);
Removes the scheduler from the global list.
factory : | factory to destroy |
GstSchedulerFactory* gst_scheduler_factory_find (const gchar *name);
Search for an schedulerfactory of the given name.
name : | name of schedulerfactory to find |
Returns : | GstSchedulerFactory if found, NULL otherwise |
GstScheduler* gst_scheduler_factory_create (GstSchedulerFactory *factory, GstElement *parent);
Create a new GstScheduler instance from the given schedulerfactory with the given parent. parent will have its scheduler set to the returned GstScheduler instance.
factory : | the factory used to create the instance |
parent : | the parent element of this scheduler |
Returns : | A new GstScheduler instance with a reference count of 1. |
GstScheduler* gst_scheduler_factory_make (const gchar *name, GstElement *parent);
Create a new GstScheduler instance from the schedulerfactory with the given name and parent. parent will have its scheduler set to the returned GstScheduler instance. If NULL is passed as name, the default scheduler name will be used.
name : | the name of the factory used to create the instance |
parent : | the parent element of this scheduler |
Returns : | A new GstScheduler instance with a reference count of 1. |
void gst_scheduler_factory_set_default_name (const gchar *name);
Set the default schedulerfactory name.
name : | the name of the factory used as a default |
<< GstRegistryPool | GstStructure >> |