libavutil/mem.h File Reference

memory handling functions More...

#include "attributes.h"
#include "error.h"
#include "avutil.h"

Go to the source code of this file.

Defines

#define DECLARE_ALIGNED(n, t, v)   t v
#define DECLARE_ASM_CONST(n, t, v)   static const t v
#define av_malloc_attrib
#define av_alloc_size(n)

Functions

void * av_malloc (size_t size) av_malloc_attrib av_alloc_size(1)
 Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU).
void * av_realloc (void *ptr, size_t size) av_alloc_size(2)
 Allocate or reallocate a block of memory.
void * av_realloc_f (void *ptr, size_t nelem, size_t elsize)
 Allocate or reallocate a block of memory.
void av_free (void *ptr)
 Free a memory block which has been allocated with av_malloc(z)() or av_realloc().
void * av_mallocz (size_t size) av_malloc_attrib av_alloc_size(1)
 Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block.
void * av_calloc (size_t nmemb, size_t size) av_malloc_attrib
 Allocate a block of nmemb * size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block.
char * av_strdup (const char *s) av_malloc_attrib
 Duplicate the string s.
void av_freep (void *ptr)
 Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer pointing to it to NULL.
void av_dynarray_add (void *tab_ptr, int *nb_ptr, void *elem)
 Add an element to a dynamic array.
static int av_size_mult (size_t a, size_t b, size_t *r)
 Multiply two size_t values checking for overflow.


Detailed Description

memory handling functions

Definition in file mem.h.


Define Documentation

#define av_alloc_size (  ) 

Definition at line 63 of file mem.h.

#define av_malloc_attrib

Definition at line 57 of file mem.h.

#define DECLARE_ALIGNED ( n,
t,
 )     t v

#define DECLARE_ASM_CONST ( n,
t,
 )     static const t v

Definition at line 51 of file mem.h.


Function Documentation

void* av_calloc ( size_t  nmemb,
size_t  size 
)

Allocate a block of nmemb * size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block.

The allocation will fail if nmemb * size is greater than or equal to INT_MAX.

Parameters:
nmemb 
size 
Returns:
Pointer to the allocated block, NULL if it cannot be allocated.

Definition at line 188 of file mem.c.

void av_dynarray_add ( void *  tab_ptr,
int *  nb_ptr,
void *  elem 
)

Add an element to a dynamic array.

Parameters:
tab_ptr Pointer to the array.
nb_ptr Pointer to the number of elements in the array.
elem Element to be added.

Definition at line 208 of file mem.c.

void av_free ( void *  ptr  ) 

Free a memory block which has been allocated with av_malloc(z)() or av_realloc().

Parameters:
ptr Pointer to the memory block which should be freed.
Note:
ptr = NULL is explicitly allowed.

It is recommended that you use av_freep() instead.

See also:
av_freep()

Definition at line 163 of file mem.c.

