mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-10 08:22:32 +00:00
rtpg729pay: Support ptime from caps
https://bugzilla.gnome.org/show_bug.cgi?id=606050
This commit is contained in:
parent
321829f595
commit
0a18587792
1 changed files with 13 additions and 3 deletions
|
@ -190,9 +190,7 @@ gst_rtp_g729_pay_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buf)
|
||||||
/* min number of bytes based on a given ptime, has to be a multiple
|
/* min number of bytes based on a given ptime, has to be a multiple
|
||||||
of frame duration */
|
of frame duration */
|
||||||
{
|
{
|
||||||
guint64 min_ptime;
|
guint64 min_ptime = payload->min_ptime;
|
||||||
|
|
||||||
g_object_get (G_OBJECT (payload), "min-ptime", &min_ptime, NULL);
|
|
||||||
|
|
||||||
min_ptime = min_ptime / 1000000;
|
min_ptime = min_ptime / 1000000;
|
||||||
minptime_octets = G729_FRAME_SIZE *
|
minptime_octets = G729_FRAME_SIZE *
|
||||||
|
@ -205,6 +203,18 @@ gst_rtp_g729_pay_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buf)
|
||||||
min_payload_len = max_payload_len;
|
min_payload_len = max_payload_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the ptime is specified in the caps, tried to adhere to it exactly */
|
||||||
|
if (payload->abidata.ABI.ptime) {
|
||||||
|
guint ptime_in_bytes = G729_FRAME_SIZE *
|
||||||
|
(guint) (payload->abidata.ABI.ptime / G729_FRAME_DURATION_MS);
|
||||||
|
|
||||||
|
/* clip to computed min and max lengths */
|
||||||
|
ptime_in_bytes = MAX (min_payload_len, ptime_in_bytes);
|
||||||
|
ptime_in_bytes = MIN (max_payload_len, ptime_in_bytes);
|
||||||
|
|
||||||
|
min_payload_len = max_payload_len = ptime_in_bytes;
|
||||||
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (basertpaudiopayload,
|
GST_LOG_OBJECT (basertpaudiopayload,
|
||||||
"Calculated min_payload_len %u and max_payload_len %u",
|
"Calculated min_payload_len %u and max_payload_len %u",
|
||||||
min_payload_len, max_payload_len);
|
min_payload_len, max_payload_len);
|
||||||
|
|
Loading…
Reference in a new issue