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

Define Documentation

#define av_alloc_size (  ) 

Definition at line 69 of file mem.h.

#define av_malloc_attrib

Definition at line 63 of file mem.h.

#define DECLARE_ALIGNED ( n,
t,
 )     t v

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

Definition at line 57 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.

Referenced by mxf_get_sorted_table_segments(), mxf_read_delta_entry_array(), and mxf_read_index_entry_array().

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(), adaptive_quantization(), add_pes_stream(), alloc_picture(), amr_free_context(), 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_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_parser_close(), av_parser_init(), av_probe_input_buffer(), av_read_frame(), av_read_packet(), av_realloc_f(), av_resample_init(), av_samples_alloc(), 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(), avformat_new_stream(), avi_read_close(), avi_write_trailer(), avio_close(), avio_close_dyn_buf(), avisynth_read_close(), avpicture_free(), avpriv_dv_init_demux(), bfi_decode_close(), buf_free(), build_filter(), caf_write_packet(), callback(), celt_header(), cinvideo_decode_end(), close(), close_audio(), close_connection(), close_video(), cmdutils_read_file(), command_queue_pop(), concat_open(), cond_release_buffer(), convert_str(), cook_decode_close(), copy_frame(), decode_end(), decode_frame(), decode_lowdelay(), decode_thread(), 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_cycle_formats(), dshow_cycle_pins(), dshow_read_close(), dshow_read_packet(), dv1394_close(), dv_read_close(), dvbsub_close_decoder(), dvbsub_parse_page_segment(), dvbsub_parse_region_segment(), dvdsub_init(), ebml_free(), ebml_read_ascii(), ebml_read_binary(), 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_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_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(), ffurl_close(), film_read_close(), film_read_header(), film_read_packet(), find_and_decode_index(), find_motion(), flac_parse(), flac_parse_close(), flashsv_decode_end(), 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_geobtag(), free_mp_image(), free_packet_list(), free_segment_list(), free_temp(), free_variant_list(), freeBuffers(), frei0r_init(), generate_codebook(), generate_new_codebooks(), get_meta(), get_metadata(), get_tag(), gif_write_header(), glyph_enu_free(), guess_mv(), h264_free_context(), h264_mp4toannexb_filter(), http_parse_request(), http_receive_data(), init(), init_coef_vlc(), init_cook_mlt(), init_pass2(), init_pattern_from_file(), init_vlc_sparse(), initFilter(), latm_decode_audio_specific_config(), latm_free_context(), latm_parse_packet(), latm_write_packet(), lavfi_read_header(), link_filter_inouts(), 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_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(), mmsh_read_seek(), 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(), movie_common_uninit(), 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(), mxf_get_sorted_table_segments(), mxf_parse_index(), 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_vstats_file(), 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(), rdt_new_context(), read_frame(), read_geobtag(), read_shape_from_file(), read_tag(), realloc_audio(), reallocAlign(), request_frame(), rl2_decode_end(), rl2_read_header(), rm_write_audio(), roq_encode_end(), roq_encode_video(), rtmp_calc_digest(), rtp_new_av_stream(), rtp_new_connection(), rtp_parse_mp4_au(), rtp_parse_queued_packet(), 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(), set_string_binary(), show_format(), show_packet(), show_stream(), 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(), swri_resample_init(), sws_addVec(), sws_convVec(), sws_freeContext(), sws_freeFilter(), sws_freeVec(), 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(), transcode_video(), truemotion1_decode_end(), tta_decode_close(), twin_decode_close(), 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(), vp8_release_frame(), 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(), xmv_process_packet_header(), xmv_read_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 173 of file mem.c.

