1 /* RIST Retransmission sender element for GStreamer
5 * Copyright (C) 2013-2019 Collabora Ltd.
6 * @author Julien Isorce <julien.isorce@collabora.co.uk>
7 * Nicoas Dufresne <nicolas.dufresne@collabora.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
26 * SECTION:element-ristrtxsend
28 * @see_also: ristrtxreceive
30 * This elements replies to custom events 'GstRTPRetransmissionRequest' and
31 * when available sends in RIST form the lost packet. This element is intented
32 * to be used by ristsink element.
40 #include <gst/rtp/gstrtpbuffer.h>
41 #include <gst/base/gstdataqueue.h>
45 GST_DEBUG_CATEGORY_STATIC (gst_rist_rtx_send_debug);
46 #define GST_CAT_DEFAULT gst_rist_rtx_send_debug
48 #define DEFAULT_MAX_SIZE_TIME 0
49 #define DEFAULT_MAX_SIZE_PACKETS 100
55 PROP_MAX_SIZE_PACKETS,
56 PROP_NUM_RTX_REQUESTS,
60 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
63 GST_STATIC_CAPS ("application/x-rtp")
66 static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
69 GST_STATIC_CAPS ("application/x-rtp, " "clock-rate = (int) [1, MAX]")
72 struct _GstRistRtxSend
80 /* rtp packets that will be pushed out */
83 /* ssrc -> SSRCRtxData */
84 GHashTable *ssrc_data;
85 /* rtx ssrc -> master ssrc */
86 GHashTable *rtx_ssrcs;
88 /* buffering control properties */
90 guint max_size_packets;
93 guint num_rtx_requests;
94 guint num_rtx_packets;
97 static gboolean gst_rist_rtx_send_queue_check_full (GstDataQueue * queue,
98 guint visible, guint bytes, guint64 time, gpointer checkdata);
100 static gboolean gst_rist_rtx_send_src_event (GstPad * pad, GstObject * parent,
102 static gboolean gst_rist_rtx_send_sink_event (GstPad * pad, GstObject * parent,
104 static GstFlowReturn gst_rist_rtx_send_chain (GstPad * pad, GstObject * parent,
106 static GstFlowReturn gst_rist_rtx_send_chain_list (GstPad * pad,
107 GstObject * parent, GstBufferList * list);
109 static void gst_rist_rtx_send_src_loop (GstRistRtxSend * rtx);
110 static gboolean gst_rist_rtx_send_activate_mode (GstPad * pad,
111 GstObject * parent, GstPadMode mode, gboolean active);
113 static GstStateChangeReturn gst_rist_rtx_send_change_state (GstElement *
114 element, GstStateChange transition);
116 static void gst_rist_rtx_send_set_property (GObject * object, guint prop_id,
117 const GValue * value, GParamSpec * pspec);
118 static void gst_rist_rtx_send_get_property (GObject * object, guint prop_id,
119 GValue * value, GParamSpec * pspec);
120 static void gst_rist_rtx_send_finalize (GObject * object);
122 G_DEFINE_TYPE_WITH_CODE (GstRistRtxSend, gst_rist_rtx_send, GST_TYPE_ELEMENT,
123 GST_DEBUG_CATEGORY_INIT (gst_rist_rtx_send_debug, "ristrtxsend", 0,
124 "RIST retransmission sender"));
134 buffer_queue_item_free (BufferQueueItem * item)
136 gst_buffer_unref (item->buffer);
137 g_slice_free (BufferQueueItem, item);
143 guint16 seqnum_base, next_seqnum;
146 /* history of rtp packets */
151 ssrc_rtx_data_new (guint32 rtx_ssrc)
153 SSRCRtxData *data = g_slice_new0 (SSRCRtxData);
155 data->rtx_ssrc = rtx_ssrc;
156 data->next_seqnum = data->seqnum_base = g_random_int_range (0, G_MAXUINT16);
157 data->queue = g_sequence_new ((GDestroyNotify) buffer_queue_item_free);
163 ssrc_rtx_data_free (SSRCRtxData * data)
165 g_sequence_free (data->queue);
166 g_slice_free (SSRCRtxData, data);
170 gst_rist_rtx_send_class_init (GstRistRtxSendClass * klass)
172 GObjectClass *gobject_class;
173 GstElementClass *gstelement_class;
175 gobject_class = (GObjectClass *) klass;
176 gstelement_class = (GstElementClass *) klass;
178 gobject_class->get_property = gst_rist_rtx_send_get_property;
179 gobject_class->set_property = gst_rist_rtx_send_set_property;
180 gobject_class->finalize = gst_rist_rtx_send_finalize;
182 g_object_class_install_property (gobject_class, PROP_MAX_SIZE_TIME,
183 g_param_spec_uint ("max-size-time", "Max Size Time",
184 "Amount of ms to queue (0 = unlimited)", 0, G_MAXUINT,
185 DEFAULT_MAX_SIZE_TIME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
187 g_object_class_install_property (gobject_class, PROP_MAX_SIZE_PACKETS,
188 g_param_spec_uint ("max-size-packets", "Max Size Packets",
189 "Amount of packets to queue (0 = unlimited)", 0, G_MAXINT16,
190 DEFAULT_MAX_SIZE_PACKETS,
191 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
193 g_object_class_install_property (gobject_class, PROP_NUM_RTX_REQUESTS,
194 g_param_spec_uint ("num-rtx-requests", "Num RTX Requests",
195 "Number of retransmission events received", 0, G_MAXUINT,
196 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
198 g_object_class_install_property (gobject_class, PROP_NUM_RTX_PACKETS,
199 g_param_spec_uint ("num-rtx-packets", "Num RTX Packets",
200 " Number of retransmission packets sent", 0, G_MAXUINT,
201 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
203 gst_element_class_add_static_pad_template (gstelement_class, &src_factory);
204 gst_element_class_add_static_pad_template (gstelement_class, &sink_factory);
206 gst_element_class_set_static_metadata (gstelement_class,
207 "RIST Retransmission Sender", "Codec",
208 "Retransmit RTP packets when needed, according to VSF TR-06-1",
209 "Nicolas Dufresne <nicolas.dufresne@collabora.com>");
211 gstelement_class->change_state =
212 GST_DEBUG_FUNCPTR (gst_rist_rtx_send_change_state);
216 gst_rist_rtx_send_reset (GstRistRtxSend * rtx)
218 GST_OBJECT_LOCK (rtx);
219 gst_data_queue_flush (rtx->queue);
220 g_hash_table_remove_all (rtx->ssrc_data);
221 g_hash_table_remove_all (rtx->rtx_ssrcs);
222 rtx->num_rtx_requests = 0;
223 rtx->num_rtx_packets = 0;
224 GST_OBJECT_UNLOCK (rtx);
228 gst_rist_rtx_send_finalize (GObject * object)
230 GstRistRtxSend *rtx = GST_RIST_RTX_SEND (object);
232 g_hash_table_unref (rtx->ssrc_data);
233 g_hash_table_unref (rtx->rtx_ssrcs);
234 g_object_unref (rtx->queue);
236 G_OBJECT_CLASS (gst_rist_rtx_send_parent_class)->finalize (object);
240 gst_rist_rtx_send_init (GstRistRtxSend * rtx)
242 GstElementClass *klass = GST_ELEMENT_GET_CLASS (rtx);
245 gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
247 GST_PAD_SET_PROXY_CAPS (rtx->srcpad);
248 GST_PAD_SET_PROXY_ALLOCATION (rtx->srcpad);
249 gst_pad_set_event_function (rtx->srcpad,
250 GST_DEBUG_FUNCPTR (gst_rist_rtx_send_src_event));
251 gst_pad_set_activatemode_function (rtx->srcpad,
252 GST_DEBUG_FUNCPTR (gst_rist_rtx_send_activate_mode));
253 gst_element_add_pad (GST_ELEMENT (rtx), rtx->srcpad);
256 gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
258 GST_PAD_SET_PROXY_CAPS (rtx->sinkpad);
259 GST_PAD_SET_PROXY_ALLOCATION (rtx->sinkpad);
260 gst_pad_set_event_function (rtx->sinkpad,
261 GST_DEBUG_FUNCPTR (gst_rist_rtx_send_sink_event));
262 gst_pad_set_chain_function (rtx->sinkpad,
263 GST_DEBUG_FUNCPTR (gst_rist_rtx_send_chain));
264 gst_pad_set_chain_list_function (rtx->sinkpad,
265 GST_DEBUG_FUNCPTR (gst_rist_rtx_send_chain_list));
266 gst_element_add_pad (GST_ELEMENT (rtx), rtx->sinkpad);
268 rtx->queue = gst_data_queue_new (gst_rist_rtx_send_queue_check_full, NULL,
270 rtx->ssrc_data = g_hash_table_new_full (g_direct_hash, g_direct_equal,
271 NULL, (GDestroyNotify) ssrc_rtx_data_free);
272 rtx->rtx_ssrcs = g_hash_table_new (g_direct_hash, g_direct_equal);
274 rtx->max_size_time = DEFAULT_MAX_SIZE_TIME;
275 rtx->max_size_packets = DEFAULT_MAX_SIZE_PACKETS;
279 gst_rist_rtx_send_set_flushing (GstRistRtxSend * rtx, gboolean flush)
281 GST_OBJECT_LOCK (rtx);
282 gst_data_queue_set_flushing (rtx->queue, flush);
283 gst_data_queue_flush (rtx->queue);
284 GST_OBJECT_UNLOCK (rtx);
288 gst_rist_rtx_send_queue_check_full (GstDataQueue * queue,
289 guint visible, guint bytes, guint64 time, gpointer checkdata)
295 gst_rtp_rtx_data_queue_item_free (gpointer item)
297 GstDataQueueItem *data = item;
299 gst_mini_object_unref (data->object);
300 g_slice_free (GstDataQueueItem, data);
304 gst_rist_rtx_send_push_out (GstRistRtxSend * rtx, gpointer object)
306 GstDataQueueItem *data;
309 data = g_slice_new0 (GstDataQueueItem);
310 data->object = GST_MINI_OBJECT (object);
313 data->visible = TRUE;
314 data->destroy = gst_rtp_rtx_data_queue_item_free;
316 success = gst_data_queue_push (rtx->queue, data);
319 data->destroy (data);
325 gst_rist_rtx_send_get_ssrc_data (GstRistRtxSend * rtx, guint32 ssrc)
328 guint32 rtx_ssrc = 0;
330 data = g_hash_table_lookup (rtx->ssrc_data, GUINT_TO_POINTER (ssrc));
332 /* See 5.3.2 Retransmitted Packets, original packet have SSRC LSB set to
333 * 0, while RTX packet have LSB set to 1 */
335 data = ssrc_rtx_data_new (rtx_ssrc);
336 g_hash_table_insert (rtx->ssrc_data, GUINT_TO_POINTER (ssrc), data);
337 g_hash_table_insert (rtx->rtx_ssrcs, GUINT_TO_POINTER (rtx_ssrc),
338 GUINT_TO_POINTER (ssrc));
345 * see RIST TR-06-1 5.3.2 Retransmitted Packets
347 * RIST simply resend the packet verbatim, with SSRC+1, the defaults SSRC always
348 * have the LSB set to 0, so we can differentiate the retransmission and the
352 gst_rtp_rist_buffer_new (GstRistRtxSend * rtx, GstBuffer * buffer, guint32 ssrc)
354 GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;
356 buffer = gst_buffer_copy_deep (buffer);
357 gst_rtp_buffer_map (buffer, GST_MAP_WRITE, &rtp);
358 gst_rtp_buffer_set_ssrc (&rtp, ssrc + 1);
359 gst_rtp_buffer_unmap (&rtp);
365 buffer_queue_items_cmp (BufferQueueItem * a, BufferQueueItem * b,
368 /* gst_rtp_buffer_compare_seqnum returns the opposite of what we want,
369 * it returns negative when seqnum1 > seqnum2 and we want negative
370 * when b > a, i.e. a is smaller, so it comes first in the sequence */
371 return gst_rtp_buffer_compare_seqnum (b->seqnum, a->seqnum);
375 gst_rist_rtx_send_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
377 GstRistRtxSend *rtx = GST_RIST_RTX_SEND (parent);
379 switch (GST_EVENT_TYPE (event)) {
380 case GST_EVENT_CUSTOM_UPSTREAM:
382 const GstStructure *s = gst_event_get_structure (event);
384 /* This event usually comes from the downstream gstrtpsession */
385 if (gst_structure_has_name (s, "GstRTPRetransmissionRequest")) {
388 GstBuffer *rtx_buf = NULL;
390 /* retrieve seqnum of the packet that need to be retransmitted */
391 if (!gst_structure_get_uint (s, "seqnum", &seqnum))
394 /* retrieve ssrc of the packet that need to be retransmitted */
395 if (!gst_structure_get_uint (s, "ssrc", &ssrc))
398 GST_DEBUG_OBJECT (rtx, "got rtx request for seqnum: %u, ssrc: %X",
401 GST_OBJECT_LOCK (rtx);
402 /* check if request is for us */
403 if (g_hash_table_contains (rtx->ssrc_data, GUINT_TO_POINTER (ssrc))) {
406 BufferQueueItem search_item;
408 /* update statistics */
409 ++rtx->num_rtx_requests;
411 data = gst_rist_rtx_send_get_ssrc_data (rtx, ssrc);
413 search_item.seqnum = seqnum;
414 iter = g_sequence_lookup (data->queue, &search_item,
415 (GCompareDataFunc) buffer_queue_items_cmp, NULL);
417 BufferQueueItem *item = g_sequence_get (iter);
418 GST_LOG_OBJECT (rtx, "found %u", item->seqnum);
419 rtx_buf = gst_rtp_rist_buffer_new (rtx, item->buffer, ssrc);
421 #ifndef GST_DISABLE_DEBUG
423 BufferQueueItem *item = NULL;
425 iter = g_sequence_get_begin_iter (data->queue);
426 if (!g_sequence_iter_is_end (iter))
427 item = g_sequence_get (iter);
429 if (item && seqnum < item->seqnum) {
430 GST_DEBUG_OBJECT (rtx, "requested seqnum %u has already been "
431 "removed from the rtx queue; the first available is %u",
432 seqnum, item->seqnum);
434 GST_WARNING_OBJECT (rtx, "requested seqnum %u has not been "
435 "transmitted yet in the original stream; either the remote end "
436 "is not configured correctly, or the source is too slow",
442 GST_OBJECT_UNLOCK (rtx);
445 gst_rist_rtx_send_push_out (rtx, rtx_buf);
447 gst_event_unref (event);
456 return gst_pad_event_default (pad, parent, event);
460 gst_rist_rtx_send_sink_event (GstPad * pad, GstObject * parent,
463 GstRistRtxSend *rtx = GST_RIST_RTX_SEND (parent);
465 switch (GST_EVENT_TYPE (event)) {
466 case GST_EVENT_FLUSH_START:
467 gst_pad_push_event (rtx->srcpad, event);
468 gst_rist_rtx_send_set_flushing (rtx, TRUE);
469 gst_pad_pause_task (rtx->srcpad);
471 case GST_EVENT_FLUSH_STOP:
472 gst_pad_push_event (rtx->srcpad, event);
473 gst_rist_rtx_send_set_flushing (rtx, FALSE);
474 gst_pad_start_task (rtx->srcpad,
475 (GstTaskFunction) gst_rist_rtx_send_src_loop, rtx, NULL);
478 GST_INFO_OBJECT (rtx, "Got EOS - enqueueing it");
479 gst_rist_rtx_send_push_out (rtx, event);
489 gst_event_parse_caps (event, &caps);
491 s = gst_caps_get_structure (caps, 0);
492 if (!gst_structure_get_uint (s, "ssrc", &ssrc))
494 if (!gst_structure_get_int (s, "payload", &payload))
498 GST_WARNING_OBJECT (rtx, "No payload in caps");
500 GST_OBJECT_LOCK (rtx);
501 data = gst_rist_rtx_send_get_ssrc_data (rtx, ssrc);
503 GST_DEBUG_OBJECT (rtx,
504 "got caps for payload: %d->%d, ssrc: %u : %" GST_PTR_FORMAT,
505 payload, ssrc, data->rtx_ssrc, caps);
507 gst_structure_get_int (s, "clock-rate", &data->clock_rate);
509 /* The session might need to know the RTX ssrc */
510 caps = gst_caps_copy (caps);
511 gst_caps_set_simple (caps, "rtx-ssrc", G_TYPE_UINT, data->rtx_ssrc,
512 "rtx-seqnum-offset", G_TYPE_UINT, data->seqnum_base, NULL);
514 GST_DEBUG_OBJECT (rtx, "got clock-rate from caps: %d for ssrc: %u",
515 data->clock_rate, ssrc);
516 GST_OBJECT_UNLOCK (rtx);
518 gst_event_unref (event);
519 event = gst_event_new_caps (caps);
520 gst_caps_unref (caps);
527 return gst_pad_event_default (pad, parent, event);
530 /* like rtp_jitter_buffer_get_ts_diff() */
532 gst_rist_rtx_send_get_ts_diff (SSRCRtxData * data)
534 guint64 high_ts, low_ts;
535 BufferQueueItem *high_buf, *low_buf;
539 g_sequence_get (g_sequence_iter_prev (g_sequence_get_end_iter
541 low_buf = g_sequence_get (g_sequence_get_begin_iter (data->queue));
543 if (!high_buf || !low_buf || high_buf == low_buf)
546 high_ts = high_buf->timestamp;
547 low_ts = low_buf->timestamp;
549 /* it needs to work if ts wraps */
550 if (high_ts >= low_ts) {
551 result = (guint32) (high_ts - low_ts);
553 result = (guint32) (high_ts + G_MAXUINT32 + 1 - low_ts);
556 /* return value in ms instead of clock ticks */
557 return (guint32) gst_util_uint64_scale_int (result, 1000, data->clock_rate);
560 /* Must be called with lock */
562 process_buffer (GstRistRtxSend * rtx, GstBuffer * buffer)
564 GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;
565 BufferQueueItem *item;
568 guint32 ssrc, rtptime;
570 /* read the information we want from the buffer */
571 gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtp);
572 seqnum = gst_rtp_buffer_get_seq (&rtp);
573 ssrc = gst_rtp_buffer_get_ssrc (&rtp);
574 rtptime = gst_rtp_buffer_get_timestamp (&rtp);
575 gst_rtp_buffer_unmap (&rtp);
577 GST_TRACE_OBJECT (rtx, "Processing buffer seqnum: %u, ssrc: %X", seqnum,
580 data = gst_rist_rtx_send_get_ssrc_data (rtx, ssrc);
582 /* add current rtp buffer to queue history */
583 item = g_slice_new0 (BufferQueueItem);
584 item->seqnum = seqnum;
585 item->timestamp = rtptime;
586 item->buffer = gst_buffer_ref (buffer);
587 g_sequence_append (data->queue, item);
589 /* remove oldest packets from history if they are too many */
590 if (rtx->max_size_packets) {
591 while (g_sequence_get_length (data->queue) > rtx->max_size_packets)
592 g_sequence_remove (g_sequence_get_begin_iter (data->queue));
594 if (rtx->max_size_time) {
595 while (gst_rist_rtx_send_get_ts_diff (data) > rtx->max_size_time)
596 g_sequence_remove (g_sequence_get_begin_iter (data->queue));
601 gst_rist_rtx_send_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
603 GstRistRtxSend *rtx = GST_RIST_RTX_SEND (parent);
606 GST_OBJECT_LOCK (rtx);
607 process_buffer (rtx, buffer);
608 GST_OBJECT_UNLOCK (rtx);
609 ret = gst_pad_push (rtx->srcpad, buffer);
615 process_buffer_from_list (GstBuffer ** buffer, guint idx, gpointer user_data)
617 process_buffer (user_data, *buffer);
622 gst_rist_rtx_send_chain_list (GstPad * pad, GstObject * parent,
623 GstBufferList * list)
625 GstRistRtxSend *rtx = GST_RIST_RTX_SEND (parent);
628 GST_OBJECT_LOCK (rtx);
629 gst_buffer_list_foreach (list, process_buffer_from_list, rtx);
630 GST_OBJECT_UNLOCK (rtx);
632 ret = gst_pad_push_list (rtx->srcpad, list);
638 gst_rist_rtx_send_src_loop (GstRistRtxSend * rtx)
640 GstDataQueueItem *data;
642 if (gst_data_queue_pop (rtx->queue, &data)) {
643 GST_LOG_OBJECT (rtx, "pushing rtx buffer %p", data->object);
645 if (G_LIKELY (GST_IS_BUFFER (data->object))) {
646 GST_OBJECT_LOCK (rtx);
647 /* Update statistics just before pushing. */
648 rtx->num_rtx_packets++;
649 GST_OBJECT_UNLOCK (rtx);
651 gst_pad_push (rtx->srcpad, GST_BUFFER (data->object));
652 } else if (GST_IS_EVENT (data->object)) {
653 gst_pad_push_event (rtx->srcpad, GST_EVENT (data->object));
655 /* after EOS, we should not send any more buffers,
656 * even if there are more requests coming in */
657 if (GST_EVENT_TYPE (data->object) == GST_EVENT_EOS) {
658 gst_rist_rtx_send_set_flushing (rtx, TRUE);
661 g_assert_not_reached ();
664 data->object = NULL; /* we no longer own that object */
665 data->destroy (data);
667 GST_LOG_OBJECT (rtx, "flushing");
668 gst_pad_pause_task (rtx->srcpad);
673 gst_rist_rtx_send_activate_mode (GstPad * pad, GstObject * parent,
674 GstPadMode mode, gboolean active)
676 GstRistRtxSend *rtx = GST_RIST_RTX_SEND (parent);
677 gboolean ret = FALSE;
680 case GST_PAD_MODE_PUSH:
682 gst_rist_rtx_send_set_flushing (rtx, FALSE);
683 ret = gst_pad_start_task (rtx->srcpad,
684 (GstTaskFunction) gst_rist_rtx_send_src_loop, rtx, NULL);
686 gst_rist_rtx_send_set_flushing (rtx, TRUE);
687 ret = gst_pad_stop_task (rtx->srcpad);
689 GST_INFO_OBJECT (rtx, "activate_mode: active %d, ret %d", active, ret);
698 gst_rist_rtx_send_get_property (GObject * object,
699 guint prop_id, GValue * value, GParamSpec * pspec)
701 GstRistRtxSend *rtx = GST_RIST_RTX_SEND (object);
704 case PROP_MAX_SIZE_TIME:
705 GST_OBJECT_LOCK (rtx);
706 g_value_set_uint (value, rtx->max_size_time);
707 GST_OBJECT_UNLOCK (rtx);
709 case PROP_MAX_SIZE_PACKETS:
710 GST_OBJECT_LOCK (rtx);
711 g_value_set_uint (value, rtx->max_size_packets);
712 GST_OBJECT_UNLOCK (rtx);
714 case PROP_NUM_RTX_REQUESTS:
715 GST_OBJECT_LOCK (rtx);
716 g_value_set_uint (value, rtx->num_rtx_requests);
717 GST_OBJECT_UNLOCK (rtx);
719 case PROP_NUM_RTX_PACKETS:
720 GST_OBJECT_LOCK (rtx);
721 g_value_set_uint (value, rtx->num_rtx_packets);
722 GST_OBJECT_UNLOCK (rtx);
725 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
731 gst_rist_rtx_send_set_property (GObject * object,
732 guint prop_id, const GValue * value, GParamSpec * pspec)
734 GstRistRtxSend *rtx = GST_RIST_RTX_SEND (object);
737 case PROP_MAX_SIZE_TIME:
738 GST_OBJECT_LOCK (rtx);
739 rtx->max_size_time = g_value_get_uint (value);
740 GST_OBJECT_UNLOCK (rtx);
742 case PROP_MAX_SIZE_PACKETS:
743 GST_OBJECT_LOCK (rtx);
744 rtx->max_size_packets = g_value_get_uint (value);
745 GST_OBJECT_UNLOCK (rtx);
748 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
753 static GstStateChangeReturn
754 gst_rist_rtx_send_change_state (GstElement * element, GstStateChange transition)
756 GstStateChangeReturn ret;
757 GstRistRtxSend *rtx = GST_RIST_RTX_SEND (element);
760 GST_ELEMENT_CLASS (gst_rist_rtx_send_parent_class)->change_state (element,
763 switch (transition) {
764 case GST_STATE_CHANGE_PAUSED_TO_READY:
765 gst_rist_rtx_send_reset (rtx);