rtsp-connection: Make use of new GstRTSPMessage API for directly storing a body buffer and add API for writing multiple messages

By doing so we can send a whole GstBufferList and each memory in the
contained buffers without copying into a single memory area and with a
single writev() call. This improves performance considerably for
high-packet-rate streams.

This depends on https://gitlab.gnome.org/GNOME/glib/merge_requests/333
to be efficient, otherwise each chunk of memory is a separate write()
call.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/370
This commit is contained in:
Sebastian Dröge 2018-09-17 17:03:45 +03:00
parent b3c0d8b89b
commit f90dac8d48
3 changed files with 914 additions and 221 deletions

View file

@ -1840,6 +1840,7 @@ gst_rtsp_connection_write
gst_rtsp_connection_poll
gst_rtsp_connection_send
gst_rtsp_connection_send_messages
gst_rtsp_connection_receive
gst_rtsp_connection_next_timeout
@ -1892,6 +1893,7 @@ gst_rtsp_watch_unref
gst_rtsp_watch_attach
gst_rtsp_watch_reset
gst_rtsp_watch_send_message
gst_rtsp_watch_send_messages
gst_rtsp_watch_write_data
gst_rtsp_watch_get_send_backlog
gst_rtsp_watch_set_send_backlog

File diff suppressed because it is too large Load diff

View file

@ -136,6 +136,10 @@ GST_RTSP_API
GstRTSPResult gst_rtsp_connection_send (GstRTSPConnection *conn, GstRTSPMessage *message,
GTimeVal *timeout);
GST_RTSP_API
GstRTSPResult gst_rtsp_connection_send_messages (GstRTSPConnection *conn, GstRTSPMessage *messages, guint n_messages,
GTimeVal *timeout);
GST_RTSP_API
GstRTSPResult gst_rtsp_connection_receive (GstRTSPConnection *conn, GstRTSPMessage *message,
GTimeVal *timeout);
@ -313,6 +317,12 @@ GstRTSPResult gst_rtsp_watch_send_message (GstRTSPWatch *watch,
GstRTSPMessage *message,
guint *id);
GST_RTSP_API
GstRTSPResult gst_rtsp_watch_send_messages (GstRTSPWatch *watch,
GstRTSPMessage *messages,
guint n_messages,
guint *id);
GST_RTSP_API
GstRTSPResult gst_rtsp_watch_wait_backlog (GstRTSPWatch * watch,
GTimeVal *timeout);