ts-rtpdtmfsrc
Thread-sharing RTP DTMF (RFC 2833) source.
The ts-rtpdtmfsrc
element generates RTP DTMF (RFC 2833) event packets on request
from application. The application communicates the beginning and end of a
DTMF event using custom upstream gstreamer events.
Compated to rtpdtmfsrc
, ts-rtpdtmfsrc
takes advantage of the threadshare runtime,
allowing reduced number of threads and context switches when many elements are used.
To report a DTMF event, an application must send an event of type gst::event::CustomUpstream
,
having a structure of name "dtmf-event" with fields set according to the following
table:
-
type
(G_TYPE_INT
akai32
, 0-1): The application uses this field to specify which of the two methods specified in RFC 2833 to use. The value should be 0 for tones and 1 for named events. Tones are specified by their frequencies and events are specified by their number. This element can only take events as input. Do not confuse with "method" which specified the output. -
number
(G_TYPE_INT
, 0-15): The event number. -
volume
(G_TYPE_INT
, 0-36): This field describes the power level of the tone, expressed in dBm0 after dropping the sign. Power levels range from 0 to -63 dBm0. The range of valid DTMF is from 0 to -36 dBm0. Can be omitted if start is set to FALSE. -
start
(G_TYPE_BOOLEAN
akabool
, True or False): Whether the event is starting or ending. -
method
(G_TYPE_INT, 1): The method used for sending event, this element will react if this field is absent or 1.
For example, the following code informs the pipeline (and in turn, the
ts-rtpdtmfsrc
element inside the pipeline) about the start of an RTP DTMF named
event '1' of volume -25 dBm0:
let dtmf_start_event = gst::event::CustomUpstream::builder(
gst::Structure::builder("dtmf-event")
.field("type", 1i32)
.field("method", 1i32)
.field("start", true)
.field("number", 1i32)
.field("volume", 25i32)
.build(),
)
.build();
pipeline.send_event(dtmf_start_event)
When a DTMF tone actually starts or stop, a "dtmf-event-processed" element GstMessage with the same fields as the "dtmf-event" GstEvent that was used to request the event. Also, if any event has not been processed when the element goes from the PAUSED to the READY state, then a "dtmf-event-dropped" message is posted on the GstBus in the order that they were received.
Hierarchy
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──ts-rtpdtmfsrc
Factory details
Authors: – François Laignel
Classification: – Source/Network/RTP
Rank – none
Plugin – threadshare
Package – gst-plugin-threadshare
Pad Templates
src
application/x-rtp:
media: audio
payload: [ 96, 127 ]
clock-rate: [ 0, 2147483647 ]
encoding-name: TELEPHONE-EVENT
Properties
clock-rate
“clock-rate” guint
The clock-rate at which to generate DTMF packets
Flags : Read / Write
Default value : 8000
context
“context” gchararray
Context name to share threads with
Flags : Read / Write / Construct Only
context-wait
“context-wait” guint
Throttle poll loop to run at most once every this many ms
Flags : Read / Write / Construct Only
Default value : 0
packet-redundancy
“packet-redundancy” guint
Number of packets to send to indicate start and stop DTMF events
Flags : Read / Write
Default value : 1
seqnum
“seqnum” guint
The RTP Sequence number of the last processed packet
Flags : Read
Default value : 0
seqnum-offset
“seqnum-offset” gint
Offset to add to all outgoing seqnum (-1 => random)
Flags : Read / Write
Default value : -1
timestamp
“timestamp” guint
The RTP timestamp of the last processed packet
Flags : Read
Default value : 0
timestamp-offset
“timestamp-offset” gint
Offset to add to all outgoing timestamps (-1 = random)
Flags : Read / Write
Default value : -1
The results of the search are