+2004-05-11 Benjamin Otte <in7y118@public.uni-hamburg.de>
+
+ * gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
+ compute mapsize correctly
+ * gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
+ use correct datatypes when calling a varargs function
+ * gst/elements/gsttypefindelement.c: (stop_typefinding):
+ push a DISCONT event as first thing
+ * gst/gst_private.h:
+ * gst/gstinfo.c: (_gst_debug_init):
+ remove GST_DATAFLOW debugging category
+ * gst/gstbin.c: (gst_bin_iterate):
+ use GST_SCHEDULING category
+ * gst/gstpad.c: (gst_pad_get_type), (_invent_event),
+ (gst_pad_push), (gst_pad_pull), (gst_pad_call_chain_function),
+ (gst_pad_call_get_function):
+ add GST_DATAFLOW to easily track flow of buffers or events.
+ * gst/gstqueue.c: (gst_queue_get_type),
+ (gst_queue_handle_pending_events), (gst_queue_chain),
+ (gst_queue_get), (gst_queue_handle_src_event):
+ use own static debugging category GST_DATAFLOW for dataflow,
+ use DEBUG category for showing which path events go, use LOG
+ category for buffers.
+
2004-05-10 David Schleef <ds@schleef.org>
* docs/gst/gstreamer-sections.txt: Add gst_element_no_more_pads.
mapsize = src->mapsize;
/* double the mapsize as long as the readsize is smaller */
- while (readsize - (src->curoffset - nextmap) > mapsize) {
+ while (readsize + src->curoffset > nextmap + mapsize) {
GST_LOG_OBJECT (src, "readsize smaller then mapsize %08x %d",
readsize, (int) mapsize);
mapsize <<= 1;
GST_DEBUG_OBJECT (src, "sending discont");
event =
gst_event_new_discontinuous (src->need_discont > 1, GST_FORMAT_BYTES,
- src->curoffset, NULL);
+ (guint64) src->curoffset, GST_FORMAT_UNDEFINED);
src->need_discont = 0;
return GST_DATA (event);
}
GST_WARNING_OBJECT (typefind,
"could not seek to required position %u, hope for the best", size);
}
+ gst_pad_push (typefind->src, GST_DATA (gst_event_new_discontinuous (TRUE,
+ GST_FORMAT_DEFAULT, (guint64) 0, GST_FORMAT_BYTES, (guint64) 0,
+ GST_FORMAT_UNDEFINED)));
if (size
&& (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
GST_DEBUG_OBJECT (typefind, "pushing cached data (%u bytes)", size);
extern GstDebugCategory *GST_CAT_STATES;
extern GstDebugCategory *GST_CAT_PLANNING;
extern GstDebugCategory *GST_CAT_SCHEDULING;
-extern GstDebugCategory *GST_CAT_DATAFLOW;
extern GstDebugCategory *GST_CAT_BUFFER;
extern GstDebugCategory *GST_CAT_CAPS;
extern GstDebugCategory *GST_CAT_CLOCK;
g_return_val_if_fail (bin != NULL, FALSE);
g_return_val_if_fail (GST_IS_BIN (bin), FALSE);
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, bin, "starting iteration");
+ GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, bin, "starting iteration");
gst_object_ref (GST_OBJECT (bin));
running = FALSE;
g_signal_emit (G_OBJECT (bin), gst_bin_signals[ITERATE], 0, &running);
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, bin, "finished iteration");
+ GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, bin, "finished iteration");
if (!running) {
if (GST_STATE (bin) == GST_STATE_PLAYING &&
GST_STATE_PENDING (bin) == GST_STATE_VOID_PENDING) {
- GST_CAT_DEBUG (GST_CAT_DATAFLOW,
+ GST_CAT_DEBUG (GST_CAT_SCHEDULING,
"[%s]: polling for child shutdown after useless iteration",
GST_ELEMENT_NAME (bin));
g_usleep (1);
GstDebugCategory *GST_CAT_STATES = NULL;
GstDebugCategory *GST_CAT_PLANNING = NULL;
GstDebugCategory *GST_CAT_SCHEDULING = NULL;
-GstDebugCategory *GST_CAT_DATAFLOW = NULL;
GstDebugCategory *GST_CAT_BUFFER = NULL;
GstDebugCategory *GST_CAT_CAPS = NULL;
GstDebugCategory *GST_CAT_CLOCK = NULL;
GST_DEBUG_BOLD | GST_DEBUG_FG_MAGENTA, NULL);
GST_CAT_SCHEDULING = _gst_debug_category_new ("GST_SCHEDULING",
GST_DEBUG_BOLD | GST_DEBUG_FG_MAGENTA, NULL);
- GST_CAT_DATAFLOW = _gst_debug_category_new ("GST_DATAFLOW",
- GST_DEBUG_BOLD | GST_DEBUG_FG_GREEN, NULL);
GST_CAT_BUFFER = _gst_debug_category_new ("GST_BUFFER",
GST_DEBUG_BOLD | GST_DEBUG_FG_GREEN, NULL);
GST_CAT_CAPS = _gst_debug_category_new ("GST_CAPS",
#include "gsterror.h"
#include "gstvalue.h"
+GST_DEBUG_CATEGORY_STATIC (debug_dataflow);
+#define DEBUG_DATA(obj,data,notice) G_STMT_START{\
+ if (GST_IS_EVENT (data)) { \
+ GST_CAT_DEBUG_OBJECT (debug_dataflow, obj, "%s event %p (type %d)", notice, data, \
+ GST_EVENT_TYPE (data)); \
+ } else { \
+ GST_CAT_LOG_OBJECT (debug_dataflow, obj, "%s buffer %p (size %d)", notice, data, \
+ GST_BUFFER_SIZE (data)); \
+ } \
+}G_STMT_END
#define GST_CAT_DEFAULT GST_CAT_PADS
-
struct _GstPadLink
{
GType type;
_gst_pad_type = g_type_register_static (GST_TYPE_OBJECT, "GstPad",
&pad_info, 0);
+
+ GST_DEBUG_CATEGORY_INIT (debug_dataflow, "GST_DATAFLOW",
+ GST_DEBUG_BOLD | GST_DEBUG_FG_GREEN, "dataflow inside pads");
}
return _gst_pad_type;
}
event = gst_event_new_discontinuous (TRUE,
GST_FORMAT_TIME, timestamp, event_type, offset, GST_FORMAT_UNDEFINED);
- GST_CAT_WARNING (GST_CAT_DATAFLOW,
+ GST_CAT_WARNING (GST_CAT_SCHEDULING,
"needed to invent a DISCONT (time %" G_GUINT64_FORMAT
") for %s:%s => %s:%s", timestamp,
GST_DEBUG_PAD_NAME (GST_PAD_PEER (pad)), GST_DEBUG_PAD_NAME (pad));
} else {
event = gst_event_new_discontinuous (TRUE,
event_type, offset, GST_FORMAT_UNDEFINED);
- GST_CAT_WARNING (GST_CAT_DATAFLOW,
+ GST_CAT_WARNING (GST_CAT_SCHEDULING,
"needed to invent a DISCONT (no time) for %s:%s => %s:%s",
GST_DEBUG_PAD_NAME (GST_PAD_PEER (pad)), GST_DEBUG_PAD_NAME (pad));
}
g_return_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SRC);
g_return_if_fail (data != NULL);
+ DEBUG_DATA (pad, data, "gst_pad_push");
if (!gst_probe_dispatcher_dispatch (&(GST_REAL_PAD (pad)->probedisp), &data))
return;
if (!GST_PAD_IS_LINKED (pad)) {
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, pad,
+ GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"not pushing data %p as pad is unconnected", data);
gst_data_unref (data);
return;
}
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, pad, "pushing");
+ GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, "pushing");
peer = GST_RPAD_PEER (pad);
if (!peer) {
if (peer->chainhandler) {
if (data) {
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, pad,
+ GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"calling chainhandler &%s of peer pad %s:%s",
GST_DEBUG_FUNCPTR_NAME (peer->chainhandler),
GST_DEBUG_PAD_NAME (GST_PAD (peer)));
gst_pad_pull (GstPad * pad)
{
GstRealPad *peer;
-
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, pad, "pulling");
+ GstData *data;
g_return_val_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SINK,
GST_DATA (gst_event_new (GST_EVENT_INTERRUPT)));
restart:
if (peer->gethandler) {
GstPadLink *link = GST_RPAD_LINK (pad);
- GstData *data;
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, pad,
+ GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"calling gethandler %s of peer pad %s:%s",
GST_DEBUG_FUNCPTR_NAME (peer->gethandler), GST_DEBUG_PAD_NAME (peer));
GST_EVENT_TYPE (data) == GST_EVENT_DISCONTINUOUS &&
GST_EVENT_DISCONT_NEW_MEDIA (data)) {
link->engaged = TRUE;
- GST_CAT_LOG (GST_CAT_DATAFLOW,
+ GST_CAT_LOG (GST_CAT_SCHEDULING,
"link engaged by discont event for pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
}
}
if (!gst_probe_dispatcher_dispatch (&peer->probedisp, &data))
goto restart;
+ DEBUG_DATA (pad, data, "gst_pad_pull returned");
return data;
}
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_PAD_NAME (peer)));
}
}
- return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
+ data = GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
+ DEBUG_DATA (pad, data, "gst_pad_pull returned created");
+ return data;
}
GstData *
#define CALL_CHAINFUNC(pad, data) G_STMT_START {\
GstData *__temp = (data); \
+ DEBUG_DATA (pad, __temp, "calling chain function with "); \
if (GST_IS_EVENT (__temp) && \
!GST_FLAG_IS_SET (gst_pad_get_parent (pad), GST_ELEMENT_EVENT_AWARE)) { \
gst_pad_send_event (pad, GST_EVENT (__temp)); \
GST_EVENT_TYPE (data) == GST_EVENT_DISCONTINUOUS &&
GST_EVENT_DISCONT_NEW_MEDIA (data)) {
link->engaged = TRUE;
- GST_CAT_LOG (GST_CAT_DATAFLOW,
+ GST_CAT_LOG (GST_CAT_SCHEDULING,
"link engaged by discont event for pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
}
GstData *
gst_pad_call_get_function (GstPad * pad)
{
+ GstData *data;
+
g_return_val_if_fail (GST_IS_REAL_PAD (pad), NULL);
g_return_val_if_fail (GST_PAD_IS_SRC (pad), NULL);
g_return_val_if_fail (GST_RPAD_GETFUNC (pad) != NULL, NULL);
- return GST_RPAD_GETFUNC (pad) (pad);
+ data = GST_RPAD_GETFUNC (pad) (pad);
+ DEBUG_DATA (pad, data, "getfunction returned");
+ return data;
}
#include "gstinfo.h"
#include "gsterror.h"
+GST_DEBUG_CATEGORY_STATIC (queue_dataflow);
+
static GstElementDetails gst_queue_details = GST_ELEMENT_DETAILS ("Queue",
"Generic",
"Simple data queue",
queue_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstQueue", &queue_info, 0);
+ GST_DEBUG_CATEGORY_INIT (queue_dataflow, "queue_dataflow", 0,
+ "dataflow inside the queue element");
}
return queue_type;
while (!g_queue_is_empty (queue->events)) {
GstQueueEventResponse *er = g_queue_pop_head (queue->events);
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "sending event upstream");
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "sending event upstream");
er->ret = gst_pad_event_default (queue->srcpad, er->event);
er->handled = TRUE;
g_cond_signal (queue->event_done);
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "event sent");
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "event sent");
}
}
#define STATUS(queue, msg) \
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, \
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, \
"(%s:%s) " msg ": %u of %u-%u buffers, %u of %u-%u " \
"bytes, %" G_GUINT64_FORMAT " of %" G_GUINT64_FORMAT \
"-%" G_GUINT64_FORMAT " ns, %u elements", \
restart:
/* we have to lock the queue since we span threads */
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "locking t:%p",
- g_thread_self ());
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "locking t:%p", g_thread_self ());
g_mutex_lock (queue->qlock);
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "locked t:%p", g_thread_self ());
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "locked t:%p", g_thread_self ());
gst_queue_handle_pending_events (queue);
break;
default:
/* we put the event in the queue, we don't have to act ourselves */
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"adding event %p of type %d", data, GST_EVENT_TYPE (data));
break;
}
}
if (GST_IS_BUFFER (data))
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"adding buffer %p of size %d", data, GST_BUFFER_SIZE (data));
/* We make space available if we're "full" according to whatever
switch (queue->leaky) {
/* leak current buffer */
case GST_QUEUE_LEAK_UPSTREAM:
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
"queue is full, leaking buffer on upstream end");
/* now we can clean up and exit right away */
g_mutex_unlock (queue->qlock);
GList *item;
GstData *leak = NULL;
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
"queue is full, leaking buffer on downstream end");
for (item = queue->queue->head; item != NULL; item = item->next) {
* or its manager, switch back to iterator so bottom
* half of state change executes */
if (queue->interrupt) {
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "interrupted");
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "interrupted");
g_mutex_unlock (queue->qlock);
if (gst_scheduler_interrupt (gst_pad_get_scheduler (queue->sinkpad),
GST_ELEMENT (queue))) {
* flush, we don't need to add the buffer to the
* queue again */
if (queue->flush) {
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
"not adding pending buffer after flush");
goto out_unref;
}
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
"adding pending buffer after interrupt");
goto restart;
}
* unref the buffer *before* calling GST_ELEMENT_ERROR */
return;
} else {
- GST_CAT_WARNING_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_WARNING_OBJECT (queue_dataflow, queue,
"%s: waiting for the app to restart "
"source pad elements", GST_ELEMENT_NAME (queue));
}
STATUS (queue, "+ level");
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "signalling item_add");
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "signalling item_add");
g_cond_signal (queue->item_add);
g_mutex_unlock (queue->qlock);
restart:
/* have to lock for thread-safety */
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
- "locking t:%p", g_thread_self ());
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "locking t:%p", g_thread_self ());
g_mutex_lock (queue->qlock);
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "locked t:%p", g_thread_self ());
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "locked t:%p", g_thread_self ());
if (queue->queue->length == 0 ||
(queue->min_threshold.buffers > 0 &&
* manager, switch back to iterator so bottom half of state
* change executes. */
if (queue->interrupt) {
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "interrupted");
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "interrupted");
g_mutex_unlock (queue->qlock);
if (gst_scheduler_interrupt (gst_pad_get_scheduler (queue->srcpad),
GST_ELEMENT (queue)))
("deadlock found, shutting down sink pad elements"));
goto restart;
} else {
- GST_CAT_WARNING_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_WARNING_OBJECT (queue_dataflow, queue,
"%s: waiting for the app to restart "
"source pad elements", GST_ELEMENT_NAME (queue));
}
g_time_val_add (&timeout, queue->block_timeout / 1000);
if (!g_cond_timed_wait (queue->item_add, queue->qlock, &timeout)) {
g_mutex_unlock (queue->qlock);
- GST_CAT_WARNING_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_WARNING_OBJECT (queue_dataflow, queue,
"Sending filler event");
return GST_DATA (gst_event_new_filler ());
}
/* There's something in the list now, whatever it is */
data = g_queue_pop_head (queue->queue);
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"retrieved data %p from queue", data);
if (data == NULL)
STATUS (queue, "after _get()");
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "signalling item_del");
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "signalling item_del");
g_cond_signal (queue->item_del);
g_mutex_unlock (queue->qlock);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
"queue \"%s\" eos", GST_ELEMENT_NAME (queue));
gst_element_set_eos (GST_ELEMENT (queue));
break;
er.event = event;
er.handled = FALSE;
g_queue_push_tail (queue->events, &er);
- GST_CAT_WARNING_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_WARNING_OBJECT (queue_dataflow, queue,
"Preparing for loop for event handler");
/* see the chain function on why this is here - it prevents a deadlock */
g_cond_signal (queue->item_del);
g_time_val_add (&timeout, 500 * 1000); /* half a second */
if (!g_cond_timed_wait (queue->event_done, queue->qlock, &timeout) &&
!er.handled) {
- GST_CAT_WARNING_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_WARNING_OBJECT (queue_dataflow, queue,
"timeout in upstream event handling");
/* remove ourselves from the pending list. Since we're
* locked, others cannot reference this anymore. */
goto handled;
}
}
- GST_CAT_WARNING_OBJECT (GST_CAT_DATAFLOW, queue, "Event handled");
+ GST_CAT_WARNING_OBJECT (queue_dataflow, queue, "Event handled");
res = er.ret;
} else {
res = gst_pad_event_default (pad, event);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH:
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
"FLUSH event, flushing queue\n");
gst_queue_locked_flush (queue);
break;
mapsize = src->mapsize;
/* double the mapsize as long as the readsize is smaller */
- while (readsize - (src->curoffset - nextmap) > mapsize) {
+ while (readsize + src->curoffset > nextmap + mapsize) {
GST_LOG_OBJECT (src, "readsize smaller then mapsize %08x %d",
readsize, (int) mapsize);
mapsize <<= 1;
GST_DEBUG_OBJECT (src, "sending discont");
event =
gst_event_new_discontinuous (src->need_discont > 1, GST_FORMAT_BYTES,
- src->curoffset, NULL);
+ (guint64) src->curoffset, GST_FORMAT_UNDEFINED);
src->need_discont = 0;
return GST_DATA (event);
}
#include "gstinfo.h"
#include "gsterror.h"
+GST_DEBUG_CATEGORY_STATIC (queue_dataflow);
+
static GstElementDetails gst_queue_details = GST_ELEMENT_DETAILS ("Queue",
"Generic",
"Simple data queue",
queue_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstQueue", &queue_info, 0);
+ GST_DEBUG_CATEGORY_INIT (queue_dataflow, "queue_dataflow", 0,
+ "dataflow inside the queue element");
}
return queue_type;
while (!g_queue_is_empty (queue->events)) {
GstQueueEventResponse *er = g_queue_pop_head (queue->events);
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "sending event upstream");
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "sending event upstream");
er->ret = gst_pad_event_default (queue->srcpad, er->event);
er->handled = TRUE;
g_cond_signal (queue->event_done);
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "event sent");
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "event sent");
}
}
#define STATUS(queue, msg) \
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, \
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, \
"(%s:%s) " msg ": %u of %u-%u buffers, %u of %u-%u " \
"bytes, %" G_GUINT64_FORMAT " of %" G_GUINT64_FORMAT \
"-%" G_GUINT64_FORMAT " ns, %u elements", \
restart:
/* we have to lock the queue since we span threads */
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "locking t:%p",
- g_thread_self ());
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "locking t:%p", g_thread_self ());
g_mutex_lock (queue->qlock);
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "locked t:%p", g_thread_self ());
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "locked t:%p", g_thread_self ());
gst_queue_handle_pending_events (queue);
break;
default:
/* we put the event in the queue, we don't have to act ourselves */
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"adding event %p of type %d", data, GST_EVENT_TYPE (data));
break;
}
}
if (GST_IS_BUFFER (data))
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"adding buffer %p of size %d", data, GST_BUFFER_SIZE (data));
/* We make space available if we're "full" according to whatever
switch (queue->leaky) {
/* leak current buffer */
case GST_QUEUE_LEAK_UPSTREAM:
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
"queue is full, leaking buffer on upstream end");
/* now we can clean up and exit right away */
g_mutex_unlock (queue->qlock);
GList *item;
GstData *leak = NULL;
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
"queue is full, leaking buffer on downstream end");
for (item = queue->queue->head; item != NULL; item = item->next) {
* or its manager, switch back to iterator so bottom
* half of state change executes */
if (queue->interrupt) {
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "interrupted");
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "interrupted");
g_mutex_unlock (queue->qlock);
if (gst_scheduler_interrupt (gst_pad_get_scheduler (queue->sinkpad),
GST_ELEMENT (queue))) {
* flush, we don't need to add the buffer to the
* queue again */
if (queue->flush) {
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
"not adding pending buffer after flush");
goto out_unref;
}
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
"adding pending buffer after interrupt");
goto restart;
}
* unref the buffer *before* calling GST_ELEMENT_ERROR */
return;
} else {
- GST_CAT_WARNING_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_WARNING_OBJECT (queue_dataflow, queue,
"%s: waiting for the app to restart "
"source pad elements", GST_ELEMENT_NAME (queue));
}
STATUS (queue, "+ level");
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "signalling item_add");
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "signalling item_add");
g_cond_signal (queue->item_add);
g_mutex_unlock (queue->qlock);
restart:
/* have to lock for thread-safety */
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
- "locking t:%p", g_thread_self ());
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "locking t:%p", g_thread_self ());
g_mutex_lock (queue->qlock);
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "locked t:%p", g_thread_self ());
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "locked t:%p", g_thread_self ());
if (queue->queue->length == 0 ||
(queue->min_threshold.buffers > 0 &&
* manager, switch back to iterator so bottom half of state
* change executes. */
if (queue->interrupt) {
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue, "interrupted");
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "interrupted");
g_mutex_unlock (queue->qlock);
if (gst_scheduler_interrupt (gst_pad_get_scheduler (queue->srcpad),
GST_ELEMENT (queue)))
("deadlock found, shutting down sink pad elements"));
goto restart;
} else {
- GST_CAT_WARNING_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_WARNING_OBJECT (queue_dataflow, queue,
"%s: waiting for the app to restart "
"source pad elements", GST_ELEMENT_NAME (queue));
}
g_time_val_add (&timeout, queue->block_timeout / 1000);
if (!g_cond_timed_wait (queue->item_add, queue->qlock, &timeout)) {
g_mutex_unlock (queue->qlock);
- GST_CAT_WARNING_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_WARNING_OBJECT (queue_dataflow, queue,
"Sending filler event");
return GST_DATA (gst_event_new_filler ());
}
/* There's something in the list now, whatever it is */
data = g_queue_pop_head (queue->queue);
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"retrieved data %p from queue", data);
if (data == NULL)
STATUS (queue, "after _get()");
- GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue, "signalling item_del");
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "signalling item_del");
g_cond_signal (queue->item_del);
g_mutex_unlock (queue->qlock);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
"queue \"%s\" eos", GST_ELEMENT_NAME (queue));
gst_element_set_eos (GST_ELEMENT (queue));
break;
er.event = event;
er.handled = FALSE;
g_queue_push_tail (queue->events, &er);
- GST_CAT_WARNING_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_WARNING_OBJECT (queue_dataflow, queue,
"Preparing for loop for event handler");
/* see the chain function on why this is here - it prevents a deadlock */
g_cond_signal (queue->item_del);
g_time_val_add (&timeout, 500 * 1000); /* half a second */
if (!g_cond_timed_wait (queue->event_done, queue->qlock, &timeout) &&
!er.handled) {
- GST_CAT_WARNING_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_WARNING_OBJECT (queue_dataflow, queue,
"timeout in upstream event handling");
/* remove ourselves from the pending list. Since we're
* locked, others cannot reference this anymore. */
goto handled;
}
}
- GST_CAT_WARNING_OBJECT (GST_CAT_DATAFLOW, queue, "Event handled");
+ GST_CAT_WARNING_OBJECT (queue_dataflow, queue, "Event handled");
res = er.ret;
} else {
res = gst_pad_event_default (pad, event);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH:
- GST_CAT_DEBUG_OBJECT (GST_CAT_DATAFLOW, queue,
+ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
"FLUSH event, flushing queue\n");
gst_queue_locked_flush (queue);
break;
GST_WARNING_OBJECT (typefind,
"could not seek to required position %u, hope for the best", size);
}
+ gst_pad_push (typefind->src, GST_DATA (gst_event_new_discontinuous (TRUE,
+ GST_FORMAT_DEFAULT, (guint64) 0, GST_FORMAT_BYTES, (guint64) 0,
+ GST_FORMAT_UNDEFINED)));
if (size
&& (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) {
GST_DEBUG_OBJECT (typefind, "pushing cached data (%u bytes)", size);