|
|
|
@ -1367,15 +1367,19 @@ typedef struct AVPacketSideData { |
|
|
|
|
* 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 or destruct (deprecated) |
|
|
|
|
* fields. If either is set, the packet data is dynamically allocated and is |
|
|
|
|
* valid indefinitely until av_free_packet() is called (which in turn calls |
|
|
|
|
* av_buffer_unref()/the destruct callback to free the data). If neither is set, |
|
|
|
|
* the packet data is typically backed by some static buffer somewhere and is |
|
|
|
|
* only valid for a limited time (e.g. until the next read call when demuxing). |
|
|
|
|
* 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 |
|
|
|
|
* reference count to 0. |
|
|
|
|
* |
|
|
|
|
* The side data is always allocated with av_malloc() and is freed in |
|
|
|
|
* av_free_packet(). |
|
|
|
|
* If the buf field is not set av_packet_ref() would make a copy instead |
|
|
|
|
* of increasing the reference count. |
|
|
|
|
* |
|
|
|
|
* The side data is always allocated with av_malloc(), copied by |
|
|
|
|
* av_packet_ref() and freed by av_packet_unref(). |
|
|
|
|
* |
|
|
|
|
* @see av_packet_ref |
|
|
|
|
* @see av_packet_unref |
|
|
|
|
*/ |
|
|
|
|
typedef struct AVPacket { |
|
|
|
|
/**
|
|
|
|
@ -3899,7 +3903,7 @@ int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size); |
|
|
|
|
* packet is allocated if it was not really allocated. |
|
|
|
|
*/ |
|
|
|
|
int av_dup_packet(AVPacket *pkt); |
|
|
|
|
|
|
|
|
|
#if FF_API_AVPACKET_OLD_API |
|
|
|
|
/**
|
|
|
|
|
* Copy packet, including contents |
|
|
|
|
* |
|
|
|
@ -3917,10 +3921,13 @@ int av_copy_packet_side_data(AVPacket *dst, const AVPacket *src); |
|
|
|
|
/**
|
|
|
|
|
* Free a packet. |
|
|
|
|
* |
|
|
|
|
* @deprecated Use av_packet_unref |
|
|
|
|
* |
|
|
|
|
* @param pkt packet to free |
|
|
|
|
*/ |
|
|
|
|
attribute_deprecated |
|
|
|
|
void av_free_packet(AVPacket *pkt); |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
/**
|
|
|
|
|
* Allocate new information of a packet. |
|
|
|
|
* |
|
|
|
@ -4563,8 +4570,7 @@ AVCodec *avcodec_find_encoder_by_name(const char *name); |
|
|
|
|
* of the output packet. |
|
|
|
|
* |
|
|
|
|
* If this function fails or produces no output, avpkt will be |
|
|
|
|
* freed using av_free_packet() (i.e. avpkt->destruct will be |
|
|
|
|
* called to free the user supplied buffer). |
|
|
|
|
* freed using av_packet_unref(). |
|
|
|
|
* @param[in] frame AVFrame containing the raw audio data to be encoded. |
|
|
|
|
* May be NULL when flushing an encoder that has the |
|
|
|
|
* AV_CODEC_CAP_DELAY capability set. |
|
|
|
@ -4605,8 +4611,7 @@ int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, |
|
|
|
|
* caller, he is responsible for freeing it. |
|
|
|
|
* |
|
|
|
|
* If this function fails or produces no output, avpkt will be |
|
|
|
|
* freed using av_free_packet() (i.e. avpkt->destruct will be |
|
|
|
|
* called to free the user supplied buffer). |
|
|
|
|
* freed using av_packet_unref(). |
|
|
|
|
* @param[in] frame AVFrame containing the raw video data to be encoded. |
|
|
|
|
* May be NULL when flushing an encoder that has the |
|
|
|
|
* AV_CODEC_CAP_DELAY capability set. |
|
|
|
|