Memory Management
[Common utility functions]


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(...)

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).
 av_alloc_size (1, 2) static inline void *av_malloc_array(size_t nmemb
 Helper function to allocate a block of size * nmemb bytes with using av_malloc().
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.
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.
void av_max_alloc (size_t max)
 Set the maximum size that may me allocated in one block.

Define Documentation

#define av_alloc_size ( ...   ) 

Definition at line 71 of file mem.h.

#define av_malloc_attrib

Definition at line 65 of file mem.h.

#define DECLARE_ALIGNED ( n,
t,
 )     t v

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

Definition at line 59 of file mem.h.


Function Documentation

av_alloc_size ( ,
 
)

Helper function to allocate a block of size * nmemb bytes with using av_malloc().

Helper function to allocate a block of size * nmemb bytes with using av_mallocz().

Parameters:
nmemb Number of elements
size Size of the single element
Returns:
Pointer to the allocated block, NULL if the block cannot be allocated.
See also:
av_malloc()
Parameters:
nmemb Number of elements
size Size of the single element
Returns:
Pointer to the allocated block, NULL if the block cannot be allocated.
See also:
av_mallocz()

av_malloc_array()

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 205 of file mem.c.

Referenced by config_props(), encode_dvd_subtitles(), ff_avfilter_graph_config_pointers(), get_codecs_sorted(), init(), movie_common_init(), mxf_compute_index_tables(), mxf_compute_ptses_fake_index(), mxf_get_sorted_table_segments(), mxf_read_content_storage(), mxf_read_generic_descriptor(), mxf_read_index_entry_array(), mxf_read_material_package(), mxf_read_primer_pack(), mxf_read_sequence(), mxf_read_source_package(), probe_file(), and wavesynth_parse_extradata().

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 225 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 178 of file mem.c.

