Statistics
| Branch: | Revision:

ffmpeg / libavformat / avio.h @ fe174fc8

History | View | Annotate | Download (21.3 KB)

1
/*
2
 * copyright (c) 2001 Fabrice Bellard
3
 *
4
 * This file is part of FFmpeg.
5
 *
6
 * FFmpeg is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU Lesser General Public
8
 * License as published by the Free Software Foundation; either
9
 * version 2.1 of the License, or (at your option) any later version.
10
 *
11
 * FFmpeg is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with FFmpeg; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
 */
20
#ifndef AVFORMAT_AVIO_H
21
#define AVFORMAT_AVIO_H
22

    
23
/**
24
 * @file
25
 * unbuffered I/O operations
26
 *
27
 * @warning This file has to be considered an internal but installed
28
 * header, so it should not be directly included in your projects.
29
 */
30

    
31
#include <stdint.h>
32

    
33
#include "libavutil/common.h"
34
#include "libavutil/log.h"
35

    
36
#include "libavformat/version.h"
37

    
38
/* unbuffered I/O */
39

    
40
/**
41
 * URL Context.
42
 * New fields can be added to the end with minor version bumps.
43
 * Removal, reordering and changes to existing fields require a major
44
 * version bump.
45
 * sizeof(URLContext) must not be used outside libav*.
46
 */
47
typedef struct URLContext {
48
#if FF_API_URL_CLASS
49
    const AVClass *av_class; ///< information for av_log(). Set by url_open().
50
#endif
51
    struct URLProtocol *prot;
52
    int flags;
53
    int is_streamed;  /**< true if streamed (no seek possible), default = false */
54
    int max_packet_size;  /**< if non zero, the stream is packetized with this max packet size */
55
    void *priv_data;
56
    char *filename; /**< specified URL */
57
    int is_connected;
58
} URLContext;
59

    
60
typedef struct URLPollEntry {
61
    URLContext *handle;
62
    int events;
63
    int revents;
64
} URLPollEntry;
65

    
66
/**
67
 * @defgroup open_modes URL open modes
68
 * The flags argument to url_open and cosins must be one of the following
69
 * constants, optionally ORed with other flags.
70
 * @{
71
 */
72
#define URL_RDONLY 0  /**< read-only */
73
#define URL_WRONLY 1  /**< write-only */
74
#define URL_RDWR   2  /**< read-write */
75
/**
76
 * @}
77
 */
78

    
79
/**
80
 * Use non-blocking mode.
81
 * If this flag is set, operations on the context will return
82
 * AVERROR(EAGAIN) if they can not be performed immediately.
83
 * If this flag is not set, operations on the context will never return
84
 * AVERROR(EAGAIN).
85
 * Note that this flag does not affect the opening/connecting of the
86
 * context. Connecting a protocol will always block if necessary (e.g. on
87
 * network protocols) but never hang (e.g. on busy devices).
88
 * Warning: non-blocking protocols is work-in-progress; this flag may be
89
 * silently ignored.
90
 */
91
#define URL_FLAG_NONBLOCK 4
92

    
93
typedef int URLInterruptCB(void);
94

    
95
/**
96
 * Create a URLContext for accessing to the resource indicated by
97
 * url, and open it using the URLProtocol up.
98
 *
99
 * @param puc pointer to the location where, in case of success, the
100
 * function puts the pointer to the created URLContext
101
 * @param flags flags which control how the resource indicated by url
102
 * is to be opened
103
 * @return 0 in case of success, a negative value corresponding to an
104
 * AVERROR code in case of failure
105
 */
106
int url_open_protocol (URLContext **puc, struct URLProtocol *up,
107
                       const char *url, int flags);
108

    
109
/**
110
 * Create a URLContext for accessing to the resource indicated by
111
 * url, but do not initiate the connection yet.
112
 *
113
 * @param puc pointer to the location where, in case of success, the
114
 * function puts the pointer to the created URLContext
115
 * @param flags flags which control how the resource indicated by url
116
 * is to be opened
117
 * @return 0 in case of success, a negative value corresponding to an
118
 * AVERROR code in case of failure
119
 */
