FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs | Functions | Variables
Memory Management
Common utility functions

Macros

#define DECLARE_ALIGNED(n, t, v)   t v
 
#define DECLARE_ALIGNED(n, t, v)   t v
 
#define DECLARE_ASM_CONST(n, t, v)   static const t v
 
#define DECLARE_ASM_CONST(n, t, v)   static const t v
 
#define av_malloc_attrib
 
#define av_malloc_attrib
 
#define av_alloc_size(...)
 
#define av_alloc_size(...)
 
#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(...)
 

Typedefs

typedef ptrdiff_t size
 

Functions

voidav_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
 Allocate a block of size * nmemb bytes with av_malloc().
 
return av_malloc (nmemb *size)
 
voidav_realloc (void *ptr, size_t size) av_alloc_size(2)
 Allocate or reallocate a block of memory.
 
voidav_realloc_f (void *ptr, size_t nelem, size_t elsize)
 Allocate or reallocate a block of memory.
 
int av_reallocp (void *ptr, size_t size)
 Allocate or reallocate a block of memory.
 
 av_alloc_size (2, 3) void *av_realloc_array(void *ptr
 Allocate or reallocate an array.
 
void av_free (void *ptr)
 Free a memory block which has been allocated with av_malloc(z)() or av_realloc().
 
voidav_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.
 
voidav_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.
 
return av_mallocz (nmemb *size)
 
char * av_strdup (const char *s) av_malloc_attrib
 Duplicate the string s.
 
voidav_memdup (const void *p, size_t size)
 Duplicate the buffer p.
 
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.
 
int av_dynarray_add_nofree (void *tab_ptr, int *nb_ptr, void *elem)
 Add an element to a dynamic array.
 
voidav_dynarray2_add (void **tab_ptr, int *nb_ptr, size_t elem_size, const uint8_t *elem_data)
 Add an element of size elem_size 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.
 
void av_memcpy_backptr (uint8_t *dst, int back, int cnt)
 deliberately overlapping memcpy implementation
 
voidav_fast_realloc (void *ptr, unsigned int *size, size_t min_size)
 Reallocate the given block if it is not large enough, otherwise do nothing.
 
void av_fast_malloc (void *ptr, unsigned int *size, size_t min_size)
 Allocate a buffer, reusing the given one if large enough.
 

Variables

size_t size
 
size_t nmemb
 

Detailed Description

Macro Definition Documentation

#define DECLARE_ALIGNED (   n,
  t,
  v 
)    t v
#define DECLARE_ALIGNED (   n,
  t,
  v 
)    t v

Definition at line 15233 of file avcodec.h.

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

Definition at line 15234 of file avcodec.h.

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

Definition at line 15234 of file avcodec.h.

#define av_malloc_attrib

Definition at line 15240 of file avcodec.h.

#define av_malloc_attrib

Definition at line 15240 of file avcodec.h.

#define av_alloc_size (   ...)

Definition at line 15246 of file avcodec.h.

#define av_alloc_size (   ...)

Definition at line 15246 of file avcodec.h.

#define DECLARE_ALIGNED (   n,
  t,
  v 
)    t v

Definition at line 59 of file mem.h.

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

Definition at line 60 of file mem.h.

#define av_malloc_attrib

Definition at line 66 of file mem.h.

#define av_alloc_size (   ...)

Definition at line 72 of file mem.h.

Typedef Documentation