Referenced by a64multi_close_encoder(), aac_decode_frame(), add_pes_stream(), amr_free_context(), ape_tag_read_field(), asf_write_trailer(), asfrtp_free_context(), asfrtp_parse_packet(), atrac3_decode_close(), audio_decode_example(), audio_encode_example(), audio_free_buffers(), audio_get_buffer(), audio_resample(), audio_resample_close(), av_audio_convert_free(), av_audio_fifo_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_fft_end(), av_fifo_free(), av_fifo_realloc2(), av_file_unmap(), av_freep(), av_image_alloc(), av_opt_set_bin(), av_parser_close(), av_parser_init(), av_probe_input_buffer(), av_realloc_f(), av_resample_init(), av_samples_alloc(), av_tree_destroy(), avcodec_alloc_context3(), avcodec_encode_video(), avfilter_free(), avfilter_get_video_buffer_ref_from_arrays(), avfilter_open(), avfilter_ref_buffer(), avfilter_unref_buffer(), avformat_free_context(), avformat_new_stream(), avi_read_close(), avi_write_trailer(), avio_close(), avio_close_dyn_buf(), avisynth_read_close(), avpicture_free(), avpriv_dv_init_demux(), avresample_alloc_context(), avresample_set_matrix(), bfi_decode_close(), buf_free(), build_filter(), caf_write_packet(), callback(), cdxl_decode_end(), celt_header(), channelmap_filter_samples(), cinvideo_decode_end(), close(), close_audio(), close_connection(), close_video(), cmdutils_read_file(), codec_get_buffer(), concat_open(), cond_release_buffer(), convert_str(), cook_decode_close(), copy_frame(), decode_end(), decode_frame(), decode_lowdelay(), decode_thread(), decode_video(), deinterlace_bottom_field_inplace(), delete_cluts(), delete_objects(), delete_region_display_list(), delete_regions(), dilate_init(), dirac_parse_close(), dnxhd_encode_end(), doTest(), dshow_cycle_formats(), dshow_cycle_pins(), dshow_read_close(), dshow_read_packet(), dv1394_close(), dv_read_close(), dv_read_timecode(), dvbsub_close_decoder(), dvbsub_parse_page_segment(), dvbsub_parse_region_segment(), dvdsub_init(), ebml_free(), ebml_read_ascii(), ebml_read_binary(), encode_close(), encode_dvd_subtitles(), encode_end(), encode_frame(), encode_picture_ls(), enu_free(), escape124_decode_close(), escape124_decode_frame(), exit_program(), ff_asf_parse_packet(), ff_ass_split_free(), ff_audio_data_alloc(), ff_audio_data_free(), ff_audio_mix_close(), ff_audio_mix_init(), ff_audio_resample_free(), ff_audio_resample_init(), ff_avfilter_default_free_buffer(), ff_cavs_end(), ff_ccitt_unpack(), ff_command_queue_pop(), ff_create_schro_frame(), ff_dct_end(), ff_dct_init(), ff_default_get_video_buffer(), ff_do_elbg(), ff_fast_malloc(), ff_free_parser_state(), ff_free_pool(), ff_gen_syncpoint_search(), ff_h264_decode_picture_parameter_set(), ff_h264_decode_seq_parameter_set(), ff_http_auth_create_response(), ff_id3v2_parse(), ff_iir_filter_free_coeffs(), ff_iir_filter_free_state(), ff_init_elbg(), ff_init_vlc_sparse(), ff_isom_write_avcc(), ff_jpegls_decode_picture(), ff_mjpeg_decode_end(), ff_mjpeg_encode_close(), ff_mov_add_hinted_packet(), ff_mov_close_hinting(), ff_mov_write_packet(), ff_mp4_read_dec_config_descr(), ff_mpegts_parse_close(), ff_nut_add_sp(), ff_packet_free_side_data(), ff_parse_fmtp(), ff_pca_free(), ff_png_zfree(), ff_psy_preprocess_end(), ff_rdt_parse_close(), ff_read_packet(), ff_restore_parser_state(), ff_rtmp_calc_digest(), ff_rtp_chain_mux_open(), ff_rtp_check_and_send_back_rr(), ff_rtp_parse_close(), ff_rtp_parse_open(), ff_rtp_reset_packet_queue(), ff_rtp_send_punch_packets(), ff_rtsp_close_streams(), ff_rtsp_setup_output_streams(), ff_rtsp_undo_setup(), ff_snow_alloc_blocks(), ff_snow_release_buffer(), ff_store_parser_state(), ff_tls_deinit(), 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(), film_read_close(), film_read_header(), film_read_packet(), filter(), filter_release_buffer(), find_and_decode_index(), find_motion(), flac_parse(), flac_parse_close(), flac_read_header(), flashsv_decode_end(), flashsv_encode_end(), flic_read_header(), flv_get_extradata(), flv_queue_extradata(), flv_write_packet(), fourxm_read_header(), frame_list_clear(), frame_list_remove_samples(), free_buffer_pool(), free_context(), free_filter_param(), free_fragment_if_needed(), free_frame_if_needed(), free_geobtag(), free_mp_image(), free_packet_list(), free_segment_list(), free_temp(), free_tracked_methods(), free_variant_list(), freeBuffers(), frei0r_init(), generate_codebook(), generate_new_codebooks(), get_meta(), get_metadata(), get_moov_size(), get_private_data(), get_tag(), gif_write_header(), glyph_enu_free(), guess_ni_flag(), h263_free_context(), h263_handle_packet(), h264_free_context(), h264_mp4toannexb_filter(), handle_invoke_error(), handle_invoke_result(), http_parse_request(), http_receive_data(), iec61883_close(), iec61883_parse_queue_dv(), iec61883_parse_queue_hdv(), init(), init_coef_vlc(), init_cook_mlt(), init_filters(), init_pass2(), init_pattern_from_file(), initFilter(), ism_flush(), ism_free(), jacosub_decode_frame(), jpeg_free_context(), latm_decode_audio_specific_config(), latm_free_context(), latm_parse_packet(), lavfi_read_header(), libschroedinger_decode_frame(), libschroedinger_free_frame(), link_filter_inouts(), load_mask(), m4sl_cb(), main(), make_digest_auth(), matroska_clear_queue(), matroska_decode_buffer(), matroska_deliver_packet(), matroska_fix_ass_packet(), matroska_merge_packets(), matroska_parse_block(), matroska_parse_frame(), matroska_read_close(), matroska_read_header(), 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(), mmsh_read_seek(), mov_create_chapter_track(), mov_create_timecode_track(), mov_flush_fragment(), mov_read_cmov(), mov_read_dref(), mov_read_dvc1(), mov_read_glbl(), mov_read_packet(), mov_read_strf(), mov_read_stsz(), mov_read_wave(), mov_write_ctts_tag(), mov_write_dvc1_structs(), mov_write_isml_manifest(), mov_write_stts_tag(), mov_write_trailer(), mov_write_udta_tag(), 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_internal(), mxf_compute_index_tables(), mxf_get_sorted_table_segments(), new_connection(), new_output_stream(), nsv_parse_NSVf_header(), nsv_read_close(), nut_read_header(), ogg_new_buf(), ogg_read_close(), ogg_read_page(), ogg_restore(), ogg_write_page(), ogm_chapter(), opt_channel_layout(), opt_old2new(), opt_qscale(), opt_timecode(), opt_vstats_file(), packet_queue_get(), parse_device_name(), parse_filter(), parse_fmtp_config(), parse_inputs(), parse_interval(), parse_key_value_pair(), parse_options(), parse_outputs(), parse_setup_header(), parse_times(), 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(), print_codecs(), put_packet(), qcelp_free_context(), qdm2_extradata_free(), qt_rtp_free(), qt_rtp_parse_packet(), qtrle_encode_end(), radix_sort(), rdt_free_context(), rdt_new_context(), read_frame(), read_geobtag(), read_header(), read_shape_from_file(), read_tag(), read_whole_file(), realloc_audio(), reallocAlign(), rl2_decode_end(), rl2_read_header(), rm_write_audio(), roq_encode_end(), roq_encode_video(), rtmp_open(), rtp_new_av_stream(), rtp_new_connection(), rtp_parse_mp4_au(), rtp_parse_queued_packet(), rtsp_cmd_describe(), sami_paragraph_to_ass(), sample_queue_free(), sample_queue_pop(), sap_write_header(), sbg_read_header(), sdp_parse_fmtp_config_h264(), sdt_cb(), seq_read_close(), set_params(), set_string_binary(), shift_data(), show_codecs(), show_stream(), smacker_decode_header_tree(), smacker_read_close(), smacker_read_header(), smka_decode_frame(), sp5x_decode_frame(), Stagefright_decode_frame(), store_in_pool(), stream_close(), stream_open(), sub2video_prepare(), svq1_decode_frame(), svq3_decode_init(), svq3_extradata_free(), svq3_parse_packet(), swri_get_dither(), swri_resample_init(), sws_addVec(), sws_convVec(), sws_freeContext(), sws_freeFilter(), sws_freeVec(), sws_scale(), sws_shiftVec(), sws_subVec(), tcp_write_packet(), tgv_decode_end(), thread_entry(), thread_free(), thread_init(), tiff_unpack_strip(), tm2_build_huff_table(), tm2_free_codes(), tqi_decode_end(), transcode(), truemotion1_decode_end(), tta_decode_close(), twin_decode_close(), uninit(), update_context_from_user(), 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(), videostream_cb(), vmd_read_close(), vmd_read_header(), vmdvideo_decode_end(), vorbis_free(), vorbis_parse_setup_hdr_codebooks(), vp3_decode_end(), vp56_size_changed(), vp6_decode_free(), vp8_free_context(), vp8_release_frame(), wavesynth_close(), wavesynth_init(), worker(), write_globalinfo(), write_headers(), write_streaminfo(), wsvqa_read_header(), wtvfile_close(), wtvfile_open_sector(), x11grab_read_header(), X264_close(), XAVS_close(), xiph_free_context(), xiph_parse_fmtp_pair(), xmv_process_packet_header(), xvid_encode_close(), 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 190 of file mem.c.

