GStreamer 0.8 Core Reference Manual |
---|
GstScheduler — Abstract class for objects that manage the scheduling of groups of elements
#include <gst/gst.h> struct GstScheduler; 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_SCHEDULER_DEFAULT_NAME
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 works with a fixed clock |
GST_SCHEDULER_FLAG_NEW_API | the scheduler supports select and lock calls |
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);
gst_scheduler_lock_element is deprecated and should not be used in newly-written code.
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);
gst_scheduler_unlock_element is deprecated and should not be used in newly-written code.
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);
gst_scheduler_pad_select is deprecated and should not be used in newly-written code.
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);
Gets 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 |
<< GstRegistryPool | GstSchedulerFactory >> |