You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.5KB

  1. /*
  2. * This file is part of FFmpeg.
  3. *
  4. * FFmpeg is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * FFmpeg is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with FFmpeg; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef AVCODEC_PACKET_INTERNAL_H
  19. #define AVCODEC_PACKET_INTERNAL_H
  20. #include <stdint.h>
  21. #include "packet.h"
  22. /**
  23. * Append an AVPacket to the list.
  24. *
  25. * @param head List head element
  26. * @param tail List tail element
  27. * @param pkt The packet being appended. The data described in it will
  28. * be made reference counted if it isn't already.
  29. * @param copy A callback to copy the contents of the packet to the list.
  30. May be null, in which case the packet's reference will be
  31. moved to the list.
  32. * @return 0 on success, negative AVERROR value on failure. On failure,
  33. the packet and the list are unchanged.
  34. */
  35. int avpriv_packet_list_put(AVPacketList **head, AVPacketList **tail,
  36. AVPacket *pkt,
  37. int (*copy)(AVPacket *dst, const AVPacket *src),
  38. int flags);
  39. /**
  40. * Remove the oldest AVPacket in the list and return it.
  41. *
  42. * @note The pkt will be overwritten completely on success. The caller
  43. * owns the packet and must unref it by itself.
  44. *
  45. * @param head List head element
  46. * @param tail List tail element
  47. * @param pkt Pointer to an AVPacket struct
  48. * @return 0 on success, and a packet is returned. AVERROR(EAGAIN) if
  49. * the list was empty.
  50. */
  51. int avpriv_packet_list_get(AVPacketList **head, AVPacketList **tail,
  52. AVPacket *pkt);
  53. /**
  54. * Wipe the list and unref all the packets in it.
  55. *
  56. * @param head List head element
  57. * @param tail List tail element
  58. */
  59. void avpriv_packet_list_free(AVPacketList **head, AVPacketList **tail);
  60. int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type);
  61. int ff_side_data_set_prft(AVPacket *pkt, int64_t timestamp);
  62. #endif // AVCODEC_PACKET_INTERNAL_H