size_t size
Initial value:
{
if (!size || nmemb >= INT_MAX / size)
return NULL

Definition at line 100 of file opengl_enc.c.

Function Documentation

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
sizeSize 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_encode_init(), aacPlus_encode_init(), add_file(), add_metadata(), adpcm_encode_init(), aic_decode_init(), alloc_buffer(), alloc_scratch_buffers(), allocate_frame_buffers(), ape_read_header(), ape_tag_read_field(), append_entry(), apply_color_indexing_transform(), asf_read_picture(), asf_write_header(), ass_decode_init(), ass_encode_init(), audio_encode_example(), audio_resample(), av_asprintf(), av_bprint_finalize(), av_buffer_alloc(), av_buffersink_params_alloc(), av_d2str(), av_expr_parse(), av_fifo_alloc(), av_file_map(), av_frame_new_side_data(), av_get_token(), av_image_alloc(), av_malloc(), av_mallocz(), av_memdup(), av_opt_get(), av_opt_set_bin(), av_parser_change(), av_realloc(), av_samples_alloc(), av_tempfile(), avcodec_alloc_context3(), avformat_alloc_context(), avi_read_tag(), avi_write_packet(), avpriv_alloc_fixed_dsp(), avresample_set_matrix(), bfi_read_header(), build_filter(), calc_rice_params(), celt_header(), check_dcbzl_effect(), cine_read_header(), cinepak_encode_init(), cmdutils_read_file(), config(), config_audio_output(), config_input(), config_output(), config_props(), convert_str(), copy_parameter_set(), create_all_formats(), create_map(), create_vorbis_context(), data_open(), decode_dvd_subtitles(), decode_frame(), decode_header_trees(), decode_init(), decode_main_header(), decode_picture_header(), decode_rle(), decode_slice(), deinterlace_bottom_field_inplace(), denoise_depth(), dnxhd_encode_init(), do_subtitle_out(), doubles2str(), dshow_add_device(), dshow_cycle_formats(), dtshd_read_header(), dump_extradata(), dup_wchar_to_utf8(), dvbsub_display_end_segment(), dvbsub_parse_clut_segment(), dvbsub_parse_init(), dvbsub_parse_region_segment(), dvdsub_parse(), dvdsub_parse_extradata(), ebml_read_ascii(), eightsvx_decode_frame(), encode_frame(), encode_init(), encode_picture_ls(), escape130_decode_init(), exif_decode_tag(), extract_header(), Faac_encode_init(), fdk_aac_decode_frame(), ff_alloc_entries(), ff_alloc_extradata(), ff_alsa_open(), ff_audio_data_realloc(), ff_bgmc_init(), ff_dct_init(), ff_fast_malloc(), ff_fft_init(), ff_fill_line_with_color(), ff_filter_alloc(), ff_flac_parse_picture(), ff_frame_thread_init(), ff_gen_syncpoint_search(), ff_http_auth_create_response(), ff_huffyuv_alloc_temp(), ff_init_rl(), ff_mdct_init(), ff_merge_channel_layouts(), ff_mjpeg_encode_init(), ff_mov_write_packet(), ff_mp_image_alloc_planes(), ff_MPV_common_frame_size_change(), ff_MPV_common_init(), ff_mss12_decode_init(), ff_parse_fmtp(), ff_pca_init(), ff_rtmp_packet_create(), ff_rv34_decode_frame(), ff_sauce_read(), ff_sndio_open(), ff_store_parser_state(), ff_tadd_string_metadata(), ff_urldecode(), ff_vc1_decode_init_alloc_tables(), ff_vda_create_decoder(), ff_vorbis_comment(), ff_yuv2rgb_c_init_tables(), ffio_ensure_seekback(), ffio_fdopen(), ffio_set_buf_size(), ffurl_get_multi_file_handle(), film_read_header(), find_headers_search_validate(), find_motion(), find_next_parse_unit(), find_smallest_bounding_rectangle(), flac_encode_init(), flac_write_block_comment(), flashsv_decode_frame(), fourxm_read_header(), frame_list_add_frame(), gen_sub_text(), generate_dither_noise(), generate_new_codebooks(), get_buffer_internal(), get_cookies(), get_geokey_val(), get_key(), get_meta(), get_metadata(), get_stats(), get_tag(), getstr8(), gif_encode_init(), gif_write_packet(), halfpel_interpol(), hevc_init_context(), hls_read_header(), hls_slice_data_wpp(), hls_slice_header(), hls_write_header(), iec61883_callback(), iff_read_header(), imx_dump_header(), init(), init_er(), init_filter_param(), init_mv_table(), init_noise(), init_pattern_from_file(), initFilter(), interpolate(), interpolate_refplane(), iso88591_to_utf8(), latm_decode_audio_specific_config(), lavfi_read_header(), libAVPin_Setup(), libopus_encode_init(), libschroedinger_decode_frame(), libvorbis_encode_init(), libwebp_encode_frame(), libx265_encode_init(), load_mask(), main(), make_digest_auth(), matroska_decode_buffer(), matroska_read_header(), mjpeg2jpeg_filter(), mjpeg_decode_com(), mjpega_dump_header(), mkv_strip_wavpack(), mmap_init(), mmap_read_frame(), modplug_read_header(), mov2textsub(), mov_create_dvd_sub_decoder_specific_info(), mov_create_timecode_track(), mov_metadata_raw(), mov_read_cmov(), mov_read_ctts(), mov_read_custom_2plus(), 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_write_ctts_tag(), mov_write_header(), mov_write_stts_tag(), mp3_header_decompress(), mp3lame_encode_init(), mpc8_parse_seektable(), mpc_read_header(), mpeg_decode_a53_cc(), mpegps_read_pes_header(), mpegts_open_section_filter(), mpegts_set_stream_info(), mpegts_write_packet_internal(), mss3_decode_init(), mss4_decode_init(), mxf_read_generic_descriptor(), mxf_read_utf16_string(), mxpeg_decode_mxm(), nal_unit_extract_rbsp(), new_connection(), noise(), nsv_parse_NSVf_header(), nut_read_header(), ogg_new_buf(), ogg_new_stream(), ogg_read_page(), ogg_save(), open_filter_param(), open_null_ctx(), open_output_file(), opengl_compile_shaders(), opengl_load_shader(), opt_opencl_bench(), packet_queue_put_private(), parse_forced_key_frames(), parse_frames(), parse_header(), parse_MP4DecConfigDescrTag(), parse_options(), parse_playlist(), parse_presentation_segment(), parse_read_intervals(), parse_setup_header(), parse_times(), parse_vtrk(), pcm_dvd_decode_init(), pcx_decode_frame(), pic_arrays_init(), piz_uncompress(), pp_get_context(), pp_get_mode_by_name_and_quality(), precalc_coefs(), prepare_sdp_description(), print_sdp(), process_line(), prores_encode_init(), queue_frames(), r3d_read_rdvo(), read_ffserver_streams(), read_frame(), read_geobtag(), read_header(), read_header_gme(), read_priv(), read_shape_from_file(), read_specific_config(), read_string(), ready_codebook(), recv_msg(), redspark_read_header(), rl2_read_header(), 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(), run_opencl_bench(), rv34_decoder_alloc(), sample_queue_retain(), sdp_parse_fmtp_config_h264(), seq_init_frame_buffers(), set_string_binary(), shift_data(), smacker_read_header(), smjpeg_read_header(), sox_read_header(), spdif_write_header(), Stagefright_decode_frame(), submit_stats(), sunrast_decode_frame(), svq1_decode_frame(), svq1_encode_frame(), svq3_decode_init(), swf_read_header(), swf_read_packet(), sws_allocVec(), sws_getDefaultFilter(), sws_init_context(), sws_scale(), tak_read_header(), teletext_decode_frame(), text2movsub(), tiff_decode_tag(), tiff_unpack_fax(), tscc2_decode_init(), tta_encode_init(), unescape(), unpack_codebook(), unrefcount_frame(), update_block_buffers(), update_size(), utvideo_decode_init(), utvideo_encode_init(), var_read_string(), vdpau_get_buffer(), vfw_read_header(), vid_read_packet(), 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(), vorbis_update_metadata(), vp56_size_changed(), vp8_encode(), vpx_init(), vqa_decode_init(), vs_set_mem_and_log_functions(), wavesynth_init(), wc3_read_header(), write_extradata(), write_frame(), write_manifest(), wtvfile_open_sector(), X264_init(), xan_decode_init(), XAVS_init(), xiph_handle_packet(), xiph_parse_fmtp_pair(), xvid_encode_init(), xvid_strip_vol_header(), and xwma_read_header().

av_alloc_size ( ,
 
)

Allocate a block of size * nmemb bytes with av_malloc().

Allocate a block of size * nmemb bytes with av_mallocz().

Parameters
nmembNumber of elements
sizeSize of the single element
Returns
Pointer to the allocated block, NULL if the block cannot be allocated.
See Also
av_malloc()
Parameters
nmembNumber of elements
sizeSize of the single element
Returns
Pointer to the allocated block, NULL if the block cannot be allocated.
See Also
av_mallocz()
av_malloc_array()
return av_malloc ( nmemb size)
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
ptrPointer to a memory block already allocated with av_realloc() or NULL.
sizeSize in bytes of 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.
Warning
Pointers originating from the av_malloc() family of functions must not be passed to av_realloc(). The former can be implemented using memalign() (or other functions), and there is no guarantee that pointers from such functions can be passed to realloc() at all. The situation is undefined according to POSIX and may crash with some libc implementations.
See Also
av_fast_realloc()

Definition at line 143 of file mem.c.

Referenced by add_file(), add_serial_pair(), append_to_cached_buf(), ass_split_section(), audio_resample(), av_bprint_alloc(), av_bprint_finalize(), av_buffer_realloc(), av_dict_set(), av_fast_realloc(), av_frame_new_side_data(), av_packet_new_side_data(), av_packet_pack_dictionary(), av_realloc_array(), av_realloc_f(), av_reallocp(), av_strdup(), avfilter_graph_alloc_filter(), concat_open(), decode_frame(), decode_header(), draw_text(), ff_alsa_extend_reorder_buf(), ff_ass_add_rect(), filter_frame(), fixup_vorbis_headers(), grow_array(), handle_file(), huf_build_dec_table(), load_textfile(), main(), match_streams(), matroska_decode_buffer(), matroska_deliver_packet(), matroska_parse_wavpack(), mov_read_trun(), new_video_stream(), nut_read_header(), ogg_new_stream(), probe_codec(), qt_rtp_parse_packet(), realloc_section_array(), reconfigure_at_keyframe(), update_context_from_user(), vs_set_mem_and_log_functions(), 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 170 of file mem.c.

Referenced by aeval_config_output(), alloc_array_elem(), alloc_table(), av_reallocp_array(), avi_write_packet(), config_input(), config_output(), copy_chapters(), decode_frame(), ffio_rewind_with_probe_data(), init(), mov_read_uuid(), parse_commands(), parse_forced_key_frames(), parse_intervals(), and read_whole_file().

int av_reallocp ( 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
ptrPointer to a pointer to a memory block already allocated with av_realloc(), or pointer to a pointer to NULL. The pointer is updated on success, or freed on failure.
sizeSize in bytes for the memory block to be allocated or reallocated
Returns
Zero on success, an AVERROR error code on failure.
Warning
Pointers originating from the av_malloc() family of functions must not be passed to av_reallocp(). The former can be implemented using memalign() (or other functions), and there is no guarantee that pointers from such functions can be passed to realloc() at all. The situation is undefined according to POSIX and may crash with some libc implementations.

Definition at line 185 of file mem.c.

Referenced by add_fragment(), add_tracked_method(), alloc_and_copy(), allocate_buffers(), append_flv_data(), asfrtp_parse_packet(), av_probe_input_buffer2(), avi_read_header(), bmv_read_packet(), concat_open(), concatenate_packet(), decode_frame(), dyn_buf_write(), fixup_vorbis_headers(), flashsv_decode_frame(), g2m_load_cursor(), get_tcp_server_response(), h264_extradata_to_annexb(), handle_metadata(), jpg_decode_data(), libschroedinger_encode_frame(), mov_read_extradata(), parse_icy(), qt_rtp_parse_packet(), queue_frames(), rdt_parse_sdp_line(), realloc_buffer(), rtmp_http_write(), rtmp_open(), smacker_read_packet(), tgv_decode_inter(), and theora_header().

av_alloc_size ( ,
 
)

Allocate or reallocate an array.

Allocate or reallocate an array through a pointer to a pointer.

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

Parameters
ptrPointer to a memory block already allocated with av_realloc() or NULL.
nmembNumber of elements
sizeSize of the single element
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.
Warning
Pointers originating from the av_malloc() family of functions must not be passed to av_realloc(). The former can be implemented using memalign() (or other functions), and there is no guarantee that pointers from such functions can be passed to realloc() at all. The situation is undefined according to POSIX and may crash with some libc implementations.

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

Parameters
ptrPointer to a pointer to a memory block already allocated with av_realloc(), or pointer to a pointer to NULL. The pointer is updated on success, or freed on failure.
nmembNumber of elements
sizeSize of the single element
Returns
Zero on success, an AVERROR error code on failure.
Warning
Pointers originating from the av_malloc() family of functions must not be passed to av_realloc(). The former can be implemented using memalign() (or other functions), and there is no guarantee that pointers from such functions can be passed to realloc() at all. The situation is undefined according to POSIX and may crash with some libc implementations.
void av_free ( void ptr)

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

Parameters
ptrPointer 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 221 of file mem.c.

Referenced by a64multi_close_encoder(), aac_adtstoasc_filter(), aac_decode_frame(), add_file(), add_pes_stream(), amr_free_context(), ape_tag_read_field(), append_entry(), apply_color_indexing_transform(), asfrtp_free_context(), asfrtp_parse_packet(), atrac3_decode_close(), atrac3p_decode_close(), audio_decode_example(), audio_encode_example(), audio_resample(), audio_resample_close(), av_audio_fifo_free(), av_audio_resample_init(), av_bitstream_filter_close(), av_buffer_default_free(), 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_hash_alloc(), av_hmac_alloc(), av_hmac_free(), av_image_alloc(), av_opt_get_key_value(), av_opt_query_ranges_default(), av_opt_set_bin(), av_opt_set_from_string(), av_packet_free_side_data(), av_parser_close(), av_parser_init(), av_probe_input_buffer2(), av_realloc_f(), av_resample_init(), av_samples_alloc(), av_tree_destroy(), avcodec_alloc_context3(), avcodec_copy_context(), avcodec_encode_audio2(), avcodec_encode_video(), avdevice_free_list_devices(), avfilter_free(), avfilter_get_video_buffer_ref_from_arrays(), avfilter_init_str(), avformat_free_context(), avformat_new_stream(), avi_read_close(), avi_write_header(), avio_close(), avio_close_dyn_buf(), avpicture_free(), avpriv_do_elbg(), avpriv_dv_init_demux(), avpriv_init_elbg(), bfi_decode_close(), build_filter(), caf_write_packet(), callback(), celt_header(), channelmap_filter_frame(), check_dcbzl_effect(), check_field_queue(), check_stream_max_drift(), cine_read_header(), close(), close_audio(), close_connection(), close_null_ctx(), close_video(), cmdutils_read_file(), cng_decode_close(), cng_encode_close(), concat_open(), config_input(), config_output(), convert_str(), copy_frame(), create_filter(), data_open(), decode_end(), decode_frame(), decode_lowdelay(), decode_slice(), decode_text_chunk(), decode_thread(), deinterlace_bottom_field_inplace(), delete_cluts(), delete_objects(), delete_region_display_list(), delete_regions(), dilate_init(), dirac_parse_close(), dnxhd_encode_end(), do_adobe_auth(), do_llnw_auth(), doTest(), doubles2str(), 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_parse_extradata(), ebml_free(), ebml_read_ascii(), encode_close(), encode_dvd_subtitles(), encode_end(), encode_frame(), encode_picture_ls(), enu_free(), escape124_decode_close(), escape124_decode_frame(), fbdev_get_device_list(), fdk_aac_decode_frame(), ff_ass_split_free(), ff_audio_data_alloc(), ff_audio_data_free(), ff_audio_mix_alloc(), ff_audio_mix_free(), ff_audio_mix_set_matrix(), ff_audio_resample_free(), ff_audio_resample_init(), ff_cavs_end(), ff_ccitt_unpack(), ff_command_queue_pop(), ff_create_schro_frame(), ff_dct_end(), ff_dct_init(), ff_decklink_write_header(), ff_dither_free(), ff_fast_malloc(), ff_filter_alloc(), ff_free_mp_image(), ff_free_parser_state(), ff_gen_syncpoint_search(), ff_get_wav_header(), ff_h264_decode_picture_parameter_set(), ff_h264_decode_seq_parameter_set(), ff_hevc_annexb2mp4(), ff_http_auth_create_response(), ff_http_do_new_request(), ff_http_match_no_proxy(), ff_huff_gen_len_table(), ff_iir_filter_free_coeffs(), ff_iir_filter_free_state(), ff_img_read_header(), ff_init_vlc_sparse(), ff_interleave_add_packet(), ff_isom_write_avcc(), ff_isom_write_hvcc(), ff_jpegls_decode_picture(), 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_parse_fmtp(), ff_pca_free(), ff_png_zfree(), ff_psy_preprocess_end(), ff_pulse_audio_get_devices(), 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_reset_packet_queue(), ff_rtp_send_punch_packets(), ff_rtp_send_rtcp_feedback(), ff_rtsp_close_streams(), ff_rtsp_setup_output_streams(), ff_rtsp_tcp_write_packet(), ff_rtsp_undo_setup(), ff_slice_thread_free(), ff_slice_thread_init(), ff_snow_alloc_blocks(), ff_snow_release_buffer(), ff_store_parser_state(), ff_tls_deinit(), ff_twinvq_decode_close(), ff_vf_get_image(), ff_wms_parse_sdp_a_line(), ff_xvid_rate_control_init(), ffio_close_null_buf(), ffio_ensure_seekback(), ffio_fdopen(), ffio_rewind_with_probe_data(), ffio_set_buf_size(), ffmpeg_cleanup(), find_and_decode_index(), find_motion(), flac_parse(), flac_parse_close(), flac_read_header(), flashsv_encode_end(), flv_get_extradata(), flv_queue_extradata(), flv_write_packet(), fourxm_read_header(), frame_list_clear(), frame_list_remove_samples(), free_context(), free_entries(), free_field_queue(), free_filter_param(), free_fragment_if_needed(), free_frame_if_needed(), free_geobtag(), free_packet_list(), free_playlist_list(), free_rendition_list(), free_segment_list(), free_temp(), free_tracked_methods(), free_variant_list(), frei0r_init(), ftp_connect_control_connection(), ftp_current_dir(), ftp_file_size(), ftp_passive_mode(), g2m_init_buffers(), gen_sub_text(), generate_codebook(), generate_new_codebooks(), get_buffer2(), get_cookies(), get_meta(), get_metadata(), get_private_data(), get_tag(), glyph_enu_free(), h263_free_context(), h263_handle_packet(), h264_extradata_to_annexb(), h264_free_context(), handle_file(), handle_invoke_error(), handle_invoke_result(), hds_flush(), hds_free(), hls_slice_data_wpp(), hls_write_header(), hls_write_trailer(), http_connect(), http_parse_request(), http_receive_data(), huf_uncompress(), huff_reader_build_canonical(), hvcc_add_nal_unit(), id3v2_parse(), iec61883_close(), iec61883_parse_queue_dv(), iec61883_parse_queue_hdv(), image_ctx_free(), init(), init_coef_vlc(), init_pass2(), init_pattern_from_file(), init_report(), initFilter(), interpolate(), ism_flush(), ism_free(), jacosub_decode_frame(), jpeg_free_context(), latm_decode_audio_specific_config(), latm_free_context(), latm_parse_packet(), lavfi_read_header(), libopus_encode(), libschroedinger_decode_frame(), libschroedinger_free_frame(), link_filter_inouts(), load_path(), m4sl_cb(), main(), make_digest_auth(), make_field_queue(), matroska_clear_queue(), matroska_decode_buffer(), matroska_deliver_packet(), matroska_parse_block(), matroska_parse_frame(), matroska_parse_rm_audio(), matroska_parse_webvtt(), matroska_read_close(), matroska_read_header(), mjpeg_decode_com(), mkv_flush_dynbuf(), mkv_write_attachments(), mkv_write_block(), mkv_write_codecprivate(), mkv_write_seekhead(), mmap_close(), mmap_init(), mmap_release_buffer(), mms_close(), mmsh_read_seek(), 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_stts(), mov_read_uuid(), mov_read_wave(), mov_write_ctts_tag(), mov_write_dvc1_structs(), mov_write_isml_manifest(), mov_write_stts_tag(), mov_write_udta_tag(), mpc8_parse_seektable(), mpeg_mux_init(), mpegps_read_pes_header(), mpegts_close_filter(), mpegts_free_context(), 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(), mxf_read_generic_descriptor(), mxf_read_local_tags(), new_connection(), new_output_stream(), new_stream(), nsv_parse_NSVf_header(), nsv_read_close(), nut_read_header(), ogg_new_buf(), ogg_read_packet(), ogg_read_page(), ogg_restore(), ogg_write_page(), ogm_chapter(), open_null_ctx(), open_slave(), opengl_compile_shaders(), opengl_load_shader(), opt_channel_layout(), opt_old2new(), opt_opencl_bench(), opt_qscale(), opt_show_entries(), opt_show_format_entry(), opt_timecode(), opt_vstats_file(), packet_queue_get(), parse_bsfs(), parse_channel_expressions(), parse_device_name(), parse_filter(), parse_fmtp_config(), parse_frames(), parse_inputs(), parse_interval(), parse_key_value_pair(), parse_location(), parse_options(), parse_outputs(), parse_playlist(), parse_read_interval(), parse_read_intervals(), parse_setup_header(), parse_times(), parse_video_var(), pcx_decode_frame(), pmt_cb(), pp_free_context(), pp_free_mode(), pp_get_mode_by_name_and_quality(), prepare_sdp_description(), print_codecs(), process_line(), process_options(), pulse_add_detected_device(), put_packet(), qcelp_free_context(), qdm2_extradata_free(), qt_rtp_free(), qt_rtp_parse_packet(), qtrle_encode_end(), queue_frames(), radix_sort(), rdt_free_context(), rdt_new_context(), read_chapter(), read_frame(), read_geobtag(), read_header(), read_huffman_code_normal(), read_shape_from_file(), read_string(), read_tag(), read_whole_file(), reallocAlign(), redspark_read_header(), release_buffer(), resample_init(), rl2_decode_end(), rl2_read_header(), rm_write_audio(), roq_encode_end(), roq_encode_video(), rtmp_open(), rtp_close(), rtp_new_av_stream(), rtp_new_connection(), rtp_parse_mp4_au(), rtp_parse_queued_packet(), rtsp_cmd_describe(), run_opencl_bench(), sami_paragraph_to_ass(), sample_queue_free(), sample_queue_pop(), sap_write_header(), sbg_read_header(), sdp_parse_fmtp_config_h264(), sdt_cb(), seg_write_trailer(), segment_end(), segment_list_print_entry(), seq_read_close(), set_enable_expr(), set_expr(), set_params(), set_string_binary(), shift_data(), show_codecs(), show_stream(), smacker_decode_header_tree(), smka_decode_frame(), sp5x_decode_frame(), Stagefright_decode_frame(), storeframe(), stream_close(), stream_open(), svq1_decode_frame(), svq3_decode_init(), svq3_extradata_free(), svq3_parse_packet(), swri_get_dither(), sws_addVec(), sws_convVec(), sws_freeContext(), sws_freeFilter(), sws_freeVec(), sws_scale(), sws_shiftVec(), sws_subVec(), tgv_decode_end(), thread_entry(), tiff_unpack_fax(), tm2_build_huff_table(), tm2_free_codes(), tqi_decode_end(), try_load(), tta_decode_close(), uninit(), update_block_buffers(), update_context_from_user(), url_open_dyn_buf_internal(), var_read_float(), var_read_int(), vc1_decode_frame(), vc1_decode_init(), vc1_extract_headers(), vda_h264_end_frame(), vda_h264_release_buffer(), vfw_read_close(), vfw_read_packet(), video_audio_display(), video_decode_example(), video_encode_example(), videostream_cb(), vmd_read_header(), vorbis_free(), vorbis_parse_setup_hdr_codebooks(), vp56_size_changed(), vp6_decode_free(), vp8_encode(), vp8_free_buffer(), vp8_free_context(), vs_set_mem_and_log_functions(), wavesynth_close(), wavesynth_init(), worker(), write_audio_frame(), write_globalinfo(), write_header_chunk(), write_headers(), write_manifest(), write_streaminfo(), write_trailer(), writer_print_string(), wtvfile_close(), wtvfile_open_sector(), x11grab_read_header(), X264_close(), XAVS_close(), xiph_free_context(), xiph_parse_fmtp_pair(), xmv_process_packet_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
sizeSize 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 243 of file mem.c.

Referenced by a64multi_encode_init(), 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(), aiff_write_packet(), alac_encode_init(), alloc_scratch_buffers(), allocate_buffers(), allocate_tables(), amr_new_context(), ape_read_header(), asf_read_stream_properties(), asfrtp_new_context(), atrac3_decode_init(), atrac3p_decode_init(), audio_get_buffer(), av_abuffersink_params_alloc(), av_aes_alloc(), av_audio_fifo_alloc(), av_audio_resample_init(), av_bitstream_filter_init(), av_buffer_create(), av_buffer_pool_init(), av_buffer_ref(), av_calloc(), av_dict_set(), av_dump_format(), av_expr_parse(), av_fft_init(), av_fifo_alloc(), av_frame_alloc(), av_frame_new_side_data(), av_hash_alloc(), av_hmac_alloc(), av_md5_alloc(), av_murmur3_alloc(), av_new_program(), av_opencl_alloc_external_env(), av_opencl_get_device_list(), av_opt_query_ranges_default(), av_packet_new_side_data(), av_packet_split_side_data(), av_parser_init(), av_resample_init(), av_ripemd_alloc(), av_sha512_alloc(), av_sha_alloc(), av_stereo3d_alloc(), av_tree_node_alloc(), av_vdpau_alloc_context(), avcodec_fill_audio_frame(), avcodec_get_context_defaults3(), avcodec_open2(), avdevice_capabilities_create(), avdevice_list_devices(), avfilter_get_video_buffer_ref_from_arrays(), avfilter_graph_alloc(), avfilter_graph_queue_command(), avfilter_inout_alloc(), avfilter_link(), avformat_alloc_context(), avformat_alloc_output_context2(), avformat_new_stream(), avformat_open_input(), avi_read_header(), avi_write_header(), avio_alloc_context(), avpriv_ac3_parse_header2(), avpriv_dv_init_demux(), avpriv_new_chapter(), avresample_alloc_context(), avui_encode_init(), bfi_decode_init(), callback(), channelmap_filter_frame(), che_configure(), check_field_queue(), compute_mask(), compute_mask_matrix(), config(), config_output(), configure_filtergraph(), cook_decode_init(), copy_chapters(), decode_dvd_subtitles(), decode_frame(), decode_init(), decode_pic(), decode_picture_header(), decode_thread(), DEF_CHOOSE_FORMAT(), dejudder_init(), 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(), encode_init(), encode_picture_ls(), enqueue_packet(), extract_mpeg4_header(), fbdev_get_device_list(), ff_all_channel_counts(), ff_all_channel_layouts(), ff_all_samplerates(), ff_alloc_entries(), ff_ass_add_rect(), ff_ass_split(), ff_audio_data_alloc(), ff_audio_mix_alloc(), ff_audio_resample_init(), ff_avc_write_annexb_extradata(), ff_cavs_init_top_lines(), ff_create_schro_frame(), ff_decklink_write_header(), ff_dither_alloc(), ff_fast_malloc(), ff_filter_alloc(), ff_frame_thread_encoder_init(), ff_frame_thread_init(), ff_graph_thread_init(), ff_h264_decode_picture_parameter_set(), ff_h264_decode_seq_parameter_set(), ff_hevc_decode_nal_pps(), ff_iir_filter_init_state(), ff_interleave_add_packet(), ff_intrax8_common_init(), ff_ivi_init_planes(), ff_ivi_init_tiles(), ff_jpegls_decode_picture(), ff_lpc_init(), ff_lzw_decode_open(), ff_merge_channel_layouts(), ff_mjpeg_decode_sof(), ff_mpegts_parse_open(), ff_nut_add_sp(), ff_pca_init(), ff_psy_preprocess_init(), ff_rate_control_init(), ff_rdt_parse_open(), ff_read_riff_info(), ff_replaygain_export_raw(), ff_rfps_add_frame(), ff_rm_alloc_rmstream(), ff_rtp_parse_open(), ff_rtsp_setup_output_streams(), ff_schro_queue_push_back(), ff_slice_thread_init(), ff_timefilter_new(), ff_vc1_decode_init_alloc_tables(), ff_wms_parse_sdp_a_line(), ffv1_init_slice_contexts(), find_headers_search_validate(), flac_read_header(), flashsv2_encode_init(), flashsv_decode_frame(), flashsv_encode_frame(), flashsv_encode_init(), flv_queue_extradata(), flv_write_header(), g2m_init_buffers(), g722_encode_init(), gen_sub_bitmap(), get_buffer(), get_buffer2(), get_buffer_internal(), get_device_list(), get_http_header_data(), get_private_data(), get_siz(), gif_encode_init(), gxf_write_header(), h263_new_context(), h264_new_context(), h264_slice_header_init(), handle_file(), handler(), hds_write_header(), hevc_init(), hevc_init_context(), hnm_decode_init(), hnm_read_header(), http_prepare_data(), http_server(), iec61883_callback(), init(), init_bundles(), init_er(), init_input_filter(), init_muxer(), init_pattern_from_string(), ism_write_header(), ivi_init_tiles(), join_config_output(), join_init(), join_request_frame(), jpeg_new_context(), latm_new_context(), lavfi_read_header(), libopus_encode_init(), libschroedinger_encode_frame(), link_filter_inouts(), load_glyph(), main(), make_eval_expr(), make_field_queue(), make_point(), matroska_parse_frame(), matroska_parse_laces(), matroska_parse_rm_audio(), matroska_parse_webvtt(), matroska_read_header(), mkv_start_cues(), mkv_start_seekhead(), mkv_write_header(), mmsh_open_internal(), mmsh_read_seek(), mov_read_chapters(), mov_read_covr(), mov_read_dref(), mov_read_trak(), mov_read_uuid(), mov_rewrite_dvd_sub_extradata(), mov_text_encode_init(), mov_write_dvc1_structs(), mov_write_header(), mpeg_mux_init(), mpeg_mux_write_packet(), mpegts_add_service(), mpegts_new_context(), mpegts_open_filter(), mpegts_write_header(), mss2_decode_init(), mxf_read_local_tags(), mxf_timestamp_to_str(), mxf_uid_to_str(), mxf_write_header(), mxpeg_decode_mxm(), new_connection(), new_context(), new_output_stream(), new_playlist(), new_rendition(), new_stream(), new_variant(), new_video_stream(), nsv_parse_NSVf_header(), nsv_parse_NSVs_header(), ogg_buffer_page(), ogg_build_flac_headers(), ogg_build_opus_headers(), ogg_build_speex_headers(), ogg_save(), ogg_write_header(), ogg_write_vorbiscomment(), opaque_list_push(), open_input_file(), open_output_file(), opt_channel_layout(), opt_filter_complex(), opt_filter_complex_script(), opus_header(), paf_video_init(), parse_acl_row(), parse_dynamic_acl(), parse_ffconfig(), parse_fmtp_config(), parse_inputs(), parse_keyframes_index(), parse_primary(), parse_sws_flags(), pic_arrays_init(), pool_alloc_buffer(), prepare_sdp_description(), psy_3gpp_init(), pthread_cond_init(), pthread_create(), pulse_add_detected_device(), put_main_header(), qcelp_new_context(), qdm2_extradata_new(), qt_rtp_new(), qt_rtp_parse_packet(), qtrle_encode_init(), rdt_new_context(), rdt_parse_b64buf(), read_apic(), read_gab2_sub(), read_geobtag(), read_header(), read_priv(), read_shape_from_file(), read_tfra(), ready_codebook(), ready_residue(), reallocAlign(), resample_init(), rl2_decode_init(), rtp_new_av_stream(), rtp_new_connection(), rtp_parse_addr_list(), rtsp_read_header(), rv34_decoder_alloc(), sap_write_header(), segment_end(), set_segment_filename(), 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_decode_init(), svq3_extradata_new(), swr_alloc(), swri_realloc_audio(), swri_rematrix_init(), swri_rematrix_init_x86(), sws_alloc_context(), tgv_decode_frame(), theora_header(), transcode_init(), update_block_buffers(), update_dimensions(), url_alloc_for_protocol(), url_open_dyn_buf_internal(), utvideo_encode_init(), vc1_decode_frame(), vc1_decode_init(), vc1_extract_headers(), vda_h264_end_frame(), vdpau_alloc(), vf_open(), videostream_cb(), 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_new_context(), vqa_decode_init(), vs_set_mem_and_log_functions(), wmv2_encode_init(), worker(), writer_open(), wtvfile_open_sector(), wv_alloc_frame_context(), xiph_new_context(), and xwma_read_header().

void* av_calloc ( size_t  nmemb,
size_t  size 
)
return av_mallocz ( nmemb size)
char* av_strdup ( const char *  s)

Duplicate the string s.

Parameters
sstring to be duplicated
Returns
Pointer to a newly-allocated string containing a copy of s or NULL if the string cannot be allocated.

Definition at line 258 of file mem.c.

Referenced by add_codec(), add_input_streams(), add_tracked_method(), av_dict_set(), av_opt_get(), av_tempfile(), avcodec_copy_context(), avfilter_graph_parse(), avfilter_graph_queue_command(), avfilter_init_str(), caca_write_header(), choose_pix_fmts(), cine_read_header(), configure_filtergraph(), decimate_init(), dilate_init(), ebml_parse_nest(), fbdev_get_device_list(), ff_filter_alloc(), ff_http_do_new_request(), ff_http_match_no_proxy(), ff_img_read_header(), ffm2_read_header(), ffm_read_header(), fieldmatch_init(), frei0r_init(), geq_init(), get_cookies(), get_geokey_val(), get_ost_filters(), grab_read_header(), http_open(), init(), init_filter(), init_filters(), join_init(), lavfi_read_header(), main(), microdvd_read_header(), mkv_write_simpletag(), movie_common_init(), mpegts_add_service(), mtv_read_header(), new_audio_stream(), new_video_stream(), open_output_file(), opengl_write_header(), opt_filter_complex(), opt_map(), opt_vstats_file(), parse_bsfs(), parse_channel_expressions(), parse_device_name(), parse_ffconfig(), parse_fmtp(), parse_frames(), parse_location(), parse_playlist(), parse_psfile(), parse_read_interval(), parse_read_intervals(), parse_source_list(), parse_times(), parse_video_var(), process_line(), pulse_add_detected_device(), pulse_server_info_cb(), read_header(), read_ttag(), realtext_read_header(), sami_paragraph_to_ass(), sap_read_header(), sdl_write_header(), seg_write_header(), set_enable_expr(), set_expr(), set_options(), set_string(), show_help(), split_init(), Stagefright_init(), write_option(), x11grab_read_header(), X264_init(), and xv_write_header().

void* av_memdup ( const void p,
size_t  size 
)

Duplicate the buffer p.

Parameters
pbuffer to be duplicated
Returns
Pointer to a newly allocated buffer containing a copy of p or NULL if the buffer cannot be allocated.

Definition at line 270 of file mem.c.

Referenced by clone_filter_formats(), and init_thread_copy().

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
ptrPointer to the pointer to the memory block which should be freed.
See Also
av_free()

Definition at line 236 of file mem.c.

Referenced by aac_decode_close(), aac_encode_close(), aac_encode_end(), aacPlus_encode_close(), ac3_decode_end(), ac3_eac3_probe(), add_file(), adpcm_encode_close(), aic_decode_close(), aiff_write_packet(), aiff_write_trailer(), alac_decode_close(), alac_encode_close(), alloc_metrics(), alloc_scratch_buffers(), allocate_buffers(), ape_decode_close(), ape_read_close(), append_to_cached_buf(), asf_read_picture(), asf_read_stream_properties(), asf_write_header1(), asf_write_markers(), asf_write_trailer(), asfrtp_free_context(), asfrtp_parse_packet(), atrac3_decode_init(), audio_encode_example(), audio_get_buffer(), audio_resample_close(), av_asprintf(), av_bitstream_filter_close(), av_bprint_finalize(), av_buffer_alloc(), av_buffer_create(), av_buffer_realloc(), av_buffer_unref(), av_dict_free(), av_dict_set(), av_dynarray2_add(), av_dynarray_add(), av_expr_free(), av_fast_padded_malloc(), av_fast_padded_mallocz(), av_fft_init(), av_fifo_alloc(), av_fifo_free(), av_frame_copy_props(), av_frame_free(), av_frame_new_side_data(), av_frame_remove_side_data(), av_frame_unref(), av_hash_freep(), av_opencl_free_device_list(), av_opencl_free_external_env(), av_opencl_get_device_list(), av_opt_free(), av_opt_freep_ranges(), av_packet_free_side_data(), av_packet_pack_dictionary(), av_parser_init(), av_probe_input_buffer2(), av_reallocp(), av_resample_close(), av_samples_alloc_array_and_samples(), av_tempfile(), av_write_trailer(), avcodec_close(), avcodec_copy_context(), avcodec_encode_audio(), avcodec_encode_video(), avcodec_fill_audio_frame(), avcodec_open2(), avdevice_capabilities_create(), avdevice_capabilities_free(), avdevice_free_list_devices(), avfilter_free(), avfilter_graph_alloc(), avfilter_graph_free(), avfilter_graph_parse(), avfilter_graph_parse2(), avfilter_graph_parse_ptr(), avfilter_init_str(), avfilter_inout_free(), avfilter_link_free(), avformat_find_stream_info(), avformat_free_context(), avi_read_close(), avi_read_header(), avi_write_trailer(), avio_close(), avresample_close(), avresample_free(), avresample_set_matrix(), avsubtitle_free(), avui_encode_close(), bmv_read_close(), buffer_pool_free(), build_feed_streams(), caca_write_trailer(), cache_open(), caf_write_trailer(), calc_rice_params(), can_merge_formats(), cdxl_decode_end(), che_configure(), cinepak_encode_end(), cinepak_encode_init(), clean_tracks(), cleanup(), clear_programs(), cllc_decode_close(), clone_filter_formats(), close_connection(), close_decoder(), close_filter_param(), close_slaves(), compat_free_buffer(), compute_mask(), compute_mask_matrix(), concat_close(), concat_open(), concat_read_close(), config_input(), config_output(), config_props(), configure_input_filter(), configure_output_audio_filter(), configure_output_filter(), configure_output_video_filter(), cook_decode_close(), copy_parameter_set(), crypto_close(), data_close(), dca_decode_end(), decimate_uninit(), decode(), decode_close(), decode_end(), decode_flush(), decode_frame(), decode_init(), decode_picture_header(), decode_slice_header(), decode_str(), dejudder_uninit(), destroy_buffers(), dfa_decode_end(), dnxhd_encode_end(), do_exit(), doTest(), dvbsub_close_decoder(), dvbsub_parse_close(), dvdsub_close(), dvdsub_decode(), dvdsub_parse(), dvdsub_parse_close(), ebml_free(), ebml_read_binary(), eightsvx_decode_close(), eightsvx_decode_frame(), encode_close(), encode_end(), encode_nals(), encode_picture(), encode_picture_ls(), escape130_decode_close(), escape130_decode_init(), estimate_best_b_count(), exif_decode_tag(), expand_function(), extract_header(), extract_mpeg4_header(), Faac_encode_close(), fbdev_get_device_list(), ff_ac3_encode_close(), ff_ac3_float_mdct_end(), ff_af_queue_close(), ff_alsa_close(), ff_ape_write_tag(), ff_ass_split_free(), ff_audio_data_free(), ff_audio_data_realloc(), ff_audio_mix_alloc(), ff_audio_mix_free(), ff_audio_resample_free(), ff_avc_parse_nal_units_buf(), ff_bgmc_end(), ff_cavs_end(), ff_command_queue_pop(), ff_decklink_write_trailer(), ff_dither_free(), ff_dwt_destroy(), ff_fft_end(), ff_fft_init(), ff_filter_alloc(), ff_flac_parse_picture(), ff_frame_thread_encoder_free(), ff_frame_thread_free(), ff_frame_thread_init(), ff_free_stream(), ff_free_vlc(), ff_generate_avci_extradata(), ff_get_extradata(), ff_graph_thread_free(), ff_graph_thread_init(), ff_h264_free_context(), ff_h264_free_tables(), ff_h264_update_thread_context(), ff_hevc_decode_nal_pps(), ff_huffyuv_common_end(), ff_id3v2_free_extra_meta(), ff_id3v2_write_apic(), ff_init_vlc_sparse(), ff_interleave_packet_per_dts(), ff_intrax8_common_end(), ff_ivi_init_tiles(), ff_jpeg2000_cleanup(), 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_frame(), 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_nut_add_sp(), ff_parse_close(), ff_pca_free(), ff_psy_end(), ff_psy_preprocess_end(), ff_rate_control_uninit(), ff_replaygain_export_raw(), ff_rfps_calculate(), ff_rtmp_packet_destroy(), ff_rtp_finalize_packet(), ff_rtsp_close_streams(), ff_rtsp_setup_input_streams(), ff_schro_queue_pop(), ff_slice_buffer_destroy(), ff_slice_buffer_init(), ff_slice_thread_free(), ff_sndio_close(), ff_sndio_open(), ff_snow_common_end(), ff_snow_common_init_after_header(), ff_srtp_free(), ff_subtitles_queue_clean(), ff_thread_video_encode_frame(), ff_timefilter_destroy(), ff_vaapi_common_end_frame(), ff_vc1_decode_end(), ff_vc1_decode_init_alloc_tables(), ff_vda_create_decoder(), ff_vda_destroy_decoder(), ff_vorbis_comment(), ff_vp56_free_context(), ff_wma_end(), ff_yuv2rgb_c_init_tables(), ffio_rewind_with_probe_data(), ffm_close(), ffmpeg_cleanup(), ffurl_closep(), ffv1_close(), fic_decode_close(), fieldmatch_uninit(), film_read_close(), filter_frame(), 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(), flashsv_decode_end(), flashsv_decode_frame(), flv_read_close(), flv_read_packet(), fourxm_read_close(), fourxm_read_header(), frame_size_alloc(), free_acl_list(), free_apic(), free_buffers(), free_bundles(), free_coded_frame(), free_context_frame(), free_device_list(), free_duplicate_context(), free_frame_buffers(), free_geotags(), free_packet_buffer(), free_playlist_list(), free_priv(), free_rendition_list(), free_schro_frame(), free_script(), free_section(), free_segment_list(), free_sequence_buffers(), free_variant_list(), g2m_decode_end(), g722_encode_close(), gen_sub_bitmap(), generate_dither_noise(), get_audio_buffer(), get_buffer_internal(), get_codec_data(), get_cookies(), get_device_list(), get_frame_defaults(), get_http_header_data(), get_tag(), gif_decode_close(), gif_encode_close(), gif_write_trailer(), glyph_enu_free(), guess_dc(), gxf_write_trailer(), h264_mp4toannexb_filter(), handle_connection(), handle_file(), handler(), hds_free(), hevc_close(), hevc_decode_free(), hevc_pps_free(), hls_read_header(), hls_slice_header(), hnm_decode_end(), hnm_decode_init(), http_close(), http_connect(), http_prepare_data(), http_send_data(), huf_uncompress(), hvcc_close(), ico_write_trailer(), id3v2_put_ttag(), init(), init_converted_samples(), init_cook_mlt(), init_er(), init_pattern_from_file(), initFilter(), ism_free(), ivi_free_buffers(), ivi_init_tiles(), join_config_output(), join_uninit(), jpeg2000_dec_cleanup(), jpg_free_context(), lag_decode_end(), latm_parse_packet(), lavfi_read_close(), libopenjpeg_encode_close(), libopenjpeg_encode_init(), libopus_encode_close(), libopus_encode_init(), libschroedinger_decode_buffer_free(), libschroedinger_decode_close(), libschroedinger_encode_close(), libschroedinger_encode_frame(), libschroedinger_free_frame(), libvorbis_encode_close(), libwebp_encode_frame(), ljpeg_encode_close(), load_glyph(), load_mask(), main(), matroska_clear_queue(), matroska_deliver_packet(), matroska_parse_frame(), matroska_parse_wavpack(), matroska_read_header(), md5_close(), mimic_decode_end(), mjpega_dump_header(), mkv_strip_wavpack(), mkv_write_seekhead(), mkv_write_simpletag(), mkv_write_trailer(), mmap_read_frame(), mmsh_close(), mmsh_open_internal(), modplug_read_close(), mov_create_chapter_track(), mov_free(), mov_read_chapters(), mov_read_close(), mov_read_ctts(), mov_read_custom_2plus(), mov_read_ftyp(), mov_read_hdlr(), mov_read_stsz(), mov_read_trak(), mov_rewrite_dvd_sub_extradata(), movie_uninit(), mp3_queue_flush(), mp3lame_encode_close(), mp_decode_end(), mp_decode_init(), mpc7_decode_close(), mpc_read_close(), mpeg_decode_a53_cc(), mpeg_decode_end(), mpeg_field_start(), 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_read_utf16_string(), mxf_write_footer(), mxg_close(), mxpeg_decode_end(), mxpeg_decode_mxm(), new_stream(), nsv_read_close(), nut_read_close(), nut_write_header(), nut_write_packet(), nut_write_trailer(), ogg_new_stream(), ogg_read_close(), ogg_read_packet(), ogg_replace_stream(), ogg_reset(), ogg_restore(), ogg_write_header(), ogg_write_pages(), ogg_write_trailer(), open_input_file(), opt_map(), packet_queue_flush(), paf_video_close(), parse_channel_expressions(), parse_command(), parse_ffconfig(), parse_fmtp_config(), parse_iplconvkernel(), parse_key_value_pair(), parse_keyframes_index(), parse_link_name(), parse_presentation_segment(), parse_primary(), parse_sws_flags(), pcm_dvd_decode_uninit(), pic_arrays_free(), piz_uncompress(), pmp_close(), png_dec_end(), print_sdp(), probe_codec(), probe_file(), process_command(), 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(), rdt_free_context(), rdt_parse_packet(), CustomSource::read(), read_apic(), read_close(), read_decode_convert_and_store(), read_frame(), read_from_packet_buffer(), read_gab2_sub(), read_header(), read_header_gme(), read_kuki_chunk(), read_priv(), read_thread(), read_ttag(), remove_decoded_packets(), resample_free(), resample_init(), reset_buffers(), reset_rects(), roq_dpcm_encode_close(), rtmp_calc_swfhash(), rtmp_close(), rtmp_http_close(), rtmp_open(), rtp_close(), rtp_write_trailer(), rtsp_read_close(), rv34_decoder_free(), sample_queue_free(), sap_read_close(), sap_write_close(), sap_write_header(), sbg_read_header(), sdp_parse_fmtp_config_h264(), seg_write_trailer(), segment_end(), set_expr(), set_string(), set_string_binary(), shorten_decode_close(), show_help(), slice_thread_uninit(), smacker_read_close(), smacker_read_header(), smjpeg_read_header(), smvjpeg_decode_end(), sox_read_header(), spdif_write_trailer(), split_uninit(), Stagefright_close(), Stagefright_decode_frame(), Stagefright_init(), stop_jack(), stream_component_close(), subtitle_rect_free(), sunrast_decode_frame(), svq1_encode_end(), svq3_decode_end(), svq3_parse_packet(), swf_read_packet(), swr_free(), swri_realloc_audio(), swri_rematrix_free(), sws_allocVec(), sws_freeContext(), sws_freeVec(), tak_decode_close(), tak_read_header(), tee_write_header(), teletext_close_decoder(), tgv_decode_end(), tgv_decode_frame(), tiff_decode_tag(), tiff_end(), transcode(), truemotion1_decode_end(), tscc2_decode_end(), tta_decode_close(), tta_encode_close(), udp_open(), uninit(), uninit_options(), uninit_parse_context(), update_size(), url_alloc_for_protocol(), utvideo_decode_close(), utvideo_encode_close(), v308_encode_close(), v408_encode_close(), v410_encode_close(), vble_decode_close(), vdpau_get_buffer(), vdpau_h264_end_frame(), vdpau_release_buffer(), vdpau_uninit(), vfw_read_header(), vid_read_close(), vid_read_packet(), video_encode_example(), vmd_read_close(), vmd_read_header(), vmdvideo_decode_end(), vorbis_cleanup(), vorbis_encode_close(), vorbis_free(), vorbis_header(), vorbis_update_metadata(), vp3_decode_end(), vp8_free(), vp9_decode_free(), vqa_decode_end(), vqa_decode_init(), wavpack_decode_end(), wavpack_encode_close(), worker(), write_chapter(), write_headers(), write_option(), write_sm_data(), writer_close(), wtvfile_close(), x11grab_read_header(), X264_close(), xan_decode_end(), xan_decode_init(), XAVS_close(), xface_encode_close(), xiph_handle_packet(), xmv_read_close(), xvid_encode_close(), y41p_encode_close(), yae_release_buffers(), and yuv4_encode_close().

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

Add an element to a dynamic array.

The array to grow is supposed to be an array of pointers to structures, and the element to add must be a pointer to an already allocated structure.

The array is reallocated when its size reaches powers of 2. Therefore, the amortized cost of adding an element is constant.

In case of success, the pointer to the array is updated in order to point to the new grown array, and the number pointed to by nb_ptr is incremented. In case of failure, the array is freed, *tab_ptr is set to NULL and *nb_ptr is set to 0.

Parameters
tab_ptrpointer to the array to grow
nb_ptrpointer to the number of elements in the array
elemelement to add
See Also
av_dynarray_add_nofree(), av_dynarray2_add()

Definition at line 294 of file mem.c.

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

Add an element to a dynamic array.

Function has the same functionality as av_dynarray_add(), but it doesn't free memory on fails. It returns error code instead and leave current buffer untouched.

Parameters
tab_ptrpointer to the array to grow
nb_ptrpointer to the number of elements in the array
elemelement to add
Returns
>=0 on success, negative otherwise.
See Also
av_dynarray_add(), av_dynarray2_add()

Definition at line 281 of file mem.c.

Referenced by fbdev_get_device_list(), and pulse_add_detected_device().

void* av_dynarray2_add ( void **  tab_ptr,
int *  nb_ptr,
size_t  elem_size,
const uint8_t elem_data 
)

Add an element of size elem_size to a dynamic array.

The array is reallocated when its number of elements reaches powers of 2. Therefore, the amortized cost of adding an element is constant.

In case of success, the pointer to the array is updated in order to point to the new grown array, and the number pointed to by nb_ptr is incremented. In case of failure, the array is freed, *tab_ptr is set to NULL and *nb_ptr is set to 0.

Parameters
tab_ptrpointer to the array to grow
nb_ptrpointer to the number of elements in the array
elem_sizesize in bytes of the elements in the array
elem_datapointer to the data of the element to add. If NULL, the space of the new added element is not filled.
Returns
pointer to the data of the element to copy in the new allocated space. If NULL, the new allocated space is left uninitialized."
See Also
av_dynarray_add(), av_dynarray_add_nofree()

Definition at line 307 of file mem.c.

static int av_size_mult ( size_t  a,
size_t  b,
size_t *  r 
)
inlinestatic

Multiply two size_t values checking for overflow.

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

Definition at line 326 of file mem.h.

Referenced by av_realloc_f(), config_output(), and ogg_new_stream().

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

void av_memcpy_backptr ( uint8_t dst,
int  back,
int  cnt 
)

deliberately overlapping memcpy implementation

Parameters
dstdestination buffer
backhow many bytes back we start (the initial size of the overlapping window), must be > 0
cntnumber of bytes to copy, must be >= 0

cnt > back is valid, this will copy the bytes we just copied, thus creating a repeating pattern with a period length of back.

Definition at line 399 of file mem.c.

Referenced by copy_backptr(), decode_dsw1(), decode_frame(), decode_tsw1(), mszh_decomp(), residual_interp(), synth_block_fcb_acb(), unpack(), and xan_unpack().

void* av_fast_realloc ( void ptr,
unsigned int *  size,
size_t  min_size 
)
void av_fast_malloc ( void ptr,
unsigned int *  size,
size_t  min_size 
)

Allocate a buffer, reusing the given one if large enough.

Contrary to av_fast_realloc the current buffer contents might not be preserved and on error the old buffer is freed, thus no special handling to avoid memleaks is necessary.

Parameters
ptrpointer to pointer to already allocated buffer, overwritten with pointer to new buffer
sizesize of the buffer *ptr points to
min_sizeminimum size of *ptr buffer after returning, *ptr will be NULL and *size 0 if an error occurred.

Definition at line 482 of file mem.c.

Referenced by allocate_buffers(), ape_decode_frame(), audio_decode_frame(), codec_reinit(), dca_decode_frame(), decode_8(), decode_frame(), ff_hevc_extract_rbsp(), ff_mpeg_update_thread_context(), fic_decode_frame(), gif_decode_frame(), gif_read_image(), id3v2_parse(), lag_decode_frame(), ljpeg_decode_rgb_scan(), pmp_packet(), reconfigure_at_keyframe(), spdif_header_dts4(), spdif_write_packet(), submit_packet(), tak_decode_frame(), truemotion1_decode_header(), truemotion1_decode_init(), update_md5_sum(), and verify_md5().

Variable Documentation

size_t size
Initial value:
{
if (!size || nmemb >= INT_MAX / size)
return NULL

Definition at line 94 of file mem.h.

size_t nmemb

Definition at line 166 of file mem.h.