Referenced by aac_decode_close(), aac_encode_close(), aac_encode_end(), aacPlus_encode_close(), add_doubles_metadata(), add_shorts_metadata(), adpcm_encode_close(), adx_read_header(), alac_decode_close(), alac_encode_close(), alloc_buffer(), alloc_frame_buffer(), amr_wb_encode_close(), ape_decode_close(), ape_read_close(), ape_tag_read_field(), asf_read_picture(), asf_read_stream_properties(), asf_write_header1(), asfrtp_free_context(), asfrtp_parse_packet(), asink_init(), asink_uninit(), atrac1_decode_end(), atrac1_decode_init(), atrac3_decode_close(), atrac3_decode_init(), audio_encode_example(), audio_free_buffers(), audio_get_buffer(), audio_resample_close(), av_asprintf(), av_bitstream_filter_close(), av_bprint_finalize(), av_dict_free(), av_dict_set(), av_expr_free(), av_fast_padded_malloc(), av_fast_padded_mallocz(), av_fft_init(), av_fifo_alloc(), av_fifo_free(), av_opt_free(), av_resample_close(), av_write_trailer(), avcodec_close(), avcodec_copy_context(), avcodec_encode_audio(), avcodec_encode_audio2(), avcodec_encode_video(), avcodec_fill_audio_frame(), avcodec_free_frame(), avcodec_get_frame_defaults(), avcodec_open2(), avfilter_copy_buffer_ref_props(), avfilter_copy_frame_props(), avfilter_free(), avfilter_get_audio_buffer_ref_from_arrays(), avfilter_graph_free(), avfilter_graph_parse(), avfilter_graph_parse2(), avfilter_inout_free(), avfilter_link_free(), avfilter_open(), avfilter_ref_buffer(), avfilter_unref_buffer(), avformat_find_stream_info(), avformat_free_context(), avi_read_close(), avi_read_header(), avi_write_trailer(), avio_close(), avresample_close(), avresample_free(), avsubtitle_free(), avui_decode_close(), avui_encode_close(), bmv_read_close(), build_feed_streams(), caca_write_trailer(), cache_open(), caf_write_trailer(), calc_rice_params(), che_configure(), clean_files(), cleanup(), clear_programs(), cllc_decode_close(), close_connection(), close_decoder(), codec_get_buffer(), common_end(), concat_close(), concat_open(), cond_release_buffer(), configure_input_filter(), configure_output_audio_filter(), configure_output_filter(), configure_output_video_filter(), copy_parameter_set(), crypto_close(), decode(), decode_close(), decode_dvd_subtitles(), decode_end(), decode_frame(), decode_init(), decode_packet(), decode_picture_header(), decode_slice_header(), decode_str(), decode_update_thread_context(), destroy_buffers(), dfa_decode_end(), dnxhd_encode_end(), do_exit(), doTest(), dvbsub_close_decoder(), dvbsub_parse_close(), dvdsub_parse(), dvdsub_parse_close(), ebml_free(), ebml_read_binary(), eightsvx_decode_close(), eightsvx_decode_frame(), encode_close(), encode_end(), encode_init(), encode_nals(), encode_picture(), escape130_decode_close(), estimate_best_b_count(), exit_program(), extract_header(), extract_mpeg4_header(), Faac_encode_close(), ff_ac3_encode_close(), ff_ac3_float_mdct_end(), ff_af_queue_close(), ff_alsa_close(), ff_ass_split_free(), ff_audio_data_free(), ff_audio_data_realloc(), ff_audio_resample_free(), ff_avc_parse_nal_units_buf(), ff_avfilter_default_free_buffer(), ff_bgmc_end(), ff_command_queue_pop(), ff_default_get_audio_buffer(), ff_fft_end(), ff_fft_init(), ff_frame_thread_encoder_free(), ff_frame_thread_encoder_init(), ff_free_pool(), ff_free_stream(), ff_free_vlc(), ff_h264_free_context(), ff_id3v2_free_extra_meta(), ff_id3v2_write_apic(), ff_init_vlc_sparse(), ff_interleave_packet_per_dts(), ff_intrax8_common_end(), ff_ivi_free_buffers(), ff_ivi_init_tiles(), ff_j2k_cleanup(), ff_j2k_dwt_destroy(), ff_load_image(), ff_lpc_end(), ff_lzw_decode_close(), ff_mdct_end(), ff_merge_channel_layouts(), ff_merge_formats(), ff_merge_samplerates(), 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_MPV_common_end(), ff_MPV_common_frame_size_change(), ff_MPV_encode_end(), ff_mss12_decode_end(), ff_packet_free_side_data(), ff_parse_close(), ff_pca_free(), ff_psy_end(), ff_psy_preprocess_end(), ff_rate_control_uninit(), ff_read_riff_info(), ff_rtmp_packet_destroy(), ff_rtsp_setup_input_streams(), ff_schro_queue_pop(), ff_slice_buffer_destroy(), ff_slice_buffer_init(), ff_sndio_close(), ff_sndio_open(), ff_snow_common_end(), ff_snow_common_init_after_header(), ff_subtitles_queue_clean(), ff_timefilter_destroy(), ff_vaapi_common_end_frame(), ff_vc1_decode_end(), ff_vda_create_decoder(), ff_vda_destroy_decoder(), ff_vda_release_vda_frame(), ff_vorbis_comment(), ff_vp56_free_context(), ffm_close(), ffurl_closep(), 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(), flv_read_close(), flv_read_packet(), fourxm_read_close(), fourxm_read_header(), frame_thread_free(), free_acl_list(), free_apic(), free_buffer_pool(), free_buffers(), free_bundles(), free_coded_frame(), free_context_frame(), free_duplicate_context(), free_frame_buffer(), free_frame_buffers(), free_geotags(), free_packet_buffer(), free_picture(), free_schro_frame(), free_script(), free_section(), free_segment_list(), free_sequence_buffers(), free_tables(), free_variant_list(), g722_encode_close(), get_http_header_data(), get_tag(), get_tcp_server_response(), gif_encode_close(), glyph_enu_free(), guess_dc(), gxf_write_trailer(), h264_mp4toannexb_filter(), handle_connection(), handle_file(), handle_packets(), http_connect(), http_prepare_data(), http_send_data(), ico_write_trailer(), id3v2_put_ttag(), ilbc_encode_close(), init(), init_pattern_from_file(), initFilter(), ism_free(), join_config_output(), join_free_buffer(), join_request_frame(), join_uninit(), lag_decode_end(), latm_parse_packet(), lavfi_read_close(), lavfi_read_header(), libgsm_encode_close(), libopenjpeg_encode_close(), libopenjpeg_encode_init(), libschroedinger_decode_buffer_free(), libschroedinger_decode_close(), libschroedinger_encode_close(), libschroedinger_encode_frame(), libschroedinger_free_frame(), load_glyph(), main(), matroska_clear_queue(), matroska_deliver_packet(), mj2_create_image(), mjpega_dump_header(), mkv_write_simpletag(), mkv_write_trailer(), mmsh_open_internal(), mmsh_read_seek(), modplug_read_close(), mov_read_chapters(), mov_read_close(), mov_read_ctts(), mov_read_ftyp(), mov_read_hdlr(), mov_read_stsz(), mov_read_trak(), mov_write_header(), mov_write_trailer(), movie_uninit(), mp3_queue_flush(), mp3lame_encode_close(), mp_decode_end(), MPA_encode_close(), mpc7_decode_close(), mpc_read_close(), mpegts_close_filter(), mpegts_write_end(), mpegts_write_header(), mss2_decode_end(), mss3_decode_end(), mss3_decode_init(), mss4_decode_end(), mxf_compute_ptses_fake_index(), mxf_free(), mxf_get_sorted_table_segments(), mxf_interleave_get_packet(), mxf_read_close(), mxf_write_footer(), mxg_close(), mxpeg_decode_end(), mxpeg_decode_mxm(), new_stream(), nsv_read_close(), nut_read_close(), nut_write_header(), nut_write_trailer(), ogg_new_stream(), ogg_replace_stream(), ogg_write_header(), ogg_write_pages(), ogg_write_trailer(), oggvorbis_encode_close(), opt_input_file(), opt_map(), packet_queue_flush(), pad_last_frame(), paf_vid_close(), parse_command(), parse_ffconfig(), parse_fmtp_config(), parse_iplconvkernel(), parse_keyframes_index(), parse_link_name(), parse_picture(), parse_presentation_segment(), parse_primary(), parse_sws_flags(), pcm_encode_close(), pmp_close(), print_sdp(), probe_codec(), probe_file(), prores_encode_close(), psy_3gpp_end(), pthread_cond_destroy(), put_str16(), qdm2_parse_config(), qt_rtp_free(), qt_rtp_parse_packet(), queue_pop(), r3d_close(), ra144_encode_close(), raw_close_decoder(), rdt_free_context(), rdt_parse_packet(), CustomSource::read(), read_apic(), read_close(), read_frame(), read_from_packet_buffer(), read_gab2_sub(), read_header(), read_kuki_chunk(), read_thread(), read_ttag(), release_queued_segmaps(), remove_decoded_packets(), reset_options(), roq_dpcm_encode_close(), rtmp_calc_swfhash(), rtmp_close(), rtmp_http_close(), rtmp_open(), rtp_write_trailer(), rtsp_read_close(), rv34_decoder_free(), sample_queue_free(), sap_read_close(), sap_write_close(), sap_write_header(), sbg_read_header(), sdl_write_trailer(), sdp_parse_fmtp_config_h264(), seg_write_trailer(), segment_end(), segment_start(), set_string(), set_string_binary(), shorten_decode_close(), show_help(), smjpeg_read_header(), sox_read_header(), spdif_write_trailer(), split_uninit(), Stagefright_close(), Stagefright_decode_frame(), Stagefright_init(), stop_jack(), store_in_pool(), stream_component_close(), sunrast_decode_frame(), svq1_encode_end(), svq3_decode_end(), svq3_parse_packet(), swr_convert(), swr_free(), swr_inject_silence(), swri_rematrix_free(), swri_resample_free(), sws_allocVec(), sws_freeContext(), sws_freeVec(), tgv_decode_frame(), thread_free(), tiff_decode_tag(), transcode(), tscc2_decode_end(), tta_decode_close(), tta_decode_init(), udp_open(), uninit(), url_alloc_for_protocol(), utvideo_decode_close(), utvideo_encode_close(), v308_decode_close(), v308_encode_close(), v408_decode_close(), v408_encode_close(), v410_decode_close(), v410_encode_close(), vble_decode_close(), vfw_read_header(), vid_read_close(), vid_read_packet(), video_encode_example(), video_free_buffers(), video_get_buffer(), vorbis_encode_close(), vorbis_free(), vorbis_header(), vp8_free(), vqa_decode_end(), vqa_decode_init(), vsink_uninit(), wavpack_decode_end(), worker(), write_chapter(), write_headers(), writer_close(), wtvfile_close(), x11grab_read_header(), X264_close(), xan_decode_end(), xan_decode_init(), XAVS_close(), xbm_decode_close(), xbm_encode_close(), xiph_handle_packet(), xmv_read_close(), xvid_encode_close(), xwd_decode_close(), xwd_encode_close(), y41p_decode_close(), y41p_encode_close(), yae_release_buffers(), yuv4_decode_close(), yuv4_encode_close(), and zerocodec_decode_close().

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 75 of file mem.c.

