oRTP 0.25.0

- Main Page
- Data Structures
- Files

- File List
- Globals

payloadtype.h
Go to the documentation of this file.
1 /*
2 The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
3 Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
26 #ifndef PAYLOADTYPE_H
27 #define PAYLOADTYPE_H
28 #include <ortp/port.h>
29
30 #ifdef __cplusplus
31 extern "C"{
32 #endif
33
34 /* flags for PayloadType::flags */
35
36 #define PAYLOAD_TYPE_ALLOCATED (1)
37 /*payload type represents a VBR codec*/
38 #define PAYLOAD_TYPE_IS_VBR (1<<1)
39 #define PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED (1<<2)
40 /* private flags for future use by ortp */
41 #define PAYLOAD_TYPE_PRIV1 (1<<3)
42 /* user flags, can be used by the application on top of oRTP */
43 #define PAYLOAD_TYPE_USER_FLAG_0 (1<<4)
44 #define PAYLOAD_TYPE_USER_FLAG_1 (1<<5)
45 #define PAYLOAD_TYPE_USER_FLAG_2 (1<<6)
46 #define PAYLOAD_TYPE_USER_FLAG_3 (1<<7)
47 #define PAYLOAD_TYPE_USER_FLAG_4 (1<<8)
48 /* ask for more if you need*/
49
50 #define PAYLOAD_AUDIO_CONTINUOUS 0
51 #define PAYLOAD_AUDIO_PACKETIZED 1
52 #define PAYLOAD_VIDEO 2
53 #define PAYLOAD_TEXT 3
54 #define PAYLOAD_OTHER 4 /* ?? */
55
56 #define PAYLOAD_TYPE_AVPF_NONE 0
57 #define PAYLOAD_TYPE_AVPF_FIR (1 << 0)
58 #define PAYLOAD_TYPE_AVPF_PLI (1 << 1)
59 #define PAYLOAD_TYPE_AVPF_SLI (1 << 2)
60 #define PAYLOAD_TYPE_AVPF_RPSI (1 << 3)
61
62 struct _PayloadTypeAvpfParams {
63 unsigned char features;
64 bool_t rpsi_compatibility; /*< Linphone uses positive feeback for RPSI. However first versions handling
65 AVPF wrongly declared RPSI as negative feedback, so this is kept for compatibility
66 with these versions but will probably be removed at some point in time. */
67 uint16_t trr_interval;
68 };
69
70 struct _PayloadType
71 {
72 int type;
73 int clock_rate;
74 char bits_per_sample; /* in case of continuous audio data */
75 char *zero_pattern;
76 int pattern_length;
77 /* other useful information for the application*/
78 int normal_bitrate; /*in bit/s */
79 char *mime_type;
80 int channels;
81 char *recv_fmtp; /* various format parameters for the incoming stream */
82 char *send_fmtp; /* various format parameters for the outgoing stream */
83 struct _PayloadTypeAvpfParams avpf; /* AVPF parameters */
84 int flags;
85 void *user_data;
86 };
87
88 #ifndef PayloadType_defined
89 #define PayloadType_defined
90 typedef struct _PayloadType PayloadType;
91 typedef struct _PayloadTypeAvpfParams PayloadTypeAvpfParams;
92 #endif
93
94 #define payload_type_set_flag(pt,flag) (pt)->flags|=((int)flag)
95 #define payload_type_unset_flag(pt,flag) (pt)->flags&=(~(int)flag)
96 #define payload_type_get_flags(pt) (pt)->flags
97
98
99 ORTP_PUBLIC PayloadType *payload_type_new(void);
100 ORTP_PUBLIC PayloadType *payload_type_clone(const PayloadType *payload);
101 ORTP_PUBLIC char *payload_type_get_rtpmap(PayloadType *pt);
102 ORTP_PUBLIC void payload_type_destroy(PayloadType *pt);
103 ORTP_PUBLIC void payload_type_set_recv_fmtp(PayloadType *pt, const char *fmtp);
104 ORTP_PUBLIC void payload_type_set_send_fmtp(PayloadType *pt, const char *fmtp);
105 ORTP_PUBLIC void payload_type_append_recv_fmtp(PayloadType *pt, const char *fmtp);
106 ORTP_PUBLIC void payload_type_append_send_fmtp(PayloadType *pt, const char *fmtp);
107 #define payload_type_get_avpf_params(pt) ((pt)->avpf)
108 ORTP_PUBLIC void payload_type_set_avpf_params(PayloadType *pt, PayloadTypeAvpfParams params);
109
110 #define payload_type_get_bitrate(pt) ((pt)->normal_bitrate)
111 #define payload_type_get_rate(pt) ((pt)->clock_rate)
112 #define payload_type_get_mime(pt) ((pt)->mime_type)
113
114 ORTP_PUBLIC bool_t fmtp_get_value(const char *fmtp, const char *param_name, char *result, size_t result_len);
115
116 #define payload_type_set_user_data(pt,p) (pt)->user_data=(p)
117 #define payload_type_get_user_data(pt) ((pt)->user_data)
118
119
120 /* some payload types */
121 /* audio */
122 ORTP_VAR_PUBLIC PayloadType payload_type_pcmu8000;
123 ORTP_VAR_PUBLIC PayloadType payload_type_pcma8000;
124 ORTP_VAR_PUBLIC PayloadType payload_type_pcm8000;
125 ORTP_VAR_PUBLIC PayloadType payload_type_l16_mono;
126 ORTP_VAR_PUBLIC PayloadType payload_type_l16_stereo;
127 ORTP_VAR_PUBLIC PayloadType payload_type_lpc1016;
128 ORTP_VAR_PUBLIC PayloadType payload_type_g729;
129 ORTP_VAR_PUBLIC PayloadType payload_type_g7231;
130 ORTP_VAR_PUBLIC PayloadType payload_type_g7221;
131 ORTP_VAR_PUBLIC PayloadType payload_type_cn;
132 ORTP_VAR_PUBLIC PayloadType payload_type_g726_40;
133 ORTP_VAR_PUBLIC PayloadType payload_type_g726_32;
134 ORTP_VAR_PUBLIC PayloadType payload_type_g726_24;
135 ORTP_VAR_PUBLIC PayloadType payload_type_g726_16;
136 ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_40;
137 ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_32;
138 ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_24;
139 ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_16;
140 ORTP_VAR_PUBLIC PayloadType payload_type_gsm;
141 ORTP_VAR_PUBLIC PayloadType payload_type_lpc;
142 ORTP_VAR_PUBLIC PayloadType payload_type_lpc1015;
143 ORTP_VAR_PUBLIC PayloadType payload_type_speex_nb;
144 ORTP_VAR_PUBLIC PayloadType payload_type_speex_wb;
145 ORTP_VAR_PUBLIC PayloadType payload_type_speex_uwb;
146 ORTP_VAR_PUBLIC PayloadType payload_type_ilbc;
147 ORTP_VAR_PUBLIC PayloadType payload_type_amr;
148 ORTP_VAR_PUBLIC PayloadType payload_type_amrwb;
149 ORTP_VAR_PUBLIC PayloadType payload_type_truespeech;
150 ORTP_VAR_PUBLIC PayloadType payload_type_evrc0;
151 ORTP_VAR_PUBLIC PayloadType payload_type_evrcb0;
152 ORTP_VAR_PUBLIC PayloadType payload_type_silk_nb;
153 ORTP_VAR_PUBLIC PayloadType payload_type_silk_mb;
154 ORTP_VAR_PUBLIC PayloadType payload_type_silk_wb;
155 ORTP_VAR_PUBLIC PayloadType payload_type_silk_swb;
156 ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_16k;
157 ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_22k;
158 ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_32k;
159 ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_44k;
160 ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_48k;
161 ORTP_VAR_PUBLIC PayloadType payload_type_opus;
162 ORTP_VAR_PUBLIC PayloadType payload_type_isac;
163 ORTP_VAR_PUBLIC PayloadType payload_type_gsm_efr;
164 ORTP_VAR_PUBLIC PayloadType payload_type_codec2;
165
166 /* video */
167 ORTP_VAR_PUBLIC PayloadType payload_type_mpv;
168 ORTP_VAR_PUBLIC PayloadType payload_type_h261;
169 ORTP_VAR_PUBLIC PayloadType payload_type_h263;
170 ORTP_VAR_PUBLIC PayloadType payload_type_h263_1998;
171 ORTP_VAR_PUBLIC PayloadType payload_type_h263_2000;
172 ORTP_VAR_PUBLIC PayloadType payload_type_mp4v;
173 ORTP_VAR_PUBLIC PayloadType payload_type_theora;
174 ORTP_VAR_PUBLIC PayloadType payload_type_h264;
175 ORTP_VAR_PUBLIC PayloadType payload_type_x_snow;
176 ORTP_VAR_PUBLIC PayloadType payload_type_jpeg;
177 ORTP_VAR_PUBLIC PayloadType payload_type_vp8;
178
179 ORTP_VAR_PUBLIC PayloadType payload_type_g722;
180
181 /* text */
182 ORTP_VAR_PUBLIC PayloadType payload_type_t140;
183 ORTP_VAR_PUBLIC PayloadType payload_type_t140_red;
184
185 /* non standard file transfer over UDP */
186 ORTP_VAR_PUBLIC PayloadType payload_type_x_udpftp;
187
188 /* telephone-event */
189 ORTP_VAR_PUBLIC PayloadType payload_type_telephone_event;
190
191 #ifdef __cplusplus
192 }
193 #endif
194
195 #endif
_PayloadType
Definition: payloadtype.h:70
_PayloadType::clock_rate
int clock_rate
Definition: payloadtype.h:73
payload_type_destroy
ORTP_PUBLIC void payload_type_destroy(PayloadType *pt)
Definition: payloadtype.c:134
_PayloadTypeAvpfParams
Definition: payloadtype.h:62
_PayloadType::mime_type
char * mime_type
Definition: payloadtype.h:79
_PayloadTypeAvpfParams::features
unsigned char features
Definition: payloadtype.h:63
payload_type_set_recv_fmtp
ORTP_PUBLIC void payload_type_set_recv_fmtp(PayloadType *pt, const char *fmtp)
Definition: payloadtype.c:77
fmtp_get_value
ORTP_PUBLIC bool_t fmtp_get_value(const char *fmtp, const char *param_name, char *result, size_t result_len)
Definition: payloadtype.c:183
_PayloadType::channels
int channels
Definition: payloadtype.h:80
payload_type_set_send_fmtp
ORTP_PUBLIC void payload_type_set_send_fmtp(PayloadType *pt, const char *fmtp)
Definition: payloadtype.c:90
_PayloadTypeAvpfParams::trr_interval
uint16_t trr_interval
Definition: payloadtype.h:67
_PayloadType::type
int type
Definition: payloadtype.h:72