Commit 9365f12d authored by Wim Taymans's avatar Wim Taymans
Browse files

GST_FLOW_WRONG_STATE -> GST_FLOW_FLUSHING

parent 640be49e
...@@ -326,7 +326,7 @@ gst_gdk_pixbuf_sink_event (GstPad * pad, GstEvent * event) ...@@ -326,7 +326,7 @@ gst_gdk_pixbuf_sink_event (GstPad * pad, GstEvent * event)
/* as long as we don't have flow returns for event functions we need /* as long as we don't have flow returns for event functions we need
* to post an error here, or the application might never know that * to post an error here, or the application might never know that
* things failed */ * things failed */
if (res != GST_FLOW_OK && res != GST_FLOW_WRONG_STATE) { if (res != GST_FLOW_OK && res != GST_FLOW_FLUSHING) {
GST_ELEMENT_ERROR (pixbuf, STREAM, FAILED, (NULL), GST_ELEMENT_ERROR (pixbuf, STREAM, FAILED, (NULL),
("Flow: %s", gst_flow_get_name (res))); ("Flow: %s", gst_flow_get_name (res)));
} }
......
...@@ -1656,7 +1656,7 @@ alloc_failed: ...@@ -1656,7 +1656,7 @@ alloc_failed:
GST_DEBUG_OBJECT (dec, "failed to alloc buffer, reason %s", reason); GST_DEBUG_OBJECT (dec, "failed to alloc buffer, reason %s", reason);
/* Reset for next time */ /* Reset for next time */
jpeg_abort_decompress (&dec->cinfo); jpeg_abort_decompress (&dec->cinfo);
if (ret != GST_FLOW_EOS && ret != GST_FLOW_WRONG_STATE && if (ret != GST_FLOW_EOS && ret != GST_FLOW_FLUSHING &&
ret != GST_FLOW_NOT_LINKED) { ret != GST_FLOW_NOT_LINKED) {
gst_jpeg_dec_set_error (dec, GST_FUNCTION, __LINE__, gst_jpeg_dec_set_error (dec, GST_FUNCTION, __LINE__,
"Buffer allocation failed, reason: %s", reason); "Buffer allocation failed, reason: %s", reason);
......
...@@ -677,7 +677,7 @@ beach: ...@@ -677,7 +677,7 @@ beach:
not_configured: not_configured:
{ {
GST_LOG_OBJECT (pngdec, "we are not configured yet"); GST_LOG_OBJECT (pngdec, "we are not configured yet");
ret = GST_FLOW_WRONG_STATE; ret = GST_FLOW_FLUSHING;
goto beach; goto beach;
} }
} }
......
...@@ -725,7 +725,7 @@ error_while_polling: ...@@ -725,7 +725,7 @@ error_while_polling:
told_to_stop: told_to_stop:
{ {
GST_DEBUG_OBJECT (dv1394src, "told to stop, shutting down"); GST_DEBUG_OBJECT (dv1394src, "told to stop, shutting down");
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} }
} }
......
...@@ -460,7 +460,7 @@ error_while_polling: ...@@ -460,7 +460,7 @@ error_while_polling:
told_to_stop: told_to_stop:
{ {
GST_DEBUG_OBJECT (dv1394src, "told to stop, shutting down"); GST_DEBUG_OBJECT (dv1394src, "told to stop, shutting down");
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} }
} }
......
...@@ -799,9 +799,9 @@ gst_wavpack_enc_chain (GstPad * pad, GstBuffer * buf) ...@@ -799,9 +799,9 @@ gst_wavpack_enc_chain (GstPad * pad, GstBuffer * buf)
} else if ((enc->srcpad_last_return == GST_FLOW_NOT_LINKED) && } else if ((enc->srcpad_last_return == GST_FLOW_NOT_LINKED) &&
(enc->wvcsrcpad_last_return == GST_FLOW_NOT_LINKED)) { (enc->wvcsrcpad_last_return == GST_FLOW_NOT_LINKED)) {
ret = GST_FLOW_NOT_LINKED; ret = GST_FLOW_NOT_LINKED;
} else if ((enc->srcpad_last_return == GST_FLOW_WRONG_STATE) && } else if ((enc->srcpad_last_return == GST_FLOW_FLUSHING) &&
(enc->wvcsrcpad_last_return == GST_FLOW_WRONG_STATE)) { (enc->wvcsrcpad_last_return == GST_FLOW_FLUSHING)) {
ret = GST_FLOW_WRONG_STATE; ret = GST_FLOW_FLUSHING;
} else { } else {
GST_ELEMENT_ERROR (enc, LIBRARY, ENCODE, (NULL), GST_ELEMENT_ERROR (enc, LIBRARY, ENCODE, (NULL),
("encoding samples failed")); ("encoding samples failed"));
......
...@@ -116,7 +116,7 @@ gst_quarktv_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame, ...@@ -116,7 +116,7 @@ gst_quarktv_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame,
gst_object_sync_values (GST_OBJECT (filter), timestamp); gst_object_sync_values (GST_OBJECT (filter), timestamp);
if (G_UNLIKELY (filter->planetable == NULL)) if (G_UNLIKELY (filter->planetable == NULL))
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0);
dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0);
......
...@@ -1837,7 +1837,7 @@ parse: ...@@ -1837,7 +1837,7 @@ parse:
if (G_UNLIKELY (demux->flushing)) { if (G_UNLIKELY (demux->flushing)) {
GST_DEBUG_OBJECT (demux, "we are now flushing, exiting parser loop"); GST_DEBUG_OBJECT (demux, "we are now flushing, exiting parser loop");
ret = GST_FLOW_WRONG_STATE; ret = GST_FLOW_FLUSHING;
goto beach; goto beach;
} }
......
...@@ -343,8 +343,7 @@ gst_image_freeze_sink_bufferalloc (GstPad * pad, guint64 offset, guint size, ...@@ -343,8 +343,7 @@ gst_image_freeze_sink_bufferalloc (GstPad * pad, guint64 offset, guint size,
GST_PAD_STREAM_LOCK (self->srcpad); GST_PAD_STREAM_LOCK (self->srcpad);
ret = gst_pad_alloc_buffer (self->srcpad, offset, size, caps, buf); ret = gst_pad_alloc_buffer (self->srcpad, offset, size, caps, buf);
seeking = ret == GST_FLOW_WRONG_STATE seeking = ret == GST_FLOW_FLUSHING && g_atomic_int_get (&self->seeking);
&& g_atomic_int_get (&self->seeking);
GST_PAD_STREAM_UNLOCK (self->srcpad); GST_PAD_STREAM_UNLOCK (self->srcpad);
} while (seeking); } while (seeking);
......
...@@ -5278,7 +5278,7 @@ parse_failed: ...@@ -5278,7 +5278,7 @@ parse_failed:
flow_failed: flow_failed:
{ {
/* maybe upstream temporarily flushing */ /* maybe upstream temporarily flushing */
if (ret != GST_FLOW_WRONG_STATE) { if (ret != GST_FLOW_FLUSHING) {
GST_DEBUG_OBJECT (qtdemux, "no next moof"); GST_DEBUG_OBJECT (qtdemux, "no next moof");
offset = 0; offset = 0;
} else { } else {
......
...@@ -600,6 +600,6 @@ cancelled: ...@@ -600,6 +600,6 @@ cancelled:
GST_DEBUG_OBJECT (src, "I/O operation cancelled from another thread"); GST_DEBUG_OBJECT (src, "I/O operation cancelled from another thread");
g_error_free (err); g_error_free (err);
gst_buffer_unref (buf); gst_buffer_unref (buf);
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} }
} }
...@@ -463,7 +463,7 @@ gst_rg_analysis_transform_ip (GstBaseTransform * base, GstBuffer * buf) ...@@ -463,7 +463,7 @@ gst_rg_analysis_transform_ip (GstBaseTransform * base, GstBuffer * buf)
GstRgAnalysis *filter = GST_RG_ANALYSIS (base); GstRgAnalysis *filter = GST_RG_ANALYSIS (base);
GstMapInfo map; GstMapInfo map;
g_return_val_if_fail (filter->ctx != NULL, GST_FLOW_WRONG_STATE); g_return_val_if_fail (filter->ctx != NULL, GST_FLOW_FLUSHING);
g_return_val_if_fail (filter->analyze != NULL, GST_FLOW_NOT_NEGOTIATED); g_return_val_if_fail (filter->analyze != NULL, GST_FLOW_NOT_NEGOTIATED);
if (filter->skip) if (filter->skip)
......
...@@ -845,7 +845,7 @@ gst_rtp_jitter_buffer_flush_start (GstRtpJitterBuffer * jitterbuffer) ...@@ -845,7 +845,7 @@ gst_rtp_jitter_buffer_flush_start (GstRtpJitterBuffer * jitterbuffer)
JBUF_LOCK (priv); JBUF_LOCK (priv);
/* mark ourselves as flushing */ /* mark ourselves as flushing */
priv->srcresult = GST_FLOW_WRONG_STATE; priv->srcresult = GST_FLOW_FLUSHING;
GST_DEBUG_OBJECT (jitterbuffer, "Disabling pop on queue"); GST_DEBUG_OBJECT (jitterbuffer, "Disabling pop on queue");
/* this unblocks any waiting pops on the src pad task */ /* this unblocks any waiting pops on the src pad task */
JBUF_SIGNAL (priv); JBUF_SIGNAL (priv);
...@@ -1152,7 +1152,7 @@ gst_rtp_jitter_buffer_sink_rtcp_event (GstPad * pad, GstObject * parent, ...@@ -1152,7 +1152,7 @@ gst_rtp_jitter_buffer_sink_rtcp_event (GstPad * pad, GstObject * parent,
/* /*
* Must be called with JBUF_LOCK held, will release the LOCK when emiting the * Must be called with JBUF_LOCK held, will release the LOCK when emiting the
* signal. The function returns GST_FLOW_ERROR when a parsing error happened and * signal. The function returns GST_FLOW_ERROR when a parsing error happened and
* GST_FLOW_WRONG_STATE when the element is shutting down. On success * GST_FLOW_FLUSHING when the element is shutting down. On success
* GST_FLOW_OK is returned. * GST_FLOW_OK is returned.
*/ */
static GstFlowReturn static GstFlowReturn
...@@ -1201,7 +1201,7 @@ no_caps: ...@@ -1201,7 +1201,7 @@ no_caps:
out_flushing: out_flushing:
{ {
GST_DEBUG_OBJECT (jitterbuffer, "we are flushing"); GST_DEBUG_OBJECT (jitterbuffer, "we are flushing");
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} }
parse_failed: parse_failed:
{ {
...@@ -1299,7 +1299,7 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent, ...@@ -1299,7 +1299,7 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent,
if (G_UNLIKELY (priv->clock_rate == -1)) { if (G_UNLIKELY (priv->clock_rate == -1)) {
/* no clock rate given on the caps, try to get one with the signal */ /* no clock rate given on the caps, try to get one with the signal */
if (gst_rtp_jitter_buffer_get_clock_rate (jitterbuffer, if (gst_rtp_jitter_buffer_get_clock_rate (jitterbuffer,
pt) == GST_FLOW_WRONG_STATE) pt) == GST_FLOW_FLUSHING)
goto out_flushing; goto out_flushing;
if (G_UNLIKELY (priv->clock_rate == -1)) if (G_UNLIKELY (priv->clock_rate == -1))
......
...@@ -3685,7 +3685,7 @@ interrupt: ...@@ -3685,7 +3685,7 @@ interrupt:
gst_rtsp_message_unset (&message); gst_rtsp_message_unset (&message);
GST_DEBUG_OBJECT (src, "got interrupted: stop connection flush"); GST_DEBUG_OBJECT (src, "got interrupted: stop connection flush");
gst_rtspsrc_connection_flush (src, FALSE); gst_rtspsrc_connection_flush (src, FALSE);
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} }
receive_error: receive_error:
{ {
...@@ -3812,7 +3812,7 @@ interrupt: ...@@ -3812,7 +3812,7 @@ interrupt:
gst_rtsp_message_unset (&message); gst_rtsp_message_unset (&message);
GST_DEBUG_OBJECT (src, "got interrupted: stop connection flush"); GST_DEBUG_OBJECT (src, "got interrupted: stop connection flush");
gst_rtspsrc_connection_flush (src, FALSE); gst_rtspsrc_connection_flush (src, FALSE);
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} }
connect_error: connect_error:
{ {
...@@ -3826,7 +3826,7 @@ connect_error: ...@@ -3826,7 +3826,7 @@ connect_error:
g_free (str); g_free (str);
ret = GST_FLOW_ERROR; ret = GST_FLOW_ERROR;
} else { } else {
ret = GST_FLOW_WRONG_STATE; ret = GST_FLOW_FLUSHING;
} }
return ret; return ret;
} }
...@@ -3851,7 +3851,7 @@ handle_request_failed: ...@@ -3851,7 +3851,7 @@ handle_request_failed:
g_free (str); g_free (str);
ret = GST_FLOW_ERROR; ret = GST_FLOW_ERROR;
} else { } else {
ret = GST_FLOW_WRONG_STATE; ret = GST_FLOW_FLUSHING;
} }
return ret; return ret;
} }
...@@ -4084,7 +4084,7 @@ gst_rtspsrc_loop (GstRTSPSrc * src) ...@@ -4084,7 +4084,7 @@ gst_rtspsrc_loop (GstRTSPSrc * src)
no_connection: no_connection:
{ {
GST_WARNING_OBJECT (src, "we are not connected"); GST_WARNING_OBJECT (src, "we are not connected");
ret = GST_FLOW_WRONG_STATE; ret = GST_FLOW_FLUSHING;
goto pause; goto pause;
} }
pause: pause:
......
...@@ -929,7 +929,7 @@ shutdown: ...@@ -929,7 +929,7 @@ shutdown:
{ {
GST_DEBUG_OBJECT (self, "Shutting down"); GST_DEBUG_OBJECT (self, "Shutting down");
gst_buffer_unref (buffer); gst_buffer_unref (buffer);
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} }
qos: qos:
{ {
......
...@@ -485,7 +485,7 @@ select_error: ...@@ -485,7 +485,7 @@ select_error:
stopped: stopped:
{ {
GST_DEBUG ("stop called"); GST_DEBUG ("stop called");
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} }
get_available_error: get_available_error:
{ {
...@@ -500,7 +500,7 @@ receive_error: ...@@ -500,7 +500,7 @@ receive_error:
if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_BUSY) || if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_BUSY) ||
g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
g_clear_error (&err); g_clear_error (&err);
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} else { } else {
GST_ELEMENT_ERROR (udpsrc, RESOURCE, READ, (NULL), GST_ELEMENT_ERROR (udpsrc, RESOURCE, READ, (NULL),
("receive error %d: %s", ret, err->message)); ("receive error %d: %s", ret, err->message));
......
...@@ -652,7 +652,7 @@ gst_wavenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) ...@@ -652,7 +652,7 @@ gst_wavenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
GstWavEnc *wavenc = GST_WAVENC (parent); GstWavEnc *wavenc = GST_WAVENC (parent);
GstFlowReturn flow = GST_FLOW_OK; GstFlowReturn flow = GST_FLOW_OK;
g_return_val_if_fail (wavenc->channels > 0, GST_FLOW_WRONG_STATE); g_return_val_if_fail (wavenc->channels > 0, GST_FLOW_FLUSHING);
if (!wavenc->sent_header) { if (!wavenc->sent_header) {
/* use bogus size initially, we'll write the real /* use bogus size initially, we'll write the real
......
...@@ -501,7 +501,7 @@ gst_v4l2_object_poll (GstV4l2Object * v4l2object) ...@@ -501,7 +501,7 @@ gst_v4l2_object_poll (GstV4l2Object * v4l2object)
stopped: stopped:
{ {
GST_DEBUG ("stop called"); GST_DEBUG ("stop called");
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} }
select_error: select_error:
{ {
...@@ -741,7 +741,7 @@ gst_v4l2_buffer_pool_acquire_buffer (GstBufferPool * bpool, GstBuffer ** buffer, ...@@ -741,7 +741,7 @@ gst_v4l2_buffer_pool_acquire_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
flushing: flushing:
{ {
GST_DEBUG_OBJECT (pool, "We are flushing"); GST_DEBUG_OBJECT (pool, "We are flushing");
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} }
} }
......
...@@ -2557,7 +2557,7 @@ gst_v4l2_object_get_mmap (GstV4l2Object * v4l2object, GstBuffer ** buf) ...@@ -2557,7 +2557,7 @@ gst_v4l2_object_get_mmap (GstV4l2Object * v4l2object, GstBuffer ** buf)
no_buffer_pool: no_buffer_pool:
{ {
GST_DEBUG_OBJECT (v4l2object->element, "no buffer pool"); GST_DEBUG_OBJECT (v4l2object->element, "no buffer pool");
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} }
poll_error: poll_error:
{ {
......
...@@ -838,7 +838,7 @@ gst_ximage_src_create (GstPushSrc * bs, GstBuffer ** buf) ...@@ -838,7 +838,7 @@ gst_ximage_src_create (GstPushSrc * bs, GstBuffer ** buf)
if (ret == GST_CLOCK_UNSCHEDULED) { if (ret == GST_CLOCK_UNSCHEDULED) {
/* Got woken up by the unlock function */ /* Got woken up by the unlock function */
GST_OBJECT_UNLOCK (s); GST_OBJECT_UNLOCK (s);
return GST_FLOW_WRONG_STATE; return GST_FLOW_FLUSHING;
} }
/* Duration is a complete 1/fps frame duration */ /* Duration is a complete 1/fps frame duration */
dur = gst_util_uint64_scale_int (GST_SECOND, s->fps_d, s->fps_n); dur = gst_util_uint64_scale_int (GST_SECOND, s->fps_d, s->fps_n);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment