Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / ui / rtp_media.h
blob406f72674c7e9a8b47f13d6daa5519c9910f699d
1 /** @file
3 * RTP decoding routines for Wireshark.
4 * Copied from ui/gtk/rtp_player.c
6 * Copyright 2006, Alejandro Vaquero <alejandrovaquero@yahoo.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1999 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
15 #ifndef __RTP_MEDIA_H__
16 #define __RTP_MEDIA_H__
18 #include <glib.h>
19 #include <wsutil/wmem/wmem_map.h>
21 /** @file
22 * "RTP Player" dialog box common routines.
23 * @ingroup main_ui_group
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
30 /****************************************************************************/
31 /* INTERFACE */
32 /****************************************************************************/
34 typedef int16_t SAMPLE;
35 #define SAMPLE_MAX INT16_MAX
36 #define SAMPLE_MIN INT16_MIN
37 #define SAMPLE_NaN SAMPLE_MIN
38 #define SAMPLE_BYTES (sizeof(SAMPLE) / sizeof(char))
40 /* Defines an RTP packet */
41 typedef struct _rtp_packet {
42 uint32_t frame_num; /* Qt only */
43 struct _rtp_info *info; /* the RTP dissected info */
44 double arrive_offset; /* arrive offset time since the beginning of the stream as ms in GTK UI and s in Qt UI */
45 uint8_t* payload_data;
46 } rtp_packet_t;
48 /** Create a new hash table.
50 * @return A new hash table suitable for passing to decode_rtp_packet.
52 GHashTable *rtp_decoder_hash_table_new(void);
54 /** Decode an RTP packet
56 * @param rp Wrapper for per-packet RTP tap data.
57 * @param out_buff Output audio samples.
58 * @param decoders_hash Hash table created with rtp_decoder_hash_table_new.
59 * @param channels_ptr If non-NULL, receives the number of channels in the sample.
60 * @param sample_rate_ptr If non-NULL, receives the sample rate.
61 * @return The number of decoded bytes on success, 0 on failure.
63 size_t decode_rtp_packet(rtp_packet_t *rp, SAMPLE **out_buff, GHashTable *decoders_hash, unsigned *channels_ptr, unsigned *sample_rate_ptr);
65 #ifdef __cplusplus
67 #endif /* __cplusplus */
69 #endif /* __RTP_MEDIA_H__ */