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

Macros

#define DECLARE_ALIGNED(n, t, v)   t __attribute__ ((aligned (n))) v
 
#define DECLARE_ASM_CONST(n, t, v)   static const t av_used __attribute__ ((aligned (n))) v
 
#define av_malloc_attrib   __attribute__((__malloc__))
 
#define av_alloc_size(...)   __attribute__((alloc_size(__VA_ARGS__)))
 

Functions

voidav_malloc (size_t size) av_malloc_attrib 1(1)
 Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU).
 
static voidav_malloc_array (size_t nmemb, size_t size)
 
voidav_realloc (void *ptr, size_t size) 1(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.
 
voidav_realloc_array (void *ptr, size_t nmemb, size_t size)
 
int av_reallocp_array (void *ptr, size_t nmemb, size_t size)
 
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 1(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.
 
static voidav_mallocz_array (size_t nmemb, size_t size)
 
char * av_strdup (const char *s) av_malloc_attrib
 Duplicate the string s.
 
char * av_strndup (const char *s, size_t len) av_malloc_attrib
 Duplicate a substring of 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.
 

Detailed Description

Macro Definition Documentation

#define DECLARE_ALIGNED (   n,
  t,
  v 
)    t __attribute__ ((aligned (n))) v
#define DECLARE_ASM_CONST (   n,
  t,
  v 
)    static const t av_used __attribute__ ((aligned (n))) v

Definition at line 54 of file mem.h.

#define av_malloc_attrib   __attribute__((__malloc__))

Definition at line 64 of file mem.h.

#define av_alloc_size (   ...)    __attribute__((alloc_size(__VA_ARGS__)))

Definition at line 70 of file mem.h.

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(), 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_malloc_array(), 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(), avpacket_queue_put(), avpriv_alloc_fixed_dsp(), avresample_set_matrix(), bfi_read_header(), build_filter(), celt_header(), check_dcbzl_effect(), cine_read_header(), cinepak_encode_init(), cmdutils_read_file(), config(), config_input(), config_output(), config_props(), convert_str(), copy_parameter_set(), create_all_formats(), create_vorbis_context(), data_open(), decode_dvd_subtitles(), decode_frame(), decode_header_trees(), decode_init(), decode_main_header(), decode_picture_header(), decode_rle(), deinterlace_bottom_field_inplace(), dnxhd_encode_init(), do_subtitle_out(), doubles2str(), dshow_add_device(), dshow_cycle_formats(), dtshd_read_header(), dump_extradata(), dup_wchar_to_utf8(), 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(), fdk_aac_decode_init(), ff_alloc_extradata(), ff_alsa_open(), ff_audio_data_realloc(), ff_bgmc_init(), ff_celt_imdct_init(), ff_fast_malloc(), ff_fft_init(), ff_fill_line_with_color(), ff_flac_parse_picture(), ff_frame_thread_init(), ff_http_auth_create_response(), ff_huffyuv_alloc_temp(), ff_init_rl(), 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_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_vda_default_init(), ff_vorbis_comment(), ff_vs_init(), 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_next_parse_unit(), find_smallest_bounding_rectangle(), flac_encode_init(), flac_write_block_comment(), flac_write_packet(), flashsv_decode_frame(), fourxm_read_header(), frame_list_add_frame(), gen_sub_text(), generate_dither_noise(), generate_new_codebooks(), get_audio_config(), get_cookies(), get_default_field_orders(), 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(), hevc_parse_sdp_line(), hls_append_segment(), hls_read_header(), hls_slice_data_wpp(), hls_write_header(), iec61883_callback(), iff_read_header(), imx_dump_header(), init(), init_er(), init_mv_table(), init_noise(), init_opencl_mtx(), init_pattern_from_file(), inject_fake_duration_metadata(), 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(), lrc_write_packet(), main(), make_digest_auth(), matroska_decode_buffer(), matroska_parse_tracks(), mjpeg2jpeg_filter(), mjpeg_decode_com(), mjpega_dump_header(), mkv_strip_wavpack(), mmap_read_frame(), modplug_read_header(), mov2textsub(), mov_create_dvd_sub_decoder_specific_info(), mov_create_timecode_track(), mov_metadata_raw(), mov_parse_stsd_data(), 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_read_tkhd(), mov_read_udta_string(), mov_write_eac3_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(), packet_queue_put_private(), parse_header(), parse_MP4DecConfigDescrTag(), parse_options(), parse_playlist(), parse_setup_header(), 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(), process_line(), prores_encode_init(), put_flac_codecpriv(), 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(), 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(), to_integer(), transcode_init(), tscc2_decode_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(), vmd_read_header(), vmdvideo_decode_init(), vorbis_parse_setup_hdr_codebooks(), vorbis_parse_setup_hdr_floors(), vorbis_update_metadata(), vp56_size_changed(), vp8_encode(), vpx_init(), vqa_decode_init(), wavesynth_init(), wc3_read_header(), webm_dash_manifest_cues(), 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().