Referenced by a64multi_close_encoder(), add_pes_stream(), alloc_blocks(), alloc_picture(), amr_free_context(), applehttp_close(), applehttp_open(), asf_write_trailer(), asfrtp_free_context(), asfrtp_parse_packet(), atrac3_decode_close(), atrac3_decode_init(), audio_decode_example(), audio_encode_example(), audio_resample(), audio_resample_close(), av_audio_convert_free(), av_audio_resample_init(), av_bitstream_filter_close(), av_destruct_packet(), av_dict_free(), av_dict_set(), av_dump_format(), av_expr_parse(), av_fast_malloc(), av_fft_end(), av_fifo_free(), av_fifo_realloc2(), av_file_unmap(), av_freep(), av_image_alloc(), av_new_stream(), av_parser_close(), av_parser_init(), av_probe_input_buffer(), av_read_frame(), av_read_packet(), av_realloc_f(), av_resample_init(), av_set_string3(), av_tree_destroy(), avcodec_alloc_context3(), avfilter_default_get_audio_buffer(), avfilter_default_get_video_buffer(), avfilter_formats_unref(), avfilter_free(), avfilter_get_video_buffer_ref_from_arrays(), avfilter_merge_formats(), avfilter_open(), avfilter_ref_buffer(), avfilter_unref_buffer(), avformat_free_context(), avi_read_close(), avi_write_trailer(), avio_close(), avio_close_dyn_buf(), avisynth_read_close(), avpicture_free(), bfi_decode_close(), build_filter(), callback(), celt_header(), cinvideo_decode_end(), close(), close_audio(), close_connection(), close_video(), concat_open(), cond_release_buffer(), convert_str(), cook_decode_close(), copy_frame(), decode_end(), decode_frame(), deinterlace_bottom_field_inplace(), delete_cluts(), delete_objects(), delete_region_display_list(), delete_regions(), dilate_init(), dirac_parse_close(), DiracFreeFrame(), dnxhd_encode_end(), doTest(), dshow_open_device(), dshow_read_close(), dshow_read_packet(), dv1394_close(), dv_init_demux(), dv_read_close(), dvbsub_close_decoder(), dvbsub_parse_page_segment(), dvbsub_parse_region_segment(), ebml_free(), ebml_read_ascii(), ebml_read_binary(), encode_end(), encode_frame(), encode_picture_ls(), enu_free(), escape124_decode_close(), escape124_decode_frame(), ff_asf_parse_packet(), ff_ass_split_free(), ff_avfilter_default_free_buffer(), ff_cavs_end(), ff_ccitt_unpack(), ff_dct_end(), ff_dct_init(), ff_do_elbg(), ff_free_parser_state(), ff_gen_syncpoint_search(), ff_h264_decode_picture_parameter_set(), ff_http_auth_create_response(), ff_id3v2_parse(), ff_iir_filter_free_coeffs(), ff_iir_filter_free_state(), ff_init_elbg(), ff_isom_write_avcc(), ff_jpegls_decode_picture(), ff_mjpeg_decode_end(), ff_mjpeg_encode_close(), ff_mjpeg_find_marker(), ff_mov_add_hinted_packet(), ff_mov_close_hinting(), ff_mp4_read_dec_config_descr(), ff_mpegts_parse_close(), ff_nut_add_sp(), ff_parse1_close(), ff_parse_fmtp(), ff_pca_free(), ff_png_zfree(), ff_psy_preprocess_end(), ff_rdt_parse_close(), ff_restore_parser_state(), ff_rtp_chain_mux_open(), ff_rtp_reset_packet_queue(), ff_rtsp_close_streams(), ff_rtsp_setup_output_streams(), ff_rtsp_undo_setup(), ff_store_parser_state(), ff_wma_end(), ff_wms_parse_sdp_a_line(), ff_yuv2rgb_c_init_tables(), ffio_fdopen(), ffio_rewind_with_probe_data(), ffio_set_buf_size(), ffmpeg_exit(), ffurl_close(), film_read_close(), film_read_header(), film_read_packet(), find_and_decode_index(), flac_parse(), flac_parse_close(), flashsv_decode_end(), flashsv_decode_frame(), flashsv_encode_end(), flic_read_header(), flush_packet_queue(), flv_get_extradata(), flv_write_packet(), fourxm_read_header(), free_context(), free_filter_param(), free_fragment_if_needed(), free_mp_image(), free_packet_list(), free_segment_list(), free_variant_list(), freeBuffers(), frei0r_init(), generate_codebook(), generate_new_codebooks(), get_meta(), get_metadata(), get_tag(), gif_write_header(), glyph_enu_free(), h264_free_context(), h264_mp4toannexb_filter(), http_parse_request(), http_receive_data(), init(), init_coef_vlc(), init_cook_mlt(), init_pass2(), init_vlc_sparse(), initFilter(), latm_decode_audio_specific_config(), latm_free_context(), latm_parse_packet(), link_filter_inouts(), main(), make_digest_auth(), matroska_clear_queue(), matroska_decode_buffer(), matroska_deliver_packet(), matroska_fix_ass_packet(), matroska_merge_packets(), matroska_parse_block(), matroska_read_close(), matroska_read_header(), merge_ref(), mimic_decode_end(), mjpeg_decode_com(), mkv_flush_dynbuf(), mkv_write_block(), mkv_write_codecprivate(), mkv_write_seekhead(), mkv_write_trailer(), mmap_close(), mmap_init(), mmap_release_buffer(), mms_close(), mmsh_close(), mov_read_cmov(), mov_read_dref(), mov_read_glbl(), mov_read_packet(), mov_read_smi(), mov_read_strf(), mov_read_stsz(), mov_read_wave(), mov_write_ctts_tag(), mov_write_stts_tag(), mov_write_trailer(), mov_write_udta_tag(), mpc7_decode_frame(), mpc8_parse_seektable(), mpeg_mux_init(), mpegts_close_filter(), mpegts_open_section_filter(), mpegts_set_stream_info(), mpegts_write_end(), mpegts_write_header(), mpegts_write_packet(), new_connection(), nsv_parse_NSVf_header(), nsv_read_close(), nut_read_header(), ogg_new_buf(), ogg_read_close(), ogg_read_page(), ogg_restore(), ogg_write_page(), ogg_write_trailer(), ogm_chapter(), opt_vstats_file(), output_packet(), packet_queue_get(), parse_device_name(), parse_filter(), parse_fmtp_config(), parse_inputs(), parse_key_value_pair(), parse_outputs(), pcx_decode_frame(), pmt_cb(), pp_free_context(), pp_free_mode(), pp_get_mode_by_name_and_quality(), pre_process_video_frame(), prepare_sdp_description(), put_packet(), qcelp_free_context(), qdm2_extradata_free(), qt_rtp_free(), qt_rtp_parse_packet(), qtrle_encode_end(), radix_sort(), rdt_free_context(), read_frame(), read_shape_from_file(), read_tag(), reallocAlign(), release_buffer(), request_frame(), rl2_decode_end(), rl2_read_header(), rm_write_audio(), roq_encode_end(), roq_encode_video(), rtmp_calc_digest(), rtmp_close(), rtmp_open(), rtp_check_and_send_back_rr(), rtp_close(), rtp_new_av_stream(), rtp_new_connection(), rtp_open(), rtp_parse_close(), rtp_parse_mp4_au(), rtp_parse_open(), rtp_parse_queued_packet(), rtp_send_punch_packets(), rtsp_cmd_describe(), sample_queue_free(), sample_queue_pop(), sap_write_header(), SchroedingerFreeFrame(), sdp_parse_fmtp_config_h264(), sdt_cb(), seq_read_close(), set_common_formats(), set_params(), smacker_decode_header_tree(), smacker_read_close(), smacker_read_header(), smka_decode_frame(), sp5x_decode_frame(), store_in_pool(), stream_close(), stream_open(), svq1_decode_frame(), svq3_decode_init(), svq3_extradata_free(), svq3_parse_packet(), sws_addVec(), sws_convVec(), sws_freeContext(), sws_freeFilter(), sws_freeVec(), sws_shiftVec(), sws_subVec(), tcp_close(), tcp_write_packet(), tgv_decode_end(), thread_free(), thread_init(), tiff_unpack_strip(), tm2_build_huff_table(), tm2_free_codes(), tqi_decode_end(), truemotion1_decode_end(), try_decode_frame(), tta_decode_close(), twin_decode_close(), udp_close(), udp_open(), uninit(), url_open_dyn_buf_internal(), vc1_decode_frame(), vc1_decode_init(), vc1_extract_headers(), vf_get_image(), vf_next_put_image(), vfw_read_close(), vfw_read_packet(), video_audio_display(), video_decode_example(), video_encode_example(), video_thread(), videostream_cb(), vmd_read_close(), vmd_read_header(), vmdvideo_decode_end(), vorbis_free(), vorbis_parse_setup_hdr_codebooks(), vp3_decode_end(), vp56_size_changed(), vp8_free_context(), vqa_decode_end(), write_globalinfo(), write_headers(), write_streaminfo(), wsvqa_read_header(), wtvfile_close(), wtvfile_open_sector(), X264_close(), XAVS_close(), xiph_free_context(), xiph_parse_fmtp_pair(), and xwma_read_header().

