|
1 /* GStreamer |
|
2 * Copyright (C) <2005> Philippe Khalaf <burger@speedy.org> |
|
3 * <2005> Wim Taymans <wim@fluendo.com> |
|
4 * |
|
5 * gstrtpbuffer.h: various helper functions to manipulate buffers |
|
6 * with RTP payload. |
|
7 * |
|
8 * This library is free software; you can redistribute it and/or |
|
9 * modify it under the terms of the GNU Library General Public |
|
10 * License as published by the Free Software Foundation; either |
|
11 * version 2 of the License, or (at your option) any later version. |
|
12 * |
|
13 * This library is distributed in the hope that it will be useful, |
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
16 * Library General Public License for more details. |
|
17 * |
|
18 * You should have received a copy of the GNU Library General Public |
|
19 * License along with this library; if not, write to the |
|
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|
21 * Boston, MA 02111-1307, USA. |
|
22 */ |
|
23 |
|
24 #ifndef __GST_RTPBUFFER_H__ |
|
25 #define __GST_RTPBUFFER_H__ |
|
26 |
|
27 #include <gst/gst.h> |
|
28 #include <gst/rtp/gstrtppayloads.h> |
|
29 |
|
30 G_BEGIN_DECLS |
|
31 |
|
32 /** |
|
33 * GST_RTP_VERSION: |
|
34 * |
|
35 * The supported RTP version 2. |
|
36 */ |
|
37 #define GST_RTP_VERSION 2 |
|
38 |
|
39 /* creating buffers */ |
|
40 #ifdef __SYMBIAN32__ |
|
41 IMPORT_C |
|
42 #endif |
|
43 |
|
44 void gst_rtp_buffer_allocate_data (GstBuffer *buffer, guint payload_len, |
|
45 guint8 pad_len, guint8 csrc_count); |
|
46 #ifdef __SYMBIAN32__ |
|
47 IMPORT_C |
|
48 #endif |
|
49 |
|
50 |
|
51 GstBuffer* gst_rtp_buffer_new_take_data (gpointer data, guint len); |
|
52 #ifdef __SYMBIAN32__ |
|
53 IMPORT_C |
|
54 #endif |
|
55 |
|
56 GstBuffer* gst_rtp_buffer_new_copy_data (gpointer data, guint len); |
|
57 #ifdef __SYMBIAN32__ |
|
58 IMPORT_C |
|
59 #endif |
|
60 |
|
61 GstBuffer* gst_rtp_buffer_new_allocate (guint payload_len, guint8 pad_len, guint8 csrc_count); |
|
62 #ifdef __SYMBIAN32__ |
|
63 IMPORT_C |
|
64 #endif |
|
65 |
|
66 GstBuffer* gst_rtp_buffer_new_allocate_len (guint packet_len, guint8 pad_len, guint8 csrc_count); |
|
67 #ifdef __SYMBIAN32__ |
|
68 IMPORT_C |
|
69 #endif |
|
70 |
|
71 |
|
72 guint gst_rtp_buffer_calc_header_len (guint8 csrc_count); |
|
73 #ifdef __SYMBIAN32__ |
|
74 IMPORT_C |
|
75 #endif |
|
76 |
|
77 guint gst_rtp_buffer_calc_packet_len (guint payload_len, guint8 pad_len, guint8 csrc_count); |
|
78 #ifdef __SYMBIAN32__ |
|
79 IMPORT_C |
|
80 #endif |
|
81 |
|
82 guint gst_rtp_buffer_calc_payload_len (guint packet_len, guint8 pad_len, guint8 csrc_count); |
|
83 #ifdef __SYMBIAN32__ |
|
84 IMPORT_C |
|
85 #endif |
|
86 |
|
87 |
|
88 gboolean gst_rtp_buffer_validate_data (guint8 *data, guint len); |
|
89 #ifdef __SYMBIAN32__ |
|
90 IMPORT_C |
|
91 #endif |
|
92 |
|
93 gboolean gst_rtp_buffer_validate (GstBuffer *buffer); |
|
94 #ifdef __SYMBIAN32__ |
|
95 IMPORT_C |
|
96 #endif |
|
97 |
|
98 |
|
99 void gst_rtp_buffer_set_packet_len (GstBuffer *buffer, guint len); |
|
100 #ifdef __SYMBIAN32__ |
|
101 IMPORT_C |
|
102 #endif |
|
103 |
|
104 guint gst_rtp_buffer_get_packet_len (GstBuffer *buffer); |
|
105 #ifdef __SYMBIAN32__ |
|
106 IMPORT_C |
|
107 #endif |
|
108 |
|
109 |
|
110 guint gst_rtp_buffer_get_header_len (GstBuffer *buffer); |
|
111 #ifdef __SYMBIAN32__ |
|
112 IMPORT_C |
|
113 #endif |
|
114 |
|
115 |
|
116 guint8 gst_rtp_buffer_get_version (GstBuffer *buffer); |
|
117 #ifdef __SYMBIAN32__ |
|
118 IMPORT_C |
|
119 #endif |
|
120 |
|
121 void gst_rtp_buffer_set_version (GstBuffer *buffer, guint8 version); |
|
122 #ifdef __SYMBIAN32__ |
|
123 IMPORT_C |
|
124 #endif |
|
125 |
|
126 |
|
127 gboolean gst_rtp_buffer_get_padding (GstBuffer *buffer); |
|
128 #ifdef __SYMBIAN32__ |
|
129 IMPORT_C |
|
130 #endif |
|
131 |
|
132 void gst_rtp_buffer_set_padding (GstBuffer *buffer, gboolean padding); |
|
133 #ifdef __SYMBIAN32__ |
|
134 IMPORT_C |
|
135 #endif |
|
136 |
|
137 void gst_rtp_buffer_pad_to (GstBuffer *buffer, guint len); |
|
138 #ifdef __SYMBIAN32__ |
|
139 IMPORT_C |
|
140 #endif |
|
141 |
|
142 |
|
143 gboolean gst_rtp_buffer_get_extension (GstBuffer *buffer); |
|
144 #ifdef __SYMBIAN32__ |
|
145 IMPORT_C |
|
146 #endif |
|
147 |
|
148 void gst_rtp_buffer_set_extension (GstBuffer *buffer, gboolean extension); |
|
149 #ifdef __SYMBIAN32__ |
|
150 IMPORT_C |
|
151 #endif |
|
152 |
|
153 gboolean gst_rtp_buffer_get_extension_data (GstBuffer *buffer, guint16 *bits, |
|
154 gpointer *data, guint *wordlen); |
|
155 #ifdef __SYMBIAN32__ |
|
156 IMPORT_C |
|
157 #endif |
|
158 |
|
159 gboolean gst_rtp_buffer_set_extension_data (GstBuffer *buffer, guint16 bits, guint16 length); |
|
160 #ifdef __SYMBIAN32__ |
|
161 IMPORT_C |
|
162 #endif |
|
163 |
|
164 |
|
165 guint32 gst_rtp_buffer_get_ssrc (GstBuffer *buffer); |
|
166 #ifdef __SYMBIAN32__ |
|
167 IMPORT_C |
|
168 #endif |
|
169 |
|
170 void gst_rtp_buffer_set_ssrc (GstBuffer *buffer, guint32 ssrc); |
|
171 #ifdef __SYMBIAN32__ |
|
172 IMPORT_C |
|
173 #endif |
|
174 |
|
175 |
|
176 guint8 gst_rtp_buffer_get_csrc_count (GstBuffer *buffer); |
|
177 #ifdef __SYMBIAN32__ |
|
178 IMPORT_C |
|
179 #endif |
|
180 |
|
181 guint32 gst_rtp_buffer_get_csrc (GstBuffer *buffer, guint8 idx); |
|
182 #ifdef __SYMBIAN32__ |
|
183 IMPORT_C |
|
184 #endif |
|
185 |
|
186 void gst_rtp_buffer_set_csrc (GstBuffer *buffer, guint8 idx, guint32 csrc); |
|
187 #ifdef __SYMBIAN32__ |
|
188 IMPORT_C |
|
189 #endif |
|
190 |
|
191 |
|
192 gboolean gst_rtp_buffer_get_marker (GstBuffer *buffer); |
|
193 #ifdef __SYMBIAN32__ |
|
194 IMPORT_C |
|
195 #endif |
|
196 |
|
197 void gst_rtp_buffer_set_marker (GstBuffer *buffer, gboolean marker); |
|
198 #ifdef __SYMBIAN32__ |
|
199 IMPORT_C |
|
200 #endif |
|
201 |
|
202 |
|
203 guint8 gst_rtp_buffer_get_payload_type (GstBuffer *buffer); |
|
204 #ifdef __SYMBIAN32__ |
|
205 IMPORT_C |
|
206 #endif |
|
207 |
|
208 void gst_rtp_buffer_set_payload_type (GstBuffer *buffer, guint8 payload_type); |
|
209 #ifdef __SYMBIAN32__ |
|
210 IMPORT_C |
|
211 #endif |
|
212 |
|
213 |
|
214 guint16 gst_rtp_buffer_get_seq (GstBuffer *buffer); |
|
215 #ifdef __SYMBIAN32__ |
|
216 IMPORT_C |
|
217 #endif |
|
218 |
|
219 void gst_rtp_buffer_set_seq (GstBuffer *buffer, guint16 seq); |
|
220 #ifdef __SYMBIAN32__ |
|
221 IMPORT_C |
|
222 #endif |
|
223 |
|
224 |
|
225 guint32 gst_rtp_buffer_get_timestamp (GstBuffer *buffer); |
|
226 #ifdef __SYMBIAN32__ |
|
227 IMPORT_C |
|
228 #endif |
|
229 |
|
230 void gst_rtp_buffer_set_timestamp (GstBuffer *buffer, guint32 timestamp); |
|
231 #ifdef __SYMBIAN32__ |
|
232 IMPORT_C |
|
233 #endif |
|
234 |
|
235 |
|
236 GstBuffer* gst_rtp_buffer_get_payload_buffer (GstBuffer *buffer); |
|
237 #ifdef __SYMBIAN32__ |
|
238 IMPORT_C |
|
239 #endif |
|
240 |
|
241 GstBuffer* gst_rtp_buffer_get_payload_subbuffer (GstBuffer *buffer, guint offset, guint len); |
|
242 #ifdef __SYMBIAN32__ |
|
243 IMPORT_C |
|
244 #endif |
|
245 |
|
246 |
|
247 guint gst_rtp_buffer_get_payload_len (GstBuffer *buffer); |
|
248 #ifdef __SYMBIAN32__ |
|
249 IMPORT_C |
|
250 #endif |
|
251 |
|
252 gpointer gst_rtp_buffer_get_payload (GstBuffer *buffer); |
|
253 |
|
254 /* some helpers */ |
|
255 #ifdef __SYMBIAN32__ |
|
256 IMPORT_C |
|
257 #endif |
|
258 |
|
259 guint32 gst_rtp_buffer_default_clock_rate (guint8 payload_type); |
|
260 #ifdef __SYMBIAN32__ |
|
261 IMPORT_C |
|
262 #endif |
|
263 |
|
264 gint gst_rtp_buffer_compare_seqnum (guint16 seqnum1, guint16 seqnum2); |
|
265 #ifdef __SYMBIAN32__ |
|
266 IMPORT_C |
|
267 #endif |
|
268 |
|
269 guint64 gst_rtp_buffer_ext_timestamp (guint64 *exttimestamp, guint32 timestamp); |
|
270 |
|
271 G_END_DECLS |
|
272 |
|
273 #endif /* __GST_RTPBUFFER_H__ */ |
|
274 |