static void* av_malloc_array ( size_t  nmemb,
size_t  size 
)
inlinestatic
Examples:
transcoding.c.

Definition at line 93 of file mem.h.

Referenced by a64multi_encode_init(), alloc_buffers(), alloc_sequence_buffers(), allocate_buffers(), audio_resample(), av_fifo_alloc_array(), av_frame_ref(), av_packet_split_side_data(), avpriv_do_elbg(), avpriv_init_elbg(), build_filter(), calc_rice_params(), cinepak_encode_init(), cng_encode_init(), config_audio_output(), config_input(), config_output(), config_props(), create_cel_evals(), create_map(), create_vorbis_context(), decode_init(), decode_nal_units(), decode_slice(), denoise_depth(), encode_init(), ff_ac3_float_mdct_init(), ff_alloc_entries(), ff_ccitt_unpack(), ff_dct_init(), ff_filter_alloc(), ff_gen_syncpoint_search(), ff_get_format(), ff_hevc_decode_nal_pps(), ff_huff_gen_len_table(), ff_init_vlc_sparse(), ff_jpeg2000_dwt_init(), ff_mdct_init(), ff_merge_channel_layouts(), ff_pca_init(), ff_print_debug_info2(), ff_psy_init(), ff_slice_buffer_init(), ff_store_parser_state(), ff_tls_init(), fft_ref_init(), ffv1_allocate_initial_states(), ffv1_init_slice_contexts(), ffv1_init_slice_state(), filter_frame(), find_and_decode_index(), generate_codebook(), generate_new_codebooks(), get_buffer_internal(), guess_dc(), hls_slice_data_wpp(), hls_slice_header(), huff_reader_build_canonical(), init(), init_coef_vlc(), init_cook_mlt(), init_filter_param(), init_filters(), init_pass2(), init_tiles(), initFilter(), lavfi_read_header(), ljpeg_encode_init(), main(), matroska_parse_tracks(), mmap_init(), mov_write_ctts_tag(), mov_write_stts_tag(), mpegts_write_header(), open_filter_param(), opt_opencl_bench(), parse_forced_key_frames(), parse_frames(), parse_read_intervals(), parse_times(), pic_arrays_init(), print_sdp(), radix_sort(), read_header(), ready_codebook(), roq_encode_init(), smacker_read_header(), start_jack(), swri_get_dither(), tiff_decode_tag(), tm2_build_huff_table(), tta_encode_init(), update_block_buffers(), vble_decode_init(), video_audio_display(), vorbis_parse_id_hdr(), vorbis_parse_setup_hdr_floors(), vorbis_parse_setup_hdr_residues(), wtvfile_open_sector(), and xmv_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
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(), 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(), av_strndup(), avfilter_graph_alloc_filter(), concat_open(), decode_frame(), decode_header(), draw_text(), ff_alsa_extend_reorder_buf(), ff_ass_add_rect(), ff_img_read_header(), ff_vs_init(), filter_frame(), fixup_vorbis_headers(), grow_array(), handle_file(), hevc_sdp_parse_fmtp_config(), 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(), parse_adaptation_sets(), probe_codec(), qt_rtp_parse_packet(), realloc_section_array(), reconfigure_at_keyframe(), update_context_from_user(), 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(), av_vdpau_bind_context(), 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(), read_tfra(), realloc_buffer(), rtmp_http_write(), rtmp_open(), smacker_read_packet(), tgv_decode_inter(), and theora_header().