120
int url_alloc(URLContext **h, const char *url, int flags);
121

    
122
/**
123
 * Connect an URLContext that has been allocated by url_alloc
124
 */
125
int url_connect(URLContext *h);
126

    
127
/**
128
 * Create an URLContext for accessing to the resource indicated by
129
 * url, and open it.
130
 *
131
 * @param puc pointer to the location where, in case of success, the
132
 * function puts the pointer to the created URLContext
133
 * @param flags flags which control how the resource indicated by url
134
 * is to be opened
135
 * @return 0 in case of success, a negative value corresponding to an
136
 * AVERROR code in case of failure
137
 */
138
int url_open(URLContext **h, const char *url, int flags);
139

    
140
/**
141
 * Read up to size bytes from the resource accessed by h, and store
142
 * the read bytes in buf.
143
 *
144
 * @return The number of bytes actually read, or a negative value
145
 * corresponding to an AVERROR code in case of error. A value of zero
146
 * indicates that it is not possible to read more from the accessed
147
 * resource (except if the value of the size argument is also zero).
148
 */
149
int url_read(URLContext *h, unsigned char *buf, int size);
150

    
151
/**
152
 * Read as many bytes as possible (up to size), calling the
153
 * read function multiple times if necessary.
154
 * Will also retry if the read function returns AVERROR(EAGAIN).
155
 * This makes special short-read handling in applications
156
 * unnecessary, if the return value is < size then it is
157
 * certain there was either an error or the end of file was reached.
158
 */
159
int url_read_complete(URLContext *h, unsigned char *buf, int size);
160

    
161
/**
162
 * Write size bytes from buf to the resource accessed by h.
163
 *
164
 * @return the number of bytes actually written, or a negative value
165
 * corresponding to an AVERROR code in case of failure
166
 */
167
int url_write(URLContext *h, const unsigned char *buf, int size);
168

    
169
/**
170
 * Passing this as the "whence" parameter to a seek function causes it to
171
 * return the filesize without seeking anywhere. Supporting this is optional.
172
 * If it is not supported then the seek function will return <0.
173
 */
174
#define AVSEEK_SIZE 0x10000
175

    
176
/**
177
 * Change the position that will be used by the next read/write
178
 * operation on the resource accessed by h.
179
 *
180
 * @param pos specifies the new position to set
181
 * @param whence specifies how pos should be interpreted, it must be
182
 * one of SEEK_SET (seek from the beginning), SEEK_CUR (seek from the
183
 * current position), SEEK_END (seek from the end), or AVSEEK_SIZE
184
 * (return the filesize of the requested resource, pos is ignored).
185
 * @return a negative value corresponding to an AVERROR code in case
186
 * of failure, or the resulting file position, measured in bytes from
187
 * the beginning of the file. You can use this feature together with
188
 * SEEK_CUR to read the current file position.
189
 */
190
int64_t url_seek(URLContext *h, int64_t pos, int whence);
191

    
192
/**
193
 * Close the resource accessed by the URLContext h, and free the
194
 * memory used by it.
195
 *
196
 * @return a negative value if an error condition occurred, 0
197
 * otherwise
198
 */
199
int url_close(URLContext *h);
200

    
201
/**
202
 * Return a non-zero value if the resource indicated by url
203
 * exists, 0 otherwise.
204
 */
205
int url_exist(const char *url);
206

    
207
/**
208
 * Return the filesize of the resource accessed by h, AVERROR(ENOSYS)
209
 * if the operation is not supported by h, or another negative value
210
 * corresponding to an AVERROR error code in case of failure.
211
 */
212
int64_t url_filesize(URLContext *h);
213

    
214
/**
215
 * Return the file descriptor associated with this URL. For RTP, this
216
 * will return only the RTP file descriptor, not the RTCP file descriptor.
217
 *
218
 * @return the file descriptor associated with this URL, or <0 on error.
219
 */
