mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 18:50:48 +00:00
Added vmethod for when an element changes scheduling behaviour (like switching from chain based to loop based etc)
Original commit message from CVS: Added vmethod for when an element changes scheduling behaviour (like switching from chain based to loop based etc)
This commit is contained in:
parent
8b3c7040d4
commit
1debaf2b59
2 changed files with 27 additions and 1 deletions
|
@ -203,8 +203,11 @@ gst_scheduler_add_element (GstScheduler *sched, GstElement *element)
|
|||
g_return_if_fail (GST_IS_ELEMENT (element));
|
||||
|
||||
/* if it's already in this scheduler, don't bother doing anything */
|
||||
if (GST_ELEMENT_SCHED (element) == sched)
|
||||
if (GST_ELEMENT_SCHED (element) == sched) {
|
||||
GST_DEBUG (GST_CAT_SCHEDULING, "element %s already in scheduler %p",
|
||||
GST_ELEMENT_NAME (element), sched);
|
||||
return;
|
||||
}
|
||||
|
||||
/* if it's not inside this scheduler, it has to be NULL */
|
||||
g_assert (GST_ELEMENT_SCHED (element) == NULL);
|
||||
|
@ -312,6 +315,27 @@ gst_scheduler_state_transition (GstScheduler *sched, GstElement *element, gint t
|
|||
return GST_STATE_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_scheduler_state_transition:
|
||||
* @sched: the scheduler
|
||||
* @element: the element with the state transition
|
||||
* @transition: the state transition
|
||||
*
|
||||
* Tell the scheduler that an element changed its state.
|
||||
*
|
||||
* Returns: a GstElementStateReturn indicating success or failure
|
||||
* of the state transition.
|
||||
*/
|
||||
void
|
||||
gst_scheduler_scheduling_change (GstScheduler *sched, GstElement *element)
|
||||
{
|
||||
g_return_if_fail (GST_IS_SCHEDULER (sched));
|
||||
g_return_if_fail (GST_IS_ELEMENT (element));
|
||||
|
||||
if (CLASS (sched)->scheduling_change)
|
||||
CLASS (sched)->scheduling_change (sched, element);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_scheduler_add_scheduler:
|
||||
* @sched: a #GstScheduler to add to
|
||||
|
|
|
@ -89,6 +89,7 @@ struct _GstSchedulerClass {
|
|||
void (*add_scheduler) (GstScheduler *sched, GstScheduler *sched2);
|
||||
void (*remove_scheduler) (GstScheduler *sched, GstScheduler *sched2);
|
||||
GstElementStateReturn (*state_transition) (GstScheduler *sched, GstElement *element, gint transition);
|
||||
void (*scheduling_change) (GstScheduler *sched, GstElement *element);
|
||||
void (*lock_element) (GstScheduler *sched, GstElement *element);
|
||||
void (*unlock_element) (GstScheduler *sched, GstElement *element);
|
||||
void (*yield) (GstScheduler *sched, GstElement *element);
|
||||
|
@ -119,6 +120,7 @@ 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);
|
||||
void gst_scheduler_yield (GstScheduler *sched, GstElement *element);
|
||||
|
|
Loading…
Reference in a new issue