void* av_realloc_array ( void ptr,
size_t  nmemb,
size_t  size 
)
int av_reallocp_array ( void ptr,
size_t  nmemb,
size_t  size 
)
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 aac_adtstoasc_filter(), aac_decode_frame(), add_file(), add_pes_stream(), amr_free_context(), ape_tag_read_field(), apply_color_indexing_transform(), asfrtp_free_context(), asfrtp_parse_packet(), 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_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_parser_close(), av_parser_init(), av_realloc_f(), av_resample_init(), av_samples_alloc(), av_thread_message_queue_alloc(), av_tree_destroy(), avcodec_alloc_context3(), avcodec_dct_init(), 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(), avpacket_queue_get(), avpriv_do_elbg(), avpriv_dv_init_demux(), avpriv_init_elbg(), avpriv_mpegts_parse_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_connection(), close_null_ctx(), 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(), 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(), dxva2_get_buffer(), dxva2_release_buffer(), ebml_free(), ebml_read_ascii(), encode_dvd_subtitles(), encode_end(), encode_frame(), encode_picture_ls(), encode_thread(), enu_free(), 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_ccitt_unpack(), ff_command_queue_pop(), ff_create_schro_frame(), ff_decklink_list_devices(), ff_decklink_read_header(), ff_decklink_write_header(), ff_dither_free(), ff_fast_malloc(), ff_fbdev_get_device_list(), 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_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_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_vs_init(), 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(), ffserver_parse_acl_row(), fifo_alloc_common(), filter_packet(), find_and_decode_index(), flac_parse(), flac_parse_close(), flac_read_header(), flv_get_extradata(), flv_queue_extradata(), flv_write_packet(), fourxm_read_header(), frame_list_clear(), frame_list_remove_samples(), free_context(), free_field_queue(), free_filter_param(), free_fragment_if_needed(), free_frame_if_needed(), free_geobtag(), free_packet_list(), free_playlist_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(), ftp_passive_mode_epsv(), 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(), h261_free_context(), h261_free_dyn_buffer(), 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(), hevc_free_context(), hls_append_segment(), hls_free_segments(), hls_slice_data_wpp(), hls_write_header(), hls_write_trailer(), http_connect(), http_parse_request(), http_server(), huf_uncompress(), huff_reader_build_canonical(), hvcc_add_nal_unit(), icecast_open(), id3v2_parse(), iec61883_close(), iec61883_parse_queue_dv(), iec61883_parse_queue_hdv(), image_ctx_free(), init(), init_coef_vlc(), init_opencl_mtx(), init_pass2(), init_pattern_from_file(), init_report(), initFilter(), inject_fake_duration_metadata(), interpolate(), ism_flush(), ism_free(), 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(), lrc_write_packet(), 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_tracks(), matroska_parse_webvtt(), matroska_read_close(), 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_parse_stsd_data(), 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_eac3_tag(), mov_write_isml_manifest(), mov_write_stts_tag(), mov_write_track_udta_tag(), mov_write_udta_tag(), mpc8_parse_seektable(), mpeg_mux_init(), mpegps_read_pes_header(), mpegts_add_service(), 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_content_storage(), mxf_read_generic_descriptor(), mxf_read_local_tags(), mxf_read_primer_pack(), new_connection(), new_output_stream(), new_stream(), nsv_parse_NSVf_header(), nut_read_header(), ogg_new_buf(), 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(), purge_dialogues(), 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(), sap_write_header(), sbg_read_header(), sdp_parse_fmtp_config_h264(), sdt_cb(), seg_write_trailer(), segment_end(), segment_list_print_entry(), 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(), 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(), thread_entry(), tiff_unpack_fax(), tm2_build_huff_table(), tm2_free_codes(), to_integer(), 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(), vda_h264_release_buffer(), vda_old_h264_end_frame(), vfw_read_close(), vfw_read_packet(), video_audio_display(), video_decode_example(), video_encode_example(), videostream_cb(), vmd_read_header(), vorbis_parse_setup_hdr_codebooks(), vp56_size_changed(), vp6_decode_free(), vp8_free_buffer(), vp8_free_context(), wavesynth_close(), wavesynth_init(), webm_dash_manifest_cues(), webm_dash_manifest_read_header(), worker(), write_globalinfo(), write_header_chunk(), write_headers(), write_manifest(), write_packet(), 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(), 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_cast5_alloc(), av_dict_set(), av_dump_format(), av_expr_parse(), av_fft_init(), av_frame_alloc(), av_frame_new_side_data(), av_hash_alloc(), av_hmac_alloc(), av_mallocz_array(), 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_thread_message_queue_alloc(), av_tree_node_alloc(), av_vdpau_alloc_context(), avcodec_dct_alloc(), 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_mpegts_parse_open(), avpriv_new_chapter(), avresample_alloc_context(), avui_encode_init(), bfi_decode_init(), callback(), 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_thread(), DEF_CHOOSE_FORMAT(), dfa_decode_init(), display_end_segment(), doTest(), dv_read_timecode(), dvbsub_parse_display_definition_segment(), dvbsub_parse_page_segment(), dvbsub_parse_region_segment(), dxva2_alloc(), dxva2_create_decoder(), dxva2_get_buffer(), encode_init(), encode_picture_ls(), enqueue_packet(), extract_mpeg4_header(), ff_all_channel_counts(), ff_all_channel_layouts(), ff_all_samplerates(), 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_celt_imdct_init(), ff_celt_init(), ff_create_schro_frame(), ff_decklink_read_header(), ff_decklink_write_header(), ff_dither_alloc(), ff_fast_malloc(), ff_fbdev_get_device_list(), 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_jpegls_decode_picture(), ff_lpc_init(), ff_lzw_decode_open(), ff_merge_channel_layouts(), 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_silk_init(), ff_slice_thread_init(), ff_timefilter_new(), ff_vc1_decode_init_alloc_tables(), ff_vs_init(), ff_wms_parse_sdp_a_line(), ffserver_parse_acl_row(), ffserver_parse_config_feed(), ffserver_parse_config_redirect(), ffserver_parse_config_stream(), ffv1_init_slice_contexts(), fifo_alloc_common(), 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(), generate_joint_tables(), 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(), h261_new_context(), h263_new_context(), h264_new_context(), h264_slice_header_init(), handle_eac3(), handle_file(), handler(), hevc_init(), hevc_init_context(), hevc_new_context(), hls_slice_data_wpp(), hnm_decode_init(), hnm_read_header(), http_prepare_data(), iec61883_callback(), init(), init_bundles(), init_er(), init_input_filter(), init_muxer(), 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_tracks(), matroska_parse_webvtt(), mkv_start_cues(), mkv_start_seekhead(), 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(), 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_dynamic_acl(), parse_fmtp_config(), parse_inputs(), parse_keyframes_index(), parse_primary(), parse_sws_flags(), parse_vtrk(), 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_tfra(), reallocAlign(), resample_init(), rl2_decode_init(), rtp_new_av_stream(), rtp_new_connection(), rtp_parse_addr_list(), rv34_decoder_alloc(), sap_write_header(), segment_end(), set_encoder_id(), set_segment_filename(), setup_hwaccel(), 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(), vda_init(), vda_old_h264_end_frame(), vdpau_alloc(), vf_open(), videostream_cb(), vorbis_header(), 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(), wmv2_encode_init(), worker(), write_frame(), write_packet(), 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 
)
static void* av_mallocz_array ( size_t  nmemb,
size_t  size 
)
inlinestatic