Referenced by a64multi_init_encoder(), aacPlus_encode_init(), add_av_stream1(), add_doubles_metadata(), add_metadata(), add_shorts_metadata(), add_string_metadata(), adpcm_encode_init(), alloc_sequence_buffers(), alloc_temp(), allocate_buffers(), allocate_frame_buffers(), allocate_initial_states(), allocate_tables(), allocStuff(), apc_read_header(), ape_read_header(), ape_tag_read_field(), asf_read_picture(), asf_write_header(), ass_decode_init(), ass_encode_init(), atrac1_decode_init(), audio_encode_example(), audio_resample(), av_abuffersink_params_alloc(), av_asprintf(), av_audio_convert_alloc(), av_bprint_finalize(), av_buffersink_params_alloc(), av_d2str(), av_expr_parse(), av_fft_init(), av_fifo_alloc(), av_file_map(), av_get_token(), av_image_alloc(), av_malloc(), av_mallocz(), av_new_packet(), av_opt_get(), av_opt_set_bin(), av_packet_merge_side_data(), av_packet_new_side_data(), av_packet_split_side_data(), av_parser_change(), av_realloc(), av_strdup(), av_tempfile(), avcodec_alloc_context2(), avcodec_alloc_context3(), avcodec_alloc_frame(), avfilter_copy_frame_props(), 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(), calc_rice_params(), celt_header(), cmdutils_read_file(), concat_open(), config(), config_input(), config_output(), config_props(), convert_str(), copy_parameter_set(), copy_video_props(), create_all_formats(), create_cel_evals(), create_map(), create_vorbis_context(), decode_dvd_subtitles(), decode_frame(), decode_header_trees(), decode_init(), decode_main_header(), decode_picture_header(), decode_rle(), decode_slice_header(), decode_update_thread_context(), deinterlace_bottom_field_inplace(), denoise_depth(), dnxhd_encode_init(), do_subtitle_out(), doubles2str(), draw_text(), dshow_add_device(), dshow_cycle_formats(), dump_extradata(), dup_wchar_to_utf8(), dvbsub_display_end_segment(), dvbsub_parse_clut_segment(), dvbsub_parse_init(), dvbsub_parse_region_segment(), dvdsub_init(), dvdsub_parse(), ebml_read_ascii(), ebml_read_binary(), eightsvx_decode_frame(), encode_frame(), encode_init(), encode_intervals(), encode_picture_ls(), escape130_decode_init(), 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_audio_data_realloc(), ff_bgmc_init(), ff_ccitt_unpack(), ff_dct_init(), ff_do_elbg(), ff_fast_malloc(), ff_fft_init(), ff_fill_line_with_color(), ff_frame_thread_encoder_init(), ff_gen_syncpoint_search(), ff_h264_frame_start(), ff_http_auth_create_response(), ff_init_elbg(), ff_init_rl(), ff_init_vlc_sparse(), ff_ivi_init_tiles(), ff_j2k_dwt_init(), ff_j2k_init_component(), ff_mdct_init(), ff_mjpeg_decode_sof(), ff_mjpeg_encode_init(), ff_mov_write_packet(), ff_MPV_common_frame_size_change(), ff_MPV_common_init(), ff_mss12_decode_init(), ff_parse_fmtp(), ff_parse_mpeg2_descriptor(), ff_png_zalloc(), ff_psy_init(), ff_read_riff_info(), ff_rtmp_packet_create(), ff_rv34_decode_frame(), ff_sauce_read(), ff_slice_buffer_init(), ff_sndio_open(), ff_store_parser_state(), ff_tls_init(), ff_urldecode(), ff_vc1_decode_init_alloc_tables(), ff_vda_create_decoder(), ff_vorbis_comment(), ff_yuv2rgb_c_init_tables(), ffio_fdopen(), ffio_set_buf_size(), ffm_read_header(), fft_ref_init(), ffurl_get_multi_file_handle(), film_read_header(), film_read_packet(), find_and_decode_index(), find_headers_search_validate(), find_motion(), find_next_parse_unit(), 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_list_add_frame(), frame_thread_init(), generate_codebook(), generate_new_codebooks(), get_codec_data(), get_geokey_val(), get_meta(), get_metadata(), get_stats(), get_tag(), getstr8(), gif_encode_init(), guess_dc(), halfpel_interpol(), hls_read_header(), horizX1Filter(), idcin_read_header(), iec61883_callback(), iff_read_header(), imx_dump_header(), init(), init_bundles(), init_coef_vlc(), init_cook_mlt(), init_filter_param(), init_mv_table(), init_pass2(), init_pattern_from_file(), init_slice_contexts(), init_slice_state(), init_tiles(), initFilter(), initNoise(), interpolate_refplane(), lag_decode_frame(), latm_decode_audio_specific_config(), lavfi_read_header(), libAVPin_Setup(), libschroedinger_decode_frame(), load_mask(), main(), make_digest_auth(), make_format_list(), matroska_decode_buffer(), matroska_fix_ass_packet(), matroska_read_header(), mjpeg2jpeg_filter(), mjpeg_decode_com(), mjpega_dump_header(), mmap_init(), mmap_read_frame(), modplug_read_header(), mov2textsub(), mov_create_timecode_track(), mov_read_cmov(), mov_read_ctts(), mov_read_dref(), mov_read_ftyp(), mov_read_hdlr(), mov_read_sbgp(), mov_read_stco(), mov_read_stps(), mov_read_stsc(), mov_read_stss(), mov_read_stsz(), mov_read_stts(), mov_read_tref(), mov_read_trun(), mov_write_ctts_tag(), mov_write_header(), mov_write_stts_tag(), mp3_header_compress(), mp3_header_decompress(), mp3lame_encode_init(), mp_image_alloc_planes(), mpc8_parse_seektable(), mpc_read_header(), mpegts_open_section_filter(), mpegts_push_data(), mpegts_set_stream_info(), mpegts_write_header(), mpegts_write_packet_internal(), mss2_decode_init(), mss3_decode_init(), mss4_decode_init(), mxf_decrypt_triplet(), mxf_read_generic_descriptor(), 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(), ogm_header(), open_audio(), open_video(), opt_output_file(), opus_header(), packet_queue_put_private(), pad_last_frame(), parse_ffconfig(), parse_forced_key_frames(), parse_MP4DecConfigDescrTag(), parse_options(), parse_packed_headers(), parse_picture(), parse_playlist(), parse_presentation_segment(), parse_setup_header(), parse_times(), pcx_decode_frame(), pp_get_context(), pp_get_mode_by_name_and_quality(), pre_process_video_frame(), precalc_coefs(), prepare_sdp_description(), print_sdp(), prores_encode_init(), qt_rtp_parse_packet(), queue_frames(), r3d_read_rdvo(), radix_sort(), raw_init_decoder(), read_apic(), read_ffserver_streams(), read_frame(), read_geobtag(), read_header(), read_shape_from_file(), read_specific_config(), ready_codebook(), rl2_read_header(), rm_read_extradata(), rm_write_audio(), roq_dpcm_encode_init(), roq_encode_init(), rtmp_calc_swfhash(), rtmp_open(), rtp_get_multi_file_handle(), rtp_new_connection(), rtp_parse_mp4_au(), rtp_write_header(), rv34_decoder_alloc(), sample_queue_retain(), sdp_parse_fmtp_config_h264(), seq_init_frame_buffers(), set_string_binary(), shift_data(), shorts2str(), smacker_read_header(), smjpeg_read_header(), smush_read_header(), sox_read_header(), spdif_write_header(), speex_header(), Stagefright_decode_frame(), start_jack(), submit_stats(), sunrast_decode_frame(), svq1_decode_frame(), svq1_encode_frame(), svq3_decode_init(), svq3_parse_packet(), swf_read_header(), swri_get_dither(), sws_allocVec(), sws_getDefaultFilter(), sws_init_context(), sws_scale(), text2movsub(), tgv_decode_frame(), tiff_decode_tag(), tiff_unpack_strip(), tm2_build_huff_table(), tscc2_decode_init(), tta_decode_init(), unescape(), unpack_codebook(), utvideo_decode_init(), utvideo_encode_init(), vble_decode_init(), vc1t_read_header(), vf_open(), vfw_read_header(), vid_read_packet(), video_audio_display(), video_get_buffer(), 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(), vqf_read_header(), wavesynth_init(), wc3_read_header(), write_frame(), writer_open(), wtvfile_open_sector(), X264_init(), xan_decode_init(), XAVS_init(), xiph_handle_packet(), xiph_parse_fmtp_pair(), xmv_process_packet_header(), xmv_read_header(), xvid_encode_init(), xvid_strip_vol_header(), 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 197 of file mem.c.

