SIGNAL_GET_PARAMETER,
SIGNAL_GET_PARAMETERS,
SIGNAL_SET_PARAMETER,
+ SIGNAL_PUSH_BACKCHANNEL_SAMPLE,
LAST_SIGNAL
};
static GstFlowReturn gst_rtspsrc_push_backchannel_buffer (GstRTSPSrc * src,
guint id, GstSample * sample);
+static GstFlowReturn gst_rtspsrc_push_backchannel_sample (GstRTSPSrc * src,
+ guint id, GstSample * sample);
+
typedef struct
{
guint8 pt;
/**
* GstRTSPSrc::push-backchannel-buffer:
* @rtspsrc: a #GstRTSPSrc
+ * @id: stream ID where the sample should be sent
* @sample: RTP sample to send back
*
+ * Deprecated: 1.22: Use action signal GstRTSPSrc::push-backchannel-sample instead.
+ * IMPORTANT: Please note that this signal decrements the reference count
+ * of sample internally! So it cannot be used from other
+ * language bindings in general.
*
*/
gst_rtspsrc_signals[SIGNAL_PUSH_BACKCHANNEL_BUFFER] =
g_signal_new ("push-backchannel-buffer", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GstRTSPSrcClass,
- push_backchannel_buffer), NULL, NULL, NULL,
- GST_TYPE_FLOW_RETURN, 2, G_TYPE_UINT, GST_TYPE_SAMPLE);
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_DEPRECATED,
+ G_STRUCT_OFFSET (GstRTSPSrcClass, push_backchannel_buffer), NULL, NULL,
+ NULL, GST_TYPE_FLOW_RETURN, 2, G_TYPE_UINT, GST_TYPE_SAMPLE);
+
+ /**
+ * GstRTSPSrc::push-backchannel-sample:
+ * @rtspsrc: a #GstRTSPSrc
+ * @id: stream ID where the sample should be sent
+ * @sample: RTP sample to send back
+ *
+ * Since: 1.22
+ */
+ gst_rtspsrc_signals[SIGNAL_PUSH_BACKCHANNEL_SAMPLE] =
+ g_signal_new ("push-backchannel-sample", G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION | G_SIGNAL_DEPRECATED,
+ G_STRUCT_OFFSET (GstRTSPSrcClass, push_backchannel_buffer), NULL, NULL,
+ NULL, GST_TYPE_FLOW_RETURN, 2, G_TYPE_UINT, GST_TYPE_SAMPLE);
/**
* GstRTSPSrc::get-parameter:
gstbin_class->handle_message = gst_rtspsrc_handle_message;
klass->push_backchannel_buffer = gst_rtspsrc_push_backchannel_buffer;
+ klass->push_backchannel_sample = gst_rtspsrc_push_backchannel_sample;
klass->get_parameter = GST_DEBUG_FUNCPTR (get_parameter);
klass->get_parameters = GST_DEBUG_FUNCPTR (get_parameters);
klass->set_parameter = GST_DEBUG_FUNCPTR (set_parameter);
gst_rtspsrc_push_backchannel_buffer (GstRTSPSrc * src, guint id,
GstSample * sample)
{
+ GstFlowReturn res;
+
+ res = gst_rtspsrc_push_backchannel_sample (src, id, sample);
+
+ gst_sample_unref (sample);
+
+ return res;
+}
+
+static GstFlowReturn
+gst_rtspsrc_push_backchannel_sample (GstRTSPSrc * src, guint id,
+ GstSample * sample)
+{
GstFlowReturn res = GST_FLOW_OK;
GstRTSPStream *stream;
}
out:
- gst_sample_unref (sample);
-
return res;
}
g_assert (stream_id != -1);
+ /* get the sample from appsink */
g_signal_emit_by_name (appsink, "pull-sample", &sample);
if (!sample)
- goto out;
+ goto nosample;
- g_signal_emit_by_name (rtspsrc, "push-backchannel-buffer", stream_id, sample,
+ g_signal_emit_by_name (rtspsrc, "push-backchannel-sample", stream_id, sample,
&ret);
-out:
+ /* Action signal callbacks don't take ownership of the arguments passed, so we must unref the sample here.
+ * (The "push-backchannel-buffer" callback unrefs the sample, which is wrong and doesn't work with bindings
+ * but could not be changed, hence the new "push-backchannel-sample" callback that behaves correctly.) */
+ gst_sample_unref (sample);
+
+nosample:
return ret;
}