mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 18:20:44 +00:00
[MOVED FROM GST-P-FARSIGHT] Put non-zero duration in first packet and put a minimum duration of 50ms
20070712195528-3e2dc-d46edeaab84fb55e74842bdcf4f8792dfcdb0457.gz
This commit is contained in:
parent
230ee96a32
commit
074189363e
1 changed files with 12 additions and 5 deletions
|
@ -144,6 +144,7 @@
|
||||||
#define MAX_EVENT_STRING "16"
|
#define MAX_EVENT_STRING "16"
|
||||||
#define MIN_VOLUME 0
|
#define MIN_VOLUME 0
|
||||||
#define MAX_VOLUME 36
|
#define MAX_VOLUME 36
|
||||||
|
#define MIN_EVENT_DURATION 50
|
||||||
|
|
||||||
#define DEFAULT_PACKET_REDUNDANCY 1
|
#define DEFAULT_PACKET_REDUNDANCY 1
|
||||||
#define MIN_PACKET_REDUNDANCY 1
|
#define MIN_PACKET_REDUNDANCY 1
|
||||||
|
@ -659,6 +660,10 @@ gst_rtp_dtmf_prepare_buffer_data (GstRTPDTMFSrc *dtmfsrc, GstBuffer *buf)
|
||||||
|
|
||||||
gst_rtp_dtmf_prepare_rtp_headers (dtmfsrc, buf);
|
gst_rtp_dtmf_prepare_rtp_headers (dtmfsrc, buf);
|
||||||
|
|
||||||
|
/* duration of DTMF payload */
|
||||||
|
dtmfsrc->payload->duration +=
|
||||||
|
dtmfsrc->interval * dtmfsrc->clock_rate / 1000;
|
||||||
|
|
||||||
/* timestamp and duration of GstBuffer */
|
/* timestamp and duration of GstBuffer */
|
||||||
GST_BUFFER_DURATION (buf) = dtmfsrc->interval * GST_MSECOND;
|
GST_BUFFER_DURATION (buf) = dtmfsrc->interval * GST_MSECOND;
|
||||||
GST_BUFFER_TIMESTAMP (buf) = dtmfsrc->timestamp;
|
GST_BUFFER_TIMESTAMP (buf) = dtmfsrc->timestamp;
|
||||||
|
@ -668,12 +673,14 @@ gst_rtp_dtmf_prepare_buffer_data (GstRTPDTMFSrc *dtmfsrc, GstBuffer *buf)
|
||||||
|
|
||||||
/* copy payload and convert to network-byte order */
|
/* copy payload and convert to network-byte order */
|
||||||
g_memmove (payload, dtmfsrc->payload, sizeof (GstRTPDTMFPayload));
|
g_memmove (payload, dtmfsrc->payload, sizeof (GstRTPDTMFPayload));
|
||||||
|
/* Force the packet duration to a certain minumum
|
||||||
|
* if its the end of the event
|
||||||
|
*/
|
||||||
|
if (payload->e &&
|
||||||
|
payload->duration < MIN_EVENT_DURATION * dtmfsrc->clock_rate / 1000)
|
||||||
|
payload->duration = MIN_EVENT_DURATION * dtmfsrc->clock_rate / 1000;
|
||||||
|
|
||||||
payload->duration = g_htons (payload->duration);
|
payload->duration = g_htons (payload->duration);
|
||||||
|
|
||||||
/* duration of DTMF payload */
|
|
||||||
dtmfsrc->payload->duration +=
|
|
||||||
dtmfsrc->interval * dtmfsrc->clock_rate / 1000;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstBuffer *
|
static GstBuffer *
|
||||||
|
|
Loading…
Reference in a new issue