GstScheduler

Name

GstScheduler -- An abstract class for plugable schedulers.

Synopsis


#include <gst/gst.h>


#define     GST_SCHEDULER_PARENT            (sched)
#define     GST_SCHEDULER_STATE             (sched)
enum        GstSchedulerState;
enum        GstSchedulerFlags;
#define     gst_scheduler_destroy           (sched)
void        gst_scheduler_setup             (GstScheduler *sched);
gboolean    gst_scheduler_get_preferred_stack
                                            (GstScheduler *sched,
                                             gpointer *stack,
                                             gulong *size);
void        gst_scheduler_reset             (GstScheduler *sched);
void        gst_scheduler_add_element       (GstScheduler *sched,
                                             GstElement *element);
void        gst_scheduler_remove_element    (GstScheduler *sched,
                                             GstElement *element);
GstElementStateReturn gst_scheduler_state_transition
                                            (GstScheduler *sched,
                                             GstElement *element,
                                             gint transition);
void        gst_scheduler_lock_element      (GstScheduler *sched,
                                             GstElement *element);
void        gst_scheduler_unlock_element    (GstScheduler *sched,
                                             GstElement *element);
void        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_connect       (GstScheduler *sched,
                                             GstPad *srcpad,
                                             GstPad *sinkpad);
void        gst_scheduler_pad_disconnect    (GstScheduler *sched,
                                             GstPad *srcpad,
                                             GstPad *sinkpad);
GstPad*     gst_scheduler_pad_select        (GstScheduler *sched,
                                             GList *padlist);
void        gst_scheduler_add_scheduler     (GstScheduler *sched,
                                             GstScheduler *sched2);
void        gst_scheduler_remove_scheduler  (GstScheduler *sched,
                                             GstScheduler *sched2);
void        gst_scheduler_auto_clock        (GstScheduler *sched);
GstClock*   gst_scheduler_get_clock         (GstScheduler *sched);
void        gst_scheduler_set_clock         (GstScheduler *sched,
                                             GstClock *clock);
void        gst_scheduler_use_clock         (GstScheduler *sched,
                                             GstClock *clock);
GstClockReturn gst_scheduler_clock_wait     (GstScheduler *sched,
                                             GstElement *element,
                                             GstClock *clock,
                                             GstClockTime time,
                                             GstClockTimeDiff *jitter);
gboolean    gst_scheduler_iterate           (GstScheduler *sched);
void        gst_scheduler_show              (GstScheduler *sched);

Object Hierarchy


  GObject
   +----GstObject
         +----GstScheduler

Description

This is a base class for custom schedulers.

Details

GST_SCHEDULER_PARENT()

#define GST_SCHEDULER_PARENT(sched)		((sched)->parent)

Get the parent object of this scheduler.

sched :the scheduler to get the parent of.


GST_SCHEDULER_STATE()

#define GST_SCHEDULER_STATE(sched)		((sched)->state)

Get the state of the scheduler.

sched :the scheduler to get the state of.


enum GstSchedulerState

typedef enum {
  GST_SCHEDULER_STATE_NONE,
  GST_SCHEDULER_STATE_RUNNING,
  GST_SCHEDULER_STATE_STOPPED,
  GST_SCHEDULER_STATE_ERROR
} GstSchedulerState;


enum GstSchedulerFlags

typedef enum {
  /* this scheduler works with a fixed clock */
  GST_SCHEDULER_FLAG_FIXED_CLOCK	= GST_OBJECT_FLAG_LAST,

  /* padding */
  GST_SCHEDULER_FLAG_LAST 		= GST_OBJECT_FLAG_LAST + 4
} GstSchedulerFlags;


gst_scheduler_destroy()

#define         	gst_scheduler_destroy(sched)	gst_object_destroy(GST_OBJECT(sched))

Destroy the scheduler

sched :The scheduler to destroy.


gst_scheduler_setup ()

void        gst_scheduler_setup             (GstScheduler *sched);

Prepare the scheduler.

sched : the scheduler


gst_scheduler_get_preferred_stack ()

gboolean    gst_scheduler_get_preferred_stack
                                            (GstScheduler *sched,
                                             gpointer *stack,
                                             gulong *size);

Gets the preferred stack location and size of this scheduler.

sched : a GstScheduler to query.
stack : the pointer to store the location of the preferred stack in.
size : the pointer to store the size of the preferred stack in.
Returns : TRUE if the scheduler suggested a preferred stacksize and location.


gst_scheduler_reset ()

void        gst_scheduler_reset             (GstScheduler *sched);

Reset the schedulers.

sched : a GstScheduler to reset.


gst_scheduler_add_element ()

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


gst_scheduler_remove_element ()

void        gst_scheduler_remove_element    (GstScheduler *sched,
                                             GstElement *element);

Remove an element from the scheduler.

sched : the scheduler
element : the element to remove


gst_scheduler_state_transition ()

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.


gst_scheduler_lock_element ()

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


gst_scheduler_unlock_element ()

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


gst_scheduler_yield ()

void        gst_scheduler_yield             (GstScheduler *sched,
                                             GstElement *element);

Tell the scheduler to schedule another element.

sched : the scheduler
element : the element requesting a yield


gst_scheduler_interrupt ()

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.


gst_scheduler_error ()

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


gst_scheduler_pad_connect ()

void        gst_scheduler_pad_connect       (GstScheduler *sched,
                                             GstPad *srcpad,
                                             GstPad *sinkpad);

Connect the srcpad to the given sinkpad.

sched : the scheduler
srcpad : the srcpad to connect
sinkpad : the sinkpad to connect to


gst_scheduler_pad_disconnect ()

void        gst_scheduler_pad_disconnect    (GstScheduler *sched,
                                             GstPad *srcpad,
                                             GstPad *sinkpad);

Disconnect the srcpad to the given sinkpad.

sched : the scheduler
srcpad : the srcpad to disconnect
sinkpad : the sinkpad to disconnect from


gst_scheduler_pad_select ()

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.


gst_scheduler_add_scheduler ()

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


gst_scheduler_remove_scheduler ()

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


gst_scheduler_auto_clock ()

void        gst_scheduler_auto_clock        (GstScheduler *sched);

Let the scheduler select a clock automatically.

sched : the scheduler


gst_scheduler_get_clock ()

GstClock*   gst_scheduler_get_clock         (GstScheduler *sched);

Get the current clock used by the scheduler

sched : the scheduler
Returns : a GstClock


gst_scheduler_set_clock ()

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


gst_scheduler_use_clock ()

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


gst_scheduler_clock_wait ()

GstClockReturn gst_scheduler_clock_wait     (GstScheduler *sched,
                                             GstElement *element,
                                             GstClock *clock,
                                             GstClockTime time,
                                             GstClockTimeDiff *jitter);

Wait till the clock reaches a specific time

sched : the scheduler
element : the element that wants to wait
clock : the clock to use
time : the time to wait for
jitter : the time difference between requested time and actual time
Returns : the status of the operation


gst_scheduler_iterate ()

gboolean    gst_scheduler_iterate           (GstScheduler *sched);

Perform one iteration on the scheduler.

sched : the scheduler
Returns : a boolean indicating something usefull has happened.


gst_scheduler_show ()

void        gst_scheduler_show              (GstScheduler *sched);

Dump the state of the scheduler

sched : the scheduler