oRTP  0.24.0
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 4
54 #define PAYLOAD_OTHER 3 /* ?? */
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 
63  unsigned char features;
64  uint16_t trr_interval;
65 };
66 
68 {
69  int type;
70  int clock_rate;
71  char bits_per_sample; /* in case of continuous audio data */
72  char *zero_pattern;
73  int pattern_length;
74  /* other useful information for the application*/
75  int normal_bitrate; /*in bit/s */
76  char *mime_type;
77  int channels;
78  char *recv_fmtp; /* various format parameters for the incoming stream */
79  char *send_fmtp; /* various format parameters for the outgoing stream */
80  struct _PayloadTypeAvpfParams avpf; /* AVPF parameters */
81  int flags;
82  void *user_data;
83 };
84 
85 #ifndef PayloadType_defined
86 #define PayloadType_defined
87 typedef struct _PayloadType PayloadType;
89 #endif
90 
91 #define payload_type_set_flag(pt,flag) (pt)->flags|=((int)flag)
92 #define payload_type_unset_flag(pt,flag) (pt)->flags&=(~(int)flag)
93 #define payload_type_get_flags(pt) (pt)->flags
94 
95 
96 ORTP_PUBLIC PayloadType *payload_type_new(void);
97 ORTP_PUBLIC PayloadType *payload_type_clone(const PayloadType *payload);
98 ORTP_PUBLIC char *payload_type_get_rtpmap(PayloadType *pt);
99 ORTP_PUBLIC void payload_type_destroy(PayloadType *pt);
100 ORTP_PUBLIC void payload_type_set_recv_fmtp(PayloadType *pt, const char *fmtp);
101 ORTP_PUBLIC void payload_type_set_send_fmtp(PayloadType *pt, const char *fmtp);
102 ORTP_PUBLIC void payload_type_append_recv_fmtp(PayloadType *pt, const char *fmtp);
103 ORTP_PUBLIC void payload_type_append_send_fmtp(PayloadType *pt, const char *fmtp);
104 #define payload_type_get_avpf_params(pt) ((pt)->avpf)
105 ORTP_PUBLIC void payload_type_set_avpf_params(PayloadType *pt, PayloadTypeAvpfParams params);
106 
107 #define payload_type_get_bitrate(pt) ((pt)->normal_bitrate)
108 #define payload_type_get_rate(pt) ((pt)->clock_rate)
109 #define payload_type_get_mime(pt) ((pt)->mime_type)
110 
111 ORTP_PUBLIC bool_t fmtp_get_value(const char *fmtp, const char *param_name, char *result, size_t result_len);
112 
113 #define payload_type_set_user_data(pt,p) (pt)->user_data=(p)
114 #define payload_type_get_user_data(pt) ((pt)->user_data)
115 
116 
117 /* some payload types */
118 /* audio */
119 ORTP_VAR_PUBLIC PayloadType payload_type_pcmu8000;
120 ORTP_VAR_PUBLIC PayloadType payload_type_pcma8000;
121 ORTP_VAR_PUBLIC PayloadType payload_type_pcm8000;
122 ORTP_VAR_PUBLIC PayloadType payload_type_l16_mono;
123 ORTP_VAR_PUBLIC PayloadType payload_type_l16_stereo;
124 ORTP_VAR_PUBLIC PayloadType payload_type_lpc1016;
125 ORTP_VAR_PUBLIC PayloadType payload_type_g729;
126 ORTP_VAR_PUBLIC PayloadType payload_type_g7231;
127 ORTP_VAR_PUBLIC PayloadType payload_type_g7221;
128 ORTP_VAR_PUBLIC PayloadType payload_type_cn;
129 ORTP_VAR_PUBLIC PayloadType payload_type_g726_40;
130 ORTP_VAR_PUBLIC PayloadType payload_type_g726_32;
131 ORTP_VAR_PUBLIC PayloadType payload_type_g726_24;
132 ORTP_VAR_PUBLIC PayloadType payload_type_g726_16;
133 ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_40;
134 ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_32;
135 ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_24;
136 ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_16;
137 ORTP_VAR_PUBLIC PayloadType payload_type_gsm;
138 ORTP_VAR_PUBLIC PayloadType payload_type_lpc;
139 ORTP_VAR_PUBLIC PayloadType payload_type_lpc1015;
140 ORTP_VAR_PUBLIC PayloadType payload_type_speex_nb;
141 ORTP_VAR_PUBLIC PayloadType payload_type_speex_wb;
142 ORTP_VAR_PUBLIC PayloadType payload_type_speex_uwb;
143 ORTP_VAR_PUBLIC PayloadType payload_type_ilbc;
144 ORTP_VAR_PUBLIC PayloadType payload_type_amr;
145 ORTP_VAR_PUBLIC PayloadType payload_type_amrwb;
146 ORTP_VAR_PUBLIC PayloadType payload_type_truespeech;
147 ORTP_VAR_PUBLIC PayloadType payload_type_evrc0;
148 ORTP_VAR_PUBLIC PayloadType payload_type_evrcb0;
149 ORTP_VAR_PUBLIC PayloadType payload_type_silk_nb;
150 ORTP_VAR_PUBLIC PayloadType payload_type_silk_mb;
151 ORTP_VAR_PUBLIC PayloadType payload_type_silk_wb;
152 ORTP_VAR_PUBLIC PayloadType payload_type_silk_swb;
153 ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_16k;
154 ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_22k;
155 ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_32k;
156 ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_44k;
157 ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_48k;
158 ORTP_VAR_PUBLIC PayloadType payload_type_opus;
159 ORTP_VAR_PUBLIC PayloadType payload_type_isac;
160 ORTP_VAR_PUBLIC PayloadType payload_type_gsm_efr;
161 
162 /* video */
163 ORTP_VAR_PUBLIC PayloadType payload_type_mpv;
164 ORTP_VAR_PUBLIC PayloadType payload_type_h261;
165 ORTP_VAR_PUBLIC PayloadType payload_type_h263;
166 ORTP_VAR_PUBLIC PayloadType payload_type_h263_1998;
167 ORTP_VAR_PUBLIC PayloadType payload_type_h263_2000;
168 ORTP_VAR_PUBLIC PayloadType payload_type_mp4v;
169 ORTP_VAR_PUBLIC PayloadType payload_type_theora;
170 ORTP_VAR_PUBLIC PayloadType payload_type_h264;
171 ORTP_VAR_PUBLIC PayloadType payload_type_x_snow;
172 ORTP_VAR_PUBLIC PayloadType payload_type_jpeg;
173 ORTP_VAR_PUBLIC PayloadType payload_type_vp8;
174 
175 ORTP_VAR_PUBLIC PayloadType payload_type_g722;
176 
177 /* text */
178 ORTP_VAR_PUBLIC PayloadType payload_type_t140;
179 ORTP_VAR_PUBLIC PayloadType payload_type_t140_red;
180 
181 /* non standard file transfer over UDP */
182 ORTP_VAR_PUBLIC PayloadType payload_type_x_udpftp;
183 
184 /* telephone-event */
185 ORTP_VAR_PUBLIC PayloadType payload_type_telephone_event;
186 
187 #ifdef __cplusplus
188 }
189 #endif
190 
191 #endif
Definition: payloadtype.h:67
int clock_rate
Definition: payloadtype.h:70
ORTP_PUBLIC void payload_type_destroy(PayloadType *pt)
Definition: payloadtype.c:134
Definition: payloadtype.h:62
char * mime_type
Definition: payloadtype.h:76
unsigned char features
Definition: payloadtype.h:63
ORTP_PUBLIC void payload_type_set_recv_fmtp(PayloadType *pt, const char *fmtp)
Definition: payloadtype.c:77
ORTP_PUBLIC bool_t fmtp_get_value(const char *fmtp, const char *param_name, char *result, size_t result_len)
Definition: payloadtype.c:183
int channels
Definition: payloadtype.h:77
ORTP_PUBLIC void payload_type_set_send_fmtp(PayloadType *pt, const char *fmtp)
Definition: payloadtype.c:90
uint16_t trr_interval
Definition: payloadtype.h:64
int type
Definition: payloadtype.h:69