mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
stream-transport: add method to handle RTP/RTCP
Call new methods instead of poking into the structures directly.
This commit is contained in:
parent
883cf794e4
commit
75473fc88d
3 changed files with 53 additions and 4 deletions
|
@ -170,3 +170,49 @@ gst_rtsp_stream_transport_set_transport (GstRTSPStreamTransport * trans,
|
||||||
gst_rtsp_transport_free (trans->transport);
|
gst_rtsp_transport_free (trans->transport);
|
||||||
trans->transport = tr;
|
trans->transport = tr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_rtsp_stream_transport_send_rtp:
|
||||||
|
* @trans: a #GstRTSPStreamTransport
|
||||||
|
* @buffer: a #GstBuffer
|
||||||
|
*
|
||||||
|
* Send @buffer to the installed RTP callback for @trans.
|
||||||
|
*
|
||||||
|
* Returns: %TRUE on success
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gst_rtsp_stream_transport_send_rtp (GstRTSPStreamTransport * trans,
|
||||||
|
GstBuffer * buffer)
|
||||||
|
{
|
||||||
|
gboolean res = FALSE;
|
||||||
|
|
||||||
|
if (trans->send_rtp)
|
||||||
|
res =
|
||||||
|
trans->send_rtp (buffer, trans->transport->interleaved.min,
|
||||||
|
trans->user_data);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_rtsp_stream_transport_send_rtcp:
|
||||||
|
* @trans: a #GstRTSPStreamTransport
|
||||||
|
* @buffer: a #GstBuffer
|
||||||
|
*
|
||||||
|
* Send @buffer to the installed RTCP callback for @trans.
|
||||||
|
*
|
||||||
|
* Returns: %TRUE on success
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gst_rtsp_stream_transport_send_rtcp (GstRTSPStreamTransport * trans,
|
||||||
|
GstBuffer * buffer)
|
||||||
|
{
|
||||||
|
gboolean res = FALSE;
|
||||||
|
|
||||||
|
if (trans->send_rtcp)
|
||||||
|
res =
|
||||||
|
trans->send_rtcp (buffer, trans->transport->interleaved.max,
|
||||||
|
trans->user_data);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
|
@ -105,6 +105,11 @@ void gst_rtsp_stream_transport_set_keepalive (GstRTSPStreamT
|
||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GDestroyNotify notify);
|
GDestroyNotify notify);
|
||||||
|
|
||||||
|
gboolean gst_rtsp_stream_transport_send_rtp (GstRTSPStreamTransport *trans,
|
||||||
|
GstBuffer *buffer);
|
||||||
|
gboolean gst_rtsp_stream_transport_send_rtcp (GstRTSPStreamTransport *trans,
|
||||||
|
GstBuffer *buffer);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GST_RTSP_STREAM_TRANSPORT_H__ */
|
#endif /* __GST_RTSP_STREAM_TRANSPORT_H__ */
|
||||||
|
|
|
@ -524,11 +524,9 @@ handle_new_sample (GstAppSink * sink, gpointer user_data)
|
||||||
GstRTSPStreamTransport *tr = (GstRTSPStreamTransport *) walk->data;
|
GstRTSPStreamTransport *tr = (GstRTSPStreamTransport *) walk->data;
|
||||||
|
|
||||||
if (GST_ELEMENT_CAST (sink) == stream->appsink[0]) {
|
if (GST_ELEMENT_CAST (sink) == stream->appsink[0]) {
|
||||||
if (tr->send_rtp)
|
gst_rtsp_stream_transport_send_rtp (tr, buffer);
|
||||||
tr->send_rtp (buffer, tr->transport->interleaved.min, tr->user_data);
|
|
||||||
} else {
|
} else {
|
||||||
if (tr->send_rtcp)
|
gst_rtsp_stream_transport_send_rtcp (tr, buffer);
|
||||||
tr->send_rtcp (buffer, tr->transport->interleaved.max, tr->user_data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gst_sample_unref (sample);
|
gst_sample_unref (sample);
|
||||||
|
|
Loading…
Reference in a new issue