220
int url_get_file_handle(URLContext *h);
221

    
222
/**
223
 * Return the maximum packet size associated to packetized file
224
 * handle. If the file is not packetized (stream like HTTP or file on
225
 * disk), then 0 is returned.
226
 *
227
 * @param h file handle
228
 * @return maximum packet size in bytes
229
 */
230
int url_get_max_packet_size(URLContext *h);
231

    
232
/**
233
 * Copy the filename of the resource accessed by h to buf.
234
 *
235
 * @param buf_size size in bytes of buf
236
 */
237
void url_get_filename(URLContext *h, char *buf, int buf_size);
238

    
239
/**
240
 * The callback is called in blocking functions to test regulary if
241
 * asynchronous interruption is needed. AVERROR(EINTR) is returned
242
 * in this case by the interrupted function. 'NULL' means no interrupt
243
 * callback is given.
244
 */
245
void url_set_interrupt_cb(URLInterruptCB *interrupt_cb);
246

    
247
/* not implemented */
248
int url_poll(URLPollEntry *poll_table, int n, int timeout);
249

    
250
/**
251
 * Pause and resume playing - only meaningful if using a network streaming
252
 * protocol (e.g. MMS).
253
 * @param pause 1 for pause, 0 for resume
254
 */
255
int av_url_read_pause(URLContext *h, int pause);
256

    
257
/**
258
 * Seek to a given timestamp relative to some component stream.
259
 * Only meaningful if using a network streaming protocol (e.g. MMS.).
260
 * @param stream_index The stream index that the timestamp is relative to.
261
 *        If stream_index is (-1) the timestamp should be in AV_TIME_BASE
262
 *        units from the beginning of the presentation.
263
 *        If a stream_index >= 0 is used and the protocol does not support
264
 *        seeking based on component streams, the call will fail with ENOTSUP.
265
 * @param timestamp timestamp in AVStream.time_base units
266
 *        or if there is no stream specified then in AV_TIME_BASE units.
267
 * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
268
 *        and AVSEEK_FLAG_ANY. The protocol may silently ignore
269
 *        AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
270
 *        fail with ENOTSUP if used and not supported.
271
 * @return >= 0 on success
272
 * @see AVInputFormat::read_seek
273
 */
274
int64_t av_url_read_seek(URLContext *h, int stream_index,
275
                         int64_t timestamp, int flags);
276

    
277
/**
278
 * Oring this flag as into the "whence" parameter to a seek function causes it to
279
 * seek by any means (like reopening and linear reading) or other normally unreasonble
280
 * means that can be extreemly slow.
281
 * This may be ignored by the seek code.
282
 */
283
#define AVSEEK_FORCE 0x20000
284

    
285
typedef struct URLProtocol {
286
    const char *name;
287
    int (*url_open)(URLContext *h, const char *url, int flags);
288
    int (*url_read)(URLContext *h, unsigned char *buf, int size);
289
    int (*url_write)(URLContext *h, const unsigned char *buf, int size);
290
    int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
291
    int (*url_close)(URLContext *h);
292
    struct URLProtocol *next;
293
    int (*url_read_pause)(URLContext *h, int pause);
294
    int64_t (*url_read_seek)(URLContext *h, int stream_index,
295
                             int64_t timestamp, int flags);
296
    int (*url_get_file_handle)(URLContext *h);
297
    int priv_data_size;
298
    const AVClass *priv_data_class;
299
} URLProtocol;
300

    
301
#if FF_API_REGISTER_PROTOCOL
302
extern URLProtocol *first_protocol;
303
#endif
304

    
305
extern URLInterruptCB *url_interrupt_cb;
306

    
307
/**
308
 * If protocol is NULL, returns the first registered protocol,
309
 * if protocol is non-NULL, returns the next registered protocol after protocol,
310
 * or NULL if protocol is the last one.
311
 */
312
URLProtocol *av_protocol_next(URLProtocol *p);
313

    
314
#if FF_API_REGISTER_PROTOCOL
315
/**
316
 * @deprecated Use av_register_protocol() instead.
317
 */
