| OLD | NEW |
| 1 /* | 1 /* |
| 2 * unbuffered io for ffmpeg system | |
| 3 * copyright (c) 2001 Fabrice Bellard | 2 * copyright (c) 2001 Fabrice Bellard |
| 4 * | 3 * |
| 5 * This file is part of FFmpeg. | 4 * This file is part of FFmpeg. |
| 6 * | 5 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 6 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 7 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 9 * version 2.1 of the License, or (at your option) any later version. |
| 11 * | 10 * |
| 12 * FFmpeg is distributed in the hope that it will be useful, | 11 * FFmpeg is distributed in the hope that it will be useful, |
| 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 * Lesser General Public License for more details. | 14 * Lesser General Public License for more details. |
| 16 * | 15 * |
| 17 * You should have received a copy of the GNU Lesser General Public | 16 * You should have received a copy of the GNU Lesser General Public |
| 18 * License along with FFmpeg; if not, write to the Free Software | 17 * License along with FFmpeg; if not, write to the Free Software |
| 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 */ | 19 */ |
| 21 #ifndef AVFORMAT_AVIO_H | 20 #ifndef AVFORMAT_AVIO_H |
| 22 #define AVFORMAT_AVIO_H | 21 #define AVFORMAT_AVIO_H |
| 23 | 22 |
| 23 /** |
| 24 * @file libavformat/avio.h |
| 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 |
| 24 #include <stdint.h> | 31 #include <stdint.h> |
| 25 | 32 |
| 33 #include "libavutil/common.h" |
| 34 |
| 26 /* unbuffered I/O */ | 35 /* unbuffered I/O */ |
| 27 | 36 |
| 28 /** | 37 /** |
| 29 * URL Context. | 38 * URL Context. |
| 30 * New fields can be added to the end with minor version bumps. | 39 * New fields can be added to the end with minor version bumps. |
| 31 * Removal, reordering and changes to existing fields require a major | 40 * Removal, reordering and changes to existing fields require a major |
| 32 * version bump. | 41 * version bump. |
| 33 * sizeof(URLContext) must not be used outside libav*. | 42 * sizeof(URLContext) must not be used outside libav*. |
| 34 */ | 43 */ |
| 35 struct URLContext { | 44 struct URLContext { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 62 const char *filename, int flags); | 71 const char *filename, int flags); |
| 63 int url_open(URLContext **h, const char *filename, int flags); | 72 int url_open(URLContext **h, const char *filename, int flags); |
| 64 int url_read(URLContext *h, unsigned char *buf, int size); | 73 int url_read(URLContext *h, unsigned char *buf, int size); |
| 65 int url_write(URLContext *h, unsigned char *buf, int size); | 74 int url_write(URLContext *h, unsigned char *buf, int size); |
| 66 int64_t url_seek(URLContext *h, int64_t pos, int whence); | 75 int64_t url_seek(URLContext *h, int64_t pos, int whence); |
| 67 int url_close(URLContext *h); | 76 int url_close(URLContext *h); |
| 68 int url_exist(const char *filename); | 77 int url_exist(const char *filename); |
| 69 int64_t url_filesize(URLContext *h); | 78 int64_t url_filesize(URLContext *h); |
| 70 | 79 |
| 71 /** | 80 /** |
| 81 * Return the file descriptor associated with this URL. For RTP, this |
| 82 * will return only the RTP file descriptor, not the RTCP file descriptor. |
| 83 * To get both, use rtp_get_file_handles(). |
| 84 * |
| 85 * @return the file descriptor associated with this URL, or <0 on error. |
| 86 */ |
| 87 int url_get_file_handle(URLContext *h); |
| 88 |
| 89 /** |
| 72 * Return the maximum packet size associated to packetized file | 90 * Return the maximum packet size associated to packetized file |
| 73 * handle. If the file is not packetized (stream like HTTP or file on | 91 * handle. If the file is not packetized (stream like HTTP or file on |
| 74 * disk), then 0 is returned. | 92 * disk), then 0 is returned. |
| 75 * | 93 * |
| 76 * @param h file handle | 94 * @param h file handle |
| 77 * @return maximum packet size in bytes | 95 * @return maximum packet size in bytes |
| 78 */ | 96 */ |
| 79 int url_get_max_packet_size(URLContext *h); | 97 int url_get_max_packet_size(URLContext *h); |
| 80 void url_get_filename(URLContext *h, char *buf, int buf_size); | 98 void url_get_filename(URLContext *h, char *buf, int buf_size); |
| 81 | 99 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 const char *name; | 146 const char *name; |
| 129 int (*url_open)(URLContext *h, const char *filename, int flags); | 147 int (*url_open)(URLContext *h, const char *filename, int flags); |
| 130 int (*url_read)(URLContext *h, unsigned char *buf, int size); | 148 int (*url_read)(URLContext *h, unsigned char *buf, int size); |
| 131 int (*url_write)(URLContext *h, unsigned char *buf, int size); | 149 int (*url_write)(URLContext *h, unsigned char *buf, int size); |
| 132 int64_t (*url_seek)(URLContext *h, int64_t pos, int whence); | 150 int64_t (*url_seek)(URLContext *h, int64_t pos, int whence); |
| 133 int (*url_close)(URLContext *h); | 151 int (*url_close)(URLContext *h); |
| 134 struct URLProtocol *next; | 152 struct URLProtocol *next; |
| 135 int (*url_read_pause)(URLContext *h, int pause); | 153 int (*url_read_pause)(URLContext *h, int pause); |
| 136 int64_t (*url_read_seek)(URLContext *h, int stream_index, | 154 int64_t (*url_read_seek)(URLContext *h, int stream_index, |
| 137 int64_t timestamp, int flags); | 155 int64_t timestamp, int flags); |
| 156 int (*url_get_file_handle)(URLContext *h); |
| 138 } URLProtocol; | 157 } URLProtocol; |
| 139 | 158 |
| 159 #if LIBAVFORMAT_VERSION_MAJOR < 53 |
| 140 extern URLProtocol *first_protocol; | 160 extern URLProtocol *first_protocol; |
| 161 #endif |
| 162 |
| 141 extern URLInterruptCB *url_interrupt_cb; | 163 extern URLInterruptCB *url_interrupt_cb; |
| 142 | 164 |
| 165 /** |
| 166 * If protocol is NULL, returns the first registered protocol, |
| 167 * if protocol is non-NULL, returns the next registered protocol after protocol, |
| 168 * or NULL if protocol is the last one. |
| 169 */ |
| 143 URLProtocol *av_protocol_next(URLProtocol *p); | 170 URLProtocol *av_protocol_next(URLProtocol *p); |
| 144 | 171 |
| 145 int register_protocol(URLProtocol *protocol); | 172 #if LIBAVFORMAT_VERSION_MAJOR < 53 |
| 173 /** |
| 174 * @deprecated Use av_register_protocol() instead. |
| 175 */ |
| 176 attribute_deprecated int register_protocol(URLProtocol *protocol); |
| 177 #endif |
| 178 |
| 179 int av_register_protocol(URLProtocol *protocol); |
| 146 | 180 |
| 147 /** | 181 /** |
| 148 * Bytestream IO Context. | 182 * Bytestream IO Context. |
| 149 * New fields can be added to the end with minor version bumps. | 183 * New fields can be added to the end with minor version bumps. |
| 150 * Removal, reordering and changes to existing fields require a major | 184 * Removal, reordering and changes to existing fields require a major |
| 151 * version bump. | 185 * version bump. |
| 152 * sizeof(ByteIOContext) must not be used outside libav*. | 186 * sizeof(ByteIOContext) must not be used outside libav*. |
| 153 */ | 187 */ |
| 154 typedef struct { | 188 typedef struct { |
| 155 unsigned char *buffer; | 189 unsigned char *buffer; |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf, | 392 unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf, |
| 359 unsigned int len); | 393 unsigned int len); |
| 360 unsigned long get_checksum(ByteIOContext *s); | 394 unsigned long get_checksum(ByteIOContext *s); |
| 361 void init_checksum(ByteIOContext *s, | 395 void init_checksum(ByteIOContext *s, |
| 362 unsigned long (*update_checksum)(unsigned long c, const uint8
_t *p, unsigned int len), | 396 unsigned long (*update_checksum)(unsigned long c, const uint8
_t *p, unsigned int len), |
| 363 unsigned long checksum); | 397 unsigned long checksum); |
| 364 | 398 |
| 365 /* udp.c */ | 399 /* udp.c */ |
| 366 int udp_set_remote_url(URLContext *h, const char *uri); | 400 int udp_set_remote_url(URLContext *h, const char *uri); |
| 367 int udp_get_local_port(URLContext *h); | 401 int udp_get_local_port(URLContext *h); |
| 402 #if (LIBAVFORMAT_VERSION_MAJOR <= 52) |
| 368 int udp_get_file_handle(URLContext *h); | 403 int udp_get_file_handle(URLContext *h); |
| 404 #endif |
| 369 | 405 |
| 370 #endif /* AVFORMAT_AVIO_H */ | 406 #endif /* AVFORMAT_AVIO_H */ |
| OLD | NEW |