mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
don't assert in state change
Original commit message from CVS: don't assert in state change
This commit is contained in:
parent
90a779acb6
commit
c750d9bd49
18 changed files with 57 additions and 33 deletions
27
ChangeLog
27
ChangeLog
|
@ -1,3 +1,30 @@
|
||||||
|
2004-07-09 Thomas Vander Stichele <thomas (at) apestaart (dot) org>
|
||||||
|
|
||||||
|
* ext/alsa/gstalsa.c: (gst_alsa_change_state):
|
||||||
|
* ext/alsa/gstalsasink.c: (gst_alsa_sink_check_event),
|
||||||
|
(gst_alsa_sink_loop), (gst_alsa_sink_change_state):
|
||||||
|
* ext/alsa/gstalsasrc.c: (gst_alsa_src_change_state):
|
||||||
|
* ext/libvisual/visual.c: (gst_visual_change_state):
|
||||||
|
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_change_state):
|
||||||
|
* ext/theora/theoradec.c: (theora_dec_change_state):
|
||||||
|
* ext/theora/theoraenc.c: (theora_enc_change_state):
|
||||||
|
* ext/vorbis/vorbisdec.c: (vorbis_dec_change_state):
|
||||||
|
* gst-libs/gst/navigation/navigation.c:
|
||||||
|
* gst/adder/gstadder.c: (gst_adder_change_state):
|
||||||
|
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain),
|
||||||
|
(gst_audio_convert_get_buffer):
|
||||||
|
* gst/multipart/multipartdemux.c:
|
||||||
|
(gst_multipart_demux_change_state):
|
||||||
|
* gst/playback/gstdecodebin.c: (gst_decode_bin_change_state):
|
||||||
|
* gst/playback/gstplaybasebin.c: (gst_play_base_bin_change_state):
|
||||||
|
* gst/playback/gstplaybin.c: (gst_play_bin_change_state):
|
||||||
|
* gst/videoscale/gstvideoscale.c:
|
||||||
|
(gst_videoscale_handle_src_event):
|
||||||
|
* gst/volume/gstvolume.c: (volume_chain_int16):
|
||||||
|
don't assert in state change, this should be done by the base
|
||||||
|
GstElement class.
|
||||||
|
various debugging fixes.
|
||||||
|
|
||||||
2004-07-08 Thomas Vander Stichele <thomas (at) apestaart (dot) org>
|
2004-07-08 Thomas Vander Stichele <thomas (at) apestaart (dot) org>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
|
|
@ -1131,7 +1131,7 @@ gst_alsa_change_state (GstElement * element)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
||||||
|
|
|
@ -548,7 +548,7 @@ gst_alsa_sink_change_state (GstElement * element)
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_ELEMENT_CLASS (sink_parent_class)->change_state)
|
if (GST_ELEMENT_CLASS (sink_parent_class)->change_state)
|
||||||
|
|
|
@ -521,7 +521,7 @@ gst_alsa_src_change_state (GstElement * element)
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_ELEMENT_CLASS (src_parent_class)->change_state)
|
if (GST_ELEMENT_CLASS (src_parent_class)->change_state)
|
||||||
|
|
|
@ -339,7 +339,7 @@ gst_visual_change_state (GstElement * element)
|
||||||
visual->actor = NULL;
|
visual->actor = NULL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
||||||
|
|
|
@ -448,7 +448,8 @@ gst_ogg_demux_src_event (GstPad * pad, GstEvent * event)
|
||||||
|
|
||||||
GST_OGG_SET_STATE (ogg, GST_OGG_STATE_SEEK);
|
GST_OGG_SET_STATE (ogg, GST_OGG_STATE_SEEK);
|
||||||
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad,
|
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad,
|
||||||
pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;);
|
pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;
|
||||||
|
);
|
||||||
GST_DEBUG_OBJECT (ogg, "initiating seeking to offset %" G_GUINT64_FORMAT,
|
GST_DEBUG_OBJECT (ogg, "initiating seeking to offset %" G_GUINT64_FORMAT,
|
||||||
offset);
|
offset);
|
||||||
ogg->seek_pad = cur;
|
ogg->seek_pad = cur;
|
||||||
|
@ -499,7 +500,8 @@ gst_ogg_demux_handle_event (GstPad * pad, GstEvent * event)
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
GST_FLAG_UNSET (ogg, GST_OGG_FLAG_WAIT_FOR_DISCONT);
|
GST_FLAG_UNSET (ogg, GST_OGG_FLAG_WAIT_FOR_DISCONT);
|
||||||
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad,
|
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad,
|
||||||
pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;);
|
pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
gst_pad_event_default (pad, event);
|
gst_pad_event_default (pad, event);
|
||||||
|
@ -756,7 +758,8 @@ _find_chain_get_unknown_part (GstOggDemux * ogg, gint64 * start, gint64 * end)
|
||||||
*end = G_MAXINT64;
|
*end = G_MAXINT64;
|
||||||
|
|
||||||
g_assert (ogg->current_chain >= 0);
|
g_assert (ogg->current_chain >= 0);
|
||||||
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, *start = MAX (*start, pad->end_offset););
|
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, *start = MAX (*start, pad->end_offset);
|
||||||
|
);
|
||||||
|
|
||||||
if (ogg->setup_state == SETUP_FIND_LAST_CHAIN) {
|
if (ogg->setup_state == SETUP_FIND_LAST_CHAIN) {
|
||||||
*end = gst_file_pad_get_length (ogg->sinkpad);
|
*end = gst_file_pad_get_length (ogg->sinkpad);
|
||||||
|
@ -886,7 +889,8 @@ _find_streams_check (GstOggDemux * ogg)
|
||||||
} else {
|
} else {
|
||||||
endpos = G_MAXINT64;
|
endpos = G_MAXINT64;
|
||||||
FOR_PAD_IN_CHAIN (ogg, pad, ogg->chains->len - 1,
|
FOR_PAD_IN_CHAIN (ogg, pad, ogg->chains->len - 1,
|
||||||
endpos = MIN (endpos, pad->start_offset););
|
endpos = MIN (endpos, pad->start_offset);
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (!ogg->seek_skipped || gst_ogg_demux_position (ogg) >= endpos) {
|
if (!ogg->seek_skipped || gst_ogg_demux_position (ogg) >= endpos) {
|
||||||
/* have we found the endposition for all streams yet? */
|
/* have we found the endposition for all streams yet? */
|
||||||
|
@ -1317,7 +1321,6 @@ gst_ogg_demux_change_state (GstElement * element)
|
||||||
ogg_sync_clear (&ogg->sync);
|
ogg_sync_clear (&ogg->sync);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -486,7 +486,6 @@ theora_dec_change_state (GstElement * element)
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -483,7 +483,6 @@ theora_enc_change_state (GstElement * element)
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -463,7 +463,6 @@ vorbis_dec_change_state (GstElement * element)
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,8 @@ gst_navigation_class_init (GstNavigationInterface * iface)
|
||||||
iface->send_event = NULL;
|
iface->send_event = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The interface implementer should make sure that the object can handle
|
||||||
|
* the event. */
|
||||||
void
|
void
|
||||||
gst_navigation_send_event (GstNavigation * navigation, GstStructure * structure)
|
gst_navigation_send_event (GstNavigation * navigation, GstStructure * structure)
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,6 +59,8 @@ gst_navigation_class_init (GstNavigationInterface * iface)
|
||||||
iface->send_event = NULL;
|
iface->send_event = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* The interface implementer should make sure that the object can handle
|
||||||
|
* the event. */
|
||||||
void
|
void
|
||||||
gst_navigation_send_event (GstNavigation * navigation, GstStructure * structure)
|
gst_navigation_send_event (GstNavigation * navigation, GstStructure * structure)
|
||||||
{
|
{
|
||||||
|
|
|
@ -497,15 +497,10 @@ gst_adder_change_state (GstElement * element)
|
||||||
adder->offset = 0;
|
adder->offset = 0;
|
||||||
break;
|
break;
|
||||||
case GST_STATE_PAUSED_TO_PLAYING:
|
case GST_STATE_PAUSED_TO_PLAYING:
|
||||||
break;
|
|
||||||
case GST_STATE_PLAYING_TO_PAUSED:
|
case GST_STATE_PLAYING_TO_PAUSED:
|
||||||
break;
|
|
||||||
case GST_STATE_PAUSED_TO_READY:
|
case GST_STATE_PAUSED_TO_READY:
|
||||||
break;
|
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -253,6 +253,7 @@ gst_audio_convert_chain (GstPad * pad, GstData * data)
|
||||||
gst_pad_event_default (pad, GST_EVENT (buf));
|
gst_pad_event_default (pad, GST_EVENT (buf));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
g_return_if_fail (GST_IS_BUFFER (buf));
|
||||||
|
|
||||||
if (!gst_pad_is_negotiated (this->sink)) {
|
if (!gst_pad_is_negotiated (this->sink)) {
|
||||||
GST_ELEMENT_ERROR (this, CORE, NEGOTIATION, (NULL),
|
GST_ELEMENT_ERROR (this, CORE, NEGOTIATION, (NULL),
|
||||||
|
@ -550,6 +551,8 @@ gst_audio_convert_get_buffer (GstBuffer * buf, guint size)
|
||||||
{
|
{
|
||||||
GstBuffer *ret;
|
GstBuffer *ret;
|
||||||
|
|
||||||
|
g_assert (GST_IS_BUFFER (buf));
|
||||||
|
|
||||||
GST_LOG
|
GST_LOG
|
||||||
("new buffer of size %u requested. Current is: data: %p - size: %u - maxsize: %u",
|
("new buffer of size %u requested. Current is: data: %p - size: %u - maxsize: %u",
|
||||||
size, buf->data, buf->size, buf->maxsize);
|
size, buf->data, buf->size, buf->maxsize);
|
||||||
|
|
|
@ -391,9 +391,9 @@ close_link (GstElement * element, GstDecodeBin * decode_bin)
|
||||||
switch (GST_PAD_TEMPLATE_PRESENCE (templ)) {
|
switch (GST_PAD_TEMPLATE_PRESENCE (templ)) {
|
||||||
case GST_PAD_ALWAYS:
|
case GST_PAD_ALWAYS:
|
||||||
{
|
{
|
||||||
GstPad *pad =
|
GstPad *pad = gst_element_get_pad (element,
|
||||||
gst_element_get_pad (element,
|
|
||||||
GST_PAD_TEMPLATE_NAME_TEMPLATE (templ));
|
GST_PAD_TEMPLATE_NAME_TEMPLATE (templ));
|
||||||
|
|
||||||
if (pad) {
|
if (pad) {
|
||||||
to_connect = g_list_prepend (to_connect, pad);
|
to_connect = g_list_prepend (to_connect, pad);
|
||||||
}
|
}
|
||||||
|
@ -401,9 +401,9 @@ close_link (GstElement * element, GstDecodeBin * decode_bin)
|
||||||
}
|
}
|
||||||
case GST_PAD_SOMETIMES:
|
case GST_PAD_SOMETIMES:
|
||||||
{
|
{
|
||||||
GstPad *pad =
|
GstPad *pad = gst_element_get_pad (element,
|
||||||
gst_element_get_pad (element,
|
|
||||||
GST_PAD_TEMPLATE_NAME_TEMPLATE (templ));
|
GST_PAD_TEMPLATE_NAME_TEMPLATE (templ));
|
||||||
|
|
||||||
if (pad) {
|
if (pad) {
|
||||||
to_connect = g_list_prepend (to_connect, pad);
|
to_connect = g_list_prepend (to_connect, pad);
|
||||||
} else {
|
} else {
|
||||||
|
@ -493,19 +493,13 @@ gst_decode_bin_change_state (GstElement * element)
|
||||||
|
|
||||||
switch (GST_STATE_TRANSITION (element)) {
|
switch (GST_STATE_TRANSITION (element)) {
|
||||||
case GST_STATE_NULL_TO_READY:
|
case GST_STATE_NULL_TO_READY:
|
||||||
break;
|
|
||||||
case GST_STATE_READY_TO_PAUSED:
|
case GST_STATE_READY_TO_PAUSED:
|
||||||
break;
|
|
||||||
case GST_STATE_PAUSED_TO_PLAYING:
|
case GST_STATE_PAUSED_TO_PLAYING:
|
||||||
break;
|
|
||||||
case GST_STATE_PLAYING_TO_PAUSED:
|
case GST_STATE_PLAYING_TO_PAUSED:
|
||||||
break;
|
|
||||||
case GST_STATE_PAUSED_TO_READY:
|
case GST_STATE_PAUSED_TO_READY:
|
||||||
break;
|
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -430,7 +430,6 @@ gst_play_base_bin_change_state (GstElement * element)
|
||||||
gst_object_unref (GST_OBJECT (play_base_bin->thread));
|
gst_object_unref (GST_OBJECT (play_base_bin->thread));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -359,15 +359,11 @@ gst_play_bin_change_state (GstElement * element)
|
||||||
setup_sinks (play_bin);
|
setup_sinks (play_bin);
|
||||||
break;
|
break;
|
||||||
case GST_STATE_PAUSED_TO_PLAYING:
|
case GST_STATE_PAUSED_TO_PLAYING:
|
||||||
break;
|
|
||||||
case GST_STATE_PLAYING_TO_PAUSED:
|
case GST_STATE_PLAYING_TO_PAUSED:
|
||||||
break;
|
|
||||||
case GST_STATE_PAUSED_TO_READY:
|
case GST_STATE_PAUSED_TO_READY:
|
||||||
break;
|
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -332,10 +332,14 @@ gst_videoscale_handle_src_event (GstPad * pad, GstEvent * event)
|
||||||
}
|
}
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
new_event = gst_event_new (GST_EVENT_NAVIGATION);
|
new_event = gst_event_new (GST_EVENT_NAVIGATION);
|
||||||
|
GST_DEBUG_OBJECT (videoscale, "creating new NAVIGATION event %p",
|
||||||
|
new_event);
|
||||||
new_event->event_data.structure.structure = structure;
|
new_event->event_data.structure.structure = structure;
|
||||||
return gst_pad_event_default (pad, new_event);
|
return gst_pad_event_default (pad, new_event);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
GST_DEBUG_OBJECT (videoscale, "passing on non-NAVIGATION event %p",
|
||||||
|
event);
|
||||||
return gst_pad_event_default (pad, event);
|
return gst_pad_event_default (pad, event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -446,12 +446,15 @@ volume_chain_int16 (GstPad * pad, GstData * _data)
|
||||||
gint16 *data;
|
gint16 *data;
|
||||||
gint i, num_samples;
|
gint i, num_samples;
|
||||||
|
|
||||||
|
g_return_if_fail (_data);
|
||||||
g_return_if_fail (GST_IS_PAD (pad));
|
g_return_if_fail (GST_IS_PAD (pad));
|
||||||
g_return_if_fail (buf != NULL);
|
g_return_if_fail (buf != NULL);
|
||||||
|
|
||||||
filter = GST_VOLUME (GST_OBJECT_PARENT (pad));
|
filter = GST_VOLUME (GST_OBJECT_PARENT (pad));
|
||||||
g_return_if_fail (GST_IS_VOLUME (filter));
|
g_return_if_fail (GST_IS_VOLUME (filter));
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (filter, "processing incoming buffer with refcount %d",
|
||||||
|
GST_BUFFER_REFCOUNT_VALUE (buf));
|
||||||
out_buf = gst_buffer_copy_on_write (buf);
|
out_buf = gst_buffer_copy_on_write (buf);
|
||||||
|
|
||||||
data = (gint16 *) GST_BUFFER_DATA (out_buf);
|
data = (gint16 *) GST_BUFFER_DATA (out_buf);
|
||||||
|
@ -484,7 +487,6 @@ volume_chain_int16 (GstPad * pad, GstData * _data)
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_pad_push (filter->srcpad, GST_DATA (out_buf));
|
gst_pad_push (filter->srcpad, GST_DATA (out_buf));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue