| @@ -220,6 +220,7 @@ void av_fifo_reset2(AVFifo *f); · 219 unmodified lines |
| 220 | void av_fifo_freep2(AVFifo **f); | 220 | void av_fifo_freep2(AVFifo **f); |
| 221 | | 221 | |
| 222 | | 222 | |
| | 223 | #if FF_API_FIFO_OLD_API |
| 223 | typedef struct AVFifoBuffer { | 224 | typedef struct AVFifoBuffer { |
| 224 | uint8_t *buffer; | 225 | uint8_t *buffer; |
| 225 | uint8_t *rptr, *wptr, *end; | 226 | uint8_t *rptr, *wptr, *end; |
| @@ -230,7 +231,9 @@ typedef struct AVFifoBuffer { · 4 unmodified lines |
| 230 | * Initialize an AVFifoBuffer. | 231 | * Initialize an AVFifoBuffer. |
| 231 | * @param size of FIFO | 232 | * @param size of FIFO |
| 232 | * @return AVFifoBuffer or NULL in case of memory allocation failure | 233 | * @return AVFifoBuffer or NULL in case of memory allocation failure |
| | 234 | * @deprecated use av_fifo_alloc2() |
| 233 | */ | 235 | */ |
| | 236 | attribute_deprecated |
| 234 | AVFifoBuffer *av_fifo_alloc(unsigned int size); | 237 | AVFifoBuffer *av_fifo_alloc(unsigned int size); |
| 235 | | 238 | |
| 236 | /** | 239 | /** |
| @@ -238,25 +241,33 @@ AVFifoBuffer *av_fifo_alloc(unsigned int size); · 1 unmodified line |
| 238 | * @param nmemb number of elements | 241 | * @param nmemb number of elements |
| 239 | * @param size size of the single element | 242 | * @param size size of the single element |
| 240 | * @return AVFifoBuffer or NULL in case of memory allocation failure | 243 | * @return AVFifoBuffer or NULL in case of memory allocation failure |
| | 244 | * @deprecated use av_fifo_alloc2() |
| 241 | */ | 245 | */ |
| | 246 | attribute_deprecated |
| 242 | AVFifoBuffer *av_fifo_alloc_array(size_t nmemb, size_t size); | 247 | AVFifoBuffer *av_fifo_alloc_array(size_t nmemb, size_t size); |
| 243 | | 248 | |
| 244 | /** | 249 | /** |
| 245 | * Free an AVFifoBuffer. | 250 | * Free an AVFifoBuffer. |
| 246 | * @param f AVFifoBuffer to free | 251 | * @param f AVFifoBuffer to free |
| | 252 | * @deprecated use the AVFifo API with av_fifo_freep2() |
| 247 | */ | 253 | */ |
| | 254 | attribute_deprecated |
| 248 | void av_fifo_free(AVFifoBuffer *f); | 255 | void av_fifo_free(AVFifoBuffer *f); |
| 249 | | 256 | |
| 250 | /** | 257 | /** |
| 251 | * Free an AVFifoBuffer and reset pointer to NULL. | 258 | * Free an AVFifoBuffer and reset pointer to NULL. |
| 252 | * @param f AVFifoBuffer to free | 259 | * @param f AVFifoBuffer to free |
| | 260 | * @deprecated use the AVFifo API with av_fifo_freep2() |
| 253 | */ | 261 | */ |
| | 262 | attribute_deprecated |
| 254 | void av_fifo_freep(AVFifoBuffer **f); | 263 | void av_fifo_freep(AVFifoBuffer **f); |
| 255 | | 264 | |
| 256 | /** | 265 | /** |
| 257 | * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied. | 266 | * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied. |
| 258 | * @param f AVFifoBuffer to reset | 267 | * @param f AVFifoBuffer to reset |
| | 268 | * @deprecated use av_fifo_reset2() with the new AVFifo-API |
| 259 | */ | 269 | */ |
| | 270 | attribute_deprecated |
| 260 | void av_fifo_reset(AVFifoBuffer *f); | 271 | void av_fifo_reset(AVFifoBuffer *f); |
| 261 | | 272 | |
| 262 | /** | 273 | /** |
| @@ -264,7 +275,9 @@ void av_fifo_reset(AVFifoBuffer *f); · 1 unmodified line |
| 264 | * amount of data you can read from it. | 275 | * amount of data you can read from it. |
| 265 | * @param f AVFifoBuffer to read from | 276 | * @param f AVFifoBuffer to read from |
| 266 | * @return size | 277 | * @return size |
| | 278 | * @deprecated use av_fifo_can_read() with the new AVFifo-API |
| 267 | */ | 279 | */ |
| | 280 | attribute_deprecated |
| 268 | int av_fifo_size(const AVFifoBuffer *f); | 281 | int av_fifo_size(const AVFifoBuffer *f); |
| 269 | | 282 | |
| 270 | /** | 283 | /** |
| @@ -272,7 +285,9 @@ int av_fifo_size(const AVFifoBuffer *f); · 1 unmodified line |
| 272 | * amount of data you can write into it. | 285 | * amount of data you can write into it. |
| 273 | * @param f AVFifoBuffer to write into | 286 | * @param f AVFifoBuffer to write into |
| 274 | * @return size | 287 | * @return size |
| | 288 | * @deprecated use av_fifo_can_write() with the new AVFifo-API |
| 275 | */ | 289 | */ |
| | 290 | attribute_deprecated |
| 276 | int av_fifo_space(const AVFifoBuffer *f); | 291 | int av_fifo_space(const AVFifoBuffer *f); |
| 277 | | 292 | |
| 278 | /** | 293 | /** |
| @@ -285,7 +300,11 @@ int av_fifo_space(const AVFifoBuffer *f); · 6 unmodified lines |
| 285 | * @param dest data destination | 300 | * @param dest data destination |
| 286 | * | 301 | * |
| 287 | * @return a non-negative number on success, a negative error code on failure | 302 | * @return a non-negative number on success, a negative error code on failure |
| | 303 | * |
| | 304 | * @deprecated use the new AVFifo-API with av_fifo_peek() when func == NULL, |
| | 305 | * av_fifo_peek_to_cb() otherwise |
| 288 | */ | 306 | */ |
| | 307 | attribute_deprecated |
| 289 | int av_fifo_generic_peek_at(AVFifoBuffer *f, void *dest, int offset, int buf_size, void (*func)(void*, void*, int)); | 308 | int av_fifo_generic_peek_at(AVFifoBuffer *f, void *dest, int offset, int buf_size, void (*func)(void*, void*, int)); |
| 290 | | 309 | |
| 291 | /** | 310 | /** |
| @@ -297,7 +316,11 @@ int av_fifo_generic_peek_at(AVFifoBuffer *f, void *dest, int offset, int buf_siz · 5 unmodified lines |
| 297 | * @param dest data destination | 316 | * @param dest data destination |
| 298 | * | 317 | * |
| 299 | * @return a non-negative number on success, a negative error code on failure | 318 | * @return a non-negative number on success, a negative error code on failure |
| | 319 | * |
| | 320 | * @deprecated use the new AVFifo-API with av_fifo_peek() when func == NULL, |
| | 321 | * av_fifo_peek_to_cb() otherwise |
| 300 | */ | 322 | */ |
| | 323 | attribute_deprecated |
| 301 | int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)); | 324 | int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)); |
| 302 | | 325 | |
| 303 | /** | 326 | /** |
| @@ -308,7 +331,11 @@ int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size, void (*func) · 4 unmodified lines |
| 308 | * @param dest data destination | 331 | * @param dest data destination |
| 309 | * | 332 | * |
| 310 | * @return a non-negative number on success, a negative error code on failure | 333 | * @return a non-negative number on success, a negative error code on failure |
| | 334 | * |
| | 335 | * @deprecated use the new AVFifo-API with av_fifo_read() when func == NULL, |
| | 336 | * av_fifo_read_to_cb() otherwise |
| 311 | */ | 337 | */ |
| | 338 | attribute_deprecated |
| 312 | int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)); | 339 | int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)); |
| 313 | | 340 | |
| 314 | /** | 341 | /** |
| @@ -323,7 +350,11 @@ int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func) · 8 unmodified lines |
| 323 | * indicate no more data available to write. | 350 | * indicate no more data available to write. |
| 324 | * If func is NULL, src is interpreted as a simple byte array for source data. | 351 | * If func is NULL, src is interpreted as a simple byte array for source data. |
| 325 | * @return the number of bytes written to the FIFO or a negative error code on failure | 352 | * @return the number of bytes written to the FIFO or a negative error code on failure |
| | 353 | * |
| | 354 | * @deprecated use the new AVFifo-API with av_fifo_write() when func == NULL, |
| | 355 | * av_fifo_write_from_cb() otherwise |
| 326 | */ | 356 | */ |
| | 357 | attribute_deprecated |
| 327 | int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int)); | 358 | int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int)); |
| 328 | | 359 | |
| 329 | /** | 360 | /** |
| @@ -333,7 +364,11 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void · 3 unmodified lines |
| 333 | * @param f AVFifoBuffer to resize | 364 | * @param f AVFifoBuffer to resize |
| 334 | * @param size new AVFifoBuffer size in bytes | 365 | * @param size new AVFifoBuffer size in bytes |
| 335 | * @return <0 for failure, >=0 otherwise | 366 | * @return <0 for failure, >=0 otherwise |
| | 367 | * |
| | 368 | * @deprecated use the new AVFifo-API with av_fifo_grow2() to increase FIFO size, |
| | 369 | * decreasing FIFO size is not supported |
| 336 | */ | 370 | */ |
| | 371 | attribute_deprecated |
| 337 | int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size); | 372 | int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size); |
| 338 | | 373 | |
| 339 | /** | 374 | /** |
| @@ -344,14 +379,21 @@ int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size); · 4 unmodified lines |
| 344 | * @param f AVFifoBuffer to resize | 379 | * @param f AVFifoBuffer to resize |
| 345 | * @param additional_space the amount of space in bytes to allocate in addition to av_fifo_size() | 380 | * @param additional_space the amount of space in bytes to allocate in addition to av_fifo_size() |
| 346 | * @return <0 for failure, >=0 otherwise | 381 | * @return <0 for failure, >=0 otherwise |
| | 382 | * |
| | 383 | * @deprecated use the new AVFifo-API with av_fifo_grow2(); note that unlike |
| | 384 | * this function it adds to the allocated size, rather than to the used size |
| 347 | */ | 385 | */ |
| | 386 | attribute_deprecated |
| 348 | int av_fifo_grow(AVFifoBuffer *f, unsigned int additional_space); | 387 | int av_fifo_grow(AVFifoBuffer *f, unsigned int additional_space); |
| 349 | | 388 | |
| 350 | /** | 389 | /** |
| 351 | * Read and discard the specified amount of data from an AVFifoBuffer. | 390 | * Read and discard the specified amount of data from an AVFifoBuffer. |
| 352 | * @param f AVFifoBuffer to read from | 391 | * @param f AVFifoBuffer to read from |
| 353 | * @param size amount of data to read in bytes | 392 | * @param size amount of data to read in bytes |
| | 393 | * |
| | 394 | * @deprecated use the new AVFifo-API with av_fifo_drain2() |
| 354 | */ | 395 | */ |
| | 396 | attribute_deprecated |
| 355 | void av_fifo_drain(AVFifoBuffer *f, int size); | 397 | void av_fifo_drain(AVFifoBuffer *f, int size); |
| 356 | | 398 | |
| 357 | #if FF_API_FIFO_PEEK2 | 399 | #if FF_API_FIFO_PEEK2 |
| @@ -364,7 +406,7 @@ void av_fifo_drain(AVFifoBuffer *f, int size); · 6 unmodified lines |
| 364 | * than the used buffer size or the returned pointer will | 406 | * than the used buffer size or the returned pointer will |
| 365 | * point outside to the buffer data. | 407 | * point outside to the buffer data. |
| 366 | * The used buffer size can be checked with av_fifo_size(). | 408 | * The used buffer size can be checked with av_fifo_size(). |
| 367 | * @deprecated use av_fifo_generic_peek_at() | 409 | * @deprecated use the new AVFifo-API with av_fifo_peek() or av_fifo_peek_to_cb() |
| 368 | */ | 410 | */ |
| 369 | attribute_deprecated | 411 | attribute_deprecated |
| 370 | static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs) | 412 | static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs) |
| @@ -377,5 +419,6 @@ static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs) · 6 unmodified lines |
| 377 | return ptr; | 419 | return ptr; |
| 378 | } | 420 | } |
| 379 | #endif | 421 | #endif |
| | 422 | #endif |
| 380 | | 423 | |
| 381 | #endif /* AVUTIL_FIFO_H */ | 424 | #endif /* AVUTIL_FIFO_H */ |