Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-01-27 22:24:10 +0300
committerJames Almer <jamrial@gmail.com>2021-03-17 20:12:17 +0300
commitf7db77bd8785d1715d3e7ed7e69bd1cc991f2d07 (patch)
tree8f9a08a90696a47bb22ff18966eefa2b246d575f /libavcodec/packet.h
parenta1cd4191e0685256eafe47dd4f34237cfdb5f6fb (diff)
avcodec/packet: deprecate av_init_packet()
Once removed, sizeof(AVPacket) will stop being a part of the public ABI. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/packet.h')
-rw-r--r--libavcodec/packet.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index 3d9013d783..da4377e09f 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -323,10 +323,6 @@ typedef struct AVPacketSideData {
* packets, with no compressed data, containing only side data
* (e.g. to update some stream parameters at the end of encoding).
*
- * AVPacket is one of the few structs in FFmpeg, whose size is a part of public
- * ABI. Thus it may be allocated on stack and no new fields can be added to it
- * without libavcodec and libavformat major bump.
- *
* The semantics of data ownership depends on the buf field.
* If it is set, the packet data is dynamically allocated and is
* valid indefinitely until a call to av_packet_unref() reduces the
@@ -338,6 +334,12 @@ typedef struct AVPacketSideData {
* The side data is always allocated with av_malloc(), copied by
* av_packet_ref() and freed by av_packet_unref().
*
+ * sizeof(AVPacket) being a part of the public ABI is deprecated. once
+ * av_init_packet() is removed, new packets will only be able to be allocated
+ * with av_packet_alloc(), and new fields may be added to the end of the struct
+ * with a minor bump.
+ *
+ * @see av_packet_alloc
* @see av_packet_ref
* @see av_packet_unref
*/
@@ -397,10 +399,13 @@ typedef struct AVPacket {
#endif
} AVPacket;
+#if FF_API_INIT_PACKET
+attribute_deprecated
typedef struct AVPacketList {
AVPacket pkt;
struct AVPacketList *next;
} AVPacketList;
+#endif
#define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe
#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
@@ -464,6 +469,7 @@ AVPacket *av_packet_clone(const AVPacket *src);
*/
void av_packet_free(AVPacket **pkt);
+#if FF_API_INIT_PACKET
/**
* Initialize optional fields of a packet with default values.
*
@@ -471,8 +477,16 @@ void av_packet_free(AVPacket **pkt);
* initialized separately.
*
* @param pkt packet
+ *
+ * @see av_packet_alloc
+ * @see av_packet_unref
+ *
+ * @deprecated This function is deprecated. Once it's removed,
+ sizeof(AVPacket) will not be a part of the ABI anymore.
*/
+attribute_deprecated
void av_init_packet(AVPacket *pkt);
+#endif
/**
* Allocate the payload of a packet and initialize its fields with