avio.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  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. * @file
  24. * unbuffered I/O operations
  25. *
  26. * @warning This file has to be considered an internal but installed
  27. * header, so it should not be directly included in your projects.
  28. */
  29. #include <stdint.h>
  30. #include "libavutil/common.h"
  31. #include "libavutil/log.h"
  32. #include "libavformat/version.h"
  33. /* unbuffered I/O */
  34. /**
  35. * URL Context.
  36. * New fields can be added to the end with minor version bumps.
  37. * Removal, reordering and changes to existing fields require a major
  38. * version bump.
  39. * sizeof(URLContext) must not be used outside libav*.
  40. */
  41. typedef struct URLContext {
  42. #if FF_API_URL_CLASS
  43. const AVClass *av_class; ///< information for av_log(). Set by url_open().
  44. #endif
  45. struct URLProtocol *prot;
  46. int flags;
  47. int is_streamed; /**< true if streamed (no seek possible), default = false */
  48. int max_packet_size; /**< if non zero, the stream is packetized with this max packet size */
  49. void *priv_data;
  50. char *filename; /**< specified URL */
  51. int is_connected;
  52. } URLContext;
  53. typedef struct URLPollEntry {
  54. URLContext *handle;
  55. int events;
  56. int revents;
  57. } URLPollEntry;
  58. #define URL_RDONLY 0
  59. #define URL_WRONLY 1
  60. #define URL_RDWR 2
  61. typedef int URLInterruptCB(void);
  62. /**
  63. * Create a URLContext for accessing to the resource indicated by
  64. * url, and open it using the URLProtocol up.
  65. *
  66. * @param puc pointer to the location where, in case of success, the
  67. * function puts the pointer to the created URLContext
  68. * @param flags flags which control how the resource indicated by url
  69. * is to be opened
  70. * @return 0 in case of success, a negative value corresponding to an
  71. * AVERROR code in case of failure
  72. */
  73. int url_open_protocol (URLContext **puc, struct URLProtocol *up,
  74. const char *url, int flags);
  75. /**
  76. * Create a URLContext for accessing to the resource indicated by
  77. * url, but do not initiate the connection yet.
  78. *
  79. * @param puc pointer to the location where, in case of success, the
  80. * function puts the pointer to the created URLContext
  81. * @param flags flags which control how the resource indicated by url
  82. * is to be opened
  83. * @return 0 in case of success, a negative value corresponding to an
  84. * AVERROR code in case of failure
  85. */
  86. int url_alloc(URLContext **h, const char *url, int flags);
  87. /**
  88. * Connect an URLContext that has been allocated by url_alloc
  89. */
  90. int url_connect(URLContext *h);
  91. /**
  92. * Create an URLContext for accessing to the resource indicated by
  93. * url, and open it.
  94. *
  95. * @param puc pointer to the location where, in case of success, the
  96. * function puts the pointer to the created URLContext
  97. * @param flags flags which control how the resource indicated by url
  98. * is to be opened
  99. * @return 0 in case of success, a negative value corresponding to an
  100. * AVERROR code in case of failure
  101. */
  102. int url_open(URLContext **h, const char *url, int flags);
  103. /**
  104. * Read up to size bytes from the resource accessed by h, and store
  105. * the read bytes in buf.
  106. *
  107. * @return The number of bytes actually read, or a negative value
  108. * corresponding to an AVERROR code in case of error. A value of zero
  109. * indicates that it is not possible to read more from the accessed
  110. * resource (except if the value of the size argument is also zero).
  111. */
  112. int url_read(URLContext *h, unsigned char *buf, int size);
  113. /**
  114. * Read as many bytes as possible (up to size), calling the
  115. * read function multiple times if necessary.
  116. * Will also retry if the read function returns AVERROR(EAGAIN).
  117. * This makes special short-read handling in applications
  118. * unnecessary, if the return value is < size then it is
  119. * certain there was either an error or the end of file was reached.
  120. */
  121. int url_read_complete(URLContext *h, unsigned char *buf, int size);
  122. /**
  123. * Write size bytes from buf to the resource accessed by h.
  124. *
  125. * @return the number of bytes actually written, or a negative value
  126. * corresponding to an AVERROR code in case of failure
  127. */
  128. int url_write(URLContext *h, const unsigned char *buf, int size);
  129. /**
  130. * Passing this as the "whence" parameter to a seek function causes it to
  131. * return the filesize without seeking anywhere. Supporting this is optional.
  132. * If it is not supported then the seek function will return <0.
  133. */
  134. #define AVSEEK_SIZE 0x10000
  135. /**
  136. * Change the position that will be used by the next read/write
  137. * operation on the resource accessed by h.
  138. *
  139. * @param pos specifies the new position to set
  140. * @param whence specifies how pos should be interpreted, it must be
  141. * one of SEEK_SET (seek from the beginning), SEEK_CUR (seek from the
  142. * current position), SEEK_END (seek from the end), or AVSEEK_SIZE
  143. * (return the filesize of the requested resource, pos is ignored).
  144. * @return a negative value corresponding to an AVERROR code in case
  145. * of failure, or the resulting file position, measured in bytes from
  146. * the beginning of the file. You can use this feature together with
  147. * SEEK_CUR to read the current file position.
  148. */
  149. int64_t url_seek(URLContext *h, int64_t pos, int whence);
  150. /**
  151. * Close the resource accessed by the URLContext h, and free the
  152. * memory used by it.
  153. *
  154. * @return a negative value if an error condition occurred, 0
  155. * otherwise
  156. */
  157. int url_close(URLContext *h);
  158. /**
  159. * Return a non-zero value if the resource indicated by url
  160. * exists, 0 otherwise.
  161. */
  162. int url_exist(const char *url);
  163. /**
  164. * Return the filesize of the resource accessed by h, AVERROR(ENOSYS)
  165. * if the operation is not supported by h, or another negative value
  166. * corresponding to an AVERROR error code in case of failure.
  167. */
  168. int64_t url_filesize(URLContext *h);
  169. /**
  170. * Return the file descriptor associated with this URL. For RTP, this
  171. * will return only the RTP file descriptor, not the RTCP file descriptor.
  172. *
  173. * @return the file descriptor associated with this URL, or <0 on error.
  174. */
  175. int url_get_file_handle(URLContext *h);
  176. /**
  177. * Return the maximum packet size associated to packetized file
  178. * handle. If the file is not packetized (stream like HTTP or file on
  179. * disk), then 0 is returned.
  180. *
  181. * @param h file handle
  182. * @return maximum packet size in bytes
  183. */
  184. int url_get_max_packet_size(URLContext *h);
  185. /**
  186. * Copy the filename of the resource accessed by h to buf.
  187. *
  188. * @param buf_size size in bytes of buf
  189. */
  190. void url_get_filename(URLContext *h, char *buf, int buf_size);
  191. /**
  192. * The callback is called in blocking functions to test regulary if
  193. * asynchronous interruption is needed. AVERROR(EINTR) is returned
  194. * in this case by the interrupted function. 'NULL' means no interrupt
  195. * callback is given.
  196. */
  197. void url_set_interrupt_cb(URLInterruptCB *interrupt_cb);
  198. /* not implemented */
  199. int url_poll(URLPollEntry *poll_table, int n, int timeout);
  200. /**
  201. * Pause and resume playing - only meaningful if using a network streaming
  202. * protocol (e.g. MMS).
  203. * @param pause 1 for pause, 0 for resume
  204. */
  205. int av_url_read_pause(URLContext *h, int pause);
  206. /**
  207. * Seek to a given timestamp relative to some component stream.
  208. * Only meaningful if using a network streaming protocol (e.g. MMS.).
  209. * @param stream_index The stream index that the timestamp is relative to.
  210. * If stream_index is (-1) the timestamp should be in AV_TIME_BASE
  211. * units from the beginning of the presentation.
  212. * If a stream_index >= 0 is used and the protocol does not support
  213. * seeking based on component streams, the call will fail with ENOTSUP.
  214. * @param timestamp timestamp in AVStream.time_base units
  215. * or if there is no stream specified then in AV_TIME_BASE units.
  216. * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
  217. * and AVSEEK_FLAG_ANY. The protocol may silently ignore
  218. * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
  219. * fail with ENOTSUP if used and not supported.
  220. * @return >= 0 on success
  221. * @see AVInputFormat::read_seek
  222. */
  223. int64_t av_url_read_seek(URLContext *h, int stream_index,
  224. int64_t timestamp, int flags);
  225. /**
  226. * Oring this flag as into the "whence" parameter to a seek function causes it to
  227. * seek by any means (like reopening and linear reading) or other normally unreasonble
  228. * means that can be extreemly slow.
  229. * This may be ignored by the seek code.
  230. */
  231. #define AVSEEK_FORCE 0x20000
  232. typedef struct URLProtocol {
  233. const char *name;
  234. int (*url_open)(URLContext *h, const char *url, int flags);
  235. int (*url_read)(URLContext *h, unsigned char *buf, int size);
  236. int (*url_write)(URLContext *h, const unsigned char *buf, int size);
  237. int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
  238. int (*url_close)(URLContext *h);
  239. struct URLProtocol *next;
  240. int (*url_read_pause)(URLContext *h, int pause);
  241. int64_t (*url_read_seek)(URLContext *h, int stream_index,
  242. int64_t timestamp, int flags);
  243. int (*url_get_file_handle)(URLContext *h);
  244. int priv_data_size;
  245. const AVClass *priv_data_class;
  246. } URLProtocol;
  247. #if FF_API_REGISTER_PROTOCOL
  248. extern URLProtocol *first_protocol;
  249. #endif
  250. extern URLInterruptCB *url_interrupt_cb;
  251. /**
  252. * If protocol is NULL, returns the first registered protocol,
  253. * if protocol is non-NULL, returns the next registered protocol after protocol,
  254. * or NULL if protocol is the last one.
  255. */
  256. URLProtocol *av_protocol_next(URLProtocol *p);
  257. #if FF_API_REGISTER_PROTOCOL
  258. /**
  259. * @deprecated Use av_register_protocol() instead.
  260. */
  261. attribute_deprecated int register_protocol(URLProtocol *protocol);
  262. /**
  263. * @deprecated Use av_register_protocol2() instead.
  264. */
  265. attribute_deprecated int av_register_protocol(URLProtocol *protocol);
  266. #endif
  267. /**
  268. * Register the URLProtocol protocol.
  269. *
  270. * @param size the size of the URLProtocol struct referenced
  271. */
  272. int av_register_protocol2(URLProtocol *protocol, int size);
  273. /**
  274. * Bytestream IO Context.
  275. * New fields can be added to the end with minor version bumps.
  276. * Removal, reordering and changes to existing fields require a major
  277. * version bump.
  278. * sizeof(ByteIOContext) must not be used outside libav*.
  279. */
  280. typedef struct {
  281. unsigned char *buffer;
  282. int buffer_size;
  283. unsigned char *buf_ptr, *buf_end;
  284. void *opaque;
  285. int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
  286. int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
  287. int64_t (*seek)(void *opaque, int64_t offset, int whence);
  288. int64_t pos; /**< position in the file of the current buffer */
  289. int must_flush; /**< true if the next seek should flush */
  290. int eof_reached; /**< true if eof reached */
  291. int write_flag; /**< true if open for writing */
  292. int is_streamed;
  293. int max_packet_size;
  294. unsigned long checksum;
  295. unsigned char *checksum_ptr;
  296. unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
  297. int error; ///< contains the error code or 0 if no error happened
  298. int (*read_pause)(void *opaque, int pause);
  299. int64_t (*read_seek)(void *opaque, int stream_index,
  300. int64_t timestamp, int flags);
  301. } ByteIOContext;
  302. int init_put_byte(ByteIOContext *s,
  303. unsigned char *buffer,
  304. int buffer_size,
  305. int write_flag,
  306. void *opaque,
  307. int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
  308. int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
  309. int64_t (*seek)(void *opaque, int64_t offset, int whence));
  310. ByteIOContext *av_alloc_put_byte(
  311. unsigned char *buffer,
  312. int buffer_size,
  313. int write_flag,
  314. void *opaque,
  315. int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
  316. int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
  317. int64_t (*seek)(void *opaque, int64_t offset, int whence));
  318. void put_byte(ByteIOContext *s, int b);
  319. void put_nbyte(ByteIOContext *s, int b, int count);
  320. void put_buffer(ByteIOContext *s, const unsigned char *buf, int size);
  321. void put_le64(ByteIOContext *s, uint64_t val);
  322. void put_be64(ByteIOContext *s, uint64_t val);
  323. void put_le32(ByteIOContext *s, unsigned int val);
  324. void put_be32(ByteIOContext *s, unsigned int val);
  325. void put_le24(ByteIOContext *s, unsigned int val);
  326. void put_be24(ByteIOContext *s, unsigned int val);
  327. void put_le16(ByteIOContext *s, unsigned int val);
  328. void put_be16(ByteIOContext *s, unsigned int val);
  329. void put_tag(ByteIOContext *s, const char *tag);
  330. #if FF_API_OLD_AVIO
  331. attribute_deprecated void put_strz(ByteIOContext *s, const char *buf);
  332. #endif
  333. /**
  334. * Write a NULL-terminated string.
  335. * @return number of bytes written.
  336. */
  337. int avio_put_str(ByteIOContext *s, const char *str);
  338. /**
  339. * Convert an UTF-8 string to UTF-16LE and write it.
  340. * @return number of bytes written.
  341. */
  342. int avio_put_str16le(ByteIOContext *s, const char *str);
  343. /**
  344. * fseek() equivalent for ByteIOContext.
  345. * @return new position or AVERROR.
  346. */
  347. int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence);
  348. /**
  349. * Skip given number of bytes forward.
  350. * @param offset number of bytes
  351. * @return 0 on success, <0 on error
  352. */
  353. int url_fskip(ByteIOContext *s, int64_t offset);
  354. /**
  355. * ftell() equivalent for ByteIOContext.
  356. * @return position or AVERROR.
  357. */
  358. int64_t url_ftell(ByteIOContext *s);
  359. /**
  360. * Get the filesize.
  361. * @return filesize or AVERROR
  362. */
  363. int64_t url_fsize(ByteIOContext *s);
  364. /**
  365. * feof() equivalent for ByteIOContext.
  366. * @return non zero if and only if end of file
  367. */
  368. int url_feof(ByteIOContext *s);
  369. int url_ferror(ByteIOContext *s);
  370. int av_url_read_fpause(ByteIOContext *h, int pause);
  371. int64_t av_url_read_fseek(ByteIOContext *h, int stream_index,
  372. int64_t timestamp, int flags);
  373. #define URL_EOF (-1)
  374. /** @note return URL_EOF (-1) if EOF */
  375. int url_fgetc(ByteIOContext *s);
  376. /** @warning currently size is limited */
  377. #ifdef __GNUC__
  378. int url_fprintf(ByteIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
  379. #else
  380. int url_fprintf(ByteIOContext *s, const char *fmt, ...);
  381. #endif
  382. /** @note unlike fgets, the EOL character is not returned and a whole
  383. line is parsed. return NULL if first char read was EOF */
  384. char *url_fgets(ByteIOContext *s, char *buf, int buf_size);
  385. void put_flush_packet(ByteIOContext *s);
  386. /**
  387. * Read size bytes from ByteIOContext into buf.
  388. * @return number of bytes read or AVERROR
  389. */
  390. int get_buffer(ByteIOContext *s, unsigned char *buf, int size);
  391. /**
  392. * Read size bytes from ByteIOContext into buf.
  393. * This reads at most 1 packet. If that is not enough fewer bytes will be
  394. * returned.
  395. * @return number of bytes read or AVERROR
  396. */
  397. int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size);
  398. /** @note return 0 if EOF, so you cannot use it if EOF handling is
  399. necessary */
  400. int get_byte(ByteIOContext *s);
  401. unsigned int get_le24(ByteIOContext *s);
  402. unsigned int get_le32(ByteIOContext *s);
  403. uint64_t get_le64(ByteIOContext *s);
  404. unsigned int get_le16(ByteIOContext *s);
  405. /**
  406. * Read a UTF-16 string from pb and convert it to UTF-8.
  407. * The reading will terminate when either a null or invalid character was
  408. * encountered or maxlen bytes have been read.
  409. * @return number of bytes read (is always <= maxlen)
  410. */
  411. int avio_get_str16le(ByteIOContext *pb, int maxlen, char *buf, int buflen);
  412. int avio_get_str16be(ByteIOContext *pb, int maxlen, char *buf, int buflen);
  413. char *get_strz(ByteIOContext *s, char *buf, int maxlen);
  414. unsigned int get_be16(ByteIOContext *s);
  415. unsigned int get_be24(ByteIOContext *s);
  416. unsigned int get_be32(ByteIOContext *s);
  417. uint64_t get_be64(ByteIOContext *s);
  418. uint64_t ff_get_v(ByteIOContext *bc);
  419. static inline int url_is_streamed(ByteIOContext *s)
  420. {
  421. return s->is_streamed;
  422. }
  423. /**
  424. * Create and initialize a ByteIOContext for accessing the
  425. * resource referenced by the URLContext h.
  426. * @note When the URLContext h has been opened in read+write mode, the
  427. * ByteIOContext can be used only for writing.
  428. *
  429. * @param s Used to return the pointer to the created ByteIOContext.
  430. * In case of failure the pointed to value is set to NULL.
  431. * @return 0 in case of success, a negative value corresponding to an
  432. * AVERROR code in case of failure
  433. */
  434. int url_fdopen(ByteIOContext **s, URLContext *h);
  435. /** @warning must be called before any I/O */
  436. int url_setbufsize(ByteIOContext *s, int buf_size);
  437. #if FF_API_URL_RESETBUF
  438. /** Reset the buffer for reading or writing.
  439. * @note Will drop any data currently in the buffer without transmitting it.
  440. * @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY
  441. * to set up the buffer for writing. */
  442. int url_resetbuf(ByteIOContext *s, int flags);
  443. #endif
  444. /**
  445. * Rewind the ByteIOContext using the specified buffer containing the first buf_size bytes of the file.
  446. * Used after probing to avoid seeking.
  447. * Joins buf and s->buffer, taking any overlap into consideration.
  448. * @note s->buffer must overlap with buf or they can't be joined and the function fails
  449. * @note This function is NOT part of the public API
  450. *
  451. * @param s The read-only ByteIOContext to rewind
  452. * @param buf The probe buffer containing the first buf_size bytes of the file
  453. * @param buf_size The size of buf
  454. * @return 0 in case of success, a negative value corresponding to an
  455. * AVERROR code in case of failure
  456. */
  457. int ff_rewind_with_probe_data(ByteIOContext *s, unsigned char *buf, int buf_size);
  458. /**
  459. * Create and initialize a ByteIOContext for accessing the
  460. * resource indicated by url.
  461. * @note When the resource indicated by url has been opened in
  462. * read+write mode, the ByteIOContext can be used only for writing.
  463. *
  464. * @param s Used to return the pointer to the created ByteIOContext.
  465. * In case of failure the pointed to value is set to NULL.
  466. * @param flags flags which control how the resource indicated by url
  467. * is to be opened
  468. * @return 0 in case of success, a negative value corresponding to an
  469. * AVERROR code in case of failure
  470. */
  471. int url_fopen(ByteIOContext **s, const char *url, int flags);
  472. int url_fclose(ByteIOContext *s);
  473. URLContext *url_fileno(ByteIOContext *s);
  474. /**
  475. * Return the maximum packet size associated to packetized buffered file
  476. * handle. If the file is not packetized (stream like http or file on
  477. * disk), then 0 is returned.
  478. *
  479. * @param s buffered file handle
  480. * @return maximum packet size in bytes
  481. */
  482. int url_fget_max_packet_size(ByteIOContext *s);
  483. int url_open_buf(ByteIOContext **s, uint8_t *buf, int buf_size, int flags);
  484. /** return the written or read size */
  485. int url_close_buf(ByteIOContext *s);
  486. /**
  487. * Open a write only memory stream.
  488. *
  489. * @param s new IO context
  490. * @return zero if no error.
  491. */
  492. int url_open_dyn_buf(ByteIOContext **s);
  493. /**
  494. * Open a write only packetized memory stream with a maximum packet
  495. * size of 'max_packet_size'. The stream is stored in a memory buffer
  496. * with a big endian 4 byte header giving the packet size in bytes.
  497. *
  498. * @param s new IO context
  499. * @param max_packet_size maximum packet size (must be > 0)
  500. * @return zero if no error.
  501. */
  502. int url_open_dyn_packet_buf(ByteIOContext **s, int max_packet_size);
  503. /**
  504. * Return the written size and a pointer to the buffer. The buffer
  505. * must be freed with av_free(). If the buffer is opened with
  506. * url_open_dyn_buf, then padding of FF_INPUT_BUFFER_PADDING_SIZE is
  507. * added; if opened with url_open_dyn_packet_buf, no padding is added.
  508. *
  509. * @param s IO context
  510. * @param pbuffer pointer to a byte buffer
  511. * @return the length of the byte buffer
  512. */
  513. int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer);
  514. unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf,
  515. unsigned int len);
  516. unsigned long get_checksum(ByteIOContext *s);
  517. void init_checksum(ByteIOContext *s,
  518. unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
  519. unsigned long checksum);
  520. /* udp.c */
  521. int udp_set_remote_url(URLContext *h, const char *uri);
  522. int udp_get_local_port(URLContext *h);
  523. #if FF_API_UDP_GET_FILE
  524. int udp_get_file_handle(URLContext *h);
  525. #endif
  526. #endif /* AVFORMAT_AVIO_H */