rtpdtmfsrc: clock-base and seqnum-base -> timestamp-offset and seqnum-offset

These were renamed in GstRTPBasePayload in 1.0
This commit is contained in:
Olivier Crête 2014-10-10 18:11:19 -04:00
parent b3069634bd
commit 155ed569c3
2 changed files with 18 additions and 16 deletions

View file

@ -893,9 +893,9 @@ gst_rtp_dtmf_src_negotiate (GstBaseSrc * basesrc)
gst_caps_set_simple (srccaps,
"payload", G_TYPE_INT, dtmfsrc->pt,
"ssrc", G_TYPE_UINT, dtmfsrc->current_ssrc,
"clock-base", G_TYPE_UINT, dtmfsrc->ts_base,
"timestamp-offset", G_TYPE_UINT, dtmfsrc->ts_base,
"clock-rate", G_TYPE_INT, dtmfsrc->clock_rate,
"seqnum-base", G_TYPE_UINT, dtmfsrc->seqnum_base, NULL);
"seqnum-offset", G_TYPE_UINT, dtmfsrc->seqnum_base, NULL);
GST_DEBUG_OBJECT (dtmfsrc, "no peer caps: %" GST_PTR_FORMAT, srccaps);
} else {
@ -970,26 +970,28 @@ gst_rtp_dtmf_src_negotiate (GstBaseSrc * basesrc)
dtmfsrc->current_ssrc);
}
if (gst_structure_has_field_typed (s, "clock-base", G_TYPE_UINT)) {
value = gst_structure_get_value (s, "clock-base");
if (gst_structure_has_field_typed (s, "timestamp-offset", G_TYPE_UINT)) {
value = gst_structure_get_value (s, "timestamp-offset");
dtmfsrc->ts_base = g_value_get_uint (value);
GST_LOG_OBJECT (dtmfsrc, "using peer clock-base %u", dtmfsrc->ts_base);
GST_LOG_OBJECT (dtmfsrc, "using peer timestamp-offset %u",
dtmfsrc->ts_base);
} else {
/* FIXME, fixate_nearest_uint would be even better */
gst_structure_set (s, "clock-base", G_TYPE_UINT, dtmfsrc->ts_base, NULL);
GST_LOG_OBJECT (dtmfsrc, "using internal clock-base %u",
gst_structure_set (s, "timestamp-offset", G_TYPE_UINT, dtmfsrc->ts_base,
NULL);
GST_LOG_OBJECT (dtmfsrc, "using internal timestamp-offset %u",
dtmfsrc->ts_base);
}
if (gst_structure_has_field_typed (s, "seqnum-base", G_TYPE_UINT)) {
value = gst_structure_get_value (s, "seqnum-base");
if (gst_structure_has_field_typed (s, "seqnum-offset", G_TYPE_UINT)) {
value = gst_structure_get_value (s, "seqnum-offset");
dtmfsrc->seqnum_base = g_value_get_uint (value);
GST_LOG_OBJECT (dtmfsrc, "using peer seqnum-base %u",
GST_LOG_OBJECT (dtmfsrc, "using peer seqnum-offset %u",
dtmfsrc->seqnum_base);
} else {
/* FIXME, fixate_nearest_uint would be even better */
gst_structure_set (s, "seqnum-base", G_TYPE_UINT, dtmfsrc->seqnum_base,
gst_structure_set (s, "seqnum-offset", G_TYPE_UINT, dtmfsrc->seqnum_base,
NULL);
GST_LOG_OBJECT (dtmfsrc, "using internal seqnum-base %u",
GST_LOG_OBJECT (dtmfsrc, "using internal seqnum-offset %u",
dtmfsrc->seqnum_base);
}

View file

@ -233,8 +233,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
"media = (string) \"audio\", "
"payload = (int) 99, "
"clock-rate = (int) 1000, "
"seqnum-base = (uint) 333, "
"clock-base = (uint) 666, "
"seqnum-offset = (uint) 333, "
"timestamp-offset = (uint) 666, "
"ssrc = (uint) 999, "
"maxptime = (uint) 20, encoding-name = (string) \"TELEPHONE-EVENT\"")
);
@ -444,8 +444,8 @@ GST_START_TEST (test_rtpdtmfsrc_min_duration)
"encoding-name", G_TYPE_STRING, "TELEPHONE-EVENT",
"media", G_TYPE_STRING, "audio",
"clock-rate", G_TYPE_INT, 1000, "payload", G_TYPE_INT, 99,
"seqnum-base", G_TYPE_UINT, 333,
"clock-base", G_TYPE_UINT, 666,
"seqnum-offset", G_TYPE_UINT, 333,
"timestamp-offset", G_TYPE_UINT, 666,
"ssrc", G_TYPE_UINT, 999, "ptime", G_TYPE_UINT, 20, NULL);
caps = gst_pad_get_current_caps (sink);
fail_unless (gst_caps_can_intersect (caps, expected_caps));