mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-12 03:16:33 +00:00
latest updates, things are very close to working
Original commit message from CVS: latest updates, things are very close to working
This commit is contained in:
parent
2d0212c808
commit
395527b2f2
6 changed files with 37 additions and 21 deletions
|
@ -108,7 +108,8 @@ gst_identity_init (GstIdentity *identity)
|
|||
gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);
|
||||
|
||||
identity->loop_based = FALSE;
|
||||
identity->sleep_time = 10000;
|
||||
// identity->sleep_time = 10000;
|
||||
identity->sleep_time = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -125,7 +126,8 @@ gst_identity_chain (GstPad *pad, GstBuffer *buf)
|
|||
|
||||
gst_pad_push (identity->srcpad, buf);
|
||||
|
||||
usleep (identity->sleep_time);
|
||||
if (identity->sleep_time)
|
||||
usleep (identity->sleep_time);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -273,6 +273,7 @@ gst_bin_add (GstBin *bin,
|
|||
// then check to see if the element's name is already taken in the bin
|
||||
g_return_if_fail (gst_object_check_uniqueness (bin->children, GST_ELEMENT_NAME(element)) == TRUE);
|
||||
|
||||
// set the element's parent and add the element to the bin's list of children
|
||||
gst_object_set_parent (GST_OBJECT (element), GST_OBJECT (bin));
|
||||
bin->children = g_list_append (bin->children, element);
|
||||
bin->numchildren++;
|
||||
|
@ -285,10 +286,6 @@ gst_bin_add (GstBin *bin,
|
|||
|
||||
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, bin, "added child \"%s\"", GST_ELEMENT_NAME (element));
|
||||
|
||||
/* we know we have at least one child, we just added one... */
|
||||
// if (GST_STATE(element) < GST_STATE_READY)
|
||||
// gst_bin_change_state_norecurse(bin,GST_STATE_READY);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (bin), gst_bin_signals[OBJECT_ADDED], element);
|
||||
}
|
||||
|
||||
|
|
|
@ -775,9 +775,6 @@ void gst_bin_schedule_func(GstBin *bin) {
|
|||
|
||||
/*************** INCREMENTAL SCHEDULING CODE STARTS HERE ***************/
|
||||
|
||||
//static GstSchedule realsched;
|
||||
//static GstSchedule *sched = &realsched;
|
||||
|
||||
|
||||
static void gst_schedule_class_init (GstScheduleClass *klass);
|
||||
static void gst_schedule_init (GstSchedule *schedule);
|
||||
|
@ -898,6 +895,10 @@ gst_schedule_chain_add_element (GstScheduleChain *chain, GstElement *element)
|
|||
{
|
||||
GST_INFO (GST_CAT_SCHEDULING, "adding element \"%s\" to chain", GST_ELEMENT_NAME (element));
|
||||
|
||||
// set the sched pointer for the element
|
||||
element->sched = chain->sched;
|
||||
|
||||
// add the element to the list of 'disabled' elements
|
||||
chain->disabled = g_list_prepend (chain->disabled, element);
|
||||
chain->num_elements++;
|
||||
}
|
||||
|
@ -950,6 +951,9 @@ gst_schedule_chain_remove_element (GstScheduleChain *chain, GstElement *element)
|
|||
// if there are no more elements in the chain, destroy the chain
|
||||
if (chain->num_elements == 0)
|
||||
gst_schedule_chain_destroy(chain);
|
||||
|
||||
// unset the sched pointer for the element
|
||||
element->sched = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1128,11 +1132,19 @@ gst_schedule_add_element (GstSchedule *sched, GstElement *element)
|
|||
g_return_if_fail (element != NULL);
|
||||
g_return_if_fail (GST_IS_ELEMENT(element));
|
||||
|
||||
// if it's already in this schedule, don't bother doing anything
|
||||
if (GST_ELEMENT_SCHED(element) == sched) return;
|
||||
|
||||
GST_INFO (GST_CAT_SCHEDULING, "adding element \"%s\" to schedule",
|
||||
GST_ELEMENT_NAME(element));
|
||||
|
||||
// if the element already has a different scheduler, remove the element from it
|
||||
if (GST_ELEMENT_SCHED(element)) {
|
||||
gst_schedule_remove_element(GST_ELEMENT_SCHED(element),element);
|
||||
}
|
||||
|
||||
// set the sched pointer in the element itself
|
||||
gst_element_set_sched (element, sched);
|
||||
GST_ELEMENT_SCHED(element) = sched;
|
||||
|
||||
// only deal with elements after this point, not bins
|
||||
if (GST_IS_BIN (element)) return;
|
||||
|
@ -1209,9 +1221,6 @@ gst_schedule_remove_element (GstSchedule *sched, GstElement *element)
|
|||
// find what chain the element is in
|
||||
chain = gst_schedule_find_chain(sched, element);
|
||||
|
||||
// disable the element, i.e. remove from chain's active list
|
||||
gst_schedule_chain_disable_element (chain, element);
|
||||
|
||||
// remove it from its chain
|
||||
gst_schedule_chain_remove_element (chain, element);
|
||||
|
||||
|
@ -1220,7 +1229,7 @@ gst_schedule_remove_element (GstSchedule *sched, GstElement *element)
|
|||
sched->num_elements--;
|
||||
|
||||
// unset the scheduler pointer in the element
|
||||
gst_element_set_sched (element, NULL);
|
||||
GST_ELEMENT_SCHED(element) = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -407,7 +407,7 @@ gst_thread_signal_thread (GstThread *thread, gboolean spinning)
|
|||
{
|
||||
// set the spinning state
|
||||
if (spinning) GST_FLAG_SET(thread,GST_THREAD_STATE_SPINNING);
|
||||
else GST_FLAG_SET (thread, GST_THREAD_STATE_SPINNING);
|
||||
else GST_FLAG_UNSET (thread, GST_THREAD_STATE_SPINNING);
|
||||
|
||||
GST_DEBUG (GST_CAT_THREAD, "sync-main: locking\n");
|
||||
g_mutex_lock(thread->lock);
|
||||
|
|
|
@ -108,7 +108,8 @@ gst_identity_init (GstIdentity *identity)
|
|||
gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);
|
||||
|
||||
identity->loop_based = FALSE;
|
||||
identity->sleep_time = 10000;
|
||||
// identity->sleep_time = 10000;
|
||||
identity->sleep_time = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -125,7 +126,8 @@ gst_identity_chain (GstPad *pad, GstBuffer *buf)
|
|||
|
||||
gst_pad_push (identity->srcpad, buf);
|
||||
|
||||
usleep (identity->sleep_time);
|
||||
if (identity->sleep_time)
|
||||
usleep (identity->sleep_time);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -28,18 +28,24 @@ int main(int argc,char *argv[]) {
|
|||
|
||||
fprintf(stderr,"\nSWITCHING to READY:\n");
|
||||
gst_element_set_state (thread, GST_STATE_READY);
|
||||
fprintf(stderr,"\nPIPELINE sched:\n");
|
||||
gst_schedule_show(GST_ELEMENT_SCHED(pipeline));
|
||||
fprintf(stderr,"\nTHREAD sched:\n");
|
||||
gst_schedule_show(GST_ELEMENT_SCHED(thread));
|
||||
|
||||
/*
|
||||
fprintf(stderr,"\nSWITCHING to PLAYING:\n");
|
||||
gst_element_set_state (thread, GST_STATE_PLAYING);
|
||||
gst_schedule_show(GST_ELEMENT_SCHED(pipeline));
|
||||
gst_schedule_show(GST_ELEMENT_SCHED(thread));
|
||||
|
||||
fprintf(stderr,"sleeping...\n");
|
||||
sleep(1);
|
||||
fprintf(stderr,"done sleeping...\n");
|
||||
|
||||
fprintf(stderr,"\nSWITCHING to READY:\n");
|
||||
gst_element_set_state (thread, GST_STATE_READY);
|
||||
gst_schedule_show(GST_ELEMENT_SCHED(pipeline));
|
||||
gst_schedule_show(GST_ELEMENT_SCHED(thread));
|
||||
*/
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue