## GstRTPBaseDepayload

GstRTPBaseDepayload — Base class for RTP depayloader

## Functions

#define | GST_RTP_BASE_DEPAYLOAD_SINKPAD()
#define | GST_RTP_BASE_DEPAYLOAD_SRCPAD()
GstFlowReturn | gst_rtp_base_depayload_push ()
GstFlowReturn | gst_rtp_base_depayload_push_list ()
gboolean | gst_rtp_base_depayload_is_source_info_enabled ()
void | gst_rtp_base_depayload_set_source_info_enabled ()

## Properties

gboolean | source-info | Read / Write
GstStructure * | stats | Read

## Types and Values

struct | GstRTPBaseDepayload
struct | GstRTPBaseDepayloadClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstRTPBaseDepayload

## Includes

    #include <gst/rtp/rtp.h>

## Description

Provides a base class for RTP depayloaders

## Functions

### GST_RTP_BASE_DEPAYLOAD_SINKPAD()

    #define GST_RTP_BASE_DEPAYLOAD_SINKPAD(depayload) (GST_RTP_BASE_DEPAYLOAD_CAST (depayload)->sinkpad)

### GST_RTP_BASE_DEPAYLOAD_SRCPAD()

    #define GST_RTP_BASE_DEPAYLOAD_SRCPAD(depayload)  (GST_RTP_BASE_DEPAYLOAD_CAST (depayload)->srcpad)

### gst_rtp_base_depayload_push ()

    GstFlowReturn
    gst_rtp_base_depayload_push (GstRTPBaseDepayload *filter,
                                 GstBuffer *out_buf);

Push `out_buf` to the peer of `filter` . This function takes ownership of `out_buf` .

This function will by default apply the last incomming timestamp on the outgoing buffer when it didn't have a timestamp already.

#### Parameters

filter | a GstRTPBaseDepayload |
out_buf | a GstBuffer |

#### Returns

a GstFlowReturn.

### gst_rtp_base_depayload_push_list ()

    GstFlowReturn
    gst_rtp_base_depayload_push_list (GstRTPBaseDepayload *filter,
                                      GstBufferList *out_list);

Push `out_list` to the peer of `filter` . This function takes ownership of `out_list` .

#### Parameters

filter | a GstRTPBaseDepayload |
out_list | a GstBufferList |

#### Returns

a GstFlowReturn.

### gst_rtp_base_depayload_is_source_info_enabled ()

    gboolean
    gst_rtp_base_depayload_is_source_info_enabled
                                   (GstRTPBaseDepayload *depayload);

Queries whether GstRTPSourceMeta will be added to depayloaded buffers.

#### Parameters

depayload | a GstRTPBaseDepayload |

#### Returns

`TRUE` if source-info is enabled.

Since: 1.16

### gst_rtp_base_depayload_set_source_info_enabled ()

    void
    gst_rtp_base_depayload_set_source_info_enabled
                                   (GstRTPBaseDepayload *depayload,
                                    gboolean enable);

Enable or disable adding GstRTPSourceMeta to depayloaded buffers.

#### Parameters

depayload | a GstRTPBaseDepayload |
enable | whether to add meta about RTP sources to buffer |

Since: 1.16

## Types and Values

### struct GstRTPBaseDepayload

    struct GstRTPBaseDepayload;

### struct GstRTPBaseDepayloadClass

    struct GstRTPBaseDepayloadClass {
      GstElementClass parent_class;

      /* virtuals, inform the subclass of the caps. */
      gboolean (*set_caps) (GstRTPBaseDepayload *filter, GstCaps *caps);

      /* pure virtual function */
      GstBuffer * (*process) (GstRTPBaseDepayload *base, GstBuffer *in);

      /* non-pure function used to to signal the depayloader about packet loss. the
       * timestamp and duration are the estimated values of the lost packet.
       * The default implementation of this message pushes a segment update. */
      gboolean (*packet_lost) (GstRTPBaseDepayload *filter, GstEvent *event);

      /* the default implementation does the default actions for events but
       * implementation can override. */
      gboolean (*handle_event) (GstRTPBaseDepayload * filter, GstEvent * event);

      GstBuffer * (*process_rtp_packet) (GstRTPBaseDepayload *base, GstRTPBuffer * rtp_buffer);
    };

Base class for RTP depayloaders.

#### Members

`set_caps` () | configure the depayloader |
`process` () | process incoming rtp packets. Subclass must implement either this method or `process_rtp_packet` to process incoming rtp packets. If the child returns a buffer without a valid timestamp, the timestamp of the provided buffer will be applied to the result buffer and the buffer will be pushed. If this function returns `NULL`, nothing is pushed. |
`packet_lost` () | signal the depayloader about packet loss |
`handle_event` () | custom event handling |

`process_rtp_packet` ()

Same as the process virtual function, but slightly more efficient, since it is passed the rtp buffer structure that has already been mapped (with GST_MAP_READ) by the base class and thus does not have to be mapped again by the subclass. Can be used by the subclass to process incoming rtp packets. If the subclass returns a buffer without a valid timestamp, the timestamp of the input buffer will be applied to the result buffer and the output buffer will be pushed out. If this function returns `NULL`, nothing is pushed out. Since: 1.6.

## Property Details

### The `“source-info”` property

      “source-info”              gboolean

Add RTP source information found in RTP header as meta to output buffer.

Owner: GstRTPBaseDepayload

Flags: Read / Write

Default value: FALSE

Since: 1.16

### The `“stats”` property

      “stats”                    GstStructure *

Various depayloader statistics retrieved atomically (and are therefore synchroized with each other). This property return a GstStructure named application/x-rtp-depayload-stats containing the following fields relating to the last processed buffer and current state of the stream being depayloaded:

- `clock-rate`: G_TYPE_UINT, clock-rate of the stream

- `npt-start`: G_TYPE_UINT64, time of playback start

- `npt-stop`: G_TYPE_UINT64, time of playback stop

- `play-speed`: G_TYPE_DOUBLE, the playback speed

- `play-scale`: G_TYPE_DOUBLE, the playback scale

- `running-time-dts`: G_TYPE_UINT64, the last running-time of the last DTS

- `running-time-pts`: G_TYPE_UINT64, the last running-time of the last PTS

- `seqnum`: G_TYPE_UINT, the last seen seqnum

- `timestamp`: G_TYPE_UINT, the last seen RTP timestamp

Owner: GstRTPBaseDepayload

Flags: Read