1 /* GStreamer plugin for forward error correction
2 * Copyright (C) 2017 Pexip
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 * Author: Mikhail Fludkov <misha@pexip.com>
22 * SECTION:element-rtpulpfecenc
23 * @short_description: Generic RTP Forward Error Correction (FEC) encoder
24 * @title: rtpulpfecenc
26 * Generic Forward Error Correction (FEC) encoder using Uneven Level
27 * Protection (ULP) as described in RFC 5109.
32 #include <gst/rtp/gstrtp-enumtypes.h>
33 #include <gst/rtp/gstrtpbuffer.h>
36 #include "rtpulpfeccommon.h"
37 #include "gstrtpulpfecenc.h"
39 static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
42 GST_STATIC_CAPS ("application/x-rtp"));
44 static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
47 GST_STATIC_CAPS ("application/x-rtp"));
52 #define DEFAULT_PT UNDEF_PT
53 #define DEFAULT_SSRC UNDEF_SSRC
55 #define DEFAULT_PCT_IMPORTANT 0
56 #define DEFAULT_MULTIPACKET FALSE
57 #define DEFAULT_MUX_SEQ FALSE
59 #define PACKETS_BUF_MAX_LENGTH (RTP_ULPFEC_PROTECTED_PACKETS_MAX(TRUE))
61 GST_DEBUG_CATEGORY (gst_rtp_ulpfec_enc_debug);
62 #define GST_CAT_DEFAULT (gst_rtp_ulpfec_enc_debug)
64 G_DEFINE_TYPE (GstRtpUlpFecEnc, gst_rtp_ulpfec_enc, GST_TYPE_ELEMENT);
75 PROP_PERCENTAGE_IMPORTANT,
78 #define RTP_FEC_MAP_INFO_NTH(ctx, data) (&g_array_index (\
79 ((GstRtpUlpFecEncStreamCtx *)ctx)->info_arr, \
81 GPOINTER_TO_UINT(data)))
84 gst_rtp_ulpfec_enc_stream_ctx_start (GstRtpUlpFecEncStreamCtx * ctx,
85 GQueue * packets, guint fec_packets)
87 GList *it = packets->tail;
89 g_array_set_size (ctx->info_arr, packets->length);
91 for (guint i = 0; i < packets->length; ++i) {
92 GstBuffer *buffer = it->data;
93 RtpUlpFecMapInfo *info = RTP_FEC_MAP_INFO_NTH (ctx, i);
95 if (!rtp_ulpfec_map_info_map (gst_buffer_ref (buffer), info))
96 g_assert_not_reached ();
98 GST_LOG_RTP_PACKET (ctx->parent, "rtp header (incoming)", &info->rtp);
100 it = g_list_previous (it);
103 ctx->fec_packets = fec_packets;
104 ctx->fec_packet_idx = 0;
108 gst_rtp_ulpfec_enc_stream_ctx_stop (GstRtpUlpFecEncStreamCtx * ctx)
110 g_array_set_size (ctx->info_arr, 0);
111 g_array_set_size (ctx->scratch_buf, 0);
113 ctx->fec_packets = 0;
114 ctx->fec_packet_idx = 0;
118 gst_rtp_ulpfec_enc_stream_ctx_get_protection_parameters
119 (GstRtpUlpFecEncStreamCtx * ctx, guint16 * dst_seq_base, guint64 * dst_mask,
120 guint * dst_start, guint * dst_end)
122 guint media_packets = ctx->info_arr->len;
123 guint start = ctx->fec_packet_idx * media_packets / ctx->fec_packets;
125 ((ctx->fec_packet_idx + 1) * media_packets + ctx->fec_packets -
126 1) / ctx->fec_packets - 1;
127 guint len = end - start + 1;
129 guint16 seq_base = 0;
131 len = MIN (len, RTP_ULPFEC_PROTECTED_PACKETS_MAX (TRUE));
132 end = start + len - 1;
134 for (guint i = start; i <= end; ++i) {
135 RtpUlpFecMapInfo *info = RTP_FEC_MAP_INFO_NTH (ctx, i);
136 guint16 seq = gst_rtp_buffer_get_seq (&info->rtp);
139 gint diff = gst_rtp_buffer_compare_seqnum (seq_base, seq);
142 mask = mask >> (-diff);
144 mask |= rtp_ulpfec_packet_mask_from_seqnum (seq, seq_base, TRUE);
147 mask = rtp_ulpfec_packet_mask_from_seqnum (seq, seq_base, TRUE);
154 *dst_seq_base = seq_base;
158 gst_rtp_ulpfec_enc_stream_ctx_protect (GstRtpUlpFecEncStreamCtx * ctx,
159 guint8 pt, guint16 seq, guint32 timestamp, guint32 ssrc)
163 guint64 fec_mask = 0;
164 guint16 seq_base = 0;
167 gboolean fec_mask_long;
169 if (ctx->fec_packet_idx >= ctx->fec_packets)
172 g_array_set_size (ctx->scratch_buf, 0);
173 gst_rtp_ulpfec_enc_stream_ctx_get_protection_parameters (ctx, &seq_base,
174 &fec_mask, &start, &end);
177 fec_mask_long = rtp_ulpfec_mask_is_long (fec_mask);
178 for (guint i = start; i <= end; ++i) {
179 RtpUlpFecMapInfo *info = RTP_FEC_MAP_INFO_NTH (ctx, i);
180 guint64 packet_mask =
181 rtp_ulpfec_packet_mask_from_seqnum (gst_rtp_buffer_get_seq (&info->rtp),
185 if (tmp_mask & packet_mask) {
186 tmp_mask ^= packet_mask;
187 rtp_buffer_to_ulpfec_bitstring (&info->rtp, ctx->scratch_buf, FALSE,
192 g_assert (tmp_mask == 0ULL);
194 rtp_ulpfec_bitstring_to_fec_rtp_buffer (ctx->scratch_buf, seq_base,
195 fec_mask_long, fec_mask, FALSE, pt, seq, timestamp, ssrc);
196 ++ctx->fec_packet_idx;
201 gst_rtp_ulpfec_enc_stream_ctx_report_budget (GstRtpUlpFecEncStreamCtx * ctx)
203 GST_TRACE_OBJECT (ctx->parent, "budget = %f budget_important = %f",
204 ctx->budget, ctx->budget_important);
208 gst_rtp_ulpfec_enc_stream_ctx_increment_budget (GstRtpUlpFecEncStreamCtx * ctx,
211 if (ctx->percentage == 0 && ctx->percentage_important == 0) {
212 if (ctx->budget > 0) {
214 ctx->budget_important = 0;
217 ctx->budget += ctx->budget_inc;
221 ctx->budget += ctx->budget_inc;
223 if (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_NON_DROPPABLE)) {
224 ctx->budget_important += ctx->budget_inc_important;
227 gst_rtp_ulpfec_enc_stream_ctx_report_budget (ctx);
231 gst_rtp_ulpfec_enc_stream_ctx_decrement_budget (GstRtpUlpFecEncStreamCtx * ctx,
232 guint fec_packets_num)
234 if (ctx->budget_important >= 1.)
235 ctx->budget_important -= fec_packets_num;
236 ctx->budget -= fec_packets_num;
238 gst_rtp_ulpfec_enc_stream_ctx_report_budget (ctx);
242 gst_rtp_ulpfec_enc_stream_ctx_get_fec_packets_num (GstRtpUlpFecEncStreamCtx *
245 g_assert_cmpfloat (ctx->budget_important, >=, 0.);
247 if (ctx->budget_important >= 1.)
248 return ctx->budget_important;
249 return ctx->budget > 0. ? (guint) ctx->budget : 0;
253 gst_rtp_ulpfec_enc_stream_ctx_free_packets_buf (GstRtpUlpFecEncStreamCtx * ctx)
255 while (ctx->packets_buf.length)
256 gst_buffer_unref (g_queue_pop_tail (&ctx->packets_buf));
260 gst_rtp_ulpfec_enc_stream_ctx_prepend_to_fec_buffer (GstRtpUlpFecEncStreamCtx *
261 ctx, GstRTPBuffer * rtp, guint buf_max_size)
264 if (ctx->packets_buf.length == buf_max_size) {
265 new_head = g_queue_pop_tail_link (&ctx->packets_buf);
267 new_head = g_list_alloc ();
270 gst_buffer_replace ((GstBuffer **) & new_head->data, rtp->buffer);
271 g_queue_push_head_link (&ctx->packets_buf, new_head);
273 g_assert_cmpint (ctx->packets_buf.length, <=, buf_max_size);
277 gst_rtp_ulpfec_enc_stream_ctx_push_fec_packets (GstRtpUlpFecEncStreamCtx * ctx,
278 guint8 pt, guint16 seq, guint32 timestamp, guint32 ssrc)
280 GstFlowReturn ret = GST_FLOW_OK;
281 guint fec_packets_num =
282 gst_rtp_ulpfec_enc_stream_ctx_get_fec_packets_num (ctx);
284 if (fec_packets_num) {
285 guint fec_packets_pushed = 0;
286 GstBuffer *latest_packet = ctx->packets_buf.head->data;
287 GstBuffer *fec = NULL;
289 gst_rtp_ulpfec_enc_stream_ctx_start (ctx, &ctx->packets_buf,
292 while (NULL != (fec =
293 gst_rtp_ulpfec_enc_stream_ctx_protect (ctx, pt,
294 seq + fec_packets_pushed, timestamp, ssrc))) {
295 gst_buffer_copy_into (fec, latest_packet, GST_BUFFER_COPY_TIMESTAMPS, 0,
298 ret = gst_pad_push (ctx->srcpad, fec);
299 if (GST_FLOW_OK == ret)
300 ++fec_packets_pushed;
305 gst_rtp_ulpfec_enc_stream_ctx_stop (ctx);
307 g_assert_cmpint (fec_packets_pushed, <=, fec_packets_num);
309 ctx->num_packets_protected += ctx->packets_buf.length;
310 ctx->num_packets_fec += fec_packets_pushed;
311 ctx->seqnum_offset += fec_packets_pushed;
312 ctx->seqnum += fec_packets_pushed;
315 gst_rtp_ulpfec_enc_stream_ctx_decrement_budget (ctx, fec_packets_num);
320 gst_rtp_ulpfec_enc_stream_ctx_cache_packet (GstRtpUlpFecEncStreamCtx * ctx,
321 GstRTPBuffer * rtp, gboolean * dst_empty_packet_buffer,
322 gboolean * dst_push_fec)
324 if (ctx->multipacket) {
325 gst_rtp_ulpfec_enc_stream_ctx_prepend_to_fec_buffer (ctx, rtp,
326 PACKETS_BUF_MAX_LENGTH);
327 gst_rtp_ulpfec_enc_stream_ctx_increment_budget (ctx, rtp->buffer);
329 *dst_empty_packet_buffer = gst_rtp_buffer_get_marker (rtp);
330 *dst_push_fec = *dst_empty_packet_buffer;
334 gst_rtp_ulpfec_enc_stream_ctx_prepend_to_fec_buffer (ctx, rtp, 1);
336 push_fec = ctx->fec_nth == 0 ? FALSE :
337 0 == (ctx->num_packets_received % ctx->fec_nth);
339 ctx->budget = push_fec ? 1 : 0;
340 ctx->budget_important = 0;
342 *dst_push_fec = push_fec;
343 *dst_empty_packet_buffer = FALSE;
348 gst_rtp_ulpfec_enc_stream_ctx_configure (GstRtpUlpFecEncStreamCtx * ctx,
349 guint pt, guint32 fec_ssrc,
350 guint percentage, guint percentage_important, gboolean multipacket,
354 ctx->fec_ssrc = fec_ssrc;
355 ctx->percentage = percentage;
356 ctx->percentage_important = percentage_important;
357 ctx->multipacket = multipacket;
358 ctx->mux_seq = mux_seq;
360 ctx->fec_nth = percentage ? 100 / percentage : 0;
362 ctx->budget_inc = percentage / 100.;
363 ctx->budget_inc_important = percentage > percentage_important ?
364 ctx->budget_inc : percentage_important / 100.;
368 ctx->budget_inc = 0.0;
371 ctx->budget_inc_important = percentage > percentage_important ?
372 ctx->budget_inc : percentage_important / 100.;
375 static GstRtpUlpFecEncStreamCtx *
376 gst_rtp_ulpfec_enc_stream_ctx_new (guint ssrc,
377 GstElement * parent, GstPad * srcpad,
378 guint pt, guint32 fec_ssrc,
379 guint percentage, guint percentage_important, gboolean multipacket,
382 GstRtpUlpFecEncStreamCtx *ctx = g_new0 (GstRtpUlpFecEncStreamCtx, 1);
385 ctx->parent = parent;
386 ctx->srcpad = srcpad;
388 ctx->seqnum = g_random_int_range (0, G_MAXUINT16 / 2);
390 ctx->info_arr = g_array_new (FALSE, TRUE, sizeof (RtpUlpFecMapInfo));
391 g_array_set_clear_func (ctx->info_arr,
392 (GDestroyNotify) rtp_ulpfec_map_info_unmap);
393 ctx->parent = parent;
394 ctx->scratch_buf = g_array_new (FALSE, TRUE, sizeof (guint8));
395 gst_rtp_ulpfec_enc_stream_ctx_configure (ctx, pt, fec_ssrc,
396 percentage, percentage_important, multipacket, mux_seq);
402 gst_rtp_ulpfec_enc_stream_ctx_free (GstRtpUlpFecEncStreamCtx * ctx)
404 if (ctx->num_packets_received) {
405 GST_INFO_OBJECT (ctx->parent, "Actual FEC overhead is %4.2f%% (%u/%u)\n",
406 ctx->num_packets_fec * (double) 100. / ctx->num_packets_received,
407 ctx->num_packets_fec, ctx->num_packets_received);
409 gst_rtp_ulpfec_enc_stream_ctx_free_packets_buf (ctx);
411 g_assert (0 == ctx->info_arr->len);
412 g_array_free (ctx->info_arr, TRUE);
413 g_array_free (ctx->scratch_buf, TRUE);
414 g_slice_free1 (sizeof (GstRtpUlpFecEncStreamCtx), ctx);
418 gst_rtp_ulpfec_enc_stream_ctx_process (GstRtpUlpFecEncStreamCtx * ctx,
421 GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;
423 gboolean push_fec = FALSE;
424 gboolean empty_packet_buffer = FALSE;
426 ctx->num_packets_received++;
428 if (ctx->mux_seq && ctx->seqnum_offset > 0) {
429 buffer = gst_buffer_make_writable (buffer);
430 if (!gst_rtp_buffer_map (buffer,
431 GST_MAP_READWRITE | GST_RTP_BUFFER_MAP_FLAG_SKIP_PADDING, &rtp))
432 g_assert_not_reached ();
433 gst_rtp_buffer_set_seq (&rtp,
434 gst_rtp_buffer_get_seq (&rtp) + ctx->seqnum_offset);
436 if (!gst_rtp_buffer_map (buffer,
437 GST_MAP_READ | GST_RTP_BUFFER_MAP_FLAG_SKIP_PADDING, &rtp))
438 g_assert_not_reached ();
441 gst_rtp_ulpfec_enc_stream_ctx_cache_packet (ctx, &rtp, &empty_packet_buffer,
445 guint32 fec_timestamp = gst_rtp_buffer_get_timestamp (&rtp);
448 UNDEF_SSRC ? gst_rtp_buffer_get_ssrc (&rtp) : ctx->fec_ssrc;
450 ctx->mux_seq ? gst_rtp_buffer_get_seq (&rtp) + 1 : ctx->seqnum;
452 gst_rtp_buffer_unmap (&rtp);
454 ret = gst_pad_push (ctx->srcpad, buffer);
455 if (GST_FLOW_OK == ret)
457 gst_rtp_ulpfec_enc_stream_ctx_push_fec_packets (ctx, ctx->pt, fec_seq,
458 fec_timestamp, fec_ssrc);
460 gst_rtp_buffer_unmap (&rtp);
461 ret = gst_pad_push (ctx->srcpad, buffer);
464 if (empty_packet_buffer)
465 gst_rtp_ulpfec_enc_stream_ctx_free_packets_buf (ctx);
470 static GstRtpUlpFecEncStreamCtx *
471 gst_rtp_ulpfec_enc_aquire_ctx (GstRtpUlpFecEnc * fec, guint ssrc)
473 GstRtpUlpFecEncStreamCtx *ctx;
475 GST_OBJECT_LOCK (fec);
476 ctx = g_hash_table_lookup (fec->ssrc_to_ctx, GUINT_TO_POINTER (ssrc));
479 gst_rtp_ulpfec_enc_stream_ctx_new (ssrc, GST_ELEMENT_CAST (fec),
480 fec->srcpad, fec->pt, fec->ssrc, fec->percentage,
481 fec->percentage_important, fec->multipacket, fec->mux_seq);
482 g_hash_table_insert (fec->ssrc_to_ctx, GUINT_TO_POINTER (ssrc), ctx);
484 GST_OBJECT_UNLOCK (fec);
490 gst_rtp_ulpfec_enc_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
492 GstRtpUlpFecEnc *fec = GST_RTP_ULPFEC_ENC (parent);
493 GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;
496 GstRtpUlpFecEncStreamCtx *ctx;
498 if (fec->pt == UNDEF_PT)
499 return gst_pad_push (fec->srcpad, buffer);
501 /* FIXME: avoid this additional mapping of the buffer to get the
503 if (!gst_rtp_buffer_map (buffer,
504 GST_MAP_READ | GST_RTP_BUFFER_MAP_FLAG_SKIP_PADDING, &rtp)) {
505 g_assert_not_reached ();
507 ssrc = gst_rtp_buffer_get_ssrc (&rtp);
508 gst_rtp_buffer_unmap (&rtp);
510 ctx = gst_rtp_ulpfec_enc_aquire_ctx (fec, ssrc);
512 ret = gst_rtp_ulpfec_enc_stream_ctx_process (ctx, buffer);
514 /* FIXME: does not work for mulitple ssrcs */
515 fec->num_packets_protected = ctx->num_packets_protected;
521 gst_rtp_ulpfec_enc_configure_ctx (gpointer key, gpointer value,
524 GstRtpUlpFecEnc *fec = user_data;
525 GstRtpUlpFecEncStreamCtx *ctx = value;
527 gst_rtp_ulpfec_enc_stream_ctx_configure (ctx, fec->pt, fec->ssrc,
528 fec->percentage, fec->percentage_important,
529 fec->multipacket, fec->mux_seq);
533 gst_rtp_ulpfec_enc_set_property (GObject * object, guint prop_id,
534 const GValue * value, GParamSpec * pspec)
536 GstRtpUlpFecEnc *fec = GST_RTP_ULPFEC_ENC (object);
540 fec->pt = g_value_get_uint (value);
543 fec->ssrc = g_value_get_uint (value);
545 case PROP_MULTIPACKET:
546 fec->multipacket = g_value_get_boolean (value);
548 case PROP_PERCENTAGE:
549 fec->percentage = g_value_get_uint (value);
551 case PROP_PERCENTAGE_IMPORTANT:
552 fec->percentage_important = g_value_get_uint (value);
555 fec->mux_seq = g_value_get_boolean (value);
558 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
562 GST_OBJECT_LOCK (fec);
563 g_hash_table_foreach (fec->ssrc_to_ctx, gst_rtp_ulpfec_enc_configure_ctx,
565 GST_OBJECT_UNLOCK (fec);
569 gst_rtp_ulpfec_enc_get_property (GObject * object, guint prop_id,
570 GValue * value, GParamSpec * pspec)
572 GstRtpUlpFecEnc *fec = GST_RTP_ULPFEC_ENC (object);
575 g_value_set_uint (value, fec->pt);
578 g_value_set_uint (value, fec->ssrc);
581 g_value_set_uint (value, fec->num_packets_protected);
583 case PROP_PERCENTAGE:
584 g_value_set_uint (value, fec->percentage);
586 case PROP_PERCENTAGE_IMPORTANT:
587 g_value_set_uint (value, fec->percentage_important);
589 case PROP_MULTIPACKET:
590 g_value_set_boolean (value, fec->multipacket);
593 g_value_set_boolean (value, fec->mux_seq);
596 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
602 gst_rtp_ulpfec_enc_dispose (GObject * obj)
604 GstRtpUlpFecEnc *fec = GST_RTP_ULPFEC_ENC (obj);
606 g_hash_table_destroy (fec->ssrc_to_ctx);
608 G_OBJECT_CLASS (gst_rtp_ulpfec_enc_parent_class)->dispose (obj);
612 gst_rtp_ulpfec_enc_init (GstRtpUlpFecEnc * fec)
614 fec->srcpad = gst_pad_new_from_static_template (&srctemplate, "src");
615 gst_element_add_pad (GST_ELEMENT (fec), fec->srcpad);
617 fec->sinkpad = gst_pad_new_from_static_template (&sinktemplate, "sink");
618 GST_PAD_SET_PROXY_CAPS (fec->sinkpad);
619 GST_PAD_SET_PROXY_ALLOCATION (fec->sinkpad);
620 gst_pad_set_chain_function (fec->sinkpad,
621 GST_DEBUG_FUNCPTR (gst_rtp_ulpfec_enc_chain));
622 gst_element_add_pad (GST_ELEMENT (fec), fec->sinkpad);
624 fec->ssrc_to_ctx = g_hash_table_new_full (NULL, NULL, NULL,
625 (GDestroyNotify) gst_rtp_ulpfec_enc_stream_ctx_free);
629 gst_rtp_ulpfec_enc_class_init (GstRtpUlpFecEncClass * klass)
631 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
632 GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
634 GST_DEBUG_CATEGORY_INIT (gst_rtp_ulpfec_enc_debug, "rtpulpfecenc", 0,
635 "FEC encoder element");
637 gst_element_class_add_pad_template (element_class,
638 gst_static_pad_template_get (&srctemplate));
639 gst_element_class_add_pad_template (element_class,
640 gst_static_pad_template_get (&sinktemplate));
642 gst_element_class_set_static_metadata (element_class,
644 "Codec/Payloader/Network/RTP",
645 "Encodes RTP FEC (RFC5109)", "Mikhail Fludkov <misha@pexip.com>");
647 gobject_class->set_property =
648 GST_DEBUG_FUNCPTR (gst_rtp_ulpfec_enc_set_property);
649 gobject_class->get_property =
650 GST_DEBUG_FUNCPTR (gst_rtp_ulpfec_enc_get_property);
651 gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_rtp_ulpfec_enc_dispose);
653 g_object_class_install_property (gobject_class, PROP_SSRC,
654 g_param_spec_uint ("ssrc", "SSRC",
655 "The SSRC to use on FEC'd packets", 0, G_MAXUINT32, DEFAULT_SSRC,
656 G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
658 g_object_class_install_property (gobject_class, PROP_PT,
659 g_param_spec_uint ("pt", "payload type",
660 "The payload type of FEC packets", 0, 255, DEFAULT_PT,
661 G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
663 g_object_class_install_property (gobject_class, PROP_MULTIPACKET,
664 g_param_spec_boolean ("multipacket", "Multipacket",
665 "Apply FEC on multiple packets", DEFAULT_MULTIPACKET,
666 G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
668 g_object_class_install_property (gobject_class, PROP_MUX_SEQ,
669 g_param_spec_boolean ("mux-seq", "Mux seq",
670 "Mux seqnum for media and fec packets in same seqnum space",
672 G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
674 g_object_class_install_property (gobject_class, PROP_PERCENTAGE,
675 g_param_spec_uint ("percentage", "Percentage",
676 "FEC overhead percentage for the whole stream", 0, 100, DEFAULT_PCT,
677 G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
679 g_object_class_install_property (gobject_class, PROP_PERCENTAGE_IMPORTANT,
680 g_param_spec_uint ("percentage-important", "Percentage important",
681 "FEC overhead percentage for important packets",
682 0, 100, DEFAULT_PCT_IMPORTANT,
683 G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
685 g_object_class_install_property (gobject_class, PROP_PROTECTED,
686 g_param_spec_uint ("protected", "Protected",
687 "Count of protected packets", 0, G_MAXUINT32, 0,
688 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));