Definition at line 228 of file mem.h.

Referenced by a64multi_encode_init(), alloc_sequence_buffers(), allocate_buffers(), allocate_tables(), atrac3_decode_init(), atrac3p_decode_init(), audio_get_buffer(), av_audio_fifo_alloc(), av_frame_ref(), av_resample_init(), avcodec_fill_audio_frame(), channelmap_filter_frame(), check_stream_max_drift(), cng_decode_init(), compute_mask(), compute_mask_matrix(), config_output(), decode_entropy_coded_image(), decode_init(), decode_init_thread_copy(), decode_lowdelay(), decode_picture_header(), dejudder_init(), encode_init(), ff_alloc_entries(), ff_cavs_init_top_lines(), ff_filter_alloc(), ff_frame_thread_init(), ff_h264_alloc_tables(), ff_ivi_init_planes(), ff_ivi_init_tiles(), ff_jpeg2000_init_component(), ff_jpeg2000_tag_tree_init(), ff_mjpeg_decode_sof(), ff_opus_parse_extradata(), ff_png_zalloc(), ff_psy_init(), ff_psy_preprocess_init(), ff_slice_buffer_init(), ff_slice_thread_init(), ff_snow_alloc_blocks(), ff_snow_common_init_after_header(), get_audio_buffer(), get_device_list(), get_siz(), hds_write_header(), http_prepare_data(), http_server(), huf_uncompress(), ico_write_header(), init(), init_parse_context(), init_pattern_from_string(), init_tiles(), ism_write_header(), ivi_init_tiles(), mkv_write_header(), mov_write_header(), mp_decode_init(), mxf_compute_index_tables(), opus_decode_init(), pic_arrays_init(), psy_3gpp_init(), qtrle_encode_init(), read_huffman_code_normal(), read_shape_from_file(), read_tfra(), ready_codebook(), ready_residue(), roq_encode_init(), rtp_new_av_stream(), rtsp_read_header(), sap_write_header(), setup_find_stream_info_opts(), smacker_decode_header_tree(), thread_init_internal(), tiff_decode_tag(), vorbis_parse_id_hdr(), vorbis_parse_setup_hdr_codebooks(), vorbis_parse_setup_hdr_floors(), vorbis_parse_setup_hdr_mappings(), and XAVS_init().

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_copy(), av_opt_get(), av_tempfile(), avcodec_copy_context(), avfilter_graph_parse(), avfilter_graph_queue_command(), avfilter_init_str(), avformat_match_stream_specifier(), caca_write_header(), choose_pix_fmts(), cine_read_header(), configure_filtergraph(), decimate_init(), dilate_init(), dump_stream_format(), ebml_parse_nest(), ff_fbdev_get_device_list(), ff_filter_alloc(), ff_http_do_new_request(), ff_http_match_no_proxy(), ff_img_read_header(), ff_mpv_encode_init(), ff_wms_parse_sdp_a_line(), ffm2_read_header(), ffm_read_header(), ffserver_parse_config_feed(), ffserver_parse_config_stream(), fieldmatch_init(), frei0r_init(), geq_init(), get_cookies(), get_geokey_val(), get_ost_filters(), grab_read_header(), hls_read_header(), http_open(), icecast_open(), init(), init_filter(), init_filters(), join_init(), lavfi_read_header(), libquvi_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_file(), open_output_file(), opengl_write_header(), opt_filter_complex(), opt_map(), opt_vstats_file(), parse_bsfs(), parse_channel_expressions(), parse_device_name(), 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_gab2_sub(), 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().

