| @@ -220,6 +220,7 @@ void av_fifo_reset2(AVFifo *f); · 219 unmodified lines |
| 220 | 220 | void av_fifo_freep2(AVFifo **f); |
| 221 | 221 | |
| 222 | 222 | |
| 223 | +#if FF_API_FIFO_OLD_API |
| 223 | 224 | typedef struct AVFifoBuffer { |
| 224 | 225 | uint8_t *buffer; |
| 225 | 226 | uint8_t *rptr, *wptr, *end; |
| @@ -230,7 +231,9 @@ typedef struct AVFifoBuffer { · 4 unmodified lines |
| 230 | 231 | * Initialize an AVFifoBuffer. |
| 231 | 232 | * @param size of FIFO |
| 232 | 233 | * @return AVFifoBuffer or NULL in case of memory allocation failure |
| 234 | + * @deprecated use av_fifo_alloc2() |
| 233 | 235 | */ |
| 236 | +attribute_deprecated |
| 234 | 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 | 241 | * @param nmemb number of elements |
| 239 | 242 | * @param size size of the single element |
| 240 | 243 | * @return AVFifoBuffer or NULL in case of memory allocation failure |
| 244 | + * @deprecated use av_fifo_alloc2() |
| 241 | 245 | */ |
| 246 | +attribute_deprecated |
| 242 | 247 | AVFifoBuffer *av_fifo_alloc_array(size_t nmemb, size_t size); |
| 243 | 248 | |
| 244 | 249 | /** |
| 245 | 250 | * Free an AVFifoBuffer. |
| 246 | 251 | * @param f AVFifoBuffer to free |
| 252 | + * @deprecated use the AVFifo API with av_fifo_freep2() |
| 247 | 253 | */ |
| 254 | +attribute_deprecated |
| 248 | 255 | void av_fifo_free(AVFifoBuffer *f); |
| 249 | 256 | |
| 250 | 257 | /** |
| 251 | 258 | * Free an AVFifoBuffer and reset pointer to NULL. |
| 252 | 259 | * @param f AVFifoBuffer to free |
| 260 | + * @deprecated use the AVFifo API with av_fifo_freep2() |
| 253 | 261 | */ |
| 262 | +attribute_deprecated |
| 254 | 263 | void av_fifo_freep(AVFifoBuffer **f); |
| 255 | 264 | |
| 256 | 265 | /** |
| 257 | 266 | * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied. |
| 258 | 267 | * @param f AVFifoBuffer to reset |
| 268 | + * @deprecated use av_fifo_reset2() with the new AVFifo-API |
| 259 | 269 | */ |
| 270 | +attribute_deprecated |
| 260 | 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 | 275 | * amount of data you can read from it. |
| 265 | 276 | * @param f AVFifoBuffer to read from |
| 266 | 277 | * @return size |
| 278 | + * @deprecated use av_fifo_can_read() with the new AVFifo-API |
| 267 | 279 | */ |
| 280 | +attribute_deprecated |
| 268 | 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 | 285 | * amount of data you can write into it. |
| 273 | 286 | * @param f AVFifoBuffer to write into |
| 274 | 287 | * @return size |
| 288 | + * @deprecated use av_fifo_can_write() with the new AVFifo-API |
| 275 | 289 | */ |
| 290 | +attribute_deprecated |
| 276 | 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 | 300 | * @param dest data destination |
| 286 | 301 | * |
| 287 | 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 | 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 | 316 | * @param dest data destination |
| 298 | 317 | * |
| 299 | 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 | 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 | 331 | * @param dest data destination |
| 309 | 332 | * |
| 310 | 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 | 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 | 350 | * indicate no more data available to write. |
| 324 | 351 | * If func is NULL, src is interpreted as a simple byte array for source data. |
| 325 | 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 | 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 | 364 | * @param f AVFifoBuffer to resize |
| 334 | 365 | * @param size new AVFifoBuffer size in bytes |
| 335 | 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 | 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 | 379 | * @param f AVFifoBuffer to resize |
| 345 | 380 | * @param additional_space the amount of space in bytes to allocate in addition to av_fifo_size() |
| 346 | 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 | 387 | int av_fifo_grow(AVFifoBuffer *f, unsigned int additional_space); |
| 349 | 388 | |
| 350 | 389 | /** |
| 351 | 390 | * Read and discard the specified amount of data from an AVFifoBuffer. |
| 352 | 391 | * @param f AVFifoBuffer to read from |
| 353 | 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 | 397 | void av_fifo_drain(AVFifoBuffer *f, int size); |
| 356 | 398 | |
| 357 | 399 | #if FF_API_FIFO_PEEK2 |
| @@ -364,7 +406,7 @@ void av_fifo_drain(AVFifoBuffer *f, int size); · 6 unmodified lines |
| 364 | 406 | * than the used buffer size or the returned pointer will |
| 365 | 407 | * point outside to the buffer data. |
| 366 | 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 | 411 | attribute_deprecated |
| 370 | 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 | 419 | return ptr; |
| 378 | 420 | } |
| 379 | 421 | #endif |
| 422 | +#endif |
| 380 | 423 | |
| 381 | 424 | #endif /* AVUTIL_FIFO_H */ |