mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-06-26 09:50:39 +00:00
GST_DEBUG and _INFO should have no trailing \n
Original commit message from CVS: GST_DEBUG and _INFO should have no trailing \n
This commit is contained in:
parent
c14adca257
commit
ffe760e476
|
@ -141,6 +141,18 @@ gst_identity_get_bufferpool (GstPad *pad)
|
||||||
return gst_pad_get_bufferpool (identity->srcpad);
|
return gst_pad_get_bufferpool (identity->srcpad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GstCaps*
|
||||||
|
gst_identity_getcaps (GstPad *pad, GstCaps *caps)
|
||||||
|
{
|
||||||
|
GstIdentity *identity;
|
||||||
|
GstPad *otherpad;
|
||||||
|
|
||||||
|
identity = GST_IDENTITY (gst_pad_get_parent (pad));
|
||||||
|
otherpad = (pad == identity->srcpad ? identity->sinkpad : identity->srcpad);
|
||||||
|
|
||||||
|
return gst_pad_get_allowed_caps (otherpad);
|
||||||
|
}
|
||||||
|
|
||||||
static GstPadConnectReturn
|
static GstPadConnectReturn
|
||||||
gst_identity_connect (GstPad *pad, GstCaps *caps)
|
gst_identity_connect (GstPad *pad, GstCaps *caps)
|
||||||
{
|
{
|
||||||
|
@ -167,10 +179,12 @@ gst_identity_init (GstIdentity *identity)
|
||||||
gst_pad_set_chain_function (identity->sinkpad, GST_DEBUG_FUNCPTR (gst_identity_chain));
|
gst_pad_set_chain_function (identity->sinkpad, GST_DEBUG_FUNCPTR (gst_identity_chain));
|
||||||
gst_pad_set_bufferpool_function (identity->sinkpad, gst_identity_get_bufferpool);
|
gst_pad_set_bufferpool_function (identity->sinkpad, gst_identity_get_bufferpool);
|
||||||
gst_pad_set_connect_function (identity->sinkpad, gst_identity_connect);
|
gst_pad_set_connect_function (identity->sinkpad, gst_identity_connect);
|
||||||
|
gst_pad_set_getcaps_function (identity->sinkpad, gst_identity_getcaps);
|
||||||
|
|
||||||
identity->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
identity->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||||
gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);
|
gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);
|
||||||
gst_pad_set_connect_function (identity->srcpad, gst_identity_connect);
|
gst_pad_set_connect_function (identity->srcpad, gst_identity_connect);
|
||||||
|
gst_pad_set_getcaps_function (identity->srcpad, gst_identity_getcaps);
|
||||||
|
|
||||||
identity->loop_based = FALSE;
|
identity->loop_based = FALSE;
|
||||||
identity->sleep_time = 0;
|
identity->sleep_time = 0;
|
||||||
|
|
|
@ -392,7 +392,7 @@ gst_bin_remove (GstBin *bin, GstElement *element)
|
||||||
gint state_idx = 0;
|
gint state_idx = 0;
|
||||||
GstElementState state;
|
GstElementState state;
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_PARENTAGE, bin, "trying to remove child %s\n", GST_ELEMENT_NAME (element));
|
GST_DEBUG_ELEMENT (GST_CAT_PARENTAGE, bin, "trying to remove child %s", GST_ELEMENT_NAME (element));
|
||||||
|
|
||||||
g_return_if_fail (bin != NULL);
|
g_return_if_fail (bin != NULL);
|
||||||
g_return_if_fail (GST_IS_BIN (bin));
|
g_return_if_fail (GST_IS_BIN (bin));
|
||||||
|
@ -553,7 +553,7 @@ gst_bin_change_state_norecurse (GstBin * bin)
|
||||||
GstElementStateReturn ret;
|
GstElementStateReturn ret;
|
||||||
|
|
||||||
if (GST_ELEMENT_CLASS (parent_class)->change_state) {
|
if (GST_ELEMENT_CLASS (parent_class)->change_state) {
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_STATES, bin, "setting bin's own state\n");
|
GST_DEBUG_ELEMENT (GST_CAT_STATES, bin, "setting bin's own state");
|
||||||
ret = GST_ELEMENT_CLASS (parent_class)->change_state (GST_ELEMENT (bin));
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (GST_ELEMENT (bin));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -845,9 +845,9 @@ gst_bin_iterate (GstBin * bin)
|
||||||
if (!running) {
|
if (!running) {
|
||||||
if (GST_STATE (bin) == GST_STATE_PLAYING && GST_STATE_PENDING (bin) == GST_STATE_VOID_PENDING) {
|
if (GST_STATE (bin) == GST_STATE_PLAYING && GST_STATE_PENDING (bin) == GST_STATE_VOID_PENDING) {
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, bin,
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, bin,
|
||||||
"waiting for child shutdown after useless iteration\n");
|
"waiting for child shutdown after useless iteration");
|
||||||
gst_element_wait_state_change (GST_ELEMENT (bin));
|
gst_element_wait_state_change (GST_ELEMENT (bin));
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, bin, "child shutdown\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, bin, "child shutdown");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1248,7 +1248,7 @@ gst_element_set_state (GstElement *element, GstElementState state)
|
||||||
/* start with the current state */
|
/* start with the current state */
|
||||||
curpending = GST_STATE(element);
|
curpending = GST_STATE(element);
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_STATES, element, "setting state from %s to %s\n",
|
GST_DEBUG_ELEMENT (GST_CAT_STATES, element, "setting state from %s to %s",
|
||||||
gst_element_statename (curpending),
|
gst_element_statename (curpending),
|
||||||
gst_element_statename (state));
|
gst_element_statename (state));
|
||||||
|
|
||||||
|
@ -1265,7 +1265,7 @@ gst_element_set_state (GstElement *element, GstElementState state)
|
||||||
GST_STATE_PENDING (element) = curpending;
|
GST_STATE_PENDING (element) = curpending;
|
||||||
|
|
||||||
if (curpending != state) {
|
if (curpending != state) {
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_STATES, element, "intermediate: setting state to %s\n",
|
GST_DEBUG_ELEMENT (GST_CAT_STATES, element, "intermediate: setting state to %s",
|
||||||
gst_element_statename (curpending));
|
gst_element_statename (curpending));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1276,17 +1276,17 @@ gst_element_set_state (GstElement *element, GstElementState state)
|
||||||
|
|
||||||
switch (return_val) {
|
switch (return_val) {
|
||||||
case GST_STATE_FAILURE:
|
case GST_STATE_FAILURE:
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_STATES, element, "have failed change_state return\n");
|
GST_DEBUG_ELEMENT (GST_CAT_STATES, element, "have failed change_state return");
|
||||||
return return_val;
|
return return_val;
|
||||||
case GST_STATE_ASYNC:
|
case GST_STATE_ASYNC:
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_STATES, element, "element will change state async\n");
|
GST_DEBUG_ELEMENT (GST_CAT_STATES, element, "element will change state async");
|
||||||
return return_val;
|
return return_val;
|
||||||
default:
|
default:
|
||||||
/* Last thing we do is verify that a successful state change really
|
/* Last thing we do is verify that a successful state change really
|
||||||
* did change the state... */
|
* did change the state... */
|
||||||
if (GST_STATE (element) != curpending) {
|
if (GST_STATE (element) != curpending) {
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_STATES, element,
|
GST_DEBUG_ELEMENT (GST_CAT_STATES, element,
|
||||||
"element claimed state-change success, but state didn't change %s, %s <-> %s\n",
|
"element claimed state-change success, but state didn't change %s, %s <-> %s",
|
||||||
gst_element_statename (GST_STATE (element)),
|
gst_element_statename (GST_STATE (element)),
|
||||||
gst_element_statename (GST_STATE_PENDING (element)),
|
gst_element_statename (GST_STATE_PENDING (element)),
|
||||||
gst_element_statename (curpending));
|
gst_element_statename (curpending));
|
||||||
|
@ -1304,7 +1304,7 @@ gst_element_negotiate_pads (GstElement *element)
|
||||||
{
|
{
|
||||||
GList *pads = GST_ELEMENT_PADS (element);
|
GList *pads = GST_ELEMENT_PADS (element);
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_CAPS, element, "negotiating pads\n");
|
GST_DEBUG_ELEMENT (GST_CAT_CAPS, element, "negotiating pads");
|
||||||
|
|
||||||
while (pads) {
|
while (pads) {
|
||||||
GstPad *pad = GST_PAD (pads->data);
|
GstPad *pad = GST_PAD (pads->data);
|
||||||
|
@ -1344,13 +1344,13 @@ gst_element_negotiate_pads (GstElement *element)
|
||||||
|
|
||||||
/* only try to negotiate if the peer element is in PAUSED or higher too */
|
/* only try to negotiate if the peer element is in PAUSED or higher too */
|
||||||
if (otherstate >= GST_STATE_READY) {
|
if (otherstate >= GST_STATE_READY) {
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_CAPS, element, "perform negotiate for %s:%s and %s:%s\n",
|
GST_DEBUG_ELEMENT (GST_CAT_CAPS, element, "perform negotiate for %s:%s and %s:%s",
|
||||||
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
|
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
|
||||||
if (!gst_pad_perform_negotiate (GST_PAD (srcpad), GST_PAD (sinkpad)))
|
if (!gst_pad_perform_negotiate (GST_PAD (srcpad), GST_PAD (sinkpad)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_CAPS, element, "not negotiatiating %s:%s and %s:%s, not in READY yet\n",
|
GST_DEBUG_ELEMENT (GST_CAT_CAPS, element, "not negotiatiating %s:%s and %s:%s, not in READY yet",
|
||||||
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
|
GST_DEBUG_PAD_NAME (srcpad), GST_DEBUG_PAD_NAME (sinkpad));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1364,7 +1364,7 @@ gst_element_clear_pad_caps (GstElement *element)
|
||||||
{
|
{
|
||||||
GList *pads = GST_ELEMENT_PADS (element);
|
GList *pads = GST_ELEMENT_PADS (element);
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_CAPS, element, "clearing pad caps\n");
|
GST_DEBUG_ELEMENT (GST_CAT_CAPS, element, "clearing pad caps");
|
||||||
|
|
||||||
while (pads) {
|
while (pads) {
|
||||||
GstRealPad *pad = GST_PAD_REALIZE (pads->data);
|
GstRealPad *pad = GST_PAD_REALIZE (pads->data);
|
||||||
|
@ -1473,7 +1473,7 @@ gst_element_dispose (GObject *object)
|
||||||
GList *pads;
|
GList *pads;
|
||||||
GstPad *pad;
|
GstPad *pad;
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_REFCOUNTING, element, "dispose\n");
|
GST_DEBUG_ELEMENT (GST_CAT_REFCOUNTING, element, "dispose");
|
||||||
|
|
||||||
gst_element_set_state (element, GST_STATE_NULL);
|
gst_element_set_state (element, GST_STATE_NULL);
|
||||||
|
|
||||||
|
|
|
@ -95,30 +95,30 @@ gst_props_debug_entry (GstPropsEntry *entry)
|
||||||
|
|
||||||
switch (entry->propstype) {
|
switch (entry->propstype) {
|
||||||
case GST_PROPS_INT_TYPE:
|
case GST_PROPS_INT_TYPE:
|
||||||
GST_DEBUG (GST_CAT_PROPERTIES, "%s: int %d\n", name, entry->data.int_data);
|
GST_DEBUG (GST_CAT_PROPERTIES, "%s: int %d", name, entry->data.int_data);
|
||||||
break;
|
break;
|
||||||
case GST_PROPS_FLOAT_TYPE:
|
case GST_PROPS_FLOAT_TYPE:
|
||||||
GST_DEBUG (GST_CAT_PROPERTIES, "%s: float %f\n", name, entry->data.float_data);
|
GST_DEBUG (GST_CAT_PROPERTIES, "%s: float %f", name, entry->data.float_data);
|
||||||
break;
|
break;
|
||||||
case GST_PROPS_FOURCC_TYPE:
|
case GST_PROPS_FOURCC_TYPE:
|
||||||
GST_DEBUG (GST_CAT_PROPERTIES, "%s: fourcc %4.4s\n", name, (gchar*)&entry->data.fourcc_data);
|
GST_DEBUG (GST_CAT_PROPERTIES, "%s: fourcc %4.4s", name, (gchar*)&entry->data.fourcc_data);
|
||||||
break;
|
break;
|
||||||
case GST_PROPS_BOOL_TYPE:
|
case GST_PROPS_BOOL_TYPE:
|
||||||
GST_DEBUG (GST_CAT_PROPERTIES, "%s: bool %d\n", name, entry->data.bool_data);
|
GST_DEBUG (GST_CAT_PROPERTIES, "%s: bool %d", name, entry->data.bool_data);
|
||||||
break;
|
break;
|
||||||
case GST_PROPS_STRING_TYPE:
|
case GST_PROPS_STRING_TYPE:
|
||||||
GST_DEBUG (GST_CAT_PROPERTIES, "%s: string %s\n", name, entry->data.string_data.string);
|
GST_DEBUG (GST_CAT_PROPERTIES, "%s: string %s", name, entry->data.string_data.string);
|
||||||
break;
|
break;
|
||||||
case GST_PROPS_INT_RANGE_TYPE:
|
case GST_PROPS_INT_RANGE_TYPE:
|
||||||
GST_DEBUG (GST_CAT_PROPERTIES, "%s: int range %d-%d\n", name, entry->data.int_range_data.min,
|
GST_DEBUG (GST_CAT_PROPERTIES, "%s: int range %d-%d", name, entry->data.int_range_data.min,
|
||||||
entry->data.int_range_data.max);
|
entry->data.int_range_data.max);
|
||||||
break;
|
break;
|
||||||
case GST_PROPS_FLOAT_RANGE_TYPE:
|
case GST_PROPS_FLOAT_RANGE_TYPE:
|
||||||
GST_DEBUG (GST_CAT_PROPERTIES, "%s: float range %f-%f\n", name, entry->data.float_range_data.min,
|
GST_DEBUG (GST_CAT_PROPERTIES, "%s: float range %f-%f", name, entry->data.float_range_data.min,
|
||||||
entry->data.float_range_data.max);
|
entry->data.float_range_data.max);
|
||||||
break;
|
break;
|
||||||
case GST_PROPS_LIST_TYPE:
|
case GST_PROPS_LIST_TYPE:
|
||||||
GST_DEBUG (GST_CAT_PROPERTIES, "[list]\n");
|
GST_DEBUG (GST_CAT_PROPERTIES, "[list]");
|
||||||
{
|
{
|
||||||
GList *entries = entry->data.list_data.entries;
|
GList *entries = entry->data.list_data.entries;
|
||||||
|
|
||||||
|
@ -1218,7 +1218,7 @@ gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry
|
||||||
switch (entry2->propstype) {
|
switch (entry2->propstype) {
|
||||||
/* b <---> a */
|
/* b <---> a */
|
||||||
case GST_PROPS_FOURCC_TYPE:
|
case GST_PROPS_FOURCC_TYPE:
|
||||||
GST_DEBUG(GST_CAT_PROPERTIES,"\"%4.4s\" <--> \"%4.4s\" ?\n",
|
GST_DEBUG(GST_CAT_PROPERTIES,"\"%4.4s\" <--> \"%4.4s\" ?",
|
||||||
(char*) &entry2->data.fourcc_data, (char*) &entry1->data.fourcc_data);
|
(char*) &entry2->data.fourcc_data, (char*) &entry1->data.fourcc_data);
|
||||||
return (entry2->data.fourcc_data == entry1->data.fourcc_data);
|
return (entry2->data.fourcc_data == entry1->data.fourcc_data);
|
||||||
default:
|
default:
|
||||||
|
@ -1229,13 +1229,13 @@ gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry
|
||||||
switch (entry2->propstype) {
|
switch (entry2->propstype) {
|
||||||
/* b <---> a - d */
|
/* b <---> a - d */
|
||||||
case GST_PROPS_INT_RANGE_TYPE:
|
case GST_PROPS_INT_RANGE_TYPE:
|
||||||
GST_DEBUG(GST_CAT_PROPERTIES,"%d <= %d <= %d ?\n",entry2->data.int_range_data.min,
|
GST_DEBUG(GST_CAT_PROPERTIES,"%d <= %d <= %d ?",entry2->data.int_range_data.min,
|
||||||
entry1->data.int_data,entry2->data.int_range_data.max);
|
entry1->data.int_data,entry2->data.int_range_data.max);
|
||||||
return (entry2->data.int_range_data.min <= entry1->data.int_data &&
|
return (entry2->data.int_range_data.min <= entry1->data.int_data &&
|
||||||
entry2->data.int_range_data.max >= entry1->data.int_data);
|
entry2->data.int_range_data.max >= entry1->data.int_data);
|
||||||
/* b <---> a */
|
/* b <---> a */
|
||||||
case GST_PROPS_INT_TYPE:
|
case GST_PROPS_INT_TYPE:
|
||||||
GST_DEBUG(GST_CAT_PROPERTIES,"%d == %d ?\n",entry1->data.int_data,entry2->data.int_data);
|
GST_DEBUG(GST_CAT_PROPERTIES,"%d == %d ?",entry1->data.int_data,entry2->data.int_data);
|
||||||
return (entry2->data.int_data == entry1->data.int_data);
|
return (entry2->data.int_data == entry1->data.int_data);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -1266,7 +1266,7 @@ gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry
|
||||||
switch (entry2->propstype) {
|
switch (entry2->propstype) {
|
||||||
/* t <---> t */
|
/* t <---> t */
|
||||||
case GST_PROPS_STRING_TYPE:
|
case GST_PROPS_STRING_TYPE:
|
||||||
GST_DEBUG(GST_CAT_PROPERTIES,"\"%s\" <--> \"%s\" ?\n",
|
GST_DEBUG(GST_CAT_PROPERTIES,"\"%s\" <--> \"%s\" ?",
|
||||||
entry2->data.string_data.string, entry1->data.string_data.string);
|
entry2->data.string_data.string, entry1->data.string_data.string);
|
||||||
return (!strcmp (entry2->data.string_data.string, entry1->data.string_data.string));
|
return (!strcmp (entry2->data.string_data.string, entry1->data.string_data.string));
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -223,7 +223,7 @@ gst_queue_init (GstQueue *queue)
|
||||||
queue->writer = FALSE;
|
queue->writer = FALSE;
|
||||||
queue->not_empty = g_cond_new ();
|
queue->not_empty = g_cond_new ();
|
||||||
queue->not_full = g_cond_new ();
|
queue->not_full = g_cond_new ();
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_THREAD, queue, "initialized queue's not_empty & not_full conditions\n");
|
GST_DEBUG_ELEMENT (GST_CAT_THREAD, queue, "initialized queue's not_empty & not_full conditions");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -251,7 +251,7 @@ gst_queue_get_bufferpool (GstPad *pad)
|
||||||
static void
|
static void
|
||||||
gst_queue_cleanup_buffers (gpointer data, const gpointer user_data)
|
gst_queue_cleanup_buffers (gpointer data, const gpointer user_data)
|
||||||
{
|
{
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, user_data, "cleaning buffer %p\n", data);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, user_data, "cleaning buffer %p", data);
|
||||||
|
|
||||||
if (GST_IS_BUFFER (data)) {
|
if (GST_IS_BUFFER (data)) {
|
||||||
gst_buffer_unref (GST_BUFFER (data));
|
gst_buffer_unref (GST_BUFFER (data));
|
||||||
|
@ -287,9 +287,9 @@ gst_queue_chain (GstPad *pad, GstBuffer *buf)
|
||||||
|
|
||||||
restart:
|
restart:
|
||||||
/* we have to lock the queue since we span threads */
|
/* we have to lock the queue since we span threads */
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locking t:%ld\n", pthread_self ());
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locking t:%ld", pthread_self ());
|
||||||
g_mutex_lock (queue->qlock);
|
g_mutex_lock (queue->qlock);
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locked t:%ld\n", pthread_self ());
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locked t:%ld", pthread_self ());
|
||||||
|
|
||||||
if (GST_IS_EVENT (buf)) {
|
if (GST_IS_EVENT (buf)) {
|
||||||
switch (GST_EVENT_TYPE (buf)) {
|
switch (GST_EVENT_TYPE (buf)) {
|
||||||
|
@ -307,7 +307,7 @@ restart:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "adding buffer %p of size %d\n",buf,GST_BUFFER_SIZE(buf));
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "adding buffer %p of size %d",buf,GST_BUFFER_SIZE(buf));
|
||||||
|
|
||||||
if (queue->level_buffers == queue->size_buffers) {
|
if (queue->level_buffers == queue->size_buffers) {
|
||||||
/* if this is a leaky queue... */
|
/* if this is a leaky queue... */
|
||||||
|
@ -315,12 +315,12 @@ restart:
|
||||||
/* FIXME don't want to leak events! */
|
/* FIXME don't want to leak events! */
|
||||||
/* if we leak on the upstream side, drop the current buffer */
|
/* if we leak on the upstream side, drop the current buffer */
|
||||||
if (queue->leaky == GST_QUEUE_LEAK_UPSTREAM) {
|
if (queue->leaky == GST_QUEUE_LEAK_UPSTREAM) {
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on upstream end\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on upstream end");
|
||||||
if (GST_IS_EVENT (buf))
|
if (GST_IS_EVENT (buf))
|
||||||
fprintf(stderr, "Error: queue [%s] leaked an event, type:%d\n",
|
fprintf(stderr, "Error: queue [%s] leaked an event, type:%d\n",
|
||||||
GST_ELEMENT_NAME(GST_ELEMENT(queue)),
|
GST_ELEMENT_NAME(GST_ELEMENT(queue)),
|
||||||
GST_EVENT_TYPE(GST_EVENT(buf)));
|
GST_EVENT_TYPE(GST_EVENT(buf)));
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on upstream end\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on upstream end");
|
||||||
gst_buffer_unref(buf);
|
gst_buffer_unref(buf);
|
||||||
/* now we have to clean up and exit right away */
|
/* now we have to clean up and exit right away */
|
||||||
g_mutex_unlock (queue->qlock);
|
g_mutex_unlock (queue->qlock);
|
||||||
|
@ -330,7 +330,7 @@ restart:
|
||||||
else {
|
else {
|
||||||
GList *front;
|
GList *front;
|
||||||
GstBuffer *leakbuf;
|
GstBuffer *leakbuf;
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on downstream end\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on downstream end");
|
||||||
front = queue->queue;
|
front = queue->queue;
|
||||||
leakbuf = (GstBuffer *)(front->data);
|
leakbuf = (GstBuffer *)(front->data);
|
||||||
if (GST_IS_EVENT (leakbuf))
|
if (GST_IS_EVENT (leakbuf))
|
||||||
|
@ -345,13 +345,13 @@ restart:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "pre full wait, level:%d/%d\n",
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "pre full wait, level:%d/%d",
|
||||||
queue->level_buffers, queue->size_buffers);
|
queue->level_buffers, queue->size_buffers);
|
||||||
while (queue->level_buffers == queue->size_buffers) {
|
while (queue->level_buffers == queue->size_buffers) {
|
||||||
/* if there's a pending state change for this queue or its manager, switch */
|
/* if there's a pending state change for this queue or its manager, switch */
|
||||||
/* back to iterator so bottom half of state change executes */
|
/* back to iterator so bottom half of state change executes */
|
||||||
while (GST_STATE_PENDING (queue) != GST_STATE_VOID_PENDING) {
|
while (GST_STATE_PENDING (queue) != GST_STATE_VOID_PENDING) {
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "interrupted!!\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "interrupted!!");
|
||||||
g_mutex_unlock (queue->qlock);
|
g_mutex_unlock (queue->qlock);
|
||||||
if (gst_element_interrupt (GST_ELEMENT (queue)))
|
if (gst_element_interrupt (GST_ELEMENT (queue)))
|
||||||
return;
|
return;
|
||||||
|
@ -372,15 +372,16 @@ restart:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "waiting for not_full, level:%d/%d\n", queue->level_buffers, queue->size_buffers);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "waiting for not_full, level:%d/%d",
|
||||||
|
queue->level_buffers, queue->size_buffers);
|
||||||
if (queue->writer)
|
if (queue->writer)
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "WARNING: multiple writers on queue!\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "WARNING: multiple writers on queue!");
|
||||||
queue->writer = TRUE;
|
queue->writer = TRUE;
|
||||||
g_cond_wait (queue->not_full, queue->qlock);
|
g_cond_wait (queue->not_full, queue->qlock);
|
||||||
queue->writer = FALSE;
|
queue->writer = FALSE;
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "got not_full signal\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "got not_full signal");
|
||||||
}
|
}
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "post full wait, level:%d/%d\n",
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "post full wait, level:%d/%d",
|
||||||
queue->level_buffers, queue->size_buffers);
|
queue->level_buffers, queue->size_buffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,7 +390,7 @@ restart:
|
||||||
queue->level_buffers++;
|
queue->level_buffers++;
|
||||||
queue->level_bytes += GST_BUFFER_SIZE(buf);
|
queue->level_bytes += GST_BUFFER_SIZE(buf);
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "(%s:%s)+ level:%d/%d\n",
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "(%s:%s)+ level:%d/%d",
|
||||||
GST_DEBUG_PAD_NAME(pad),
|
GST_DEBUG_PAD_NAME(pad),
|
||||||
queue->level_buffers, queue->size_buffers);
|
queue->level_buffers, queue->size_buffers);
|
||||||
|
|
||||||
|
@ -403,7 +404,7 @@ restart:
|
||||||
|
|
||||||
if (reader)
|
if (reader)
|
||||||
{
|
{
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "signalling not_empty\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "signalling not_empty");
|
||||||
g_cond_signal (queue->not_empty);
|
g_cond_signal (queue->not_empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -425,17 +426,17 @@ gst_queue_get (GstPad *pad)
|
||||||
|
|
||||||
restart:
|
restart:
|
||||||
/* have to lock for thread-safety */
|
/* have to lock for thread-safety */
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locking t:%ld\n", pthread_self ());
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locking t:%ld", pthread_self ());
|
||||||
g_mutex_lock (queue->qlock);
|
g_mutex_lock (queue->qlock);
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locked t:%ld %p\n", pthread_self (), queue->not_empty);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locked t:%ld %p", pthread_self (), queue->not_empty);
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "pre empty wait, level:%d/%d\n", queue->level_buffers, queue->size_buffers);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "pre empty wait, level:%d/%d", queue->level_buffers, queue->size_buffers);
|
||||||
while (queue->level_buffers == 0) {
|
while (queue->level_buffers == 0) {
|
||||||
/* if there's a pending state change for this queue or its manager, switch
|
/* if there's a pending state change for this queue or its manager, switch
|
||||||
* back to iterator so bottom half of state change executes
|
* back to iterator so bottom half of state change executes
|
||||||
*/
|
*/
|
||||||
while (GST_STATE_PENDING (queue) != GST_STATE_VOID_PENDING) {
|
while (GST_STATE_PENDING (queue) != GST_STATE_VOID_PENDING) {
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "interrupted!!\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "interrupted!!");
|
||||||
g_mutex_unlock (queue->qlock);
|
g_mutex_unlock (queue->qlock);
|
||||||
if (gst_element_interrupt (GST_ELEMENT (queue)))
|
if (gst_element_interrupt (GST_ELEMENT (queue)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -453,26 +454,26 @@ restart:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "waiting for not_empty, level:%d/%d\n", queue->level_buffers, queue->size_buffers);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "waiting for not_empty, level:%d/%d", queue->level_buffers, queue->size_buffers);
|
||||||
if (queue->reader)
|
if (queue->reader)
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "WARNING: multiple readers on queue!\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "WARNING: multiple readers on queue!");
|
||||||
queue->reader = TRUE;
|
queue->reader = TRUE;
|
||||||
g_cond_wait (queue->not_empty, queue->qlock);
|
g_cond_wait (queue->not_empty, queue->qlock);
|
||||||
queue->reader = FALSE;
|
queue->reader = FALSE;
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "got not_empty signal\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "got not_empty signal");
|
||||||
}
|
}
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "post empty wait, level:%d/%d\n", queue->level_buffers, queue->size_buffers);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "post empty wait, level:%d/%d", queue->level_buffers, queue->size_buffers);
|
||||||
|
|
||||||
front = queue->queue;
|
front = queue->queue;
|
||||||
buf = (GstBuffer *)(front->data);
|
buf = (GstBuffer *)(front->data);
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "retrieved buffer %p from queue\n", buf);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "retrieved buffer %p from queue", buf);
|
||||||
queue->queue = g_list_remove_link (queue->queue, front);
|
queue->queue = g_list_remove_link (queue->queue, front);
|
||||||
g_list_free (front);
|
g_list_free (front);
|
||||||
|
|
||||||
queue->level_buffers--;
|
queue->level_buffers--;
|
||||||
queue->level_bytes -= GST_BUFFER_SIZE(buf);
|
queue->level_bytes -= GST_BUFFER_SIZE(buf);
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "(%s:%s)- level:%d/%d\n",
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "(%s:%s)- level:%d/%d",
|
||||||
GST_DEBUG_PAD_NAME(pad),
|
GST_DEBUG_PAD_NAME(pad),
|
||||||
queue->level_buffers, queue->size_buffers);
|
queue->level_buffers, queue->size_buffers);
|
||||||
|
|
||||||
|
@ -486,7 +487,7 @@ restart:
|
||||||
|
|
||||||
if (writer)
|
if (writer)
|
||||||
{
|
{
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "signalling not_full\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "signalling not_full");
|
||||||
g_cond_signal (queue->not_full);
|
g_cond_signal (queue->not_full);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,7 +496,7 @@ restart:
|
||||||
GstEvent *event = GST_EVENT(buf);
|
GstEvent *event = GST_EVENT(buf);
|
||||||
switch (GST_EVENT_TYPE(event)) {
|
switch (GST_EVENT_TYPE(event)) {
|
||||||
case GST_EVENT_EOS:
|
case GST_EVENT_EOS:
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue \"%s\" eos\n", GST_ELEMENT_NAME (queue));
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue \"%s\" eos", GST_ELEMENT_NAME (queue));
|
||||||
gst_element_set_eos (GST_ELEMENT (queue));
|
gst_element_set_eos (GST_ELEMENT (queue));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -128,8 +128,6 @@ void gst_scheduler_error (GstScheduler *sched, GstElement *element);
|
||||||
void gst_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad);
|
void gst_scheduler_pad_connect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkpad);
|
||||||
void gst_scheduler_pad_disconnect (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);
|
GstPad* gst_scheduler_pad_select (GstScheduler *sched, GList *padlist);
|
||||||
GstClock* gst_scheduler_get_clock (GstScheduler *sched);
|
|
||||||
GstClock* gst_scheduler_get_clock (GstScheduler *sched);
|
|
||||||
GstClockReturn gst_scheduler_clock_wait (GstScheduler *sched, GstElement *element,
|
GstClockReturn gst_scheduler_clock_wait (GstScheduler *sched, GstElement *element,
|
||||||
GstClock *clock, GstClockTime time);
|
GstClock *clock, GstClockTime time);
|
||||||
gboolean gst_scheduler_iterate (GstScheduler *sched);
|
gboolean gst_scheduler_iterate (GstScheduler *sched);
|
||||||
|
|
|
@ -265,7 +265,7 @@ gst_thread_change_state (GstElement * element)
|
||||||
|
|
||||||
if (pthread_equal (self, thread->thread_id)) {
|
if (pthread_equal (self, thread->thread_id)) {
|
||||||
GST_DEBUG (GST_CAT_THREAD,
|
GST_DEBUG (GST_CAT_THREAD,
|
||||||
"no sync(" GST_DEBUG_THREAD_FORMAT "): setting own thread's state to spinning\n",
|
"no sync(" GST_DEBUG_THREAD_FORMAT "): setting own thread's state to spinning",
|
||||||
GST_DEBUG_THREAD_ARGS (thread->pid));
|
GST_DEBUG_THREAD_ARGS (thread->pid));
|
||||||
return gst_thread_update_state (thread);
|
return gst_thread_update_state (thread);
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,7 @@ gst_thread_change_state (GstElement * element)
|
||||||
/* set the state to idle */
|
/* set the state to idle */
|
||||||
GST_FLAG_UNSET (thread, GST_THREAD_STATE_SPINNING);
|
GST_FLAG_UNSET (thread, GST_THREAD_STATE_SPINNING);
|
||||||
|
|
||||||
THR_DEBUG ("creating thread \"%s\"\n", GST_ELEMENT_NAME (element));
|
THR_DEBUG ("creating thread \"%s\"", GST_ELEMENT_NAME (element));
|
||||||
|
|
||||||
g_mutex_lock (thread->lock);
|
g_mutex_lock (thread->lock);
|
||||||
|
|
||||||
|
@ -283,29 +283,29 @@ gst_thread_change_state (GstElement * element)
|
||||||
pthread_create (&thread->thread_id, NULL, gst_thread_main_loop, thread);
|
pthread_create (&thread->thread_id, NULL, gst_thread_main_loop, thread);
|
||||||
|
|
||||||
/* wait for it to 'spin up' */
|
/* wait for it to 'spin up' */
|
||||||
THR_DEBUG ("waiting for child thread spinup\n");
|
THR_DEBUG ("waiting for child thread spinup");
|
||||||
g_cond_wait (thread->cond, thread->lock);
|
g_cond_wait (thread->cond, thread->lock);
|
||||||
THR_DEBUG ("thread claims to be up\n");
|
THR_DEBUG ("thread claims to be up");
|
||||||
g_mutex_unlock (thread->lock);
|
g_mutex_unlock (thread->lock);
|
||||||
break;
|
break;
|
||||||
case GST_STATE_READY_TO_PAUSED:
|
case GST_STATE_READY_TO_PAUSED:
|
||||||
THR_INFO ("readying thread");
|
THR_INFO ("readying thread");
|
||||||
g_mutex_lock (thread->lock);
|
g_mutex_lock (thread->lock);
|
||||||
THR_DEBUG ("signaling\n");
|
THR_DEBUG ("signaling");
|
||||||
g_cond_signal (thread->cond);
|
g_cond_signal (thread->cond);
|
||||||
THR_DEBUG ("waiting for ack\n");
|
THR_DEBUG ("waiting for ack");
|
||||||
g_cond_wait (thread->cond, thread->lock);
|
g_cond_wait (thread->cond, thread->lock);
|
||||||
THR_DEBUG ("got ack\n");
|
THR_DEBUG ("got ack");
|
||||||
g_mutex_unlock (thread->lock);
|
g_mutex_unlock (thread->lock);
|
||||||
break;
|
break;
|
||||||
case GST_STATE_PAUSED_TO_PLAYING:
|
case GST_STATE_PAUSED_TO_PLAYING:
|
||||||
THR_DEBUG ("telling thread to start spinning\n");
|
THR_DEBUG ("telling thread to start spinning");
|
||||||
g_mutex_lock (thread->lock);
|
g_mutex_lock (thread->lock);
|
||||||
THR_DEBUG ("signaling\n");
|
THR_DEBUG ("signaling");
|
||||||
g_cond_signal (thread->cond);
|
g_cond_signal (thread->cond);
|
||||||
THR_DEBUG ("waiting for ack\n");
|
THR_DEBUG ("waiting for ack");
|
||||||
g_cond_wait (thread->cond, thread->lock);
|
g_cond_wait (thread->cond, thread->lock);
|
||||||
THR_DEBUG ("got ack\n");
|
THR_DEBUG ("got ack");
|
||||||
g_mutex_unlock (thread->lock);
|
g_mutex_unlock (thread->lock);
|
||||||
break;
|
break;
|
||||||
case GST_STATE_PLAYING_TO_PAUSED:
|
case GST_STATE_PLAYING_TO_PAUSED:
|
||||||
|
@ -328,7 +328,7 @@ gst_thread_change_state (GstElement * element)
|
||||||
GstElement *element = GST_ELEMENT (elements->data);
|
GstElement *element = GST_ELEMENT (elements->data);
|
||||||
|
|
||||||
g_assert (element);
|
g_assert (element);
|
||||||
THR_DEBUG (" element \"%s\"\n", GST_ELEMENT_NAME (element));
|
THR_DEBUG (" element \"%s\"", GST_ELEMENT_NAME (element));
|
||||||
elements = g_list_next (elements);
|
elements = g_list_next (elements);
|
||||||
if (GST_IS_QUEUE (element)) {
|
if (GST_IS_QUEUE (element)) {
|
||||||
GstQueue *queue = GST_QUEUE (element);
|
GstQueue *queue = GST_QUEUE (element);
|
||||||
|
@ -337,7 +337,7 @@ gst_thread_change_state (GstElement * element)
|
||||||
* FIXME on up- or down-stream side)
|
* FIXME on up- or down-stream side)
|
||||||
* FIXME also make this more efficient by keeping list of managed queues
|
* FIXME also make this more efficient by keeping list of managed queues
|
||||||
*/
|
*/
|
||||||
THR_DEBUG ("waking queue \"%s\"\n", GST_ELEMENT_NAME (element));
|
THR_DEBUG ("waking queue \"%s\"", GST_ELEMENT_NAME (element));
|
||||||
g_mutex_lock (queue->qlock);
|
g_mutex_lock (queue->qlock);
|
||||||
GST_STATE_PENDING (element) = GST_STATE_PAUSED;
|
GST_STATE_PENDING (element) = GST_STATE_PAUSED;
|
||||||
g_cond_signal (queue->not_full);
|
g_cond_signal (queue->not_full);
|
||||||
|
@ -374,7 +374,7 @@ gst_thread_change_state (GstElement * element)
|
||||||
if (GST_ELEMENT_SCHED (peerelement) != GST_ELEMENT_SCHED (thread)) {
|
if (GST_ELEMENT_SCHED (peerelement) != GST_ELEMENT_SCHED (thread)) {
|
||||||
GstQueue *queue = GST_QUEUE (peerelement);
|
GstQueue *queue = GST_QUEUE (peerelement);
|
||||||
|
|
||||||
THR_DEBUG (" element \"%s\" has pad cross sched boundary\n", GST_ELEMENT_NAME (element));
|
THR_DEBUG (" element \"%s\" has pad cross sched boundary", GST_ELEMENT_NAME (element));
|
||||||
/* FIXME!! */
|
/* FIXME!! */
|
||||||
g_mutex_lock (queue->qlock);
|
g_mutex_lock (queue->qlock);
|
||||||
g_cond_signal (queue->not_full);
|
g_cond_signal (queue->not_full);
|
||||||
|
@ -384,23 +384,23 @@ gst_thread_change_state (GstElement * element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
THR_DEBUG ("telling thread to pause, signaling\n");
|
THR_DEBUG ("telling thread to pause, signaling");
|
||||||
g_cond_signal (thread->cond);
|
g_cond_signal (thread->cond);
|
||||||
THR_DEBUG ("waiting for ack\n");
|
THR_DEBUG ("waiting for ack");
|
||||||
g_cond_wait (thread->cond, thread->lock);
|
g_cond_wait (thread->cond, thread->lock);
|
||||||
THR_DEBUG ("got ack\n");
|
THR_DEBUG ("got ack");
|
||||||
g_mutex_unlock (thread->lock);
|
g_mutex_unlock (thread->lock);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
THR_DEBUG ("telling thread to pause (null) - and joining\n");
|
THR_DEBUG ("telling thread to pause (null) - and joining");
|
||||||
/* MattH FIXME revisit */
|
/* MattH FIXME revisit */
|
||||||
g_mutex_lock (thread->lock);
|
g_mutex_lock (thread->lock);
|
||||||
THR_DEBUG ("signaling\n");
|
THR_DEBUG ("signaling");
|
||||||
g_cond_signal (thread->cond);
|
g_cond_signal (thread->cond);
|
||||||
THR_DEBUG ("waiting for ack\n");
|
THR_DEBUG ("waiting for ack");
|
||||||
g_cond_wait (thread->cond, thread->lock);
|
g_cond_wait (thread->cond, thread->lock);
|
||||||
THR_DEBUG ("got ack\n");
|
THR_DEBUG ("got ack");
|
||||||
pthread_join (thread->thread_id, NULL);
|
pthread_join (thread->thread_id, NULL);
|
||||||
thread->thread_id = -1;
|
thread->thread_id = -1;
|
||||||
g_mutex_unlock (thread->lock);
|
g_mutex_unlock (thread->lock);
|
||||||
|
@ -411,18 +411,18 @@ gst_thread_change_state (GstElement * element)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case GST_STATE_PAUSED_TO_READY:
|
case GST_STATE_PAUSED_TO_READY:
|
||||||
THR_DEBUG ("telling thread to stop spinning\n");
|
THR_DEBUG ("telling thread to stop spinning");
|
||||||
g_mutex_lock (thread->lock);
|
g_mutex_lock (thread->lock);
|
||||||
THR_DEBUG ("signaling\n");
|
THR_DEBUG ("signaling");
|
||||||
g_cond_signal (thread->cond);
|
g_cond_signal (thread->cond);
|
||||||
THR_DEBUG ("waiting for ack\n");
|
THR_DEBUG ("waiting for ack");
|
||||||
g_cond_wait (thread->cond, thread->lock);
|
g_cond_wait (thread->cond, thread->lock);
|
||||||
THR_DEBUG ("got ack\n");
|
THR_DEBUG ("got ack");
|
||||||
g_mutex_unlock (thread->lock);
|
g_mutex_unlock (thread->lock);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_THREAD, element, "UNHANDLED STATE CHANGE! %x\n", transition);
|
GST_DEBUG_ELEMENT (GST_CAT_THREAD, element, "UNHANDLED STATE CHANGE! %x", transition);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,15 +455,15 @@ gst_thread_main_loop (void *arg)
|
||||||
stateset = GST_ELEMENT_CLASS (parent_class)->change_state (GST_ELEMENT(thread));
|
stateset = GST_ELEMENT_CLASS (parent_class)->change_state (GST_ELEMENT(thread));
|
||||||
|
|
||||||
if (stateset != GST_STATE_SUCCESS) {
|
if (stateset != GST_STATE_SUCCESS) {
|
||||||
THR_DEBUG_MAIN ("state change of children failed\n");
|
THR_DEBUG_MAIN ("state change of children failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
THR_DEBUG_MAIN ("indicating spinup\n");
|
THR_DEBUG_MAIN ("indicating spinup");
|
||||||
g_cond_signal (thread->cond);
|
g_cond_signal (thread->cond);
|
||||||
/* don't unlock the mutex because we hold it into the top of the while loop */
|
/* don't unlock the mutex because we hold it into the top of the while loop */
|
||||||
THR_DEBUG_MAIN ("thread has indicated spinup to parent process\n");
|
THR_DEBUG_MAIN ("thread has indicated spinup to parent process");
|
||||||
|
|
||||||
/***** THREAD IS NOW IN READY STATE *****/
|
/***** THREAD IS NOW IN READY STATE *****/
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ gst_thread_main_loop (void *arg)
|
||||||
/* NOTE: cannot be in NULL, we're not running in that state at all */
|
/* NOTE: cannot be in NULL, we're not running in that state at all */
|
||||||
case GST_STATE_READY:
|
case GST_STATE_READY:
|
||||||
/* wait to be set to either the NULL or PAUSED states */
|
/* wait to be set to either the NULL or PAUSED states */
|
||||||
THR_DEBUG_MAIN ("thread in %s state, waiting for either %s or %s\n",
|
THR_DEBUG_MAIN ("thread in %s state, waiting for either %s or %s",
|
||||||
gst_element_statename (GST_STATE_READY),
|
gst_element_statename (GST_STATE_READY),
|
||||||
gst_element_statename (GST_STATE_NULL),
|
gst_element_statename (GST_STATE_NULL),
|
||||||
gst_element_statename (GST_STATE_PAUSED));
|
gst_element_statename (GST_STATE_PAUSED));
|
||||||
|
@ -489,7 +489,7 @@ gst_thread_main_loop (void *arg)
|
||||||
|
|
||||||
/* been signaled, we need to state transition now and signal back */
|
/* been signaled, we need to state transition now and signal back */
|
||||||
gst_thread_update_state (thread);
|
gst_thread_update_state (thread);
|
||||||
THR_DEBUG_MAIN ("done with state transition, signaling back to parent process\n");
|
THR_DEBUG_MAIN ("done with state transition, signaling back to parent process");
|
||||||
g_cond_signal (thread->cond);
|
g_cond_signal (thread->cond);
|
||||||
/* now we decide what to do next */
|
/* now we decide what to do next */
|
||||||
if (GST_STATE (thread) == GST_STATE_NULL) {
|
if (GST_STATE (thread) == GST_STATE_NULL) {
|
||||||
|
@ -499,7 +499,7 @@ gst_thread_main_loop (void *arg)
|
||||||
continue;
|
continue;
|
||||||
case GST_STATE_PAUSED:
|
case GST_STATE_PAUSED:
|
||||||
/* wait to be set to either the READY or PLAYING states */
|
/* wait to be set to either the READY or PLAYING states */
|
||||||
THR_DEBUG_MAIN("thread in %s state, waiting for either %s or %s\n",
|
THR_DEBUG_MAIN("thread in %s state, waiting for either %s or %s",
|
||||||
gst_element_statename (GST_STATE_PAUSED),
|
gst_element_statename (GST_STATE_PAUSED),
|
||||||
gst_element_statename (GST_STATE_READY),
|
gst_element_statename (GST_STATE_READY),
|
||||||
gst_element_statename (GST_STATE_PLAYING));
|
gst_element_statename (GST_STATE_PLAYING));
|
||||||
|
@ -540,14 +540,14 @@ gst_thread_main_loop (void *arg)
|
||||||
gst_thread_update_state (thread);
|
gst_thread_update_state (thread);
|
||||||
}
|
}
|
||||||
/* once we're here, SPINNING has stopped, we should signal that we're done */
|
/* once we're here, SPINNING has stopped, we should signal that we're done */
|
||||||
THR_DEBUG_MAIN ("SPINNING stopped, signaling back to parent process\n");
|
THR_DEBUG_MAIN ("SPINNING stopped, signaling back to parent process");
|
||||||
g_cond_signal (thread->cond);
|
g_cond_signal (thread->cond);
|
||||||
/* now we can wait for PAUSED */
|
/* now we can wait for PAUSED */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case GST_STATE_PLAYING:
|
case GST_STATE_PLAYING:
|
||||||
/* wait to be set to PAUSED */
|
/* wait to be set to PAUSED */
|
||||||
THR_DEBUG_MAIN ("thread in %s state, waiting for %s\n",
|
THR_DEBUG_MAIN ("thread in %s state, waiting for %s",
|
||||||
gst_element_statename(GST_STATE_PLAYING),
|
gst_element_statename(GST_STATE_PLAYING),
|
||||||
gst_element_statename(GST_STATE_PAUSED));
|
gst_element_statename(GST_STATE_PAUSED));
|
||||||
g_cond_wait (thread->cond,thread->lock);
|
g_cond_wait (thread->cond,thread->lock);
|
||||||
|
@ -559,7 +559,7 @@ gst_thread_main_loop (void *arg)
|
||||||
/* there's only PAUSED, we we just wait for it */
|
/* there's only PAUSED, we we just wait for it */
|
||||||
continue;
|
continue;
|
||||||
case GST_STATE_NULL:
|
case GST_STATE_NULL:
|
||||||
THR_DEBUG_MAIN ("thread in %s state, preparing to die\n",
|
THR_DEBUG_MAIN ("thread in %s state, preparing to die",
|
||||||
gst_element_statename(GST_STATE_NULL));
|
gst_element_statename(GST_STATE_NULL));
|
||||||
GST_FLAG_SET (thread, GST_THREAD_STATE_REAPING);
|
GST_FLAG_SET (thread, GST_THREAD_STATE_REAPING);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -141,6 +141,18 @@ gst_identity_get_bufferpool (GstPad *pad)
|
||||||
return gst_pad_get_bufferpool (identity->srcpad);
|
return gst_pad_get_bufferpool (identity->srcpad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GstCaps*
|
||||||
|
gst_identity_getcaps (GstPad *pad, GstCaps *caps)
|
||||||
|
{
|
||||||
|
GstIdentity *identity;
|
||||||
|
GstPad *otherpad;
|
||||||
|
|
||||||
|
identity = GST_IDENTITY (gst_pad_get_parent (pad));
|
||||||
|
otherpad = (pad == identity->srcpad ? identity->sinkpad : identity->srcpad);
|
||||||
|
|
||||||
|
return gst_pad_get_allowed_caps (otherpad);
|
||||||
|
}
|
||||||
|
|
||||||
static GstPadConnectReturn
|
static GstPadConnectReturn
|
||||||
gst_identity_connect (GstPad *pad, GstCaps *caps)
|
gst_identity_connect (GstPad *pad, GstCaps *caps)
|
||||||
{
|
{
|
||||||
|
@ -167,10 +179,12 @@ gst_identity_init (GstIdentity *identity)
|
||||||
gst_pad_set_chain_function (identity->sinkpad, GST_DEBUG_FUNCPTR (gst_identity_chain));
|
gst_pad_set_chain_function (identity->sinkpad, GST_DEBUG_FUNCPTR (gst_identity_chain));
|
||||||
gst_pad_set_bufferpool_function (identity->sinkpad, gst_identity_get_bufferpool);
|
gst_pad_set_bufferpool_function (identity->sinkpad, gst_identity_get_bufferpool);
|
||||||
gst_pad_set_connect_function (identity->sinkpad, gst_identity_connect);
|
gst_pad_set_connect_function (identity->sinkpad, gst_identity_connect);
|
||||||
|
gst_pad_set_getcaps_function (identity->sinkpad, gst_identity_getcaps);
|
||||||
|
|
||||||
identity->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
identity->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||||
gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);
|
gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);
|
||||||
gst_pad_set_connect_function (identity->srcpad, gst_identity_connect);
|
gst_pad_set_connect_function (identity->srcpad, gst_identity_connect);
|
||||||
|
gst_pad_set_getcaps_function (identity->srcpad, gst_identity_getcaps);
|
||||||
|
|
||||||
identity->loop_based = FALSE;
|
identity->loop_based = FALSE;
|
||||||
identity->sleep_time = 0;
|
identity->sleep_time = 0;
|
||||||
|
|
|
@ -223,7 +223,7 @@ gst_queue_init (GstQueue *queue)
|
||||||
queue->writer = FALSE;
|
queue->writer = FALSE;
|
||||||
queue->not_empty = g_cond_new ();
|
queue->not_empty = g_cond_new ();
|
||||||
queue->not_full = g_cond_new ();
|
queue->not_full = g_cond_new ();
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_THREAD, queue, "initialized queue's not_empty & not_full conditions\n");
|
GST_DEBUG_ELEMENT (GST_CAT_THREAD, queue, "initialized queue's not_empty & not_full conditions");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -251,7 +251,7 @@ gst_queue_get_bufferpool (GstPad *pad)
|
||||||
static void
|
static void
|
||||||
gst_queue_cleanup_buffers (gpointer data, const gpointer user_data)
|
gst_queue_cleanup_buffers (gpointer data, const gpointer user_data)
|
||||||
{
|
{
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, user_data, "cleaning buffer %p\n", data);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, user_data, "cleaning buffer %p", data);
|
||||||
|
|
||||||
if (GST_IS_BUFFER (data)) {
|
if (GST_IS_BUFFER (data)) {
|
||||||
gst_buffer_unref (GST_BUFFER (data));
|
gst_buffer_unref (GST_BUFFER (data));
|
||||||
|
@ -287,9 +287,9 @@ gst_queue_chain (GstPad *pad, GstBuffer *buf)
|
||||||
|
|
||||||
restart:
|
restart:
|
||||||
/* we have to lock the queue since we span threads */
|
/* we have to lock the queue since we span threads */
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locking t:%ld\n", pthread_self ());
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locking t:%ld", pthread_self ());
|
||||||
g_mutex_lock (queue->qlock);
|
g_mutex_lock (queue->qlock);
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locked t:%ld\n", pthread_self ());
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locked t:%ld", pthread_self ());
|
||||||
|
|
||||||
if (GST_IS_EVENT (buf)) {
|
if (GST_IS_EVENT (buf)) {
|
||||||
switch (GST_EVENT_TYPE (buf)) {
|
switch (GST_EVENT_TYPE (buf)) {
|
||||||
|
@ -307,7 +307,7 @@ restart:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "adding buffer %p of size %d\n",buf,GST_BUFFER_SIZE(buf));
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "adding buffer %p of size %d",buf,GST_BUFFER_SIZE(buf));
|
||||||
|
|
||||||
if (queue->level_buffers == queue->size_buffers) {
|
if (queue->level_buffers == queue->size_buffers) {
|
||||||
/* if this is a leaky queue... */
|
/* if this is a leaky queue... */
|
||||||
|
@ -315,12 +315,12 @@ restart:
|
||||||
/* FIXME don't want to leak events! */
|
/* FIXME don't want to leak events! */
|
||||||
/* if we leak on the upstream side, drop the current buffer */
|
/* if we leak on the upstream side, drop the current buffer */
|
||||||
if (queue->leaky == GST_QUEUE_LEAK_UPSTREAM) {
|
if (queue->leaky == GST_QUEUE_LEAK_UPSTREAM) {
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on upstream end\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on upstream end");
|
||||||
if (GST_IS_EVENT (buf))
|
if (GST_IS_EVENT (buf))
|
||||||
fprintf(stderr, "Error: queue [%s] leaked an event, type:%d\n",
|
fprintf(stderr, "Error: queue [%s] leaked an event, type:%d\n",
|
||||||
GST_ELEMENT_NAME(GST_ELEMENT(queue)),
|
GST_ELEMENT_NAME(GST_ELEMENT(queue)),
|
||||||
GST_EVENT_TYPE(GST_EVENT(buf)));
|
GST_EVENT_TYPE(GST_EVENT(buf)));
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on upstream end\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on upstream end");
|
||||||
gst_buffer_unref(buf);
|
gst_buffer_unref(buf);
|
||||||
/* now we have to clean up and exit right away */
|
/* now we have to clean up and exit right away */
|
||||||
g_mutex_unlock (queue->qlock);
|
g_mutex_unlock (queue->qlock);
|
||||||
|
@ -330,7 +330,7 @@ restart:
|
||||||
else {
|
else {
|
||||||
GList *front;
|
GList *front;
|
||||||
GstBuffer *leakbuf;
|
GstBuffer *leakbuf;
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on downstream end\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue is full, leaking buffer on downstream end");
|
||||||
front = queue->queue;
|
front = queue->queue;
|
||||||
leakbuf = (GstBuffer *)(front->data);
|
leakbuf = (GstBuffer *)(front->data);
|
||||||
if (GST_IS_EVENT (leakbuf))
|
if (GST_IS_EVENT (leakbuf))
|
||||||
|
@ -345,13 +345,13 @@ restart:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "pre full wait, level:%d/%d\n",
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "pre full wait, level:%d/%d",
|
||||||
queue->level_buffers, queue->size_buffers);
|
queue->level_buffers, queue->size_buffers);
|
||||||
while (queue->level_buffers == queue->size_buffers) {
|
while (queue->level_buffers == queue->size_buffers) {
|
||||||
/* if there's a pending state change for this queue or its manager, switch */
|
/* if there's a pending state change for this queue or its manager, switch */
|
||||||
/* back to iterator so bottom half of state change executes */
|
/* back to iterator so bottom half of state change executes */
|
||||||
while (GST_STATE_PENDING (queue) != GST_STATE_VOID_PENDING) {
|
while (GST_STATE_PENDING (queue) != GST_STATE_VOID_PENDING) {
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "interrupted!!\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "interrupted!!");
|
||||||
g_mutex_unlock (queue->qlock);
|
g_mutex_unlock (queue->qlock);
|
||||||
if (gst_element_interrupt (GST_ELEMENT (queue)))
|
if (gst_element_interrupt (GST_ELEMENT (queue)))
|
||||||
return;
|
return;
|
||||||
|
@ -372,15 +372,16 @@ restart:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "waiting for not_full, level:%d/%d\n", queue->level_buffers, queue->size_buffers);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "waiting for not_full, level:%d/%d",
|
||||||
|
queue->level_buffers, queue->size_buffers);
|
||||||
if (queue->writer)
|
if (queue->writer)
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "WARNING: multiple writers on queue!\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "WARNING: multiple writers on queue!");
|
||||||
queue->writer = TRUE;
|
queue->writer = TRUE;
|
||||||
g_cond_wait (queue->not_full, queue->qlock);
|
g_cond_wait (queue->not_full, queue->qlock);
|
||||||
queue->writer = FALSE;
|
queue->writer = FALSE;
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "got not_full signal\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "got not_full signal");
|
||||||
}
|
}
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "post full wait, level:%d/%d\n",
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "post full wait, level:%d/%d",
|
||||||
queue->level_buffers, queue->size_buffers);
|
queue->level_buffers, queue->size_buffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,7 +390,7 @@ restart:
|
||||||
queue->level_buffers++;
|
queue->level_buffers++;
|
||||||
queue->level_bytes += GST_BUFFER_SIZE(buf);
|
queue->level_bytes += GST_BUFFER_SIZE(buf);
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "(%s:%s)+ level:%d/%d\n",
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "(%s:%s)+ level:%d/%d",
|
||||||
GST_DEBUG_PAD_NAME(pad),
|
GST_DEBUG_PAD_NAME(pad),
|
||||||
queue->level_buffers, queue->size_buffers);
|
queue->level_buffers, queue->size_buffers);
|
||||||
|
|
||||||
|
@ -403,7 +404,7 @@ restart:
|
||||||
|
|
||||||
if (reader)
|
if (reader)
|
||||||
{
|
{
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "signalling not_empty\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "signalling not_empty");
|
||||||
g_cond_signal (queue->not_empty);
|
g_cond_signal (queue->not_empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -425,17 +426,17 @@ gst_queue_get (GstPad *pad)
|
||||||
|
|
||||||
restart:
|
restart:
|
||||||
/* have to lock for thread-safety */
|
/* have to lock for thread-safety */
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locking t:%ld\n", pthread_self ());
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locking t:%ld", pthread_self ());
|
||||||
g_mutex_lock (queue->qlock);
|
g_mutex_lock (queue->qlock);
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locked t:%ld %p\n", pthread_self (), queue->not_empty);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "locked t:%ld %p", pthread_self (), queue->not_empty);
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "pre empty wait, level:%d/%d\n", queue->level_buffers, queue->size_buffers);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "pre empty wait, level:%d/%d", queue->level_buffers, queue->size_buffers);
|
||||||
while (queue->level_buffers == 0) {
|
while (queue->level_buffers == 0) {
|
||||||
/* if there's a pending state change for this queue or its manager, switch
|
/* if there's a pending state change for this queue or its manager, switch
|
||||||
* back to iterator so bottom half of state change executes
|
* back to iterator so bottom half of state change executes
|
||||||
*/
|
*/
|
||||||
while (GST_STATE_PENDING (queue) != GST_STATE_VOID_PENDING) {
|
while (GST_STATE_PENDING (queue) != GST_STATE_VOID_PENDING) {
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "interrupted!!\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "interrupted!!");
|
||||||
g_mutex_unlock (queue->qlock);
|
g_mutex_unlock (queue->qlock);
|
||||||
if (gst_element_interrupt (GST_ELEMENT (queue)))
|
if (gst_element_interrupt (GST_ELEMENT (queue)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -453,26 +454,26 @@ restart:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "waiting for not_empty, level:%d/%d\n", queue->level_buffers, queue->size_buffers);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "waiting for not_empty, level:%d/%d", queue->level_buffers, queue->size_buffers);
|
||||||
if (queue->reader)
|
if (queue->reader)
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "WARNING: multiple readers on queue!\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "WARNING: multiple readers on queue!");
|
||||||
queue->reader = TRUE;
|
queue->reader = TRUE;
|
||||||
g_cond_wait (queue->not_empty, queue->qlock);
|
g_cond_wait (queue->not_empty, queue->qlock);
|
||||||
queue->reader = FALSE;
|
queue->reader = FALSE;
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "got not_empty signal\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "got not_empty signal");
|
||||||
}
|
}
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "post empty wait, level:%d/%d\n", queue->level_buffers, queue->size_buffers);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "post empty wait, level:%d/%d", queue->level_buffers, queue->size_buffers);
|
||||||
|
|
||||||
front = queue->queue;
|
front = queue->queue;
|
||||||
buf = (GstBuffer *)(front->data);
|
buf = (GstBuffer *)(front->data);
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "retrieved buffer %p from queue\n", buf);
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "retrieved buffer %p from queue", buf);
|
||||||
queue->queue = g_list_remove_link (queue->queue, front);
|
queue->queue = g_list_remove_link (queue->queue, front);
|
||||||
g_list_free (front);
|
g_list_free (front);
|
||||||
|
|
||||||
queue->level_buffers--;
|
queue->level_buffers--;
|
||||||
queue->level_bytes -= GST_BUFFER_SIZE(buf);
|
queue->level_bytes -= GST_BUFFER_SIZE(buf);
|
||||||
|
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "(%s:%s)- level:%d/%d\n",
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "(%s:%s)- level:%d/%d",
|
||||||
GST_DEBUG_PAD_NAME(pad),
|
GST_DEBUG_PAD_NAME(pad),
|
||||||
queue->level_buffers, queue->size_buffers);
|
queue->level_buffers, queue->size_buffers);
|
||||||
|
|
||||||
|
@ -486,7 +487,7 @@ restart:
|
||||||
|
|
||||||
if (writer)
|
if (writer)
|
||||||
{
|
{
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "signalling not_full\n");
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "signalling not_full");
|
||||||
g_cond_signal (queue->not_full);
|
g_cond_signal (queue->not_full);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,7 +496,7 @@ restart:
|
||||||
GstEvent *event = GST_EVENT(buf);
|
GstEvent *event = GST_EVENT(buf);
|
||||||
switch (GST_EVENT_TYPE(event)) {
|
switch (GST_EVENT_TYPE(event)) {
|
||||||
case GST_EVENT_EOS:
|
case GST_EVENT_EOS:
|
||||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue \"%s\" eos\n", GST_ELEMENT_NAME (queue));
|
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, queue, "queue \"%s\" eos", GST_ELEMENT_NAME (queue));
|
||||||
gst_element_set_eos (GST_ELEMENT (queue));
|
gst_element_set_eos (GST_ELEMENT (queue));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue