libavcodec/avpacket.c File Reference

#include "internal.h"
#include "libavutil/avassert.h"
#include "bytestream.h"
#include "avcodec.h"

Go to the source code of this file.

Defines

#define DUP_DATA(dst, src, size, padding)
#define FF_MERGE_MARKER   0x8c4d9d108e25e9feULL

Functions

void av_destruct_packet_nofree (AVPacket *pkt)
void ff_packet_free_side_data (AVPacket *pkt)
 Remove and free all side data from packet.
void av_destruct_packet (AVPacket *pkt)
 Default packet destructor.
void av_init_packet (AVPacket *pkt)
 Initialize optional fields of a packet with default values.
int av_new_packet (AVPacket *pkt, int size)
 Allocate the payload of a packet and initialize its fields with default values.
void av_shrink_packet (AVPacket *pkt, int size)
 Reduce packet size, correctly zeroing padding.
int av_grow_packet (AVPacket *pkt, int grow_by)
 Increase packet size, correctly zeroing padding.
int av_dup_packet (AVPacket *pkt)
void av_free_packet (AVPacket *pkt)
 Free a packet.
uint8_tav_packet_new_side_data (AVPacket *pkt, enum AVPacketSideDataType type, int size)
 Allocate new information of a packet.
uint8_tav_packet_get_side_data (AVPacket *pkt, enum AVPacketSideDataType type, int *size)
 Get side information from packet.
int av_packet_merge_side_data (AVPacket *pkt)
int av_packet_split_side_data (AVPacket *pkt)
int av_packet_shrink_side_data (AVPacket *pkt, enum AVPacketSideDataType type, int size)
 Shrink the already allocated side data buffer.


Define Documentation

#define DUP_DATA ( dst,
src,
size,
padding   ) 

Value:

do {                                                                \
        void *data;                                                     \
        if (padding) {                                                  \
            if ((unsigned)(size) >                                      \
                (unsigned)(size) + FF_INPUT_BUFFER_PADDING_SIZE)        \
                goto failed_alloc;                                      \
            data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);      \
        } else {                                                        \
            data = av_malloc(size);                                     \
        }                                                               \
        if (!data)                                                      \
            goto failed_alloc;                                          \
        memcpy(data, src, size);                                        \
        if (padding)                                                    \
            memset((uint8_t *)data + size, 0,                           \
                   FF_INPUT_BUFFER_PADDING_SIZE);                       \
        dst = data;                                                     \
    } while (0)

Definition at line 113 of file avpacket.c.

Referenced by av_dup_packet().

#define FF_MERGE_MARKER   0x8c4d9d108e25e9feULL

Definition at line 217 of file avpacket.c.

Referenced by av_packet_merge_side_data(), and av_packet_split_side_data().


Function Documentation

void ff_packet_free_side_data ( AVPacket pkt  ) 

Remove and free all side data from packet.

Definition at line 35 of file avpacket.c.

Referenced by av_destruct_packet(), avcodec_decode_audio4(), avcodec_decode_video2(), and avcodec_encode_audio().


Generated on Fri Oct 26 02:47:55 2012 for FFmpeg by  doxygen 1.5.8