From a75e9102c571f75cf40893f1fd1955e06df35692 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 8 Feb 2012 15:17:49 +0100 Subject: [PATCH] GST_FLOW_WRONG_STATE -> GST_FLOW_FLUSHING --- ext/ogg/gstoggmux.c | 2 +- ext/ogg/gstogmparse.c | 4 ++-- ext/pango/gstbasetextoverlay.c | 6 +++--- gst-libs/gst/app/gstappsink.c | 4 ++-- gst-libs/gst/app/gstappsrc.c | 10 +++++----- gst-libs/gst/audio/gstaudiobasesink.c | 2 +- gst-libs/gst/audio/gstaudiobasesrc.c | 4 ++-- gst/gio/gstgio.c | 4 ++-- gst/tcp/gstmultisocketsink.c | 2 +- gst/tcp/gsttcpclientsink.c | 4 ++-- gst/tcp/gsttcpclientsrc.c | 4 ++-- gst/tcp/gsttcpserversrc.c | 4 ++-- tests/check/elements/textoverlay.c | 2 +- tests/check/elements/videorate.c | 2 +- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index bcb02d3..e414793 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -1643,7 +1643,7 @@ gst_ogg_mux_process_best_pad (GstOggMux * ogg_mux, GstOggPadData * best) } else { /* no pad to pull on, send EOS */ gst_pad_push_event (ogg_mux->srcpad, gst_event_new_eos ()); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } } diff --git a/ext/ogg/gstogmparse.c b/ext/ogg/gstogmparse.c index 2dd8805..82e75e6 100644 --- a/ext/ogg/gstogmparse.c +++ b/ext/ogg/gstogmparse.c @@ -687,7 +687,7 @@ gst_ogm_parse_comment_packet (GstOgmParse * ogm, GstBuffer * buf) if (ogm->srcpad == NULL) { GST_DEBUG ("no source pad"); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } /* if this is not a subtitle stream, push the vorbiscomment packet @@ -821,7 +821,7 @@ gst_ogm_parse_data_packet (GstOgmParse * ogm, GstBuffer * buf, GST_DEBUG_PAD_NAME (ogm->srcpad), gst_flow_get_name (ret)); } } else { - ret = GST_FLOW_WRONG_STATE; + ret = GST_FLOW_FLUSHING; } return ret; diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c index e96669d..1c19c3b 100644 --- a/ext/pango/gstbasetextoverlay.c +++ b/ext/pango/gstbasetextoverlay.c @@ -2367,7 +2367,7 @@ gst_base_text_overlay_text_chain (GstPad * pad, GstObject * parent, if (overlay->text_flushing) { GST_OBJECT_UNLOCK (overlay); - ret = GST_FLOW_WRONG_STATE; + ret = GST_FLOW_FLUSHING; GST_LOG_OBJECT (overlay, "text flushing"); goto beach; } @@ -2413,7 +2413,7 @@ gst_base_text_overlay_text_chain (GstPad * pad, GstObject * parent, GST_DEBUG ("Pad %s:%s resuming", GST_DEBUG_PAD_NAME (pad)); if (overlay->text_flushing) { GST_OBJECT_UNLOCK (overlay); - ret = GST_FLOW_WRONG_STATE; + ret = GST_FLOW_FLUSHING; goto beach; } } @@ -2735,7 +2735,7 @@ flushing: GST_OBJECT_UNLOCK (overlay); GST_DEBUG_OBJECT (overlay, "flushing, discarding buffer"); gst_buffer_unref (buffer); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } have_eos: { diff --git a/gst-libs/gst/app/gstappsink.c b/gst-libs/gst/app/gstappsink.c index 1c987d7..5239e82 100644 --- a/gst-libs/gst/app/gstappsink.c +++ b/gst-libs/gst/app/gstappsink.c @@ -634,7 +634,7 @@ flushing: { GST_DEBUG_OBJECT (appsink, "we are flushing"); g_mutex_unlock (priv->mutex); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } } @@ -745,7 +745,7 @@ flushing: { GST_DEBUG_OBJECT (appsink, "we are flushing"); g_mutex_unlock (priv->mutex); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } stopping: { diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c index 0b8012b..605df44 100644 --- a/gst-libs/gst/app/gstappsrc.c +++ b/gst-libs/gst/app/gstappsrc.c @@ -1041,7 +1041,7 @@ flushing: { GST_DEBUG_OBJECT (appsrc, "we are flushing"); g_mutex_unlock (priv->mutex); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } eos: { @@ -1502,7 +1502,7 @@ flushing: if (steal_ref) gst_buffer_unref (buffer); g_mutex_unlock (priv->mutex); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } eos: { @@ -1526,7 +1526,7 @@ eos: * space becomes available in the queue. * * Returns: #GST_FLOW_OK when the buffer was successfuly queued. - * #GST_FLOW_WRONG_STATE when @appsrc is not PAUSED or PLAYING. + * #GST_FLOW_FLUSHING when @appsrc is not PAUSED or PLAYING. * #GST_FLOW_EOS when EOS occured. * * Since: 0.10.22 @@ -1553,7 +1553,7 @@ gst_app_src_push_buffer_action (GstAppSrc * appsrc, GstBuffer * buffer) * element is the last buffer of the stream. * * Returns: #GST_FLOW_OK when the EOS was successfuly queued. - * #GST_FLOW_WRONG_STATE when @appsrc is not PAUSED or PLAYING. + * #GST_FLOW_FLUSHING when @appsrc is not PAUSED or PLAYING. * * Since: 0.10.22 */ @@ -1584,7 +1584,7 @@ flushing: { g_mutex_unlock (priv->mutex); GST_DEBUG_OBJECT (appsrc, "refuse EOS, we are flushing"); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } } diff --git a/gst-libs/gst/audio/gstaudiobasesink.c b/gst-libs/gst/audio/gstaudiobasesink.c index 97bc719..7a55e0b 100644 --- a/gst-libs/gst/audio/gstaudiobasesink.c +++ b/gst-libs/gst/audio/gstaudiobasesink.c @@ -1469,7 +1469,7 @@ flushing: { GST_DEBUG_OBJECT (sink, "we are flushing"); GST_OBJECT_LOCK (sink); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } } diff --git a/gst-libs/gst/audio/gstaudiobasesrc.c b/gst-libs/gst/audio/gstaudiobasesrc.c index 90206c6..ffc42c7 100644 --- a/gst-libs/gst/audio/gstaudiobasesrc.c +++ b/gst-libs/gst/audio/gstaudiobasesrc.c @@ -1028,7 +1028,7 @@ no_sync: wrong_state: { GST_DEBUG_OBJECT (src, "ringbuffer in wrong state"); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } wrong_offset: { @@ -1046,7 +1046,7 @@ stopped: { gst_buffer_unref (buf); GST_DEBUG_OBJECT (src, "ringbuffer stopped"); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } } diff --git a/gst/gio/gstgio.c b/gst/gio/gstgio.c index 96aea35..af797af 100644 --- a/gst/gio/gstgio.c +++ b/gst/gio/gstgio.c @@ -37,7 +37,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_gio_debug); /* @func_name: Name of the GIO function, for debugging messages. * @err: Error location. *err may be NULL, but err must be non-NULL. * @ret: Flow return location. May be NULL. Is set to either #GST_FLOW_ERROR - * or #GST_FLOW_WRONG_STATE. + * or #GST_FLOW_FLUSHING. * * Returns: TRUE to indicate a handled error. Error at given location err will * be freed and *err will be set to NULL. A FALSE return indicates an unhandled @@ -56,7 +56,7 @@ gst_gio_error (gpointer element, const gchar * func_name, GError ** err, if (GST_GIO_ERROR_MATCHES (*err, CANCELLED)) { GST_DEBUG_OBJECT (element, "blocking I/O call cancelled (%s)", func_name); if (ret) - *ret = GST_FLOW_WRONG_STATE; + *ret = GST_FLOW_FLUSHING; } else if (*err != NULL) { handled = FALSE; } else { diff --git a/gst/tcp/gstmultisocketsink.c b/gst/tcp/gstmultisocketsink.c index 0b4dcd5..14c46f1 100644 --- a/gst/tcp/gstmultisocketsink.c +++ b/gst/tcp/gstmultisocketsink.c @@ -2341,7 +2341,7 @@ gst_multi_socket_sink_render (GstBaseSink * bsink, GstBuffer * buf) sink = GST_MULTI_SOCKET_SINK (bsink); g_return_val_if_fail (GST_OBJECT_FLAG_IS_SET (sink, - GST_MULTI_SOCKET_SINK_OPEN), GST_FLOW_WRONG_STATE); + GST_MULTI_SOCKET_SINK_OPEN), GST_FLOW_FLUSHING); #if 0 /* since we check every buffer for streamheader caps, we need to make diff --git a/gst/tcp/gsttcpclientsink.c b/gst/tcp/gsttcpclientsink.c index 16097b6..96b82a2 100644 --- a/gst/tcp/gsttcpclientsink.c +++ b/gst/tcp/gsttcpclientsink.c @@ -180,7 +180,7 @@ gst_tcp_client_sink_render (GstBaseSink * bsink, GstBuffer * buf) sink = GST_TCP_CLIENT_SINK (bsink); g_return_val_if_fail (GST_OBJECT_FLAG_IS_SET (sink, GST_TCP_CLIENT_SINK_OPEN), - GST_FLOW_WRONG_STATE); + GST_FLOW_FLUSHING); gst_buffer_map (buf, &map, GST_MAP_READ); GST_LOG_OBJECT (sink, "writing %" G_GSIZE_FORMAT " bytes for buffer data", @@ -207,7 +207,7 @@ write_error: GstFlowReturn ret; if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - ret = GST_FLOW_WRONG_STATE; + ret = GST_FLOW_FLUSHING; GST_DEBUG_OBJECT (sink, "Cancelled reading from socket"); } else { GST_ELEMENT_ERROR (sink, RESOURCE, WRITE, diff --git a/gst/tcp/gsttcpclientsrc.c b/gst/tcp/gsttcpclientsrc.c index 7cd63d6..8b99f2a 100644 --- a/gst/tcp/gsttcpclientsrc.c +++ b/gst/tcp/gsttcpclientsrc.c @@ -245,7 +245,7 @@ gst_tcp_client_src_create (GstPushSrc * psrc, GstBuffer ** outbuf) *outbuf = NULL; } else if (rret < 0) { if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - ret = GST_FLOW_WRONG_STATE; + ret = GST_FLOW_FLUSHING; GST_DEBUG_OBJECT (src, "Cancelled reading from socket"); } else { ret = GST_FLOW_ERROR; @@ -290,7 +290,7 @@ get_available_error: wrong_state: { GST_DEBUG_OBJECT (src, "connection to closed, cannot read data"); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } } diff --git a/gst/tcp/gsttcpserversrc.c b/gst/tcp/gsttcpserversrc.c index 93e1afa..1abe1bd 100644 --- a/gst/tcp/gsttcpserversrc.c +++ b/gst/tcp/gsttcpserversrc.c @@ -240,7 +240,7 @@ gst_tcp_server_src_create (GstPushSrc * psrc, GstBuffer ** outbuf) *outbuf = NULL; } else if (rret < 0) { if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - ret = GST_FLOW_WRONG_STATE; + ret = GST_FLOW_FLUSHING; GST_DEBUG_OBJECT (src, "Cancelled reading from socket"); } else { ret = GST_FLOW_ERROR; @@ -272,7 +272,7 @@ done: wrong_state: { GST_DEBUG_OBJECT (src, "connection to closed, cannot read data"); - return GST_FLOW_WRONG_STATE; + return GST_FLOW_FLUSHING; } accept_error: { diff --git a/tests/check/elements/textoverlay.c b/tests/check/elements/textoverlay.c index 54e2870..afd8411 100644 --- a/tests/check/elements/textoverlay.c +++ b/tests/check/elements/textoverlay.c @@ -620,7 +620,7 @@ GST_START_TEST (test_video_waits_for_text) GST_LOG ("pushing video buffer 4"); gst_buffer_ref (inbuffer); - fail_unless (gst_pad_push (myvideosrcpad, inbuffer) == GST_FLOW_WRONG_STATE); + fail_unless (gst_pad_push (myvideosrcpad, inbuffer) == GST_FLOW_FLUSHING); /* and clean up */ g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL); diff --git a/tests/check/elements/videorate.c b/tests/check/elements/videorate.c index 5340002..421cad5 100644 --- a/tests/check/elements/videorate.c +++ b/tests/check/elements/videorate.c @@ -657,7 +657,7 @@ GST_START_TEST (test_non_ok_flow) GST_BUFFER_TIMESTAMP (buf) = ts; /* pushing gives away our reference */ - fail_unless_equals_int (gst_pad_push (mysrcpad, buf), GST_FLOW_WRONG_STATE); + fail_unless_equals_int (gst_pad_push (mysrcpad, buf), GST_FLOW_FLUSHING); /* cleanup */ cleanup_videorate (videorate); -- 2.7.4