libavcodec/avpacket.c File Reference

#include "avcodec.h"
#include "internal.h"
#include "libavutil/avassert.h"
#include "bytestream.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_t * av_packet_new_side_data (AVPacket *pkt, enum AVPacketSideDataType type, int size)
 Allocate new information of a packet.
uint8_t * av_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)


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 108 of file avpacket.c.

Referenced by av_dup_packet().

#define FF_MERGE_MARKER   0x8c4d9d108e25e9feULL

Definition at line 205 of file avpacket.c.

Referenced by av_packet_merge_side_data(), and av_packet_split_side_data().


Function Documentation

void av_destruct_packet ( AVPacket pkt  ) 

void av_destruct_packet_nofree ( AVPacket pkt  ) 

Deprecated:
use NULL instead

Definition at line 27 of file avpacket.c.

Referenced by av_dup_packet().

int av_dup_packet ( AVPacket pkt  ) 

Warning:
This is a hack - the packet memory allocation stuff is broken. The packet is allocated if it was not really allocated.

Definition at line 126 of file avpacket.c.

Referenced by av_read_frame(), avformat_find_stream_info(), ff_interleave_add_packet(), and packet_queue_put().

void av_free_packet ( AVPacket pkt  ) 

Free a packet.

Parameters:
pkt packet to free

Definition at line 156 of file avpacket.c.

Referenced by adx_read_packet(), amr_read_packet(), applehttp_read_seek(), asf_read_header(), asf_read_pts(), asf_reset_header(), asfrtp_parse_packet(), audio_decode_frame(), audio_read_packet(), av_get_packet(), av_interleaved_write_frame(), av_packet_merge_side_data(), av_read_packet(), av_write_trailer(), avformat_free_context(), avi_read_close(), avs_read_video_packet(), cin_read_packet(), dfa_read_packet(), do_streamcopy(), dxa_read_packet(), encode_audio_frame(), estimate_timings_from_pts(), extract_mpeg4_header(), ff_asf_parse_packet(), ff_free_parser_state(), ff_raw_read_partial_packet(), ff_read_frame_flush(), ff_rm_free_rmstream(), ffm_read_packet(), flic_read_packet(), flush_packet_queue(), fourxm_read_packet(), free_packet_list(), free_pkt_fifo(), free_variant_list(), g723_1_read_packet(), gsm_read_packet(), http_prepare_data(), ingenient_read_packet(), interleave_packet(), load_ipmovie_packet(), lxf_read_packet(), main(), matroska_clear_queue(), mmf_read_packet(), modplug_read_packet(), mpc_read_packet(), mpc_read_seek(), mpegts_get_dts(), mpegts_raw_read_packet(), mxf_interleave_get_packet(), nc_read_packet(), nsv_read_close(), nuv_packet(), packet_queue_flush(), pulse_read_packet(), qt_rtp_parse_packet(), read_frame_internal(), read_packet(), read_thread(), rl2_read_packet(), rm_assemble_video_frame(), rm_read_packet(), rpl_read_packet(), sap_fetch_packet(), search_hi_lo_keyframes(), seek_frame_generic(), seek_subtitle(), show_packets(), spdif_read_packet(), str_read_close(), str_read_packet(), stream_component_close(), subtitle_thread(), thp_read_packet(), transcode(), vid_read_packet(), video_thread(), vmd_read_packet(), vqf_read_packet(), wc3_read_close(), write_frame(), wv_read_packet(), wv_read_seek(), xiph_handle_packet(), yop_read_close(), yop_read_packet(), and yop_read_seek().

int av_grow_packet ( AVPacket pkt,
int  grow_by 
)

Increase packet size, correctly zeroing padding.

Parameters:
pkt packet
grow_by number of bytes by which to increase the size of the packet

Definition at line 91 of file avpacket.c.

Referenced by av_append_packet().

void av_init_packet ( AVPacket pkt  ) 

int av_new_packet ( AVPacket pkt,
int  size 
)

Allocate the payload of a packet and initialize its fields with default values.

Parameters:
pkt packet
size wanted payload size
Returns:
0 if OK, AVERROR_xxx otherwise

