Wireshark  4.3.0
The Wireshark network protocol analyzer
Classes | Macros | Typedefs | Functions
rtp_media.h File Reference
#include <glib.h>
#include <wsutil/wmem/wmem_map.h>

Go to the source code of this file.

Classes

struct  _rtp_packet
 

Macros

#define SAMPLE_MAX   INT16_MAX
 
#define SAMPLE_MIN   INT16_MIN
 
#define SAMPLE_NaN   SAMPLE_MIN
 
#define SAMPLE_BYTES   (sizeof(SAMPLE) / sizeof(char))
 

Typedefs

typedef int16_t SAMPLE
 
typedef struct _rtp_packet rtp_packet_t
 

Functions

GHashTable * rtp_decoder_hash_table_new (void)
 
size_t decode_rtp_packet_payload (uint8_t payload_type, const char *payload_type_str, int payload_rate, int payload_channels, wmem_map_t *payload_fmtp_map, uint8_t *payload_data, size_t payload_len, SAMPLE **out_buff, GHashTable *decoders_hash, unsigned *channels_ptr, unsigned *sample_rate_ptr)
 
size_t decode_rtp_packet (rtp_packet_t *rp, SAMPLE **out_buff, GHashTable *decoders_hash, unsigned *channels_ptr, unsigned *sample_rate_ptr)
 

Detailed Description

RTP decoding routines for Wireshark. Copied from ui/gtk/rtp_player.c

Copyright 2006, Alejandro Vaquero aleja.nosp@m.ndro.nosp@m.vaque.nosp@m.ro@y.nosp@m.ahoo..nosp@m.com

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1999 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

"RTP Player" dialog box common routines.

Function Documentation

◆ decode_rtp_packet()

size_t decode_rtp_packet ( rtp_packet_t rp,
SAMPLE **  out_buff,
GHashTable *  decoders_hash,
unsigned *  channels_ptr,
unsigned *  sample_rate_ptr 
)

Decode an RTP packet

Parameters
rpWrapper for per-packet RTP tap data.
out_buffOutput audio samples.
decoders_hashHash table created with rtp_decoder_hash_table_new.
channels_ptrIf non-NULL, receives the number of channels in the sample.
sample_rate_ptrIf non-NULL, receives the sample rate.
Returns
The number of decoded bytes on success, 0 on failure.

◆ decode_rtp_packet_payload()

size_t decode_rtp_packet_payload ( uint8_t  payload_type,
const char *  payload_type_str,
int  payload_rate,
int  payload_channels,
wmem_map_t payload_fmtp_map,
uint8_t *  payload_data,
size_t  payload_len,
SAMPLE **  out_buff,
GHashTable *  decoders_hash,
unsigned *  channels_ptr,
unsigned *  sample_rate_ptr 
)

Decode payload from an RTP packet For RTP packets with dynamic payload types, the payload name, clock rate, and number of audio channels (e.g., from the SDP) can be provided. Note that the output sample rate and number of channels might not be the same as that of the input.

Parameters
payload_typePayload number
payload_type_strPayload name, can be NULL
payload_rateSample rate, can be 0 for codec default
payload_channelsAudio channels, can be 0 for codec default
payload_fmtp_mapMap of format parameters for the media type
payload_dataPayload
payload_lenLength of payload
out_buffOutput audio samples.
decoders_hashHash table created with rtp_decoder_hash_table_new.
channels_ptrIf non-NULL, receives the number of channels in the sample.
sample_rate_ptrIf non-NULL, receives the sample rate.
Returns
The number of decoded bytes on success, 0 on failure.

◆ rtp_decoder_hash_table_new()

GHashTable* rtp_decoder_hash_table_new ( void  )

Create a new hash table.

Returns
A new hash table suitable for passing to decode_rtp_packet.