+2005-07-14 Wim Taymans <wim@fluendo.com>
+
+ * gst/gstcaps.c: (gst_caps_do_simplify):
+ Remove debug info.
+
+ * gst/gsterror.h:
+ Define error for stream stopped.
+
+ * gst/gstghostpad.c: (gst_proxy_pad_do_bufferalloc),
+ (gst_proxy_pad_do_chain), (gst_proxy_pad_do_getrange):
+ Do proper return values.
+
+ * gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
+ (gst_pad_set_caps), (gst_pad_chain), (gst_pad_push),
+ (gst_pad_get_range):
+ Better return values.
+
+ * gst/gstpad.h:
+ Reorganise return values, add macro to check for fatal errors.
+
+ * gst/gstqueue.c: (gst_queue_chain):
+ Return proper GstFlowReturn values,
+
2005-07-14 Thomas Vander Stichele <thomas at apestaart dot org>
* docs/gst/gstreamer-sections.txt:
break;
}
if (gst_caps_structure_simplify (&result, simplify, compare)) {
-#if 0
- g_print ("%s - %s = %s\n",
- gst_structure_to_string (simplify),
- gst_structure_to_string (compare),
- result ? gst_structure_to_string (result) : "---");
-#endif
if (result) {
gst_caps_switch_structures (caps, simplify, result, i);
} else {
* @GST_STREAM_ERROR_MUX: used when muxing fails.
* @GST_STREAM_ERROR_FORMAT: used when the stream is of the wrong format
* (for example, wrong caps).
+ * @GST_STREAM_ERROR_STOPPED: Streaming stopped.
* @GST_STREAM_ERROR_NUM_ERRORS: the number of library error types.
*
* Stream errors are for anything related to the stream being processed:
GST_STREAM_ERROR_DEMUX,
GST_STREAM_ERROR_MUX,
GST_STREAM_ERROR_FORMAT,
+ GST_STREAM_ERROR_STOPPED,
GST_STREAM_ERROR_NUM_ERRORS
} GstStreamError;
GstPad *target = GST_PROXY_PAD_TARGET (pad);
GstPad *peer;
- g_return_val_if_fail (target != NULL, GST_FLOW_UNEXPECTED);
+ g_return_val_if_fail (target != NULL, GST_FLOW_NOT_LINKED);
peer = gst_pad_get_peer (target);
if (peer) {
{
GstPad *target = GST_PROXY_PAD_TARGET (pad);
- g_return_val_if_fail (target != NULL, GST_FLOW_UNEXPECTED);
+ g_return_val_if_fail (target != NULL, GST_FLOW_NOT_LINKED);
return gst_pad_chain (target, buffer);
}
{
GstPad *target = GST_PROXY_PAD_TARGET (pad);
- g_return_val_if_fail (target != NULL, GST_FLOW_UNEXPECTED);
+ g_return_val_if_fail (target != NULL, GST_FLOW_NOT_LINKED);
return gst_pad_get_range (target, offset, size, buffer);
}
g_critical ("pad %s:%s returned NULL caps from getcaps function",
GST_DEBUG_PAD_NAME (pad));
} else {
+ GST_CAT_DEBUG (GST_CAT_CAPS,
+ "pad getcaps %s:%s returned %" GST_PTR_FORMAT,
+ GST_DEBUG_PAD_NAME (pad), result);
#ifndef G_DISABLE_ASSERT
/* check that the returned caps are a real subset of the template caps */
if (GST_PAD_PAD_TEMPLATE (pad)) {
"pushing, but pad was flushing");
GST_UNLOCK (pad);
GST_STREAM_UNLOCK (pad);
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_WRONG_STATE;
}
dropping:
{
gst_buffer_unref (buffer);
GST_DEBUG ("Dropping buffer due to FALSE probe return");
GST_STREAM_UNLOCK (pad);
- /* FIXME, failure? */
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_OK;
}
not_negotiated:
{
gst_buffer_unref (buffer);
gst_object_unref (peer);
GST_DEBUG ("Dropping buffer due to FALSE probe return");
- /* FIXME, failure? */
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_OK;
}
}
"pulling range, but pad was flushing");
GST_UNLOCK (pad);
GST_STREAM_UNLOCK (pad);
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_WRONG_STATE;
}
no_function:
{
#define GST_PAD_LINK_SUCCESSFUL(ret) ((ret) >= GST_PAD_LINK_OK)
typedef enum {
- GST_FLOW_OK = 0, /* data passing was ok */
GST_FLOW_RESEND = 1, /* resend buffer, possibly with new caps */
- GST_FLOW_ERROR = -1, /* some (fatal) error occured */
- GST_FLOW_NOT_LINKED = -2, /* pad is not linked */
- GST_FLOW_NOT_NEGOTIATED = -3, /* pad is not negotiated */
- GST_FLOW_WRONG_STATE = -4, /* pad is in wrong state */
- GST_FLOW_UNEXPECTED = -5, /* did not expect anything, this is not fatal */
+ GST_FLOW_OK = 0, /* data passing was ok */
+ /* expected failures */
+ GST_FLOW_NOT_LINKED = -1, /* pad is not linked */
+ GST_FLOW_WRONG_STATE = -2, /* pad is in wrong state */
+ /* error cases */
+ GST_FLOW_UNEXPECTED = -3, /* did not expect anything, like after EOS */
+ GST_FLOW_NOT_NEGOTIATED = -4, /* pad is not negotiated */
+ GST_FLOW_ERROR = -5, /* some (fatal) error occured */
GST_FLOW_NOT_SUPPORTED = -6 /* function not supported */
} GstFlowReturn;
+#define GST_FLOW_IS_FATAL(ret) ((ret) <= GST_FLOW_UNEXPECTED)
+
typedef enum {
GST_ACTIVATE_NONE,
GST_ACTIVATE_PUSH,
return GST_FLOW_OK;
out_unref:
- GST_QUEUE_MUTEX_UNLOCK;
+ {
+ GST_QUEUE_MUTEX_UNLOCK;
- gst_buffer_unref (buffer);
-
- return GST_FLOW_OK;
+ gst_buffer_unref (buffer);
+ return GST_FLOW_OK;
+ }
out_flushing:
- GST_CAT_LOG_OBJECT (queue_dataflow, queue, "exit because of flush");
- GST_QUEUE_MUTEX_UNLOCK;
- gst_pad_pause_task (queue->srcpad);
+ {
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "exit because of flush");
+ GST_QUEUE_MUTEX_UNLOCK;
+ gst_pad_pause_task (queue->srcpad);
- gst_buffer_unref (buffer);
+ gst_buffer_unref (buffer);
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_WRONG_STATE;
+ }
}
static void
return GST_FLOW_OK;
out_unref:
- GST_QUEUE_MUTEX_UNLOCK;
+ {
+ GST_QUEUE_MUTEX_UNLOCK;
- gst_buffer_unref (buffer);
-
- return GST_FLOW_OK;
+ gst_buffer_unref (buffer);
+ return GST_FLOW_OK;
+ }
out_flushing:
- GST_CAT_LOG_OBJECT (queue_dataflow, queue, "exit because of flush");
- GST_QUEUE_MUTEX_UNLOCK;
- gst_pad_pause_task (queue->srcpad);
+ {
+ GST_CAT_LOG_OBJECT (queue_dataflow, queue, "exit because of flush");
+ GST_QUEUE_MUTEX_UNLOCK;
+ gst_pad_pause_task (queue->srcpad);
- gst_buffer_unref (buffer);
+ gst_buffer_unref (buffer);
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_WRONG_STATE;
+ }
}
static void