Referenced by aac_decode_close(), aac_encode_close(), aac_encode_end(), aacPlus_encode_close(), adpcm_encode_close(), adpcm_encode_init(), adx_encode_close(), adx_read_header(), 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(), atrac1_decode_end(), atrac1_decode_init(), atrac3_decode_close(), atrac3_decode_init(), audio_free_buffers(), audio_resample_close(), av_asprintf(), 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_write_trailer(), avcodec_close(), avcodec_copy_context(), 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_free_context(), avi_read_close(), avi_read_header(), avi_write_trailer(), avsubtitle_free(), bmv_read_close(), build_feed_streams(), cache_open(), caf_write_trailer(), calc_rice_params(), che_configure(), cleanup(), clear_programs(), close_connection(), close_decoder(), color_uninit(), command_queue_pop(), common_end(), compact_uninit(), concat_close(), concat_open(), cond_release_buffer(), copy_parameter_set(), crypto_close(), decode(), decode_close(), decode_dvd_subtitles(), decode_end(), decode_frame(), decode_init(), decode_picture_header(), decode_str(), 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_ascii(), ebml_read_binary(), eightsvx_decode_close(), encode_close(), encode_end(), encode_nals(), encode_picture(), escape130_decode_close(), estimate_best_b_count(), exit_program(), extract_header(), extract_mpeg4_header(), Faac_encode_close(), fast_asprintf(), 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_id3v2_free_extra_meta(), 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_read_riff_info(), ff_rtmp_packet_destroy(), ff_rtsp_setup_input_streams(), ff_rv34_decode_end(), ff_slice_buffer_destroy(), ff_sndio_close(), ff_sndio_open(), ff_snow_common_end(), ff_snow_common_init_after_header(), ff_timefilter_destroy(), ff_vaapi_common_end_frame(), ff_vda_destroy_decoder(), ff_vda_release_vda_frame(), ff_vorbis_comment(), ff_vp56_free(), ffm_close(), 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(), flush_cluster_buffer(), 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_frame_buffers(), free_picture(), free_section(), free_segment_list(), free_sequence_buffers(), free_tables(), free_variant_list(), free_vlc(), FreeSchroFrame(), g722_encode_close(), get_http_header_data(), get_tag(), get_tcp_server_response(), gif_encode_close(), gxf_write_trailer(), h264_mp4toannexb_filter(), handle_connection(), handle_packets(), http_connect(), http_prepare_data(), http_send_data(), id3v2_put_ttag(), init(), init_vlc_sparse(), initFilter(), json_uninit(), lag_decode_end(), latm_parse_packet(), lavfi_read_close(), lavfi_read_header(), libdirac_decode_close(), libdirac_encode_close(), libdirac_encode_frame(), libgsm_encode_close(), libopenjpeg_encode_close(), libopenjpeg_encode_init(), libschroedinger_decode_buffer_free(), libschroedinger_decode_close(), libschroedinger_encode_close(), libschroedinger_encode_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_ftyp(), mov_read_hdlr(), mov_read_stsz(), mov_read_trak(), mov_write_header(), mov_write_trailer(), movie_common_uninit(), MP3lame_encode_close(), MP3lame_encode_init(), mp_decode_end(), MPA_encode_close(), mpc_read_close(), mpegts_close_filter(), 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_stream(), nsv_read_close(), nut_read_close(), nut_write_header(), nut_write_trailer(), ogg_read_page(), ogg_write_header(), ogg_write_pages(), ogg_write_trailer(), oggvorbis_encode_close(), opt_input_file(), opt_map(), packet_queue_flush(), parse_ffconfig(), parse_fmtp_config(), parse_iplconvkernel(), parse_keyframes_index(), parse_link_name(), parse_primary(), pcm_encode_close(), pmp_close(), print_sdp(), probe_file(), prores_encode_close(), psy_3gpp_end(), pthread_cond_destroy(), put_str16(), qdm2_parse_config(), qt_rtp_free(), qt_rtp_parse_packet(), r3d_close(), raw_close_decoder(), rdt_free_context(), rdt_parse_packet(), CustomSource::read(), read_close(), read_gab2_sub(), read_header(), read_thread(), read_ttag(), release_queued_segmaps(), remove_decoded_packets(), reset_options(), roq_dpcm_encode_close(), rtmp_close(), rtp_write_trailer(), rtsp_read_close(), rv34_decode_slice(), sample_queue_free(), sap_read_close(), sap_write_close(), sap_write_header(), SchroedingerFreeFrame(), sdl_write_trailer(), set_string(), set_string_binary(), shorten_decode_close(), smjpeg_read_header(), sox_read_header(), spdif_write_trailer(), Stagefright_close(), Stagefright_decode_frame(), Stagefright_init(), stop_jack(), store_in_pool(), stream_component_close(), svq1_encode_end(), svq3_decode_end(), svq3_parse_packet(), swr_free(), swri_resample_free(), sws_allocVec(), sws_freeContext(), sws_freeVec(), tgv_decode_frame(), thread_free(), transcode(), tta_decode_close(), tta_decode_init(), uninit(), url_alloc_for_protocol(), url_open_buf(), utvideo_decode_close(), v410_decode_close(), v410_encode_close(), vble_decode_close(), vc1_decode_end(), vda_lock_operation(), vfw_read_header(), video_free_buffers(), video_get_buffer(), vorbis_encode_close(), vorbis_free(), vp8_free(), wavpack_decode_end(), write_chapter(), write_headers(), writer_close(), x11grab_read_header(), X264_close(), xan_decode_end(), xan_decode_init(), XAVS_close(), xiph_handle_packet(), y41p_decode_close(), and y41p_encode_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 70 of file mem.c.