void av_freep ( void *  ptr  ) 

Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer pointing to it to NULL.

Parameters:
ptr Pointer to the pointer to the memory block which should be freed.
See also:
av_free()

Definition at line 173 of file mem.c.

Referenced by aac_decode_close(), aac_encode_close(), aac_encode_end(), aacPlus_encode_close(), adx_encode_close(), alac_decode_close(), alac_encode_close(), alloc_frame_buffer(), amr_wb_encode_close(), ape_decode_close(), ape_read_close(), asf_read_stream_properties(), asf_write_header1(), asfrtp_free_context(), asfrtp_parse_packet(), audio_resample_close(), av_bitstream_filter_close(), av_destruct_packet(), av_dict_free(), av_dict_set(), av_expr_free(), av_fft_init(), av_fifo_alloc(), av_fifo_free(), av_interleave_packet_per_dts(), av_opt_free(), av_read_packet(), av_resample_close(), av_set_string3(), av_write_trailer(), avcodec_close(), avcodec_copy_context(), avcodec_default_free_buffers(), avcodec_default_get_buffer(), avcodec_open2(), avfilter_free(), avfilter_get_audio_buffer_ref_from_arrays(), avfilter_graph_free(), avfilter_graph_parse(), avfilter_inout_free(), avfilter_link_free(), avfilter_open(), avfilter_unref_buffer(), avformat_find_stream_info(), avformat_free_context(), avi_read_close(), avi_read_header(), avi_write_trailer(), avsubtitle_free(), build_feed_streams(), calc_rice_params(), che_configure(), cleanup(), clear_programs(), close_connection(), close_decoder(), color_uninit(), common_end(), common_init_after_header(), concat_close(), concat_open(), cond_release_buffer(), copy_parameter_set(), crypto_close(), crypto_open(), decode(), decode_close(), decode_dvd_subtitles(), decode_end(), decode_frame(), decode_init(), decode_update_thread_context(), dfa_decode_end(), DiracFreeFrame(), dnxhd_encode_end(), doTest(), dvbsub_close_decoder(), dvbsub_parse_close(), dvdsub_parse(), dvdsub_parse_close(), ebml_free(), ebml_read_binary(), eightsvx_decode_close(), encode_close(), encode_end(), estimate_best_b_count(), extract_header(), extract_mpeg4_header(), Faac_encode_close(), ff_ac3_encode_close(), ff_ac3_float_mdct_end(), ff_alsa_close(), ff_avc_parse_nal_units_buf(), ff_bgmc_end(), ff_dirac_schro_queue_pop(), ff_fft_end(), ff_fft_init(), ff_h264_free_context(), ff_intrax8_common_end(), ff_ivi_free_buffers(), ff_ivi_init_tiles(), ff_j2k_cleanup(), ff_j2k_dwt_destroy(), ff_lpc_end(), ff_lzw_decode_close(), ff_mdct_end(), ff_mjpeg_decode_end(), ff_mjpeg_decode_sof(), ff_mms_read_header(), ff_mov_add_hinted_packet(), ff_mov_close_hinting(), ff_mov_init_hinting(), ff_parse_close(), ff_pca_free(), ff_psy_end(), ff_psy_preprocess_end(), ff_rate_control_uninit(), ff_rtmp_packet_destroy(), ff_rtsp_setup_input_streams(), ff_rv34_decode_end(), ff_slice_buffer_destroy(), ff_sndio_close(), ff_sndio_open(), ff_thread_free(), ff_timefilter_destroy(), ff_vaapi_common_end_frame(), ff_vorbis_comment(), ff_vp56_free(), ffio_fdopen(), ffm_close(), ffmpeg_exit(), find_smallest_bounding_rectangle(), fixup_vorbis_headers(), flac_decode_close(), flac_encode_close(), flac_parse(), flac_parse_close(), flac_read_header(), flac_write_block_comment(), fourxm_read_close(), fourxm_read_header(), frame_thread_free(), free_acl_list(), free_buffers(), free_bundles(), free_coded_frame(), free_duplicate_context(), free_frame_buffer(), free_picture(), free_section(), free_segment_list(), free_tables(), free_variant_list(), free_vlc(), FreeSchroFrame(), g722_close(), g726_close(), get_http_header_data(), get_tag(), get_tcp_server_response(), gif_encode_close(), gopher_close(), gxf_write_trailer(), h264_mp4toannexb_filter(), handle_connection(), http_connect(), http_prepare_data(), http_send_data(), id3v2_put_ttag(), init_vlc_sparse(), initFilter(), iv_alloc_frames(), iv_free_func(), latm_parse_packet(), libdirac_decode_close(), libdirac_encode_close(), libdirac_encode_frame(), libgsm_close(), libschroedinger_decode_buffer_free(), libschroedinger_decode_close(), libschroedinger_encode_close(), libschroedinger_encode_frame(), load_glyph(), main(), matroska_clear_queue(), matroska_deliver_packet(), mjpega_dump_header(), mkv_write_simpletag(), mkv_write_trailer(), mms_close(), mmsh_close(), mmsh_open(), mov_read_chapters(), mov_read_close(), mov_read_ftyp(), mov_read_stsz(), mov_read_trak(), mov_write_header(), mov_write_trailer(), MP3lame_encode_close(), MP3lame_encode_init(), mp_decode_end(), MPA_encode_close(), mpc_read_close(), mpegts_close_filter(), mpegts_read_packet(), mpegts_write_end(), mpegts_write_header(), MPV_common_end(), MPV_encode_end(), mxf_free(), mxf_interleave_get_packet(), mxf_read_close(), mxf_write_footer(), mxg_close(), mxpeg_decode_end(), mxpeg_decode_mxm(), new_audio_stream(), new_data_stream(), new_stream(), new_subtitle_stream(), new_video_stream(), nsv_read_close(), nut_read_close(), ogg_read_page(), ogg_write_header(), ogg_write_pages(), ogg_write_trailer(), oggvorbis_encode_close(), opt_codec(), opt_input_file(), opt_output_file(), packet_queue_flush(), parse_ffconfig(), parse_fmtp_config(), parse_iplconvkernel(), parse_keyframes_index(), parse_link_name(), parse_primary(), pcm_encode_close(), pmp_close(), psy_3gpp_end(), put_str16(), qdm2_parse_config(), qt_rtp_free(), qt_rtp_parse_packet(), r3d_close(), raw_close_decoder(), rdt_free_context(), rdt_parse_packet(), read_close(), read_gab2_sub(), read_header(), remove_decoded_packets(), roq_dpcm_encode_close(), rtmp_close(), rtp_write_trailer(), rtsp_read_close(), sample_queue_free(), sap_read_close(), sap_write_close(), sap_write_header(), SchroedingerFreeFrame(), sdl_write_trailer(), shorten_decode_close(), sox_read_header(), spdif_write_trailer(), stop_jack(), store_in_pool(), svq1_encode_end(), svq3_decode_end(), svq3_parse_packet(), sws_allocVec(), sws_freeContext(), sws_freeVec(), tgv_decode_frame(), thread_free(), tta_decode_close(), uninit(), uninit_opts(), url_open_buf(), v4l2_set_parameters(), vc1_decode_end(), vfw_read_header(), vorbis_encode_close(), vorbis_free(), vp8_free(), wavpack_decode_end(), write_chapter(), write_header(), write_headers(), write_trailer(), x11grab_read_header(), X264_close(), xan_decode_end(), xan_decode_init(), XAVS_close(), and xiph_handle_packet().