Referenced by a64multi_init_encoder(), aac_adtstoasc_filter(), aac_decode_frame(), aac_encode_init(), add_av_stream1(), add_codec(), add_fragment(), add_input_streams(), add_pes_stream(), add_to_pktbuf(), add_to_queue(), adx_read_header(), aiff_read_header(), alac_encode_init(), alloc_buffer(), alloc_frame_buffer(), alloc_sequence_buffers(), alloc_temp(), amr_new_context(), asf_read_picture(), asf_read_stream_properties(), asfrtp_new_context(), atrac3_decode_init(), audio_get_buffer(), av_audio_fifo_alloc(), av_audio_resample_init(), av_bitstream_filter_init(), av_calloc(), av_dict_set(), av_dump_format(), av_expr_parse(), av_fifo_alloc(), av_new_program(), av_parser_init(), av_resample_init(), av_samples_alloc(), avcodec_fill_audio_frame(), avcodec_get_context_defaults3(), avcodec_open2(), avfilter_copy_buf_props(), avfilter_get_audio_buffer_ref_from_arrays(), avfilter_get_video_buffer_ref_from_arrays(), avfilter_graph_alloc(), avfilter_graph_queue_command(), avfilter_inout_alloc(), avfilter_link(), avfilter_open(), avformat_alloc_output_context2(), avformat_new_stream(), avformat_open_input(), avformat_write_header(), avi_read_header(), avi_write_header(), avio_alloc_context(), avisynth_read_header(), avpriv_dv_init_demux(), avpriv_new_chapter(), avresample_alloc_context(), avui_encode_init(), bfi_decode_init(), callback(), channelmap_filter_samples(), che_configure(), cinvideo_decode_init(), config(), config_input(), config_output(), configure_filtergraph(), cook_decode_init(), copy_chapters(), crypto_open(), decode_dvd_subtitles(), decode_frame(), decode_init(), decode_init_thread_copy(), decode_lowdelay(), decode_main_header(), decode_picture_header(), decode_stream_header(), decode_thread(), DEF_CHOOSE_FORMAT(), dfa_decode_init(), display_end_segment(), doTest(), dv_read_timecode(), 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_all_channel_layouts(), ff_all_samplerates(), ff_ass_add_rect(), ff_ass_split(), ff_audio_data_alloc(), ff_audio_mix_init(), ff_audio_resample_init(), ff_avc_write_annexb_extradata(), ff_cavs_init_top_lines(), ff_create_schro_frame(), ff_default_get_audio_buffer(), ff_default_get_video_buffer(), ff_er_frame_end(), ff_fast_malloc(), ff_frame_thread_encoder_init(), 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_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_rtmp_calc_digest(), ff_rtp_parse_open(), ff_rtsp_setup_output_streams(), ff_schro_queue_push_back(), ff_slice_buffer_init(), ff_snow_alloc_blocks(), ff_snow_common_init_after_header(), ff_timefilter_new(), ff_vc1_decode_init_alloc_tables(), ff_wms_parse_sdp_a_line(), ffurl_register_protocol(), filter(), find_headers_search_validate(), fixup_vorbis_headers(), flac_read_header(), flashsv2_encode_init(), flashsv_encode_frame(), flashsv_encode_init(), flv_get_extradata(), flv_queue_extradata(), flv_write_header(), frame_thread_init(), g722_encode_init(), get_attachment(), get_http_header_data(), get_private_data(), get_siz(), gif_encode_init(), guess_ni_flag(), gxf_write_header(), h263_new_context(), h264_new_context(), handle_file(), http_prepare_data(), http_server(), ico_write_header(), iec61883_callback(), init(), init_input_filter(), init_pattern_from_file(), init_pattern_from_string(), init_slice_contexts(), ism_write_header(), join_config_output(), join_init(), join_request_frame(), jpeg_new_context(), latm_new_context(), lavfi_read_header(), libschroedinger_encode_frame(), link_filter_inouts(), load_glyph(), main(), make_format_list(), matroska_parse_frame(), matroska_parse_laces(), matroska_parse_rm_audio(), matroska_read_header(), mj2_create_image(), mkv_start_cues(), mkv_start_seekhead(), mkv_write_header(), mmsh_open_internal(), mov_read_chapters(), mov_read_covr(), mov_read_dref(), mov_read_dvc1(), mov_read_glbl(), mov_read_strf(), mov_read_trak(), mov_read_wave(), mov_text_encode_init(), mov_write_dvc1_structs(), mov_write_header(), mp_decode_init(), mpc8_read_header(), mpc_read_header(), 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(), new_video_stream(), nsv_parse_NSVf_header(), nsv_parse_NSVs_header(), nut_read_header(), nut_write_header(), ogg_buffer_page(), ogg_build_flac_headers(), ogg_build_speex_headers(), ogg_save(), ogg_write_header(), ogg_write_vorbiscomment(), oma_read_header(), opaque_list_push(), opt_channel_layout(), opt_filter_complex(), opt_input_file(), opt_output_file(), opus_header(), paf_vid_init(), parse_acl_row(), parse_dynamic_acl(), parse_ffconfig(), parse_fmtp_config(), parse_inputs(), parse_keyframes_index(), parse_primary(), parse_sws_flags(), prepare_sdp_description(), psy_3gpp_init(), pthread_cond_init(), pthread_create(), 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_apic(), read_geobtag(), read_header(), read_kuki_chunk(), read_shape_from_file(), read_tfra(), ready_codebook(), ready_residue(), realloc_audio(), reallocAlign(), rl2_decode_init(), rl2_read_header(), roq_encode_init(), rtp_new_av_stream(), rtp_new_connection(), rtsp_read_header(), rv34_decoder_alloc(), sap_write_header(), segment_start(), setup_find_stream_info_opts(), smacker_decode_header_tree(), smka_decode_frame(), sp5x_decode_frame(), speex_header(), Stagefright_close(), Stagefright_decode_frame(), Stagefright_init(), stream_open(), svq1_encode_init(), svq1_encode_plane(), svq3_extradata_new(), swr_alloc(), swri_rematrix_init(), swri_rematrix_init_x86(), swri_resample_init(), sws_alloc_context(), theora_header(), thread_init(), tiff_decode_tag(), tm2_build_huff_table(), transcode_init(), tta_decode_init(), tta_read_header(), update_dimensions(), url_alloc_for_protocol(), url_open_dyn_buf_internal(), utvideo_encode_init(), vc1_decode_frame(), vc1_decode_init(), vc1_extract_headers(), vda_decoder_callback(), vf_next_put_image(), vf_open(), video_get_buffer(), 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(), vp6_decode_init(), vp8_alloc_frame(), vp8_new_context(), wmv2_encode_init(), worker(), writer_open(), wsvqa_read_header(), wsvqa_read_packet(), wtvfile_open_sector(), wv_alloc_frame_context(), XAVS_init(), xiph_new_context(), xwma_read_header(), and yop_read_header().

void av_max_alloc ( size_t  max  ) 

Set the maximum size that may me allocated in one block.

Definition at line 71 of file mem.c.

Referenced by main(), and opt_max_alloc().

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 163 of file mem.c.

Referenced by alloc_array_elem(), alloc_table(), avi_read_header(), avi_write_packet(), config_output(), copy_chapters(), decode_frame(), dyn_buf_write(), ff_mov_write_packet(), ffio_rewind_with_probe_data(), fourxm_read_header(), gxf_write_map_packet(), gxf_write_packet(), main(), parse_commands(), parse_intervals(), queue_frames(), and read_whole_file().

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 203 of file mem.h.

Referenced by av_realloc_f(), and ogg_new_stream().


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