318
attribute_deprecated int register_protocol(URLProtocol *protocol);
319

    
320
/**
321
 * @deprecated Use av_register_protocol2() instead.
322
 */
323
attribute_deprecated int av_register_protocol(URLProtocol *protocol);
324
#endif
325

    
326
/**
327
 * Register the URLProtocol protocol.
328
 *
329
 * @param size the size of the URLProtocol struct referenced
330
 */
331
int av_register_protocol2(URLProtocol *protocol, int size);
332

    
333
/**
334
 * Bytestream IO Context.
335
 * New fields can be added to the end with minor version bumps.
336
 * Removal, reordering and changes to existing fields require a major
337
 * version bump.
338
 * sizeof(ByteIOContext) must not be used outside libav*.
339
 */
340
typedef struct {
341
    unsigned char *buffer;
342
    int buffer_size;
343
    unsigned char *buf_ptr, *buf_end;
344
    void *opaque;
345
    int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
346
    int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
347
    int64_t (*seek)(void *opaque, int64_t offset, int whence);
348
    int64_t pos; /**< position in the file of the current buffer */
349
    int must_flush; /**< true if the next seek should flush */
350
    int eof_reached; /**< true if eof reached */
351
    int write_flag;  /**< true if open for writing */
352
    int is_streamed;
353
    int max_packet_size;
354
    unsigned long checksum;
355
    unsigned char *checksum_ptr;
356
    unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
357
    int error;         ///< contains the error code or 0 if no error happened
358
    int (*read_pause)(void *opaque, int pause);
359
    int64_t (*read_seek)(void *opaque, int stream_index,
360
                         int64_t timestamp, int flags);
361
} ByteIOContext;
362

    
363
int init_put_byte(ByteIOContext *s,
364
                  unsigned char *buffer,
365
                  int buffer_size,
366
                  int write_flag,
367
                  void *opaque,
368
                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
369
                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
370
                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
371
ByteIOContext *av_alloc_put_byte(
372
                  unsigned char *buffer,
373
                  int buffer_size,
374
                  int write_flag,
375
                  void *opaque,
376
                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
377
                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
378
                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
379

    
380
void put_byte(ByteIOContext *s, int b);
381
void put_nbyte(ByteIOContext *s, int b, int count);
382
void put_buffer(ByteIOContext *s, const unsigned char *buf, int size);
383
void put_le64(ByteIOContext *s, uint64_t val);
384
void put_be64(ByteIOContext *s, uint64_t val);
385
void put_le32(ByteIOContext *s, unsigned int val);
386
void put_be32(ByteIOContext *s, unsigned int val);
387
void put_le24(ByteIOContext *s, unsigned int val);
388
void put_be24(ByteIOContext *s, unsigned int val);
389
void put_le16(ByteIOContext *s, unsigned int val);
390
void put_be16(ByteIOContext *s, unsigned int val);
391
void put_tag(ByteIOContext *s, const char *tag);
392

    
393
#if FF_API_OLD_AVIO
394
attribute_deprecated void put_strz(ByteIOContext *s, const char *buf);
395
#endif
396

    
397
/**
398
 * Write a NULL-terminated string.
399
 * @return number of bytes written.
400
 */
401
int avio_put_str(ByteIOContext *s, const char *str);
402

    
403
/**
404
 * Convert an UTF-8 string to UTF-16LE and write it.
405
 * @return number of bytes written.
406
 */
407
int avio_put_str16le(ByteIOContext *s, const char *str);
408

    
409
/**
410
 * fseek() equivalent for ByteIOContext.
411
 * @return new position or AVERROR.
412
 */
413
int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence);
414

    
415
/**
416
 * Skip given number of bytes forward.
417
 * @param offset number of bytes
418
 * @return 0 on success, <0 on error
419
 */
420
int url_fskip(ByteIOContext *s, int64_t offset);
421

    
422
/**
423
 * ftell() equivalent for ByteIOContext.
424
 * @return position or AVERROR.
425
 */
426
int64_t url_ftell(ByteIOContext *s);
427

    
428
/**
429
 * Get the filesize.
430
 * @return filesize or AVERROR
431
 */
432
int64_t url_fsize(ByteIOContext *s);
433

    
434
/**
435
 * feof() equivalent for ByteIOContext.
436
 * @return non zero if and only if end of file
437
 */
438
int url_feof(ByteIOContext *s);
439

    
440
int url_ferror(ByteIOContext *s);
441

    
442
int av_url_read_fpause(ByteIOContext *h, int pause);
443
int64_t av_url_read_fseek(ByteIOContext *h, int stream_index,
444
                          int64_t timestamp, int flags);
445

    
446
#define URL_EOF (-1)
447
/** @note return URL_EOF (-1) if EOF */
448
int url_fgetc(ByteIOContext *s);
449

    
450
/** @warning currently size is limited */
451
#ifdef __GNUC__
452
int url_fprintf(ByteIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
453
#else
454
int url_fprintf(ByteIOContext *s, const char *fmt, ...);
455
#endif
456

    
457
/** @note unlike fgets, the EOL character is not returned and a whole
458
    line is parsed. return NULL if first char read was EOF */
459
char *url_fgets(ByteIOContext *s, char *buf, int buf_size);
460

    
461
void put_flush_packet(ByteIOContext *s);
462

    
463

    
464
/**
465
 * Read size bytes from ByteIOContext into buf.
466
 * @return number of bytes read or AVERROR
467
 */
468
int get_buffer(ByteIOContext *s, unsigned char *buf, int size);
469

    
470
/**
471
 * Read size bytes from ByteIOContext into buf.
472
 * This reads at most 1 packet. If that is not enough fewer bytes will be
473
 * returned.
474
 * @return number of bytes read or AVERROR
475
 */
476
int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size);
477

    
478
/** @note return 0 if EOF, so you cannot use it if EOF handling is
479
    necessary */
480
int get_byte(ByteIOContext *s);
481
unsigned int get_le24(ByteIOContext *s);
482
unsigned int get_le32(ByteIOContext *s);
483
uint64_t get_le64(ByteIOContext *s);
484
unsigned int get_le16(ByteIOContext *s);
485

    
486
/**
487
 * Read a UTF-16 string from pb and convert it to UTF-8.
488
 * The reading will terminate when either a null or invalid character was
489
 * encountered or maxlen bytes have been read.
490
 * @return number of bytes read (is always <= maxlen)
491
 */
492
int avio_get_str16le(ByteIOContext *pb, int maxlen, char *buf, int buflen);
493
int avio_get_str16be(ByteIOContext *pb, int maxlen, char *buf, int buflen);
494

    
495
char *get_strz(ByteIOContext *s, char *buf, int maxlen);
496
unsigned int get_be16(ByteIOContext *s);
497
unsigned int get_be24(ByteIOContext *s);
498
unsigned int get_be32(ByteIOContext *s);
499
uint64_t get_be64(ByteIOContext *s);
500

    
501
uint64_t ff_get_v(ByteIOContext *bc);
502

    
503
static inline int url_is_streamed(ByteIOContext *s)
504
{
505
    return s->is_streamed;
506
}
507

    
508
/**
509
 * Create and initialize a ByteIOContext for accessing the
510
 * resource referenced by the URLContext h.
511
 * @note When the URLContext h has been opened in read+write mode, the
512
 * ByteIOContext can be used only for writing.
513
 *
514
 * @param s Used to return the pointer to the created ByteIOContext.
515
 * In case of failure the pointed to value is set to NULL.
516
 * @return 0 in case of success, a negative value corresponding to an
517
 * AVERROR code in case of failure
518
 */
519
int url_fdopen(ByteIOContext **s, URLContext *h);
520

    
521
/** @warning must be called before any I/O */
522
int url_setbufsize(ByteIOContext *s, int buf_size);
523
#if FF_API_URL_RESETBUF
524
/** Reset the buffer for reading or writing.
525
 * @note Will drop any data currently in the buffer without transmitting it.
526
 * @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY
527
 *        to set up the buffer for writing. */
528
int url_resetbuf(ByteIOContext *s, int flags);
529
#endif
530

    
531
/**
532
 * Rewind the ByteIOContext using the specified buffer containing the first buf_size bytes of the file.
533
 * Used after probing to avoid seeking.
534
 * Joins buf and s->buffer, taking any overlap into consideration.
535
 * @note s->buffer must overlap with buf or they can't be joined and the function fails
536
 * @note This function is NOT part of the public API
537
 *
538
 * @param s The read-only ByteIOContext to rewind
539
 * @param buf The probe buffer containing the first buf_size bytes of the file
540
 * @param buf_size The size of buf
541
 * @return 0 in case of success, a negative value corresponding to an
542
 * AVERROR code in case of failure
543
 */
544
int ff_rewind_with_probe_data(ByteIOContext *s, unsigned char *buf, int buf_size);
545

    
546
/**
547
 * Create and initialize a ByteIOContext for accessing the
548
 * resource indicated by url.
549
 * @note When the resource indicated by url has been opened in
550
 * read+write mode, the ByteIOContext can be used only for writing.
551
 *
552
 * @param s Used to return the pointer to the created ByteIOContext.
553
 * In case of failure the pointed to value is set to NULL.
554
 * @param flags flags which control how the resource indicated by url
555
 * is to be opened
556
 * @return 0 in case of success, a negative value corresponding to an
557
 * AVERROR code in case of failure
558
 */
559
int url_fopen(ByteIOContext **s, const char *url, int flags);
560

    
561
int url_fclose(ByteIOContext *s);
562
URLContext *url_fileno(ByteIOContext *s);
563

    
564
/**
565
 * Return the maximum packet size associated to packetized buffered file
566
 * handle. If the file is not packetized (stream like http or file on
567
 * disk), then 0 is returned.
568
 *
569
 * @param s buffered file handle
570
 * @return maximum packet size in bytes
571
 */
572
int url_fget_max_packet_size(ByteIOContext *s);
573

    
574
int url_open_buf(ByteIOContext **s, uint8_t *buf, int buf_size, int flags);
575

    
576
/** return the written or read size */
577
int url_close_buf(ByteIOContext *s);
578

    
579
/**
580
 * Open a write only memory stream.
581
 *
582
 * @param s new IO context
583
 * @return zero if no error.
584
 */
585
int url_open_dyn_buf(ByteIOContext **s);
586

    
587
/**
588
 * Open a write only packetized memory stream with a maximum packet
589
 * size of 'max_packet_size'.  The stream is stored in a memory buffer
590
 * with a big endian 4 byte header giving the packet size in bytes.
591
 *
592
 * @param s new IO context
593
 * @param max_packet_size maximum packet size (must be > 0)
594
 * @return zero if no error.
595
 */
596
int url_open_dyn_packet_buf(ByteIOContext **s, int max_packet_size);
597

    
598
/**
599
 * Return the written size and a pointer to the buffer. The buffer
600
 * must be freed with av_free(). If the buffer is opened with
601
 * url_open_dyn_buf, then padding of FF_INPUT_BUFFER_PADDING_SIZE is
602
 * added; if opened with url_open_dyn_packet_buf, no padding is added.
603
 *
604
 * @param s IO context
605
 * @param pbuffer pointer to a byte buffer
606
 * @return the length of the byte buffer
607
 */
608
int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer);
609

    
610
unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
611
                                    unsigned int len);
612
unsigned long get_checksum(ByteIOContext *s);
613
void init_checksum(ByteIOContext *s,
614
                   unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
615
                   unsigned long checksum);
616

    
617
/* udp.c */
618
int udp_set_remote_url(URLContext *h, const char *uri);
619
int udp_get_local_port(URLContext *h);
620
#if FF_API_UDP_GET_FILE
621
int udp_get_file_handle(URLContext *h);
622
#endif
623

    
624
#endif /* AVFORMAT_AVIO_H */