oRTP 0.22.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 /* private flags for future use by ortp */
38 #define PAYLOAD_TYPE_PRIV1 (1<<1)
39 #define PAYLOAD_TYPE_PRIV2 (1<<2)
40 #define PAYLOAD_TYPE_PRIV3 (1<<3)
41 /* user flags, can be used by the application on top of oRTP */
42 #define PAYLOAD_TYPE_USER_FLAG_0 (1<<4)
43 #define PAYLOAD_TYPE_USER_FLAG_1 (1<<5)
44 #define PAYLOAD_TYPE_USER_FLAG_2 (1<<6)
45 /* ask for more if you need*/
46
47 #define PAYLOAD_AUDIO_CONTINUOUS 0
48 #define PAYLOAD_AUDIO_PACKETIZED 1
49 #define PAYLOAD_VIDEO 2
50 #define PAYLOAD_TEXT 4
51 #define PAYLOAD_OTHER 3 /* ?? */
52
53 struct _PayloadType
54 {
55 int type;
56 int clock_rate;
57 char bits_per_sample; /* in case of continuous audio data */
58 char *zero_pattern;
59 int pattern_length;
60 /* other useful information for the application*/
61 int normal_bitrate; /*in bit/s */
62 char *mime_type;
63 int channels;
64 char *recv_fmtp; /* various format parameters for the incoming stream */
65 char *send_fmtp; /* various format parameters for the outgoing stream */
66 int flags;
67 void *user_data;
68 };
69
70 #ifndef PayloadType_defined
71 #define PayloadType_defined
72 typedef struct _PayloadType PayloadType;
73 #endif
74
75 #define payload_type_set_flag(pt,flag) (pt)->flags|=((int)flag)
76 #define payload_type_unset_flag(pt,flag) (pt)->flags&=(~(int)flag)
77 #define payload_type_get_flags(pt) (pt)->flags
78
79
80 ORTP_PUBLIC PayloadType *payload_type_new(void);
81 ORTP_PUBLIC PayloadType *payload_type_clone(PayloadType *payload);
82 ORTP_PUBLIC char *payload_type_get_rtpmap(PayloadType *pt);
83 ORTP_PUBLIC void payload_type_destroy(PayloadType *pt);
84 ORTP_PUBLIC void payload_type_set_recv_fmtp(PayloadType *pt, const char *fmtp);
85 ORTP_PUBLIC void payload_type_set_send_fmtp(PayloadType *pt, const char *fmtp);
86 ORTP_PUBLIC void payload_type_append_recv_fmtp(PayloadType *pt, const char *fmtp);
87 ORTP_PUBLIC void payload_type_append_send_fmtp(PayloadType *pt, const char *fmtp);
88
89 #define payload_type_get_bitrate(pt) ((pt)->normal_bitrate)
90 #define payload_type_get_rate(pt) ((pt)->clock_rate)
91 #define payload_type_get_mime(pt) ((pt)->mime_type)
92
93 ORTP_PUBLIC bool_t fmtp_get_value(const char *fmtp, const char *param_name, char *result, size_t result_len);
94
95 #define payload_type_set_user_data(pt,p) (pt)->user_data=(p)
96 #define payload_type_get_user_data(pt) ((pt)->user_data)
97
98
99 /* some payload types */
100 /* audio */
101 ORTP_VAR_PUBLIC PayloadType payload_type_pcmu8000;
102 ORTP_VAR_PUBLIC PayloadType payload_type_pcma8000;
103 ORTP_VAR_PUBLIC PayloadType payload_type_pcm8000;
104 ORTP_VAR_PUBLIC PayloadType payload_type_l16_mono;
105 ORTP_VAR_PUBLIC PayloadType payload_type_l16_stereo;
106 ORTP_VAR_PUBLIC PayloadType payload_type_lpc1016;
107 ORTP_VAR_PUBLIC PayloadType payload_type_g729;
108 ORTP_VAR_PUBLIC PayloadType payload_type_g7231;
109 ORTP_VAR_PUBLIC PayloadType payload_type_g7221;
110 ORTP_VAR_PUBLIC PayloadType payload_type_g726_40;
111 ORTP_VAR_PUBLIC PayloadType payload_type_g726_32;
112 ORTP_VAR_PUBLIC PayloadType payload_type_g726_24;
113 ORTP_VAR_PUBLIC PayloadType payload_type_g726_16;
114 ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_40;
115 ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_32;
116 ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_24;
117 ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_16;
118 ORTP_VAR_PUBLIC PayloadType payload_type_gsm;
119 ORTP_VAR_PUBLIC PayloadType payload_type_lpc;
120 ORTP_VAR_PUBLIC PayloadType payload_type_lpc1015;
121 ORTP_VAR_PUBLIC PayloadType payload_type_speex_nb;
122 ORTP_VAR_PUBLIC PayloadType payload_type_speex_wb;
123 ORTP_VAR_PUBLIC PayloadType payload_type_speex_uwb;
124 ORTP_VAR_PUBLIC PayloadType payload_type_ilbc;
125 ORTP_VAR_PUBLIC PayloadType payload_type_amr;
126 ORTP_VAR_PUBLIC PayloadType payload_type_amrwb;
127 ORTP_VAR_PUBLIC PayloadType payload_type_truespeech;
128 ORTP_VAR_PUBLIC PayloadType payload_type_evrc0;
129 ORTP_VAR_PUBLIC PayloadType payload_type_evrcb0;
130 ORTP_VAR_PUBLIC PayloadType payload_type_silk_nb;
131 ORTP_VAR_PUBLIC PayloadType payload_type_silk_mb;
132 ORTP_VAR_PUBLIC PayloadType payload_type_silk_wb;
133 ORTP_VAR_PUBLIC PayloadType payload_type_silk_swb;
134 ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_22k;
135 ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_44k;
136 ORTP_VAR_PUBLIC PayloadType payload_type_opus;
137
138 /* video */
139 ORTP_VAR_PUBLIC PayloadType payload_type_mpv;
140 ORTP_VAR_PUBLIC PayloadType payload_type_h261;
141 ORTP_VAR_PUBLIC PayloadType payload_type_h263;
142 ORTP_VAR_PUBLIC PayloadType payload_type_h263_1998;
143 ORTP_VAR_PUBLIC PayloadType payload_type_h263_2000;
144 ORTP_VAR_PUBLIC PayloadType payload_type_mp4v;
145 ORTP_VAR_PUBLIC PayloadType payload_type_theora;
146 ORTP_VAR_PUBLIC PayloadType payload_type_h264;
147 ORTP_VAR_PUBLIC PayloadType payload_type_x_snow;
148 ORTP_VAR_PUBLIC PayloadType payload_type_jpeg;
149 ORTP_VAR_PUBLIC PayloadType payload_type_vp8;
150
151 ORTP_VAR_PUBLIC PayloadType payload_type_g722;
152
153 /* text */
154 ORTP_VAR_PUBLIC PayloadType payload_type_t140;
155 ORTP_VAR_PUBLIC PayloadType payload_type_t140_red;
156
157 /* non standard file transfer over UDP */
158 ORTP_VAR_PUBLIC PayloadType payload_type_x_udpftp;
159
160 /* telephone-event */
161 ORTP_VAR_PUBLIC PayloadType payload_type_telephone_event;
162
163 #ifdef __cplusplus
164 }
165 #endif
166
167 #endif