void* av_malloc ( size_t  size  ) 

Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU).

Parameters:
size Size in bytes for the memory block to be allocated.
Returns:
Pointer to the allocated block, NULL if the block cannot be allocated.
See also:
av_mallocz()

Definition at line 70 of file mem.c.

Referenced by a64multi_init_encoder(), aac_encode_init(), aacPlus_encode_init(), add_av_stream1(), add_metadata(), alloc_picture(), alloc_temp(), allocate_buffers(), allocate_initial_states(), allocate_tables(), allocStuff(), apc_read_header(), ape_read_header(), ape_tag_read_field(), applehttp_read_header(), asf_write_header(), ass_decode_init(), ass_encode_init(), audio_resample(), av_audio_convert_alloc(), av_d2str(), av_expr_parse(), av_fast_malloc(), av_fft_init(), av_fifo_alloc(), av_file_map(), av_get_token(), av_image_alloc(), av_malloc(), av_mallocz(), av_new_packet(), av_packet_merge_side_data(), av_packet_new_side_data(), av_packet_split_side_data(), av_parser_change(), av_realloc(), av_set_string3(), av_strdup(), avcodec_alloc_context2(), avcodec_alloc_context3(), avcodec_alloc_frame(), avcodec_default_get_buffer(), avfilter_merge_formats(), avfilter_open(), avfilter_ref_buffer(), avformat_alloc_context(), avformat_find_stream_info(), avi_read_header(), avi_read_tag(), avi_write_packet(), avisynth_read_header(), bfi_read_header(), build_filter(), build_modpred(), calc_rice_params(), celt_header(), common_init(), concat_open(), config(), config_input(), config_props(), convert_str(), copy_parameter_set(), create_cel_evals(), create_map(), create_vorbis_context(), decode_dvd_subtitles(), decode_frame(), decode_header_trees(), decode_init(), decode_main_header(), decode_rle(), decode_slice_header(), decode_update_thread_context(), deinterlace_bottom_field_inplace(), deNoise(), dnxhd_encode_init(), do_subtitle_out(), draw_text(), dshow_add_device(), dump_extradata(), dup_wchar_to_utf8(), dvbsub_display_end_segment(), dvbsub_parse_clut_segment(), dvbsub_parse_init(), dvbsub_parse_region_segment(), dvdsub_parse(), ebml_read_ascii(), ebml_read_binary(), eightsvx_decode_frame(), encode_frame(), encode_init(), encode_nals(), encode_picture_ls(), estimate_best_b_count(), extract_header(), extract_mpeg4_header(), Faac_encode_init(), ff_ac3_float_mdct_init(), ff_alsa_open(), ff_asf_parse_packet(), ff_ass_add_rect(), ff_bgmc_init(), ff_cavs_init_top_lines(), ff_ccitt_unpack(), ff_dct_init(), ff_do_elbg(), ff_fft_init(), ff_fill_line_with_color(), ff_gen_syncpoint_search(), ff_h264_frame_start(), ff_http_auth_create_response(), ff_init_elbg(), ff_ivi_init_planes(), ff_ivi_init_tiles(), ff_j2k_dwt_init(), ff_j2k_init_component(), ff_mdct_init(), ff_mjpeg_decode_sof(), ff_mjpeg_encode_init(), ff_mjpeg_find_marker(), ff_mov_write_packet(), ff_parse_fmtp(), ff_parse_mpeg2_descriptor(), ff_png_zalloc(), ff_psy_init(), ff_rtmp_packet_create(), ff_rv34_decode_init(), ff_sauce_read(), ff_slice_buffer_init(), ff_sndio_open(), ff_store_parser_state(), ff_tempfile(), ff_vorbis_comment(), ff_yuv2rgb_c_init_tables(), ffio_fdopen(), ffio_set_buf_size(), ffm_read_header(), FfmpegFindNextSchroParseUnit(), fft_ref_init(), film_read_header(), film_read_packet(), find_and_decode_index(), find_headers_search_validate(), find_smallest_bounding_rectangle(), flac_encode_init(), flac_header(), flac_write_block_comment(), flashsv_decode_frame(), flic_read_header(), flv_set_video_codec(), fourxm_read_header(), frame_thread_init(), generate_codebook(), generate_new_codebooks(), get_codec_data(), get_meta(), get_metadata(), get_stats(), get_tag(), getstr8(), gif_encode_init(), gopher_open(), halfpel_interpol(), horizX1Filter(), idcin_read_header(), iff_read_header(), imx_dump_header(), init(), init_bundles(), init_coef_vlc(), init_cook_mlt(), init_filter_param(), init_mdct_win(), init_pass2(), init_rl(), init_slice_contexts(), init_slice_state(), init_tiles(), init_vlc_sparse(), initFilter(), initNoise(), iv_alloc_frames(), latm_decode_audio_specific_config(), libAVPin_Setup(), libdirac_decode_frame(), libdirac_encode_init(), main(), make_digest_auth(), make_format_list(), matroska_fix_ass_packet(), matroska_read_header(), mjpeg2jpeg_filter(), mjpeg_decode_com(), mjpega_dump_header(), mmap_init(), mmap_read_frame(), mov2textsub(), mov_build_index(), mov_read_cmov(), mov_read_ctts(), mov_read_dref(), mov_read_ftyp(), mov_read_stco(), mov_read_stps(), mov_read_stsc(), mov_read_stss(), mov_read_stsz(), mov_read_stts(), mov_read_trun(), mov_write_ctts_tag(), mov_write_stts_tag(), mp3_header_compress(), mp3_header_decompress(), MP3lame_encode_init(), mp4_read_iods(), mp_image_alloc_planes(), mpc7_decode_frame(), mpc8_parse_seektable(), mpc_read_header(), mpegts_open_section_filter(), mpegts_push_data(), mpegts_set_stream_info(), mpegts_write_header(), mpegts_write_packet(), MPV_common_init(), mxf_decrypt_triplet(), mxf_read_content_storage(), mxf_read_generic_descriptor(), mxf_read_material_package(), mxf_read_primer_pack(), mxf_read_sequence(), mxf_read_source_package(), mxpeg_decode_mxm(), new_connection(), noise(), nsv_parse_NSVf_header(), nut_read_header(), ogg_new_buf(), ogg_new_stream(), ogg_read_page(), ogg_save(), oggvorbis_encode_init(), open_audio(), open_video(), output_packet(), packet_queue_put(), parse_ffconfig(), parse_forced_key_frames(), parse_packed_headers(), parse_playlist(), pcx_decode_frame(), pp_get_context(), pp_get_mode_by_name_and_quality(), pre_process_video_frame(), prepare_sdp_description(), qt_rtp_parse_packet(), queue_frames(), r3d_read_rdvo(), radix_sort(), raw_init_decoder(), read_ffserver_streams(), read_file(), read_frame(), read_header(), read_shape_from_file(), read_specific_config(), ready_codebook(), rl2_read_header(), rm_read_extradata(), rm_write_audio(), roq_encode_init(), rtp_new_connection(), rtp_parse_mp4_au(), rtp_write_header(), sample_queue_retain(), scale_image(), sdp_parse_fmtp_config_h264(), seq_init_frame_buffers(), smacker_read_header(), sox_read_header(), spdif_write_header(), speex_header(), start_jack(), start_slice(), submit_stats(), svq1_decode_frame(), svq1_encode_frame(), svq3_decode_init(), svq3_parse_packet(), sws_allocVec(), sws_getDefaultFilter(), sws_init_context(), tcp_open(), text2movsub(), tgv_decode_frame(), tiff_unpack_strip(), tm2_build_huff_table(), transcode(), try_decode_frame(), tta_decode_init(), unescape(), unpack_codebook(), vc1_decode_init(), vc1t_read_header(), vf_open(), vfw_read_header(), video_audio_display(), vmd_read_header(), vmdvideo_decode_init(), vorbis_parse_id_hdr(), vorbis_parse_setup_hdr_codebooks(), vorbis_parse_setup_hdr_floors(), vorbis_parse_setup_hdr_residues(), vp56_size_changed(), vp8_decode_frame(), vp8_encode(), vp8_init(), vqa_decode_init(), wc3_read_header(), wtvfile_open_sector(), X264_init(), xan_decode_init(), XAVS_init(), xiph_handle_packet(), xiph_parse_fmtp_pair(), and xwma_read_header().