Definition at line 65 of file avpacket.c.

Referenced by a64_write_packet(), aac_parse_packet(), amr_handle_packet(), amr_read_packet(), ape_read_packet(), audio_read_packet(), av_get_packet(), av_grow_packet(), avisynth_read_packet(), avs_read_video_packet(), bmv_read_packet(), callback(), cin_read_packet(), decode_frame(), dxa_read_packet(), fbdev_read_packet(), ff_alloc_packet(), ff_asf_parse_packet(), ff_interleave_new_audio_packet(), ff_raw_read_partial_packet(), ff_rm_retrieve_cache(), ffm_read_packet(), film_read_packet(), flic_read_packet(), fourxm_read_packet(), g723_1_read_packet(), grab_read_packet(), h263_handle_packet(), h264_handle_packet(), iff_read_packet(), ingenient_read_packet(), latm_parse_packet(), lavfi_read_packet(), load_ipmovie_packet(), lxf_read_packet(), matroska_parse_block(), microdvd_read_packet(), mmf_read_packet(), modplug_read_packet(), mpc_read_packet(), mpegts_raw_read_packet(), nut_read_packet(), nuv_packet(), ogg_read_packet(), pulse_read_packet(), qdm2_restore_block(), qt_rtp_parse_packet(), read_frame(), read_packet(), return_stored_frame(), rm_assemble_video_frame(), rm_read_audio_stream_info(), roq_read_packet(), rtp_parse_packet_internal(), sbg_read_packet(), seq_read_packet(), siff_read_packet(), smacker_read_packet(), spdif_read_packet(), srt_read_packet(), store_packet(), str_read_packet(), supply_new_packets(), swf_read_packet(), videostream_cb(), vmd_read_packet(), vqf_read_packet(), wsaud_read_packet(), wv_read_packet(), xiph_handle_packet(), and yop_read_packet().

uint8_t* av_packet_get_side_data ( AVPacket pkt,
enum AVPacketSideDataType  type,
int *  size 
)

Get side information from packet.

Parameters:
pkt packet
type desired side information type
size pointer for side information size to store (optional)
Returns:
pointer to data if present or NULL otherwise

Definition at line 190 of file avpacket.c.

Referenced by aac_decode_frame(), apply_param_change(), cinepak_decode_frame(), decode_frame(), decode_tag(), idcin_decode_frame(), ipvideo_decode_frame(), msrle_decode_frame(), msvideo1_decode_frame(), qtrle_decode_frame(), raw_decode(), and smc_decode_frame().

int av_packet_merge_side_data ( AVPacket pkt  ) 

Definition at line 207 of file avpacket.c.

Referenced by av_read_packet().

uint8_t* av_packet_new_side_data ( AVPacket pkt,
enum AVPacketSideDataType  type,
int  size 
)

Allocate new information of a packet.

Parameters:
pkt packet
type side information type
size side information size
Returns:
pointer to fresh allocated data or NULL otherwise

Definition at line 166 of file avpacket.c.

Referenced by ff_add_param_change(), ff_asf_parse_packet(), flv_read_packet(), idcin_read_packet(), load_ipmovie_packet(), and mov_read_packet().

int av_packet_split_side_data ( AVPacket pkt  ) 

Definition at line 241 of file avpacket.c.

Referenced by avcodec_decode_audio4(), and avcodec_decode_video2().

void av_shrink_packet ( AVPacket pkt,
int  size 
)

Reduce packet size, correctly zeroing padding.

Parameters:
pkt packet
size new size

Definition at line 84 of file avpacket.c.

Referenced by av_append_packet(), av_get_packet(), cin_read_packet(), ff_asf_parse_packet(), ff_raw_read_partial_packet(), mxf_decrypt_triplet(), mxf_get_d10_aes3_packet(), nuv_packet(), and yop_read_packet().

void ff_packet_free_side_data ( AVPacket pkt  ) 

Remove and free all side data from packet.

Definition at line 34 of file avpacket.c.

Referenced by av_destruct_packet(), and avcodec_decode_video2().


Generated on Fri Oct 26 02:46:07 2012 for FFmpeg by  doxygen 1.5.8