mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-08 18:39:54 +00:00
gst/base/gstbasesink.c: Remove extra parameter to debug output
Original commit message from CVS: * gst/base/gstbasesink.c: (gst_base_sink_handle_object): Remove extra parameter to debug output * gst/base/gstbasesrc.c: (gst_base_src_send_discont), (gst_base_src_do_seek), (gst_base_src_activate_push): Fix seek event handling. * gst/gstpipeline.c: (gst_pipeline_change_state): * gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_src_activate_push): Don't start the src pad task on FLUSH_STOP if the pad isn't linked. Debug changes.
This commit is contained in:
parent
e6d23e0aee
commit
05fa076d05
8 changed files with 88 additions and 69 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
2005-08-22 Jan Schmidt <thaytan@mad.scientist.com>
|
||||
|
||||
* gst/base/gstbasesink.c: (gst_base_sink_handle_object):
|
||||
Remove extra parameter to debug output
|
||||
|
||||
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
|
||||
(gst_base_src_do_seek), (gst_base_src_activate_push):
|
||||
Fix seek event handling.
|
||||
|
||||
* gst/gstpipeline.c: (gst_pipeline_change_state):
|
||||
* gst/gstqueue.c: (gst_queue_handle_sink_event),
|
||||
(gst_queue_src_activate_push):
|
||||
Don't start the src pad task on FLUSH_STOP if the pad
|
||||
isn't linked.
|
||||
Debug changes.
|
||||
|
||||
2005-08-22 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* check/gst/gstcaps.c: (GST_START_TEST), (gst_caps_suite):
|
||||
|
|
|
@ -604,8 +604,7 @@ gst_base_sink_handle_object (GstBaseSink * basesink, GstPad * pad,
|
|||
* application thread and we don't want to block there. */
|
||||
if (length > basesink->preroll_queue_max_len && !have_event) {
|
||||
/* block until the state changes, or we get a flush, or something */
|
||||
GST_DEBUG_OBJECT (basesink, "waiting to finish preroll",
|
||||
GST_ELEMENT_NAME (basesink));
|
||||
GST_DEBUG_OBJECT (basesink, "waiting to finish preroll");
|
||||
GST_PREROLL_WAIT (pad);
|
||||
GST_DEBUG_OBJECT (basesink, "done preroll");
|
||||
}
|
||||
|
|
|
@ -376,22 +376,6 @@ gst_base_src_query (GstPad * pad, GstQuery * query)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static const GstEventMask *
|
||||
gst_base_src_get_event_mask (GstPad * pad)
|
||||
{
|
||||
static const GstEventMask masks[] = {
|
||||
{GST_EVENT_SEEK, GST_SEEK_METHOD_CUR | GST_SEEK_METHOD_SET |
|
||||
GST_SEEK_METHOD_END | GST_SEEK_FLAG_FLUSH |
|
||||
GST_SEEK_FLAG_SEGMENT_LOOP},
|
||||
{GST_EVENT_FLUSH, 0},
|
||||
{GST_EVENT_SIZE, 0},
|
||||
{0, 0},
|
||||
};
|
||||
return masks;
|
||||
}
|
||||
#endif
|
||||
|
||||
static gboolean
|
||||
gst_base_src_send_discont (GstBaseSrc * src)
|
||||
{
|
||||
|
@ -443,37 +427,51 @@ gst_base_src_do_seek (GstBaseSrc * src, GstEvent * event)
|
|||
|
||||
/* perform the seek */
|
||||
switch (cur_type) {
|
||||
case GST_SEEK_TYPE_NONE:
|
||||
break;
|
||||
case GST_SEEK_TYPE_SET:
|
||||
if (cur < 0)
|
||||
goto error;
|
||||
src->offset = MIN (cur, src->size);
|
||||
src->segment_start = src->offset;
|
||||
src->segment_end = MIN (stop, src->size);
|
||||
GST_DEBUG_OBJECT (src, "seek set pending to %" G_GINT64_FORMAT,
|
||||
src->offset);
|
||||
break;
|
||||
case GST_SEEK_TYPE_CUR:
|
||||
cur += src->offset;
|
||||
src->offset = CLAMP (cur, 0, src->size);
|
||||
src->offset = CLAMP (src->offset + cur, 0, src->size);
|
||||
src->segment_start = src->offset;
|
||||
src->segment_end = stop;
|
||||
GST_DEBUG_OBJECT (src, "seek cur pending to %" G_GINT64_FORMAT,
|
||||
src->offset);
|
||||
break;
|
||||
case GST_SEEK_TYPE_END:
|
||||
if (cur > 0)
|
||||
goto error;
|
||||
cur = src->size + cur;
|
||||
src->offset = MAX (0, cur);
|
||||
src->offset = MAX (0, src->size + cur);
|
||||
src->segment_start = src->offset;
|
||||
src->segment_end = stop;
|
||||
GST_DEBUG_OBJECT (src, "seek end pending to %" G_GINT64_FORMAT,
|
||||
src->offset);
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
|
||||
switch (stop_type) {
|
||||
case GST_SEEK_TYPE_NONE:
|
||||
break;
|
||||
case GST_SEEK_TYPE_SET:
|
||||
if (stop < 0)
|
||||
goto error;
|
||||
src->segment_end = MIN (stop, src->size);
|
||||
break;
|
||||
case GST_SEEK_TYPE_CUR:
|
||||
src->segment_end = CLAMP (src->segment_end + stop, 0, src->size);
|
||||
break;
|
||||
case GST_SEEK_TYPE_END:
|
||||
if (stop > 0)
|
||||
goto error;
|
||||
src->segment_end = src->size + stop;
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (src, "seek pending for segment from %" G_GINT64_FORMAT
|
||||
" to %" G_GINT64_FORMAT, src->segment_start, src->segment_end);
|
||||
|
||||
/* now make sure the discont will be send */
|
||||
src->need_discont = TRUE;
|
||||
|
||||
|
|
|
@ -364,7 +364,8 @@ gst_pipeline_change_state (GstElement * element)
|
|||
|
||||
result = gst_element_get_state (element, NULL, NULL, timeval);
|
||||
if (result == GST_STATE_ASYNC) {
|
||||
GST_WARNING ("timeout in PREROLL, forcing next state change");
|
||||
GST_WARNING_OBJECT (pipeline,
|
||||
"timeout in PREROLL, forcing next state change");
|
||||
g_warning ("timeout in PREROLL, forcing next state change");
|
||||
result = GST_STATE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -544,8 +544,12 @@ gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
|
|||
GST_QUEUE_MUTEX_LOCK (queue);
|
||||
gst_queue_locked_flush (queue);
|
||||
queue->srcresult = GST_FLOW_OK;
|
||||
gst_pad_start_task (queue->srcpad, (GstTaskFunction) gst_queue_loop,
|
||||
queue->srcpad);
|
||||
if (gst_pad_is_linked (queue->srcpad)) {
|
||||
gst_pad_start_task (queue->srcpad, (GstTaskFunction) gst_queue_loop,
|
||||
queue->srcpad);
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (queue, "not re-starting task as pad is not linked");
|
||||
}
|
||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
||||
STATUS (queue, "after flush");
|
||||
|
@ -961,7 +965,7 @@ gst_queue_src_activate_push (GstPad * pad, gboolean active)
|
|||
if (gst_pad_is_linked (pad))
|
||||
result = gst_pad_start_task (pad, (GstTaskFunction) gst_queue_loop, pad);
|
||||
else {
|
||||
GST_DEBUG ("not starting task as pad is not linked");
|
||||
GST_DEBUG_OBJECT (queue, "not starting task as pad is not linked");
|
||||
result = TRUE;
|
||||
}
|
||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
|
|
@ -604,8 +604,7 @@ gst_base_sink_handle_object (GstBaseSink * basesink, GstPad * pad,
|
|||
* application thread and we don't want to block there. */
|
||||
if (length > basesink->preroll_queue_max_len && !have_event) {
|
||||
/* block until the state changes, or we get a flush, or something */
|
||||
GST_DEBUG_OBJECT (basesink, "waiting to finish preroll",
|
||||
GST_ELEMENT_NAME (basesink));
|
||||
GST_DEBUG_OBJECT (basesink, "waiting to finish preroll");
|
||||
GST_PREROLL_WAIT (pad);
|
||||
GST_DEBUG_OBJECT (basesink, "done preroll");
|
||||
}
|
||||
|
|
|
@ -376,22 +376,6 @@ gst_base_src_query (GstPad * pad, GstQuery * query)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static const GstEventMask *
|
||||
gst_base_src_get_event_mask (GstPad * pad)
|
||||
{
|
||||
static const GstEventMask masks[] = {
|
||||
{GST_EVENT_SEEK, GST_SEEK_METHOD_CUR | GST_SEEK_METHOD_SET |
|
||||
GST_SEEK_METHOD_END | GST_SEEK_FLAG_FLUSH |
|
||||
GST_SEEK_FLAG_SEGMENT_LOOP},
|
||||
{GST_EVENT_FLUSH, 0},
|
||||
{GST_EVENT_SIZE, 0},
|
||||
{0, 0},
|
||||
};
|
||||
return masks;
|
||||
}
|
||||
#endif
|
||||
|
||||
static gboolean
|
||||
gst_base_src_send_discont (GstBaseSrc * src)
|
||||
{
|
||||
|
@ -443,37 +427,51 @@ gst_base_src_do_seek (GstBaseSrc * src, GstEvent * event)
|
|||
|
||||
/* perform the seek */
|
||||
switch (cur_type) {
|
||||
case GST_SEEK_TYPE_NONE:
|
||||
break;
|
||||
case GST_SEEK_TYPE_SET:
|
||||
if (cur < 0)
|
||||
goto error;
|
||||
src->offset = MIN (cur, src->size);
|
||||
src->segment_start = src->offset;
|
||||
src->segment_end = MIN (stop, src->size);
|
||||
GST_DEBUG_OBJECT (src, "seek set pending to %" G_GINT64_FORMAT,
|
||||
src->offset);
|
||||
break;
|
||||
case GST_SEEK_TYPE_CUR:
|
||||
cur += src->offset;
|
||||
src->offset = CLAMP (cur, 0, src->size);
|
||||
src->offset = CLAMP (src->offset + cur, 0, src->size);
|
||||
src->segment_start = src->offset;
|
||||
src->segment_end = stop;
|
||||
GST_DEBUG_OBJECT (src, "seek cur pending to %" G_GINT64_FORMAT,
|
||||
src->offset);
|
||||
break;
|
||||
case GST_SEEK_TYPE_END:
|
||||
if (cur > 0)
|
||||
goto error;
|
||||
cur = src->size + cur;
|
||||
src->offset = MAX (0, cur);
|
||||
src->offset = MAX (0, src->size + cur);
|
||||
src->segment_start = src->offset;
|
||||
src->segment_end = stop;
|
||||
GST_DEBUG_OBJECT (src, "seek end pending to %" G_GINT64_FORMAT,
|
||||
src->offset);
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
|
||||
switch (stop_type) {
|
||||
case GST_SEEK_TYPE_NONE:
|
||||
break;
|
||||
case GST_SEEK_TYPE_SET:
|
||||
if (stop < 0)
|
||||
goto error;
|
||||
src->segment_end = MIN (stop, src->size);
|
||||
break;
|
||||
case GST_SEEK_TYPE_CUR:
|
||||
src->segment_end = CLAMP (src->segment_end + stop, 0, src->size);
|
||||
break;
|
||||
case GST_SEEK_TYPE_END:
|
||||
if (stop > 0)
|
||||
goto error;
|
||||
src->segment_end = src->size + stop;
|
||||
break;
|
||||
default:
|
||||
goto error;
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (src, "seek pending for segment from %" G_GINT64_FORMAT
|
||||
" to %" G_GINT64_FORMAT, src->segment_start, src->segment_end);
|
||||
|
||||
/* now make sure the discont will be send */
|
||||
src->need_discont = TRUE;
|
||||
|
||||
|
|
|
@ -544,8 +544,12 @@ gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
|
|||
GST_QUEUE_MUTEX_LOCK (queue);
|
||||
gst_queue_locked_flush (queue);
|
||||
queue->srcresult = GST_FLOW_OK;
|
||||
gst_pad_start_task (queue->srcpad, (GstTaskFunction) gst_queue_loop,
|
||||
queue->srcpad);
|
||||
if (gst_pad_is_linked (queue->srcpad)) {
|
||||
gst_pad_start_task (queue->srcpad, (GstTaskFunction) gst_queue_loop,
|
||||
queue->srcpad);
|
||||
} else {
|
||||
GST_DEBUG_OBJECT (queue, "not re-starting task as pad is not linked");
|
||||
}
|
||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
||||
STATUS (queue, "after flush");
|
||||
|
@ -961,7 +965,7 @@ gst_queue_src_activate_push (GstPad * pad, gboolean active)
|
|||
if (gst_pad_is_linked (pad))
|
||||
result = gst_pad_start_task (pad, (GstTaskFunction) gst_queue_loop, pad);
|
||||
else {
|
||||
GST_DEBUG ("not starting task as pad is not linked");
|
||||
GST_DEBUG_OBJECT (queue, "not starting task as pad is not linked");
|
||||
result = TRUE;
|
||||
}
|
||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
|
Loading…
Reference in a new issue