void* av_mallocz ( size_t  size  ) 

Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block.

Parameters:
size Size in bytes for the memory block to be allocated.
Returns:
Pointer to the allocated block, NULL if it cannot be allocated.
See also:
av_malloc()

Definition at line 180 of file mem.c.

Referenced by a64multi_init_encoder(), aac_adtstoasc_filter(), aac_encode_init(), add_av_stream1(), add_codec(), add_pes_stream(), add_to_pktbuf(), aiff_read_header(), alac_encode_init(), alloc_blocks(), alloc_frame_buffer(), alloc_priv_context(), alloc_temp(), amr_new_context(), applehttp_open(), asf_read_stream_properties(), asfrtp_new_context(), atrac3_decode_init(), av_audio_resample_init(), av_bitstream_filter_init(), av_calloc(), av_dict_set(), av_dump_format(), av_fifo_alloc(), av_new_program(), av_new_stream(), av_parser_init(), av_resample_init(), av_samples_alloc(), av_set_parameters(), avcodec_default_get_buffer(), avcodec_get_context_defaults3(), avcodec_open2(), avfilter_add_format(), avfilter_default_get_video_buffer(), avfilter_get_audio_buffer_ref_from_arrays(), avfilter_get_video_buffer_ref_from_arrays(), avfilter_graph_alloc(), avfilter_inout_alloc(), avfilter_link(), avfilter_merge_formats(), avfilter_open(), avformat_alloc_output_context2(), avformat_open_input(), avformat_write_header(), avi_read_header(), avi_write_header(), avio_alloc_context(), avisynth_read_header(), bfi_decode_init(), callback(), che_configure(), cinvideo_decode_init(), common_init(), common_init_after_header(), concat_open(), config(), config_input(), cook_decode_init(), copy_chapters(), crypto_open(), decode_dvd_subtitles(), decode_frame(), decode_init(), decode_init_thread_copy(), decode_main_header(), decode_stream_header(), dfa_decode_init(), display_end_segment(), doTest(), dv_init_demux(), dvbsub_display_end_segment(), dvbsub_parse_display_definition_segment(), dvbsub_parse_page_segment(), dvbsub_parse_region_segment(), eightsvx_decode_frame(), encode_init(), encode_picture_ls(), enqueue_packet(), ff_ass_add_rect(), ff_ass_split(), ff_cavs_init_top_lines(), ff_create_schro_frame(), ff_dirac_schro_queue_push_back(), ff_er_frame_end(), ff_h264_decode_picture_parameter_set(), ff_h264_decode_seq_parameter_set(), ff_iir_filter_init_state(), ff_interleave_add_packet(), ff_intrax8_common_init(), ff_ivi_init_planes(), ff_ivi_init_tiles(), ff_j2k_tag_tree_init(), ff_jpegls_decode_picture(), ff_lpc_init(), ff_lzw_decode_open(), ff_mjpeg_decode_sof(), ff_mp4_read_dec_config_descr(), ff_mpegts_parse_open(), ff_new_chapter(), ff_nut_add_sp(), ff_pca_init(), ff_psy_init(), ff_psy_preprocess_init(), ff_rate_control_init(), ff_rdt_parse_open(), ff_rm_alloc_rmstream(), ff_rtsp_setup_output_streams(), ff_rv34_decode_init(), ff_slice_buffer_init(), ff_thread_init(), ff_timefilter_new(), ff_wms_parse_sdp_a_line(), ffio_fdopen(), ffurl_register_protocol(), find_headers_search_validate(), fixup_vorbis_headers(), flac_read_header(), flashsv2_encode_init(), flashsv_encode_frame(), flashsv_encode_init(), flv_get_extradata(), frame_thread_init(), g722_init(), get_attachment(), get_http_header_data(), get_siz(), gif_encode_init(), gxf_write_header(), h264_new_context(), http_prepare_data(), http_server(), init(), init_slice_contexts(), latm_new_context(), libdirac_encode_frame(), libschroedinger_encode_frame(), link_filter_inouts(), load_glyph(), main(), make_format_list(), matroska_parse_block(), matroska_read_header(), mkv_start_cues(), mkv_start_seekhead(), mkv_write_header(), mms_open(), mmsh_open(), mov_read_chapters(), mov_read_dref(), mov_read_glbl(), mov_read_smi(), mov_read_strf(), mov_read_trak(), mov_read_wave(), mov_write_header(), mp_decode_init(), mpc8_read_header(), mpc_read_header(), mpeg4video_parse_init(), mpeg_mux_init(), mpeg_mux_write_packet(), mpegts_add_service(), mpegts_open_pes_filter(), mpegts_open_section_filter(), mpegts_write_header(), mxf_read_local_tags(), mxf_write_header(), mxpeg_decode_mxm(), new_connection(), new_context(), new_eval_expr(), new_output_stream(), new_stream(), new_variant(), nsv_parse_NSVf_header(), nsv_parse_NSVs_header(), nut_read_header(), ogg_buffer_page(), ogg_build_flac_headers(), ogg_build_speex_headers(), ogg_write_header(), ogg_write_vorbiscomment(), oma_read_header(), opaque_list_push(), opt_inter_matrix(), opt_intra_matrix(), parse_acl_row(), parse_dynamic_acl(), parse_ffconfig(), parse_fmtp_config(), parse_inputs(), parse_keyframes_index(), parse_primary(), prepare_sdp_description(), psy_3gpp_init(), put_main_header(), qcelp_new_context(), qdm2_extradata_new(), qdm2_parse_config(), qt_rtp_new(), qt_rtp_parse_packet(), qtrle_encode_init(), rdt_new_context(), rdt_parse_b64buf(), read_ffserver_streams(), read_header(), read_kuki_chunk(), read_shape_from_file(), ready_codebook(), ready_residue(), reallocAlign(), rl2_decode_init(), rl2_read_header(), roq_encode_init(), rtmp_calc_digest(), rtmp_open(), rtp_new_av_stream(), rtp_new_connection(), rtp_open(), rtp_parse_open(), rtsp_read_header(), sap_write_header(), smacker_decode_header_tree(), smka_decode_frame(), sp5x_decode_frame(), speex_header(), start_frame(), stream_open(), svq1_encode_init(), svq1_encode_plane(), svq3_extradata_new(), sws_alloc_context(), theora_header(), thread_init(), tm2_build_huff_table(), transcode(), tta_decode_init(), tta_read_header(), udp_open(), update_dimensions(), url_alloc_for_protocol(), url_open_buf(), url_open_dyn_buf_internal(), vc1_decode_frame(), vc1_decode_init(), vc1_extract_headers(), vf_next_put_image(), vf_open(), videostream_cb(), vmd_read_header(), vorbis_header(), vorbis_parse_id_hdr(), vorbis_parse_setup_hdr_codebooks(), vorbis_parse_setup_hdr_floors(), vorbis_parse_setup_hdr_mappings(), vorbis_parse_setup_hdr_modes(), vorbis_parse_setup_hdr_residues(), vp8_new_context(), wmv2_encode_init(), write_header(), wsvqa_read_header(), wtvfile_open_sector(), wv_alloc_frame_context(), xiph_new_context(), xwma_read_header(), and yop_read_header().

