nexmon – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | /* rtp_media.h |
2 | * |
||
3 | * RTP decoding routines for Wireshark. |
||
4 | * Copied from ui/gtk/rtp_player.c |
||
5 | * |
||
6 | * Copyright 2006, Alejandro Vaquero <alejandrovaquero@yahoo.com> |
||
7 | * |
||
8 | * Wireshark - Network traffic analyzer |
||
9 | * By Gerald Combs <gerald@wireshark.org> |
||
10 | * Copyright 1999 Gerald Combs |
||
11 | * |
||
12 | * This program is free software; you can redistribute it and/or |
||
13 | * modify it under the terms of the GNU General Public License |
||
14 | * as published by the Free Software Foundation; either version 2 |
||
15 | * of the License, or (at your option) any later version. |
||
16 | * |
||
17 | * This program is distributed in the hope that it will be useful, |
||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
20 | * GNU General Public License for more details. |
||
21 | * |
||
22 | * You should have received a copy of the GNU General Public License |
||
23 | * along with this program; if not, write to the Free Software |
||
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
||
25 | */ |
||
26 | |||
27 | #ifndef __RTP_MEDIA_H__ |
||
28 | #define __RTP_MEDIA_H__ |
||
29 | |||
30 | /** @file |
||
31 | * "RTP Player" dialog box common routines. |
||
32 | * @ingroup main_ui_group |
||
33 | */ |
||
34 | |||
35 | #ifdef __cplusplus |
||
36 | extern "C" { |
||
37 | #endif /* __cplusplus */ |
||
38 | |||
39 | #include <glib.h> |
||
40 | |||
41 | /****************************************************************************/ |
||
42 | /* INTERFACE */ |
||
43 | /****************************************************************************/ |
||
44 | |||
45 | typedef gint16 SAMPLE; |
||
46 | #define SAMPLE_MAX G_MAXINT16 |
||
47 | #define SAMPLE_MIN G_MININT16 |
||
48 | |||
49 | /* Defines an RTP packet */ |
||
50 | typedef struct _rtp_packet { |
||
51 | guint32 frame_num; /* Qt only */ |
||
52 | struct _rtp_info *info; /* the RTP dissected info */ |
||
53 | double arrive_offset; /* arrive offset time since the beginning of the stream as ms in GTK UI and s in Qt UI */ |
||
54 | guint8* payload_data; |
||
55 | } rtp_packet_t; |
||
56 | |||
57 | /** Create a new hash table. |
||
58 | * |
||
59 | * @return A new hash table suitable for passing to decode_rtp_packet. |
||
60 | */ |
||
61 | GHashTable *rtp_decoder_hash_table_new(void); |
||
62 | |||
63 | /** Decode an RTP packet |
||
64 | * |
||
65 | * @param rp Wrapper for per-packet RTP tap data. |
||
66 | * @param out_buff Output audio samples. |
||
67 | * @param decoders_hash Hash table created with rtp_decoder_hash_table_new. |
||
68 | * @param channels_ptr If non-NULL, receives the number of channels in the sample. |
||
69 | * @param sample_rate_ptr If non-NULL, receives the sample rate. |
||
70 | * @return The number of decoded bytes on success, 0 on failure. |
||
71 | */ |
||
72 | size_t decode_rtp_packet(rtp_packet_t *rp, SAMPLE **out_buff, GHashTable *decoders_hash, unsigned *channels_ptr, unsigned *sample_rate_ptr); |
||
73 | |||
74 | #ifdef __cplusplus |
||
75 | } |
||
76 | #endif /* __cplusplus */ |
||
77 | |||
78 | #endif /* __RTP_MEDIA_H__ */ |
||
79 | |||
80 | /* |
||
81 | * Editor modelines - http://www.wireshark.org/tools/modelines.html |
||
82 | * |
||
83 | * Local variables: |
||
84 | * c-basic-offset: 4 |
||
85 | * tab-width: 8 |
||
86 | * indent-tabs-mode: nil |
||
87 | * End: |
||
88 | * |
||
89 | * vi: set shiftwidth=4 tabstop=8 expandtab: |
||
90 | * :indentSize=4:tabSize=8:noTabs=true: |
||
91 | */ |