+#define FF_PACKETLIST_FLAG_REF_PACKET (1 << 0) /**< Create a new reference for the packet instead of
+ transferring the ownership of the existing one to the
+ list. */
+
+/**
+ * Append an AVPacket to the list.
+ *
+ * @param head List head element
+ * @param tail List tail element
+ * @param pkt The packet being appended. The data described in it will
+ * be made reference counted if it isn't already.
+ * @param flags Any combination of FF_PACKETLIST_FLAG_* flags
+ * @return 0 on success, negative AVERROR value on failure. On failure,
+ the list is unchanged
+ */
+int ff_packet_list_put(AVPacketList **head, AVPacketList **tail,
+ AVPacket *pkt, int flags);
+
+/**
+ * Remove the oldest AVPacket in the list and return it.
+ * The behaviour is undefined if the packet list is empty.
+ *
+ * @note The pkt will be overwritten completely. The caller owns the
+ * packet and must unref it by itself.
+ *
+ * @param head List head element
+ * @param tail List tail element
+ * @param pkt Pointer to an AVPacket struct
+ * @return 0 on success. Success is guaranteed
+ * if the packet list is not empty.
+ */
+int ff_packet_list_get(AVPacketList **head, AVPacketList **tail,
+ AVPacket *pkt);
+