void* av_realloc ( void *  ptr,
size_t  size 
)

Allocate or reallocate a block of memory.

If ptr is NULL and size > 0, allocate a new block. If size is zero, free the memory block pointed to by ptr.

Parameters:
size Size in bytes for the memory block to be allocated or reallocated.
ptr Pointer to a memory block already allocated with av_malloc(z)() or av_realloc() or NULL.
Returns:
Pointer to a newly reallocated block or NULL if the block cannot be reallocated or the function is used to free the memory block.
See also:
av_fast_realloc()

Definition at line 126 of file mem.c.

Referenced by add_pat_entry(), alloc_and_copy(), allocate_buffers(), ape_decode_frame(), asf_write_packet(), asfrtp_parse_packet(), ass_split_section(), audio_resample(), av_dict_set(), av_dynarray_add(), av_fast_realloc(), av_grow_packet(), av_new_stream(), av_packet_new_side_data(), av_probe_input_buffer(), av_read_packet(), av_realloc_f(), avfilter_add_format(), avfilter_formats_ref(), avfilter_graph_add_filter(), avfilter_insert_pad(), concat_open(), concatenate_packet(), copy_chapters(), decode_frame(), do_audio_out(), draw_text(), ebml_parse_elem(), ff_alsa_extend_reorder_buf(), ff_ass_add_rect(), ff_program_add_stream_index(), fixup_vorbis_headers(), get_packet(), get_tcp_server_response(), grow_array(), h264_mp4toannexb_filter(), libdirac_encode_frame(), libschroedinger_encode_frame(), main(), matroska_decode_buffer(), matroska_deliver_packet(), matroska_merge_packets(), mkv_add_cuepoint(), mkv_add_seekhead_entry(), mov_read_extradata(), mov_read_trex(), mov_read_trun(), mxf_add_metadata_set(), mxf_write_packet(), mxf_write_partition(), new_video_stream(), nut_read_header(), ogg_new_stream(), ogg_restore(), opt_default(), qt_rtp_parse_packet(), rdt_parse_sdp_line(), realloc_section_array(), reconfigure_at_keyframe(), rtmp_open(), rv34_decode_slice(), sample_queue_push(), smacker_read_packet(), tgv_decode_inter(), theora_header(), tm2_read_stream(), vc1_decode_frame(), vp56_size_changed(), and xan_decode_frame().

void* av_realloc_f ( void *  ptr,
size_t  nelem,
size_t  elsize 
)

Allocate or reallocate a block of memory.

This function does the same thing as av_realloc, except:

  • It takes two arguments and checks the result of the multiplication for integer overflow.
  • It frees the input block in case of failure, thus avoiding the memory leak with the classic "buf = realloc(buf); if (!buf) return -1;".

Definition at line 148 of file mem.c.

Referenced by alloc_table(), avi_read_header(), avi_write_packet(), dyn_buf_write(), ff_mov_write_packet(), ffio_rewind_with_probe_data(), fourxm_read_header(), gxf_write_map_packet(), gxf_write_packet(), and queue_frames().

static int av_size_mult ( size_t  a,
size_t  b,
size_t *  r 
) [inline, static]

Multiply two size_t values checking for overflow.

Returns:
0 if success, AVERROR(EINVAL) if overflow.

Definition at line 162 of file mem.h.

Referenced by av_realloc_f().

char* av_strdup ( const char *  s  ) 


Generated on Fri Oct 26 02:39:50 2012 for FFmpeg by  doxygen 1.5.8