![]() |
![]() |
![]() |
GStreamer Base Plugins 1.0 Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <gst/rtp/gstrtpbasepayload.h> struct GstRTPBasePayload; struct GstRTPBasePayloadClass; #define GST_RTP_BASE_PAYLOAD_MTU (payload) #define GST_RTP_BASE_PAYLOAD_PT (payload) #define GST_RTP_BASE_PAYLOAD_SINKPAD (payload) #define GST_RTP_BASE_PAYLOAD_SRCPAD (payload) gboolean gst_rtp_base_payload_is_filled (GstRTPBasePayload *payload
,guint size
,GstClockTime duration
); GstFlowReturn gst_rtp_base_payload_push (GstRTPBasePayload *payload
,GstBuffer *buffer
); GstFlowReturn gst_rtp_base_payload_push_list (GstRTPBasePayload *payload
,GstBufferList *list
); void gst_rtp_base_payload_set_options (GstRTPBasePayload *payload
,const gchar *media
,gboolean dynamic
,const gchar *encoding_name
,guint32 clock_rate
); gboolean gst_rtp_base_payload_set_outcaps (GstRTPBasePayload *payload
,const gchar *fieldname
,...
);
GObject +----GInitiallyUnowned +----GstObject +----GstElement +----GstRTPBasePayload +----GstRTPBaseAudioPayload
"max-ptime" gint64 : Read / Write "min-ptime" gint64 : Read / Write "mtu" guint : Read / Write "perfect-rtptime" gboolean : Read / Write "pt" guint : Read / Write "ptime-multiple" gint64 : Read / Write "seqnum" guint : Read "seqnum-offset" gint : Read / Write "ssrc" guint : Read / Write "stats" GstStructure* : Read "timestamp" guint : Read "timestamp-offset" guint : Read / Write
struct GstRTPBasePayloadClass { GstElementClass parent_class; /* query accepted caps */ GstCaps * (*get_caps) (GstRTPBasePayload *payload, GstPad * pad, GstCaps * filter); /* receive caps on the sink pad, configure the payloader. */ gboolean (*set_caps) (GstRTPBasePayload *payload, GstCaps *caps); /* handle a buffer, perform 0 or more gst_rtp_base_payload_push() on * the RTP buffers. This function takes ownership of the buffer. */ GstFlowReturn (*handle_buffer) (GstRTPBasePayload *payload, GstBuffer *buffer); /* handle events and queries */ gboolean (*sink_event) (GstRTPBasePayload *payload, GstEvent * event); gboolean (*src_event) (GstRTPBasePayload *payload, GstEvent * event); gboolean (*query) (GstRTPBasePayload *payload, GstPad *pad, GstQuery * query); };
Base class for audio RTP payloader.
#define GST_RTP_BASE_PAYLOAD_MTU(payload) (GST_RTP_BASE_PAYLOAD (payload)->mtu)
Get access to the configured MTU of payload
.
|
a GstRTPBasePayload |
#define GST_RTP_BASE_PAYLOAD_PT(payload) (GST_RTP_BASE_PAYLOAD (payload)->pt)
Get access to the configured payload type of payload
.
|
a GstRTPBasePayload |
#define GST_RTP_BASE_PAYLOAD_SINKPAD(payload) (GST_RTP_BASE_PAYLOAD (payload)->sinkpad)
Get access to the sinkpad of payload
.
|
a GstRTPBasePayload |
#define GST_RTP_BASE_PAYLOAD_SRCPAD(payload) (GST_RTP_BASE_PAYLOAD (payload)->srcpad)
Get access to the srcpad of payload
.
|
a GstRTPBasePayload |
gboolean gst_rtp_base_payload_is_filled (GstRTPBasePayload *payload
,guint size
,GstClockTime duration
);
Check if the packet with size
and duration
would exceed the configured
maximum size.
|
a GstRTPBasePayload |
|
the size of the packet |
|
the duration of the packet |
Returns : |
TRUE if the packet of size and duration would exceed the
configured MTU or max_ptime. |
GstFlowReturn gst_rtp_base_payload_push (GstRTPBasePayload *payload
,GstBuffer *buffer
);
Push buffer
to the peer element of the payloader. The SSRC, payload type,
seqnum and timestamp of the RTP buffer will be updated first.
This function takes ownership of buffer
.
|
a GstRTPBasePayload |
|
a GstBuffer |
Returns : |
a GstFlowReturn. |
GstFlowReturn gst_rtp_base_payload_push_list (GstRTPBasePayload *payload
,GstBufferList *list
);
Push list
to the peer element of the payloader. The SSRC, payload type,
seqnum and timestamp of the RTP buffer will be updated first.
This function takes ownership of list
.
|
a GstRTPBasePayload |
|
a GstBufferList |
Returns : |
a GstFlowReturn. |
void gst_rtp_base_payload_set_options (GstRTPBasePayload *payload
,const gchar *media
,gboolean dynamic
,const gchar *encoding_name
,guint32 clock_rate
);
Set the rtp options of the payloader. These options will be set in the caps
of the payloader. Subclasses must call this method before calling
gst_rtp_base_payload_push()
or gst_rtp_base_payload_set_outcaps()
.
|
a GstRTPBasePayload |
|
the media type (typically "audio" or "video") |
|
if the payload type is dynamic |
|
the encoding name |
|
the clock rate of the media |
gboolean gst_rtp_base_payload_set_outcaps (GstRTPBasePayload *payload
,const gchar *fieldname
,...
);
Configure the output caps with the optional parameters.
Variable arguments should be in the form field name, field type (as a GType), value(s). The last variable argument should be NULL.
|
a GstRTPBasePayload |
|
the first field name or NULL
|
|
field values |
Returns : |
TRUE if the caps could be set. |
"max-ptime"
property"max-ptime" gint64 : Read / Write
Maximum duration of the packet data in ns (-1 = unlimited up to MTU).
Allowed values: >= -1
Default value: -1
"min-ptime"
property"min-ptime" gint64 : Read / Write
Minimum duration of the packet data in ns (can't go above MTU)
Allowed values: >= 0
Default value: 0
"mtu"
property"mtu" guint : Read / Write
Maximum size of one packet.
Allowed values: >= 28
Default value: 1400
"perfect-rtptime"
property"perfect-rtptime" gboolean : Read / Write
Try to use the offset fields to generate perfect RTP timestamps. When this option is disabled, RTP timestamps are generated from GST_BUFFER_PTS of each payloaded buffer. The PTSes of buffers may not necessarily increment with the amount of data in each input buffer, consider e.g. the case where the buffer arrives from a network which means that the PTS is unrelated to the amount of data. Because the RTP timestamps are generated from GST_BUFFER_PTS this can result in RTP timestamps that also don't increment with the amount of data in the payloaded packet. To circumvent this it is possible to set the perfect rtptime option enabled. When this option is enabled the payloader will increment the RTP timestamps based on GST_BUFFER_OFFSET which relates to the amount of data in each packet rather than the GST_BUFFER_PTS of each buffer and therefore the RTP timestamps will more closely correlate with the amount of data in each buffer. Currently GstRTPBasePayload is limited to handling perfect RTP timestamps for audio streams.
Default value: TRUE
"pt"
property"pt" guint : Read / Write
The payload type of the packets.
Allowed values: <= 127
Default value: 96
"ptime-multiple"
property"ptime-multiple" gint64 : Read / Write
Force buffers to be multiples of this duration in ns (0 disables)
Allowed values: >= 0
Default value: 0
"seqnum"
property"seqnum" guint : Read
The RTP sequence number of the last processed packet.
Allowed values: <= 65535
Default value: 0
"seqnum-offset"
property"seqnum-offset" gint : Read / Write
Offset to add to all outgoing seqnum (-1 = random).
Allowed values: [-1,65535]
Default value: -1
"ssrc"
property"ssrc" guint : Read / Write
The SSRC of the packets (default == random).
Default value: 4294967295
"stats"
property "stats" GstStructure* : Read
Various payloader statistics retrieved atomically (and are therefore synchroized with each other), these can be used e.g. to generate an RTP-Info header. This property return a GstStructure named application/x-rtp-payload-stats containing the following fields relating to the last processed buffer and current state of the stream being payloaded:
clock-rate |
G_TYPE_UINT, clock-rate of the stream |
running-time |
G_TYPE_UINT64, running time |
seqnum |
G_TYPE_UINT, sequence number, same as "seqnum" |
timestamp |
G_TYPE_UINT, RTP timestamp, same as "timestamp" |
ssrc |
G_TYPE_UINT, The SSRC in use |
pt |
G_TYPE_UINT, The Payload type in use, same as "pt" |
seqnum-offset |
G_TYPE_UINT, The current offset added to the seqnum |
timestamp-offset |
G_TYPE_UINT, The current offset added to the timestamp |
"timestamp"
property"timestamp" guint : Read
The RTP timestamp of the last processed packet.
Default value: 0
"timestamp-offset"
property"timestamp-offset" guint : Read / Write
Offset to add to all outgoing timestamps (default = random).
Default value: 4294967295