summaryrefslogtreecommitdiff
path: root/libavcodec/avcodec.h
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2015-10-18 17:02:08 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-10-19 20:06:42 +0200
commit4d33d316a131c201c3737f6be621013f66f6bd8a (patch)
tree6ffd8252dba7af2ed17af1ae27e612d84ec211b9 /libavcodec/avcodec.h
parent7a5e6b37aa18fedf1f1faf617589f547689bb029 (diff)
avpacket: Provide an alloc and a free function for the struct
Pave the way for having the size of the AVPacket struct not part of the ABI.
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r--libavcodec/avcodec.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index a370e3ebb8..9e6b0defae 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3413,6 +3413,28 @@ void avsubtitle_free(AVSubtitle *sub);
*/
/**
+ * Allocate an AVPacket and set its fields to default values. The resulting
+ * struct must be freed using av_packet_free().
+ *
+ * @return An AVPacket filled with default values or NULL on failure.
+ *
+ * @note this only allocates the AVPacket itself, not the data buffers. Those
+ * must be allocated through other means such as av_new_packet.
+ *
+ * @see av_new_packet
+ */
+AVPacket *av_packet_alloc(void);
+
+/**
+ * Free the packet, if the packet is reference counted, it will be
+ * unreferenced first.
+ *
+ * @param packet packet to be freed. The pointer will be set to NULL.
+ * @note passing NULL is a no-op.
+ */
+void av_packet_free(AVPacket **pkt);
+
+/**
* Initialize optional fields of a packet with default values.
*
* Note, this does not touch the data and size members, which have to be