char* av_strndup ( const char *  s,
size_t  len 
)

Duplicate a substring of the string s.

Parameters
sstring to be duplicated
lenthe maximum length of the resulting string (not counting the terminating byte).
Returns
Pointer to a newly-allocated string containing a copy of s or NULL if the string cannot be allocated.

Definition at line 270 of file mem.c.

Referenced by avformat_match_stream_specifier().

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

Referenced by av_opt_copy(), 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.
Note
passing a pointer to a NULL pointer is safe and leads to no action.
See Also
av_free()

Definition at line 236 of file mem.c.

Referenced by a64multi_close_encoder(), 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_buffers(), 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_close(), atrac3_decode_init(), atrac3p_decode_close(), 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_destruct_packet(), 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_free(), av_frame_copy_props(), av_frame_free(), av_frame_new_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_copy(), 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_thread_message_queue_free(), av_write_trailer(), avcodec_close(), avcodec_copy_context(), avcodec_encode_audio(), avcodec_encode_video(), avcodec_fill_audio_frame(), avcodec_free_context(), 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(), avformat_match_stream_specifier(), avi_read_close(), avi_read_header(), avi_write_trailer(), avio_close(), avpacket_queue_flush(), avpicture_free(), avresample_close(), avresample_free(), avresample_set_matrix(), avsubtitle_free(), avui_encode_close(), bfi_decode_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_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(), destroy_context(), dfa_decode_end(), dirac_parse_close(), dnxhd_encode_end(), do_exit(), doTest(), dump_stream_format(), dvbsub_close_decoder(), dvbsub_parse_close(), dvdsub_close(), dvdsub_decode(), dvdsub_parse(), dvdsub_parse_close(), dxva2_destroy_decoder(), dxva2_uninit(), ebml_free(), ebml_read_binary(), eightsvx_decode_close(), eightsvx_decode_frame(), encode_close(), encode_end(), encode_init(), encode_nals(), encode_picture(), encode_picture_ls(), escape124_decode_close(), escape124_decode_frame(), escape130_decode_close(), escape130_decode_init(), estimate_best_b_count(), exif_decode_tag(), expand_function(), extract_header(), extract_mpeg4_header(), Faac_encode_close(), fdk_aac_decode_close(), fdk_aac_decode_frame(), ff_ac3_encode_close(), ff_ac3_float_mdct_end(), ff_af_queue_close(), ff_alloc_entries(), 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_celt_free(), ff_celt_imdct_uninit(), ff_command_queue_pop(), ff_dct_end(), ff_dct_init(), ff_decklink_read_close(), ff_decklink_write_trailer(), ff_dither_free(), ff_dwt_destroy(), ff_fbdev_get_device_list(), 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_get_format(), 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_iir_filter_free_coeffsp(), ff_iir_filter_free_statep(), 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_mkv_stereo3d_conv(), 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_mpv_encode_init(), ff_mss12_decode_end(), ff_nut_add_sp(), ff_parse_close(), ff_pca_free(), ff_print_debug_info2(), 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_silk_free(), 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_default_init(), ff_vdpau_common_end_frame(), ff_vorbis_comment(), ff_vp56_free_context(), ff_wma_end(), ff_yuv2rgb_c_init_tables(), ffio_rewind_with_probe_data(), ffm_close(), ffmpeg_cleanup(), ffserver_parse_config_stream(), 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(), flac_write_packet(), flac_write_trailer(), flashsv_decode_end(), flashsv_decode_frame(), flashsv_encode_end(), flush_cache(), 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_side_data(), free_tables(), free_variant_list(), ftp_features(), g2m_decode_end(), g722_encode_close(), gen_sub_bitmap(), generate_dither_noise(), generate_joint_tables(), 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(), guess_dc(), gxf_write_trailer(), h264_mp4toannexb_filter(), handle_connection(), handle_file(), handler(), hds_free(), hevc_close(), hevc_decode_free(), hevc_parse_sdp_line(), hevc_pps_free(), hls_read_header(), hls_slice_header(), hnm_decode_end(), hnm_decode_init(), http_close(), http_connect(), http_prepare_data(), http_receive_data(), http_send_data(), huf_uncompress(), hvcc_close(), icecast_open(), 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_tracks(), matroska_parse_wavpack(), 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_tkhd(), mov_read_trak(), mov_read_udta_string(), mov_rewrite_dvd_sub_extradata(), mov_write_eac3_tag(), movie_uninit(), mp3_queue_flush(), mp3_write_trailer(), 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_add_service(), 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_connection(), 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(), opus_decode_close(), opus_parse(), packet_queue_flush(), paf_video_close(), parse_channel_expressions(), parse_command(), parse_fmtp_config(), parse_iplconvkernel(), parse_key_value_pair(), parse_keyframes_index(), parse_link_name(), parse_primary(), parse_sws_flags(), pcm_dvd_decode_uninit(), pic_arrays_free(), piz_uncompress(), pmp_close(), png_dec_end(), prepare_sdp_description(), print_sdp(), probe_codec(), probe_file(), process_command(), prores_encode_close(), psy_3gpp_end(), pthread_cond_destroy(), put_flac_codecpriv(), put_main_header(), 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_tfra(), 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_new_connection(), rtp_write_trailer(), rtsp_read_close(), rv34_decoder_free(), sample_queue_free(), sample_queue_pop(), sap_read_close(), sap_write_close(), sap_write_header(), sbg_read_header(), sdp_parse_fmtp_config_h264(), seg_write_trailer(), segment_end(), seq_read_close(), set_expr(), set_string(), set_string_binary(), setup_hwaccel(), 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_decode_end(), 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(), tqi_decode_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(), vda_h264_uninit(), vda_uninit(), vdpau_get_buffer(), 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_encode(), vp8_free(), vp9_decode_free(), vqa_decode_end(), vqa_decode_init(), wavpack_decode_end(), wavpack_encode_close(), webm_dash_manifest_write_trailer(), 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 314 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 301 of file mem.c.

Referenced by ff_fbdev_get_device_list(), mpegts_add_service(), 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 327 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 337 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 419 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 502 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(), find_motion(), gif_decode_frame(), gif_read_image(), id3v2_parse(), lag_decode_frame(), ljpeg_decode_rgb_scan(), opus_decode_subpacket(), pmp_packet(), reconfigure_at_keyframe(), spdif_header_dts4(), spdif_write_packet(), tak_decode_frame(), truemotion1_decode_header(), truemotion1_decode_init(), update_md5_sum(), and verify_md5().