if (watch->funcs.message_received)
watch->funcs.message_received (watch, &watch->message,
watch->user_data);
- } else
- goto error;
+ } else {
+ if (watch->funcs.error_full)
+ GST_RTSP_CHECK (watch->funcs.error_full (watch, res, &watch->message,
+ 0, watch->user_data), error);
+ else
+ goto error;
+ }
read_done:
gst_rtsp_message_unset (&watch->message);
&watch->write_off, watch->write_size);
if (res == GST_RTSP_EINTR)
break;
- if (G_UNLIKELY (res != GST_RTSP_OK))
- goto error;
-
- if (watch->funcs.message_sent)
- watch->funcs.message_sent (watch, watch->write_id, watch->user_data);
+ else if (G_LIKELY (res == GST_RTSP_OK)) {
+ if (watch->funcs.message_sent)
+ watch->funcs.message_sent (watch, watch->write_id, watch->user_data);
+ } else {
+ if (watch->funcs.error_full)
+ GST_RTSP_CHECK (watch->funcs.error_full (watch, res, NULL,
+ watch->write_id, watch->user_data), error);
+ else
+ goto error;
+ }
done:
if (g_async_queue_length (watch->messages) == 0 && watch->write_added) {
* @tunnel_complete: a client finished a tunneled connection. In this callback
* you usually pair the tunnelid of this connection with the saved one using
* gst_rtsp_connection_do_tunnel().
+ * @error_full: callback when an error occured with more information than
+ * the @error callback
*
* Callback functions from a #GstRTSPWatch.
*
gpointer user_data);
GstRTSPStatusCode (*tunnel_start) (GstRTSPWatch *watch, gpointer user_data);
GstRTSPResult (*tunnel_complete) (GstRTSPWatch *watch, gpointer user_data);
+ GstRTSPResult (*error_full) (GstRTSPWatch *watch, GstRTSPResult result,
+ GstRTSPMessage *message, guint id,
+ gpointer user_data);
/*< private >*/
- gpointer _gst_reserved[GST_PADDING];
+ gpointer _gst_reserved[GST_PADDING - 1];
} GstRTSPWatchFuncs;
GstRTSPWatch * gst_rtsp_watch_new (GstRTSPConnection *conn,