Mercurial > libavformat.hg
comparison avio.h @ 1874:3328f652d741 libavformat
Move aviobuf.c comments to avio.h. By moving the aviobuf.c comments to avio.h,
these comments can be extracted by Doxygen by only accessing the installed
headers.
author | takis |
---|---|
date | Mon, 05 Mar 2007 13:55:45 +0000 |
parents | eb16c64144ee |
children | 84ed710a9adc |
comparison
equal
deleted
inserted
replaced
1873:342cce8cb3e4 | 1874:3328f652d741 |
---|---|
144 offset_t url_fsize(ByteIOContext *s); | 144 offset_t url_fsize(ByteIOContext *s); |
145 int url_feof(ByteIOContext *s); | 145 int url_feof(ByteIOContext *s); |
146 int url_ferror(ByteIOContext *s); | 146 int url_ferror(ByteIOContext *s); |
147 | 147 |
148 #define URL_EOF (-1) | 148 #define URL_EOF (-1) |
149 /* NOTE: return URL_EOF (-1) if EOF */ | |
149 int url_fgetc(ByteIOContext *s); | 150 int url_fgetc(ByteIOContext *s); |
151 | |
152 /* XXX: currently size is limited */ | |
150 #ifdef __GNUC__ | 153 #ifdef __GNUC__ |
151 int url_fprintf(ByteIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); | 154 int url_fprintf(ByteIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); |
152 #else | 155 #else |
153 int url_fprintf(ByteIOContext *s, const char *fmt, ...); | 156 int url_fprintf(ByteIOContext *s, const char *fmt, ...); |
154 #endif | 157 #endif |
158 | |
159 /* note: unlike fgets, the EOL character is not returned and a whole | |
160 line is parsed. return NULL if first char read was EOF */ | |
155 char *url_fgets(ByteIOContext *s, char *buf, int buf_size); | 161 char *url_fgets(ByteIOContext *s, char *buf, int buf_size); |
156 | 162 |
157 void put_flush_packet(ByteIOContext *s); | 163 void put_flush_packet(ByteIOContext *s); |
158 | 164 |
159 int get_buffer(ByteIOContext *s, unsigned char *buf, int size); | 165 int get_buffer(ByteIOContext *s, unsigned char *buf, int size); |
160 int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size); | 166 int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size); |
167 | |
168 /* NOTE: return 0 if EOF, so you cannot use it if EOF handling is | |
169 necessary */ | |
161 int get_byte(ByteIOContext *s); | 170 int get_byte(ByteIOContext *s); |
162 unsigned int get_le24(ByteIOContext *s); | 171 unsigned int get_le24(ByteIOContext *s); |
163 unsigned int get_le32(ByteIOContext *s); | 172 unsigned int get_le32(ByteIOContext *s); |
164 uint64_t get_le64(ByteIOContext *s); | 173 uint64_t get_le64(ByteIOContext *s); |
165 unsigned int get_le16(ByteIOContext *s); | 174 unsigned int get_le16(ByteIOContext *s); |
174 { | 183 { |
175 return s->is_streamed; | 184 return s->is_streamed; |
176 } | 185 } |
177 | 186 |
178 int url_fdopen(ByteIOContext *s, URLContext *h); | 187 int url_fdopen(ByteIOContext *s, URLContext *h); |
188 | |
189 /* XXX: must be called before any I/O */ | |
179 int url_setbufsize(ByteIOContext *s, int buf_size); | 190 int url_setbufsize(ByteIOContext *s, int buf_size); |
191 | |
192 /* NOTE: when opened as read/write, the buffers are only used for | |
193 reading */ | |
180 int url_fopen(ByteIOContext *s, const char *filename, int flags); | 194 int url_fopen(ByteIOContext *s, const char *filename, int flags); |
181 int url_fclose(ByteIOContext *s); | 195 int url_fclose(ByteIOContext *s); |
182 URLContext *url_fileno(ByteIOContext *s); | 196 URLContext *url_fileno(ByteIOContext *s); |
197 | |
198 /* | |
199 * Return the maximum packet size associated to packetized buffered file | |
200 * handle. If the file is not packetized (stream like http or file on | |
201 * disk), then 0 is returned. | |
202 * | |
203 * @param h buffered file handle | |
204 * @return maximum packet size in bytes | |
205 */ | |
183 int url_fget_max_packet_size(ByteIOContext *s); | 206 int url_fget_max_packet_size(ByteIOContext *s); |
184 | 207 |
185 int url_open_buf(ByteIOContext *s, uint8_t *buf, int buf_size, int flags); | 208 int url_open_buf(ByteIOContext *s, uint8_t *buf, int buf_size, int flags); |
209 | |
210 /* return the written or read size */ | |
186 int url_close_buf(ByteIOContext *s); | 211 int url_close_buf(ByteIOContext *s); |
187 | 212 |
213 /* | |
214 * Open a write only memory stream. | |
215 * | |
216 * @param s new IO context | |
217 * @return zero if no error. | |
218 */ | |
188 int url_open_dyn_buf(ByteIOContext *s); | 219 int url_open_dyn_buf(ByteIOContext *s); |
220 | |
221 /* | |
222 * Open a write only packetized memory stream with a maximum packet | |
223 * size of 'max_packet_size'. The stream is stored in a memory buffer | |
224 * with a big endian 4 byte header giving the packet size in bytes. | |
225 * | |
226 * @param s new IO context | |
227 * @param max_packet_size maximum packet size (must be > 0) | |
228 * @return zero if no error. | |
229 */ | |
189 int url_open_dyn_packet_buf(ByteIOContext *s, int max_packet_size); | 230 int url_open_dyn_packet_buf(ByteIOContext *s, int max_packet_size); |
231 | |
232 /* | |
233 * Return the written size and a pointer to the buffer. The buffer | |
234 * must be freed with av_free(). | |
235 * @param s IO context | |
236 * @param pointer to a byte buffer | |
237 * @return the length of the byte buffer | |
238 */ | |
190 int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer); | 239 int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer); |
191 | 240 |
192 unsigned long get_checksum(ByteIOContext *s); | 241 unsigned long get_checksum(ByteIOContext *s); |
193 void init_checksum(ByteIOContext *s, unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), unsigned long checksum); | 242 void init_checksum(ByteIOContext *s, unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), unsigned long checksum); |
194 | 243 |