enum
{
PROP_0 = 0,
+ PROP_MAX_EXT_SEQNUM,
+ PROP_HAVE_EXT_SEQNUM
};
static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src",
GstPad *srcpad, *sinkpad;
- gboolean drop_null;
- gboolean seqnumext;
-
+ gboolean have_extseqnum;
guint32 max_extseqnum;
};
num_packets_deleted = bit_count (npd_bits);
+ self->have_extseqnum = has_seqnum_ext;
+
if (has_seqnum_ext) {
guint16 seqnumext_val = GST_READ_UINT16_BE (data + 2);
guint32 extseqnum = seqnumext_val << 16 | gst_rtp_buffer_get_seq (&rtp);
gst_rist_rtp_deext_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
- /* GstRistRtpDeext *self = GST_RIST_RTP_DEEXT (object); */
+ GstRistRtpDeext *self = GST_RIST_RTP_DEEXT (object);
switch (prop_id) {
+ case PROP_MAX_EXT_SEQNUM:
+ g_value_set_uint (value, self->max_extseqnum);
+ break;
+ case PROP_HAVE_EXT_SEQNUM:
+ g_value_set_boolean (value, self->have_extseqnum);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
-
static void
gst_rist_rtp_deext_class_init (GstRistRtpDeextClass * klass)
{
GObjectClass *object_class = (GObjectClass *) klass;
gst_element_class_set_metadata (element_class,
- "RIST RTP Eextension remover", "Filter/Network",
+ "RIST RTP Extension remover", "Filter/Network",
"Removes RIST TR-06-2 RTP Header extension",
"Olivier Crete <olivier.crete@collabora.com");
gst_element_class_add_static_pad_template (element_class, &src_templ);
gst_element_class_add_static_pad_template (element_class, &sink_templ);
object_class->get_property = gst_rist_rtp_deext_get_property;
+
+ g_object_class_install_property (object_class, PROP_MAX_EXT_SEQNUM,
+ g_param_spec_uint ("max-ext-seqnum",
+ "Maximum Extended Sequence Number",
+ "Largest extended sequence number received", 0, G_MAXUINT, 0,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (object_class, PROP_HAVE_EXT_SEQNUM,
+ g_param_spec_boolean ("have-ext-seqnum",
+ "Have extended seqnum",
+ "Has an extended sequence number extension been seen", FALSE,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
}
data = extdata;
- has_drop_null = (data[0] >> 7) & 1; /* N */
- has_seqnum_ext = (data[0] >> 6) & 1; /* E */
- orig_ts_packet_count = (data[0] >> 3) & 7; /* Size */
+ has_drop_null = (data[0] >> 7) & 1; /* N */
+ has_seqnum_ext = (data[0] >> 6) & 1; /* E */
+ orig_ts_packet_count = (data[0] >> 3) & 7; /* Size */
ts_packet_size = ((data[1] >> 7) & 1) ? 204 : 188;
npd_bits = data[1] & 0x7F;
GstHarness *h = gst_harness_new ("ristrtpdeext");
GstBuffer *ibuf, *obuf;
GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;
+ guint max_seqnum;
gst_harness_set_src_caps_str (h, "application/x-rtp, payload=33,"
"clock-rate=90000, encoding-name=MP2T");
gst_rtp_buffer_unmap (&rtp);
gst_buffer_unref (obuf);
+ g_object_get (h->element, "max-ext-seqnum", &max_seqnum, NULL);
+ fail_unless_equals_int (max_seqnum, 44);
+
ibuf = alloc_ts_buffer_with_ext (7, FALSE, TRUE, 7, 188, 0, 1);
obuf = gst_harness_push_and_pull (h, ibuf);
gst_rtp_buffer_map (obuf, GST_MAP_READ, &rtp);
gst_rtp_buffer_unmap (&rtp);
gst_buffer_unref (obuf);
+ g_object_get (h->element, "max-ext-seqnum", &max_seqnum, NULL);
+ fail_unless_equals_int (max_seqnum, 65536 + 44);
+
gst_harness_teardown (h);
}
GstHarness *h = gst_harness_new ("ristrtpdeext");
GstBuffer *ibuf, *obuf;
GstRTPBuffer rtp = GST_RTP_BUFFER_INIT;
+ guint max_seqnum;
gst_harness_set_src_caps_str (h, "application/x-rtp, payload=33,"
"clock-rate=90000, encoding-name=MP2T");
gst_rtp_buffer_unmap (&rtp);
gst_buffer_unref (obuf);
+ g_object_get (h->element, "max-ext-seqnum", &max_seqnum, NULL);
+ fail_unless_equals_int (max_seqnum, 44);
+
+
ibuf = alloc_ts_buffer_with_ext (7, FALSE, TRUE, 7, 188, 0, 2);
obuf = gst_harness_push_and_pull (h, ibuf);
gst_rtp_buffer_map (obuf, GST_MAP_READ, &rtp);
gst_rtp_buffer_unmap (&rtp);
gst_buffer_unref (obuf);
+ g_object_get (h->element, "max-ext-seqnum", &max_seqnum, NULL);
+ fail_unless_equals_int (max_seqnum, 65536 + 65536 + 44);
+
ibuf = alloc_ts_buffer_with_ext (7, FALSE, TRUE, 7, 188, 0, 0);
fail_unless_equals_int (gst_harness_push (h, ibuf), GST_FLOW_OK);
fail_unless_equals_int (gst_harness_buffers_in_queue (h), 0);
+ g_object_get (h->element, "max-ext-seqnum", &max_seqnum, NULL);
+ fail_unless_equals_int (max_seqnum, 65536 + 65536 + 44);
+
gst_harness_teardown (h);
}