GstScheduler

GstScheduler — Abstract class for objects that manage the scheduling of groups of elements

Synopsis




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);

Object Hierarchy


  GObject
   +----GstPluginFeature
         +----GstSchedulerFactory

Description

This is a base class for custom schedulers.

Details

enum GstSchedulerFlags

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_CLOCKThe scheduler has a fixed clock
GST_SCHEDULER_FLAG_NEW_API
GST_SCHEDULER_FLAG_LASTsubclasses can start numbering their flags starting from here.

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;

The state of the scheduler

GST_SCHEDULER_STATE_NONEno state
GST_SCHEDULER_STATE_RUNNINGthe scheduler is running
GST_SCHEDULER_STATE_STOPPEDthe scheduler is stopped
GST_SCHEDULER_STATE_ERRORthe scheduler is in error

gst_scheduler_setup ()

void        gst_scheduler_setup             (GstScheduler *sched);

Prepare the scheduler.

sched : the scheduler

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_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_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_scheduling_change ()

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

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 ()

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.

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_link ()

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

gst_scheduler_pad_unlink ()

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

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_clock_wait ()

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

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_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_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_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_auto_clock ()

void        gst_scheduler_auto_clock        (GstScheduler *sched);

Let the scheduler select a clock automatically.

sched : the scheduler

gst_scheduler_show ()

void        gst_scheduler_show              (GstScheduler *sched);

Dump the state of the scheduler

sched : the scheduler

GST_TYPE_SCHEDULER_FACTORY

#define GST_TYPE_SCHEDULER_FACTORY 		(gst_scheduler_factory_get_type ())


GST_SCHEDULER_FACTORY()

#define GST_SCHEDULER_FACTORY(obj) 		(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SCHEDULER_FACTORY, GstSchedulerFactory))

obj :

GST_IS_SCHEDULER_FACTORY()

#define GST_IS_SCHEDULER_FACTORY(obj) 		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SCHEDULER_FACTORY))

obj :

GST_SCHEDULER_FACTORY_CLASS()

#define GST_SCHEDULER_FACTORY_CLASS(klass) 	(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SCHEDULER_FACTORY, GstSchedulerFactoryClass))

klass :

GST_IS_SCHEDULER_FACTORY_CLASS()

#define GST_IS_SCHEDULER_FACTORY_CLASS(klass) 	(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SCHEDULER_FACTORY))

klass :

GST_SCHEDULER_FACTORY_GET_CLASS()

#define GST_SCHEDULER_FACTORY_GET_CLASS(obj) 	(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_SCHEDULER_FACTORY, GstSchedulerFactoryClass))

obj :

GST_SCHEDULER_DEFAULT_NAME

#define GST_SCHEDULER_DEFAULT_NAME	"opt"


struct GstSchedulerFactory

struct GstSchedulerFactory;


struct GstSchedulerFactoryClass

struct GstSchedulerFactoryClass {

  GstPluginFeatureClass parent;

  gpointer _gst_reserved[GST_PADDING];
};


gst_scheduler_factory_get_type ()

GType       gst_scheduler_factory_get_type  (void);

Returns :

gst_scheduler_factory_new ()

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.

gst_scheduler_factory_destroy ()

void        gst_scheduler_factory_destroy   (GstSchedulerFactory *factory);

Removes the scheduler from the global list.

factory : factory to destroy

gst_scheduler_factory_find ()

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

gst_scheduler_factory_create ()

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.

gst_scheduler_factory_make ()

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.

gst_scheduler_factory_set_default_name ()

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

gst_scheduler_factory_get_default_name ()

G_CONST_RETURN gchar* gst_scheduler_factory_get_default_name
                                            (void);

Get the default schedulerfactory name.

Returns : the name of the default scheduler.