gstbasertppayload

## gstbasertppayload gstbasertppayload — Base class for RTP payloader |

## Functions

#define | GST_BASE_RTP_PAYLOAD_MTU()
#define | GST_BASE_RTP_PAYLOAD_PT()
#define | GST_BASE_RTP_PAYLOAD_SINKPAD()
#define | GST_BASE_RTP_PAYLOAD_SRCPAD()
gboolean | gst_basertppayload_is_filled ()
GstFlowReturn | gst_basertppayload_push ()
GstFlowReturn | gst_basertppayload_push_list ()
void | gst_basertppayload_set_options ()
gboolean | gst_basertppayload_set_outcaps ()

## Properties

gint64 | max-ptime | Read / Write
gint64 | min-ptime | Read / Write
guint | mtu | Read / Write
gboolean | perfect-rtptime | Read / Write
guint | pt | Read / Write
gint64 | ptime-multiple | Read / Write
guint | seqnum | Read
gint | seqnum-offset | Read / Write
guint | ssrc | Read / Write
guint | timestamp | Read
guint | timestamp-offset | Read / Write

## Types and Values

struct | GstBaseRTPPayload
struct | GstBaseRTPPayloadClass

## Object Hierarchy

        GObject
        ╰── GstObject
            ╰── GstElement
                ╰── GstBaseRTPPayload
                    ╰── GstBaseRTPAudioPayload

## Includes

    #include <gst/rtp/gstbasertppayload.h>

## Description

Provides a base class for RTP payloaders

## Functions

### GST_BASE_RTP_PAYLOAD_MTU()

    #define GST_BASE_RTP_PAYLOAD_MTU(payload) (GST_BASE_RTP_PAYLOAD (payload)->mtu)

Get access to the configured MTU of `payload` .

#### Parameters

payload | a GstBaseRTPPayload |

### GST_BASE_RTP_PAYLOAD_PT()

    #define GST_BASE_RTP_PAYLOAD_PT(payload)  (GST_BASE_RTP_PAYLOAD (payload)->pt)

Get access to the configured payload type of `payload` .

#### Parameters

payload | a GstBaseRTPPayload |

### GST_BASE_RTP_PAYLOAD_SINKPAD()

    #define GST_BASE_RTP_PAYLOAD_SINKPAD(payload) (GST_BASE_RTP_PAYLOAD (payload)->sinkpad)

Get access to the sinkpad of `payload` .

#### Parameters

payload | a GstBaseRTPPayload |

### GST_BASE_RTP_PAYLOAD_SRCPAD()

    #define GST_BASE_RTP_PAYLOAD_SRCPAD(payload)  (GST_BASE_RTP_PAYLOAD (payload)->srcpad)

Get access to the srcpad of `payload` .

#### Parameters

payload | a GstBaseRTPPayload |

### gst_basertppayload_is_filled ()

    gboolean
    gst_basertppayload_is_filled (GstBaseRTPPayload *payload,
                                  guint size,
                                  GstClockTime duration);

Check if the packet with `size` and `duration` would exceed the configured maximum size.

#### Parameters

payload | a GstBaseRTPPayload |
size | the size of the packet |
duration | the duration of the packet |

#### Returns

`TRUE` if the packet of `size` and `duration` would exceed the configured MTU or max_ptime.

### gst_basertppayload_push ()

    GstFlowReturn
    gst_basertppayload_push (GstBaseRTPPayload *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` .

#### Parameters

payload | a GstBaseRTPPayload |
buffer | a GstBuffer |

#### Returns

a GstFlowReturn.

### gst_basertppayload_push_list ()

    GstFlowReturn
    gst_basertppayload_push_list (GstBaseRTPPayload *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` .

#### Parameters

payload | a GstBaseRTPPayload |
list | a GstBufferList |

#### Returns

a GstFlowReturn.

Since: 0.10.24

### gst_basertppayload_set_options ()

    void
    gst_basertppayload_set_options (GstBaseRTPPayload *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_basertppayload_push()` or `gst_basertppayload_set_outcaps()`.

#### Parameters

payload | a GstBaseRTPPayload |
media | the media type (typically "audio" or "video") |
dynamic | if the payload type is dynamic |
encoding_name | the encoding name |
clock_rate | the clock rate of the media |

### gst_basertppayload_set_outcaps ()

    gboolean
    gst_basertppayload_set_outcaps (GstBaseRTPPayload *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.

#### Parameters

payload | a GstBaseRTPPayload |
fieldname | the first field name or `NULL` |
... | field values |

#### Returns

`TRUE` if the caps could be set.

## Types and Values

### struct GstBaseRTPPayload

    struct GstBaseRTPPayload;

### struct GstBaseRTPPayloadClass

    struct GstBaseRTPPayloadClass {
      GstElementClass parent_class;

      /* receive caps on the sink pad, configure the payloader. */
      gboolean      (*set_caps)             (GstBaseRTPPayload *payload, GstCaps *caps);
      /* handle a buffer, perform 0 or more gst_basertppayload_push() on
       * the RTP buffers. This function takes ownership of the buffer. */
      GstFlowReturn (*handle_buffer)        (GstBaseRTPPayload *payload,
                                             GstBuffer *buffer);
      gboolean      (*handle_event)         (GstPad * pad, GstEvent * event);
      GstCaps *     (*get_caps)             (GstBaseRTPPayload *payload, GstPad * pad);
    };

Base class for audio RTP payloader.

#### Members

GstElementClass `parent_class`; | the parent class |
`set_caps` () | configure the payloader |
`handle_buffer` () | process data |
`handle_event` () | custom event handling |
`get_caps` () | get desired caps |

## Property Details

### The `“max-ptime”` property

      “max-ptime”                gint64

Maximum duration of the packet data in ns (-1 = unlimited up to MTU).

Flags: Read / Write

Allowed values: >= -1

Default value: -1

### The `“min-ptime”` property

      “min-ptime”                gint64

Minimum duration of the packet data in ns (can't go above MTU).

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“mtu”` property

      “mtu”                      guint

Maximum size of one packet.

Flags: Read / Write

Allowed values: >= 28

Default value: 1400

### The `“perfect-rtptime”` property

      “perfect-rtptime”          gboolean

Generate perfect RTP timestamps when possible.

Flags: Read / Write

Default value: TRUE

### The `“pt”` property

      “pt”                       guint

The payload type of the packets.

Flags: Read / Write

Allowed values: <= 128

Default value: 96

### The `“ptime-multiple”` property

      “ptime-multiple”           gint64

Force buffers to be multiples of this duration in ns (0 disables).

Flags: Read / Write

Allowed values: >= 0

Default value: 0

### The `“seqnum”` property

      “seqnum”                   guint

The RTP sequence number of the last processed packet.

Flags: Read

Allowed values: <= 65535

Default value: 0

### The `“seqnum-offset”` property

      “seqnum-offset”            gint

Offset to add to all outgoing seqnum (-1 = random).

Flags: Read / Write

Allowed values: [-1,65535]

Default value: -1

### The `“ssrc”` property

      “ssrc”                     guint

The SSRC of the packets (default == random).

Flags: Read / Write

Default value: 4294967295

### The `“timestamp”` property

      “timestamp”                guint

The RTP timestamp of the last processed packet.

Flags: Read

Default value: 0

### The `“timestamp-offset”` property

      “timestamp-offset”         guint

Offset to add to all outgoing timestamps (default = random).

Flags: Read / Write

Default value: 4294967295