Mercurial > libavformat.hg
comparison avio.h @ 2771:d52c718e83f9 libavformat
Use dynamically allocated ByteIOContext in AVFormatContext
patch by: Bj«Órn Axelsson, bjorn d axelsson a intinor d se
thread: [PATCH] Remove static ByteIOContexts, 06 nov 2007
author | andoma |
---|---|
date | Wed, 21 Nov 2007 07:41:00 +0000 |
parents | fdeb230c8ced |
children | 50e2307414ee |
comparison
equal
deleted
inserted
replaced
2770:a7e42cf4b364 | 2771:d52c718e83f9 |
---|---|
199 return s->is_streamed; | 199 return s->is_streamed; |
200 } | 200 } |
201 | 201 |
202 /** @note when opened as read/write, the buffers are only used for | 202 /** @note when opened as read/write, the buffers are only used for |
203 writing */ | 203 writing */ |
204 int url_fdopen(ByteIOContext *s, URLContext *h); | 204 int url_fdopen(ByteIOContext **s, URLContext *h); |
205 | 205 |
206 /** @warning must be called before any I/O */ | 206 /** @warning must be called before any I/O */ |
207 int url_setbufsize(ByteIOContext *s, int buf_size); | 207 int url_setbufsize(ByteIOContext *s, int buf_size); |
208 /** Reset the buffer for reading or writing. | 208 /** Reset the buffer for reading or writing. |
209 * @note Will drop any data currently in the buffer without transmitting it. | 209 * @note Will drop any data currently in the buffer without transmitting it. |
211 * to set up the buffer for writing. */ | 211 * to set up the buffer for writing. */ |
212 int url_resetbuf(ByteIOContext *s, int flags); | 212 int url_resetbuf(ByteIOContext *s, int flags); |
213 | 213 |
214 /** @note when opened as read/write, the buffers are only used for | 214 /** @note when opened as read/write, the buffers are only used for |
215 writing */ | 215 writing */ |
216 int url_fopen(ByteIOContext *s, const char *filename, int flags); | 216 int url_fopen(ByteIOContext **s, const char *filename, int flags); |
217 int url_fclose(ByteIOContext *s); | 217 int url_fclose(ByteIOContext *s); |
218 URLContext *url_fileno(ByteIOContext *s); | 218 URLContext *url_fileno(ByteIOContext *s); |
219 | 219 |
220 /** | 220 /** |
221 * Return the maximum packet size associated to packetized buffered file | 221 * Return the maximum packet size associated to packetized buffered file |
225 * @param s buffered file handle | 225 * @param s buffered file handle |
226 * @return maximum packet size in bytes | 226 * @return maximum packet size in bytes |
227 */ | 227 */ |
228 int url_fget_max_packet_size(ByteIOContext *s); | 228 int url_fget_max_packet_size(ByteIOContext *s); |
229 | 229 |
230 int url_open_buf(ByteIOContext *s, uint8_t *buf, int buf_size, int flags); | 230 int url_open_buf(ByteIOContext **s, uint8_t *buf, int buf_size, int flags); |
231 | 231 |
232 /** return the written or read size */ | 232 /** return the written or read size */ |
233 int url_close_buf(ByteIOContext *s); | 233 int url_close_buf(ByteIOContext *s); |
234 | 234 |
235 /** | 235 /** |
236 * Open a write only memory stream. | 236 * Open a write only memory stream. |
237 * | 237 * |
238 * @param s new IO context | 238 * @param s new IO context |
239 * @return zero if no error. | 239 * @return zero if no error. |
240 */ | 240 */ |
241 int url_open_dyn_buf(ByteIOContext *s); | 241 int url_open_dyn_buf(ByteIOContext **s); |
242 | 242 |
243 /** | 243 /** |
244 * Open a write only packetized memory stream with a maximum packet | 244 * Open a write only packetized memory stream with a maximum packet |
245 * size of 'max_packet_size'. The stream is stored in a memory buffer | 245 * size of 'max_packet_size'. The stream is stored in a memory buffer |
246 * with a big endian 4 byte header giving the packet size in bytes. | 246 * with a big endian 4 byte header giving the packet size in bytes. |
247 * | 247 * |
248 * @param s new IO context | 248 * @param s new IO context |
249 * @param max_packet_size maximum packet size (must be > 0) | 249 * @param max_packet_size maximum packet size (must be > 0) |
250 * @return zero if no error. | 250 * @return zero if no error. |
251 */ | 251 */ |
252 int url_open_dyn_packet_buf(ByteIOContext *s, int max_packet_size); | 252 int url_open_dyn_packet_buf(ByteIOContext **s, int max_packet_size); |
253 | 253 |
254 /** | 254 /** |
255 * Return the written size and a pointer to the buffer. The buffer | 255 * Return the written size and a pointer to the buffer. The buffer |
256 * must be freed with av_free(). | 256 * must be freed with av_free(). |
257 * @param s IO context | 257 * @param s IO context |