Referenced by a64multi_init_encoder(), aac_encode_init(), aacPlus_encode_init(), adaptive_quantization(), add_av_stream1(), add_metadata(), adpcm_encode_init(), alloc_picture(), alloc_sequence_buffers(), alloc_temp(), allocate_frame_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(), atrac1_decode_init(), audio_resample(), av_abuffersink_params_alloc(), av_asprintf(), av_audio_convert_alloc(), av_buffersink_params_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_opt_get(), 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_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(), calc_rice_params(), celt_header(), cmdutils_read_file(), compact_init(), concat_open(), config(), config_input(), config_props(), convert_str(), copy_parameter_set(), 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(), dnxhd_encode_init(), do_subtitle_out(), 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_nals(), 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_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_read_riff_info(), ff_rtmp_packet_create(), ff_rv34_decode_init(), ff_sauce_read(), ff_slice_buffer_init(), ff_sndio_open(), ff_store_parser_state(), ff_tls_init(), ff_vorbis_comment(), ff_yuv2rgb_c_init_tables(), ffio_fdopen(), ffio_set_buf_size(), ffm_read_header(), fft_ref_init(), film_read_header(), film_read_packet(), find_and_decode_index(), find_headers_search_validate(), find_motion(), find_smallest_bounding_rectangle(), FindNextSchroParseUnit(), 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(), guess_mv(), 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_pass2(), init_pattern_from_file(), init_rl(), init_slice_contexts(), init_slice_state(), init_tiles(), init_vlc_sparse(), initFilter(), initNoise(), interpolate_refplane(), json_init(), lag_decode_frame(), latm_decode_audio_specific_config(), latm_write_packet(), lavfi_read_header(), libAVPin_Setup(), libdirac_decode_frame(), libdirac_encode_init(), main(), make_digest_auth(), make_format_list(), matroska_fix_ass_packet(), matroska_read_header(), mca(), mjpeg2jpeg_filter(), mjpeg_decode_com(), mjpega_dump_header(), mmap_init(), mmap_read_frame(), modplug_read_header(), mov2textsub(), mov_build_index(), mov_read_cmov(), mov_read_ctts(), mov_read_dref(), mov_read_ftyp(), mov_read_hdlr(), 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(), 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(), opt_old2new(), opt_output_file(), packet_queue_put(), parse_ffconfig(), parse_forced_key_frames(), parse_MP4DecConfigDescrTag(), 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(), print_sdp(), prores_encode_init(), qt_rtp_parse_packet(), queue_frames(), r3d_read_rdvo(), radix_sort(), raw_init_decoder(), read_ffserver_streams(), read_frame(), read_geobtag(), read_header(), read_shape_from_file(), read_specific_config(), ready_codebook(), realloc_audio(), rl2_read_header(), rm_read_extradata(), rm_write_audio(), roq_encode_init(), rtp_new_connection(), rtp_parse_mp4_au(), rtp_write_header(), rv34_decode_slice(), sample_queue_retain(), scale_image(), sdp_parse_fmtp_config_h264(), seq_init_frame_buffers(), set_string_binary(), smacker_read_header(), smjpeg_read_header(), sox_read_header(), spdif_write_header(), speex_header(), Stagefright_decode_frame(), 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(), text2movsub(), tgv_decode_frame(), tiff_unpack_strip(), tm2_build_huff_table(), transcode_init(), tta_decode_init(), unescape(), unpack_codebook(), utvideo_decode_init(), vble_decode_init(), vc1_decode_init_alloc_tables(), vc1t_read_header(), vda_lock_operation(), vf_open(), vfw_read_header(), 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(), wc3_read_header(), 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(), 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(), adx_read_header(), aiff_read_header(), alac_encode_init(), alloc_frame_buffer(), alloc_sequence_buffers(), alloc_temp(), amr_new_context(), asf_read_stream_properties(), asfrtp_new_context(), atrac3_decode_init(), audio_get_buffer(), 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(), av_set_parameters(), 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_graph_queue_command(), avfilter_inout_alloc(), avfilter_link(), avfilter_merge_formats(), 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(), bfi_decode_init(), callback(), che_configure(), cinvideo_decode_init(), config(), config_input(), 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(), dfa_decode_init(), display_end_segment(), doTest(), 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_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_rtp_parse_open(), ff_rtsp_setup_output_streams(), ff_rv34_decode_init(), ff_slice_buffer_init(), ff_snow_alloc_blocks(), ff_snow_common_init_after_header(), ff_timefilter_new(), ff_wms_parse_sdp_a_line(), 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(), flv_write_header(), frame_thread_init(), g722_encode_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_pattern_from_file(), init_pattern_from_string(), 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(), mca(), mj2_create_image(), mkv_start_cues(), mkv_start_seekhead(), mkv_write_header(), mmsh_open_internal(), 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_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_write_header(), ogg_write_vorbiscomment(), oma_read_header(), opaque_list_push(), parse_acl_row(), parse_dynamic_acl(), parse_ffconfig(), parse_fmtp_config(), parse_inputs(), parse_keyframes_index(), parse_primary(), 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_geobtag(), 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(), rtp_new_av_stream(), rtp_new_connection(), rtsp_read_header(), sap_write_header(), setup_find_stream_info_opts(), smacker_decode_header_tree(), smka_decode_frame(), sp5x_decode_frame(), speex_header(), Stagefright_close(), Stagefright_decode_frame(), Stagefright_init(), start_frame(), stream_open(), svq1_encode_init(), svq1_encode_plane(), svq3_extradata_new(), swr_alloc(), swri_resample_init(), sws_alloc_context(), theora_header(), thread_init(), tm2_build_huff_table(), transcode(), transcode_init(), tta_decode_init(), tta_read_header(), update_dimensions(), url_alloc_for_protocol(), url_open_buf(), url_open_dyn_buf_internal(), vc1_decode_frame(), vc1_decode_init(), vc1_decode_init_alloc_tables(), 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(), vp8_alloc_frame(), vp8_new_context(), wmv2_encode_init(), writer_open(), 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:
ptr Pointer to a memory block already allocated with av_malloc(z)() or av_realloc() or NULL.
size Size in bytes for the memory block to be allocated or reallocated.
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_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(), avformat_new_stream(), bmv_read_packet(), concat_open(), concatenate_packet(), copy_chapters(), decode_frame(), do_audio_out(), draw_text(), ebml_parse_elem(), fast_asprintf(), ff_alsa_extend_reorder_buf(), ff_ass_add_rect(), ff_program_add_stream_index(), filter_samples(), fixup_vorbis_headers(), flashsv_decode_frame(), 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_read_partition_pack(), mxf_write_packet(), mxf_write_partition(), new_video_stream(), nut_read_header(), ogg_new_stream(), ogg_restore(), 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(), 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(), 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 168 of file mem.h.

Referenced by av_realloc_f().

char* av_strdup ( const char *  s  ) 


Generated on Fri Oct 26 02:43:54 2012 for FFmpeg by  doxygen 1.5.8