FFmpeg
|
Simple key:value store. More...
Data Structures | |
struct | AVDictionaryEntry |
Macros | |
#define | AV_DICT_MATCH_CASE 1 |
Only get an entry with exact-case key match. | |
#define | AV_DICT_IGNORE_SUFFIX 2 |
Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string. | |
#define | AV_DICT_DONT_STRDUP_KEY 4 |
Take ownership of a key that's been allocated with av_malloc() or another memory allocation function. | |
#define | AV_DICT_DONT_STRDUP_VAL 8 |
Take ownership of a value that's been allocated with av_malloc() or another memory allocation function. | |
#define | AV_DICT_DONT_OVERWRITE 16 |
Don't overwrite existing entries. | |
#define | AV_DICT_APPEND 32 |
If the entry already exists, append to it. | |
Functions | |
AVDictionaryEntry * | av_dict_get (FF_CONST_AVUTIL53 AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags) |
Get a dictionary entry with matching key. | |
int | av_dict_count (const AVDictionary *m) |
Get number of entries in dictionary. | |
int | av_dict_set (AVDictionary **pm, const char *key, const char *value, int flags) |
Set the given entry in *pm, overwriting an existing entry. | |
int | av_dict_parse_string (AVDictionary **pm, const char *str, const char *key_val_sep, const char *pairs_sep, int flags) |
Parse the key/value pairs list and add the parsed entries to a dictionary. | |
void | av_dict_copy (AVDictionary **dst, FF_CONST_AVUTIL53 AVDictionary *src, int flags) |
Copy entries from one AVDictionary struct into another. | |
void | av_dict_free (AVDictionary **m) |
Free all the memory allocated for an AVDictionary struct and all keys and values. | |
Simple key:value store.
Dictionaries are used for storing key:value pairs. To create an AVDictionary, simply pass an address of a NULL pointer to av_dict_set(). NULL can be used as an empty dictionary wherever a pointer to an AVDictionary is required. Use av_dict_get() to retrieve an entry or iterate over all entries and finally av_dict_free() to free the dictionary and all its contents.
#define AV_DICT_MATCH_CASE 1 |
Only get an entry with exact-case key match.
Only relevant in av_dict_get().
Definition at line 69 of file dict.h.
Referenced by av_dict_get(), ff_riff_write_info(), get_date_tag(), id3_has_changed_values(), mov_parse_stsd_audio(), and riff_has_valid_tags().
#define AV_DICT_IGNORE_SUFFIX 2 |
Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string.
Only relevant in av_dict_get().
Definition at line 70 of file dict.h.
Referenced by adts_aac_read_header(), asf_write_header1(), assert_avoptions(), av_dict_copy(), av_dict_get(), av_opt_set_dict2(), av_packet_pack_dictionary(), caf_write_header(), config_output(), config_props(), configure_filtergraph(), dump_metadata(), ff_ape_write_tag(), ff_metadata_conv(), ff_vorbiscomment_length(), ff_vorbiscomment_write(), filter_codec_opts(), flv_write_header(), id3_has_changed_values(), id3v2_3_metadata_split_date(), init(), init_dict(), init_muxer(), lavfi_read_packet(), libx265_encode_init(), lrc_write_header(), main(), mkv_check_tag(), mkv_write_tag(), mov_write_string_metadata(), mp3_read_header(), mpc_read_header(), open_input_file(), open_output_file(), open_slave(), read_thread(), show_tags(), smjpeg_write_header(), stream_component_open(), strip_specifiers(), write_chapter(), write_globalinfo(), write_metadata(), write_streaminfo(), write_table_entries_attrib(), write_table_redirector_legacy_attrib(), write_tags(), writer_open(), wv_read_header(), and X264_init().
#define AV_DICT_DONT_STRDUP_KEY 4 |
Take ownership of a key that's been allocated with av_malloc() or another memory allocation function.
Definition at line 72 of file dict.h.
Referenced by av_dict_parse_string(), av_dict_set(), decode_text_chunk(), ff_vorbis_comment(), mov_read_custom_2plus(), opt_show_entries(), parse_slave_options(), read_tag(), and read_ttag().
#define AV_DICT_DONT_STRDUP_VAL 8 |
Take ownership of a value that's been allocated with av_malloc() or another memory allocation function.
Definition at line 74 of file dict.h.
Referenced by add_metadata(), ape_tag_read_field(), asf_read_picture(), av_dict_parse_string(), av_dict_set(), avi_read_tag(), cine_read_header(), decode_text_chunk(), dtshd_read_header(), ff_flac_parse_picture(), ff_read_riff_info(), ff_rtp_chain_mux_open(), ff_sauce_read(), ff_tadd_bytes_metadata(), ff_tadd_doubles_metadata(), ff_tadd_long_metadata(), ff_tadd_rational_metadata(), ff_tadd_shorts_metadata(), ff_tadd_string_metadata(), get_meta(), get_metadata(), modplug_load_metadata(), mov_metadata_raw(), mov_read_custom_2plus(), ogm_chapter(), parse_slave_options(), read_string(), read_tag(), read_ttag(), set_encoder_id(), smjpeg_read_header(), sox_read_header(), stream_component_open(), var_read_metadata(), and wc3_read_header().
#define AV_DICT_DONT_OVERWRITE 16 |
Don't overwrite existing entries.
Definition at line 76 of file dict.h.
Referenced by av_dict_set(), copy_metadata(), new_output_stream(), ogg_write_header(), open_output_file(), opt_target(), read_ttag(), set_encoder_id(), and transcode_init().
#define AV_DICT_APPEND 32 |
If the entry already exists, append to it.
Note that no delimiter is added, the strings are simply concatenated.
Definition at line 77 of file dict.h.
Referenced by av_dict_set(), ff_vorbis_comment(), new_video_stream(), and nist_read_header().
AVDictionaryEntry* av_dict_get | ( | FF_CONST_AVUTIL53 AVDictionary * | m, |
const char * | key, | ||
const AVDictionaryEntry * | prev, | ||
int | flags | ||
) |
Get a dictionary entry with matching key.
The returned entry key or value must not be changed, or it will cause undefined behavior.
To iterate through all the dictionary entries, you can set the matching key to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag.
prev | Set to the previous matching element to find the next. If set to NULL the first matching element is returned. |
key | matching key |
flags | a collection of AV_DICT_* flags controlling how the entry is retrieved |
Definition at line 38 of file dict.c.
Referenced by adts_aac_read_header(), asf_write_header1(), asf_write_markers(), assert_avoptions(), av_dict_copy(), av_dict_set(), av_dump_format(), av_opt_set_dict2(), av_packet_pack_dictionary(), avi_read_header(), avi_write_header(), bitstream_switching(), caf_write_header(), choose_pix_fmts(), config_output(), config_props(), configure_filtergraph(), dump_attachment(), dump_metadata(), dump_stream_format(), dv_init_mux(), dv_write_header(), export_orphan_timecode(), ff_ape_write_tag(), ff_id3v2_write_apic(), ff_metadata_conv(), ff_replaygain_export(), ff_riff_write_info(), ff_vorbis_comment(), ff_vorbiscomment_length(), ff_vorbiscomment_write(), ffm_write_header(), filter_codec_opts(), find_compressor(), flac_read_header(), flac_write_header(), flv_read_packet(), flv_write_header(), func_metadata(), get_date_tag(), get_duration(), get_metadata_val(), gxf_write_header(), gxf_write_umf_material_description(), id3_has_changed_values(), id3v1_create_tag(), id3v1_set_string(), id3v2_3_metadata_split_date(), init(), init_dict(), init_input_stream(), init_muxer(), lavfi_read_packet(), libx265_encode_init(), lrc_write_header(), main(), matroska_parse_flac(), mkv_check_tag(), mkv_write_attachments(), mkv_write_chapters(), mkv_write_header(), mkv_write_tag(), mkv_write_track(), mov_parse_stsd_audio(), mov_read_header(), mov_write_3gp_udta_tag(), mov_write_chpl_tag(), mov_write_header(), mov_write_int8_metadata(), mov_write_string_metadata(), mov_write_tkhd_tag(), mov_write_tmpo_tag(), mov_write_trkn_tag(), mov_write_uuidusmt_tag(), mp3_read_header(), mpc_read_header(), mpegts_write_header(), mpegts_write_pmt(), mxf_write_header(), open_input_file(), open_output_file(), open_slave(), prepare_sdp_description(), put_meta(), read_thread(), riff_has_valid_tags(), rv10_write_header(), sap_write_header(), set_encoder_id(), show_tags(), smjpeg_write_header(), sox_write_header(), stream_component_open(), strip_specifiers(), subsegment_alignment(), write_adaptation_set(), write_chapter(), write_globalinfo(), write_metadata(), write_streaminfo(), write_table_entries_attrib(), write_table_redirector_legacy_attrib(), write_tags(), writer_open(), writer_print_integer(), writer_print_string(), wv_read_header(), and X264_init().
int av_dict_count | ( | const AVDictionary * | m | ) |
Get number of entries in dictionary.
m | dictionary |
Definition at line 33 of file dict.c.
Referenced by asf_write_header1(), caf_write_header(), dump_metadata(), and ff_vorbiscomment_write().
int av_dict_set | ( | AVDictionary ** | pm, |
const char * | key, | ||
const char * | value, | ||
int | flags | ||
) |
Set the given entry in *pm, overwriting an existing entry.
pm | pointer to a pointer to a dictionary struct. If *pm is NULL a dictionary struct is allocated and put in *pm. |
key | entry key to add to *pm (will be av_strduped depending on flags) |
value | entry value to add to *pm (will be av_strduped depending on flags). Passing a NULL value will cause an existing entry to be deleted. |
Definition at line 68 of file dict.c.
Referenced by add_meta(), add_metadata(), add_metadata_from_renditions(), add_timecode_metadata(), amf_parse_object(), ape_tag_read_field(), asf_read_header(), asf_read_picture(), av_dict_copy(), av_opt_set_dict2(), av_packet_unpack_dictionary(), avformat_find_stream_info(), avi_metadata_creation_time(), avi_read_nikon(), avi_read_tag(), avpriv_new_chapter(), build_file_streams(), cine_read_header(), config(), config_props(), decode_frame(), decode_info_header(), decode_text_chunk(), dtshd_read_header(), dv_read_timecode(), export_orphan_timecode(), ff_flac_parse_picture(), ff_frame_thread_encoder_init(), ff_id3v2_parse_apic(), ff_metadata_conv(), ff_parse_mpeg2_descriptor(), ff_read_riff_info(), ff_rm_read_mdpr_codecdata(), ff_rtp_chain_mux_open(), ff_sauce_read(), ff_tadd_bytes_metadata(), ff_tadd_doubles_metadata(), ff_tadd_long_metadata(), ff_tadd_rational_metadata(), ff_tadd_shorts_metadata(), ff_tadd_string_metadata(), ff_vorbis_comment(), ff_wms_parse_sdp_a_line(), filter_codec_opts(), filter_frame(), flac_read_header(), flac_write_header(), ftp_connect_control_connection(), ftp_connect_data_connection(), get_attachment(), get_meta(), get_metadata(), get_string(), get_tag(), hls_read_header(), id3v2_3_metadata_split_date(), iff_read_header(), init(), init_filter_graph(), init_input_stream(), init_muxer(), ism_seek(), ism_write_header(), libquvi_read_header(), lrc_read_header(), lrc_write_header(), main(), matroska_convert_tag(), matroska_metadata_creation_time(), matroska_parse_tracks(), matroska_read_header(), merge_date(), modplug_load_metadata(), mov_metadata_creation_time(), mov_metadata_gnre(), mov_metadata_int8_bypass_padding(), mov_metadata_int8_no_padding(), mov_metadata_loci(), mov_metadata_raw(), mov_metadata_track_or_disc_number(), mov_parse_stsd_video(), mov_read_custom_2plus(), mov_read_ftyp(), mov_read_hdlr(), mov_read_header(), mov_read_mdhd(), mov_read_tkhd(), mov_read_udta_string(), mxf_add_timecode_metadata(), new_output_stream(), new_video_stream(), nist_read_header(), nsv_parse_NSVf_header(), ogm_chapter(), open_codec_context(), open_input(), open_input_file(), open_output_file(), open_slave(), opt_bitrate(), opt_default(), opt_profile(), opt_show_entries(), opt_target(), opt_timecode(), output_frame(), parse_chunks(), parse_dsd_prop(), parse_ffconfig(), parse_key_value_pair(), parse_playlist(), parse_slave_options(), parse_tag(), parse_timecode_in_framenum_format(), prepare_sdp_description(), process_options(), put_flac_codecpriv(), r3d_read_red1(), read_gab2_sub(), read_header(), read_info_chunk(), read_string(), read_tag(), read_ttag(), read_uint16(), read_uint32(), read_uint64(), read_uint8(), rm_read_metadata(), rpl_read_header(), rtmp_open(), sap_write_header(), scan_file(), sdt_cb(), select_frame(), set_encoder_id(), set_meta(), set_metadata_int(), smjpeg_read_header(), smvjpeg_decode_init(), sox_read_header(), stream_component_open(), strip_specifiers(), subviewer_read_header(), transcode_init(), try_decode_frame(), update(), var_read_metadata(), vivo_read_header(), vqf_read_header(), wc3_read_header(), webm_dash_manifest_cues(), and webm_dash_manifest_read_header().
int av_dict_parse_string | ( | AVDictionary ** | pm, |
const char * | str, | ||
const char * | key_val_sep, | ||
const char * | pairs_sep, | ||
int | flags | ||
) |
Parse the key/value pairs list and add the parsed entries to a dictionary.
In case of failure, all the successfully set entries are stored in *pm. You may need to manually free the created dictionary.
key_val_sep | a 0-terminated list of characters used to separate key from value |
pairs_sep | a 0-terminated list of characters used to separate two pairs from each other |
flags | flags to use when adding to dictionary. AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL are ignored since the key/value tokens will always be duplicated. |
Definition at line 150 of file dict.c.
Referenced by libx265_encode_init(), writer_open(), and X264_init().
void av_dict_copy | ( | AVDictionary ** | dst, |
FF_CONST_AVUTIL53 AVDictionary * | src, | ||
int | flags | ||
) |
Copy entries from one AVDictionary struct into another.
dst | pointer to a pointer to a AVDictionary struct. If *dst is NULL, this function will allocate a struct for you and put it in *dst |
src | pointer to source AVDictionary struct |
flags | flags to use when setting entries in *dst |
Definition at line 187 of file dict.c.
Referenced by av_frame_copy_props(), avcodec_open2(), avformat_open_input(), copy_chapters(), copy_metadata(), ff_frame_thread_encoder_init(), ff_http_do_new_request(), ff_mjpeg_decode_frame(), ff_wms_parse_sdp_a_line(), handle_id3(), hls_mux_init(), http_open(), http_prepare_data(), http_seek(), init_muxer(), mark_section_show_entries(), new_output_stream(), ogg_write_header(), open_input(), open_output_file(), open_slave(), opt_default_new(), segment_mux_init(), and webp_decode_frame().
void av_dict_free | ( | AVDictionary ** | m | ) |
Free all the memory allocated for an AVDictionary struct and all keys and values.
Definition at line 173 of file dict.c.
Referenced by av_frame_unref(), av_opt_set_dict2(), avcodec_open2(), avformat_find_stream_info(), avformat_free_context(), avformat_open_input(), close_connection(), config(), config_props(), decode_frame(), ff_frame_thread_encoder_init(), ff_free_stream(), ff_http_do_new_request(), ff_metadata_conv(), ff_mjpeg_decode_end(), ff_mjpeg_decode_frame(), ff_rtp_chain_mux_open(), ff_wms_parse_sdp_a_line(), ffmpeg_cleanup(), ffprobe_cleanup(), free_playlist_list(), free_side_data(), ftp_connect_control_connection(), ftp_connect_data_connection(), handle_id3(), http_close(), http_open(), http_prepare_data(), http_seek(), id3v2_3_metadata_split_date(), init_dict(), init_filter_graph(), init_muxer(), ism_seek(), ism_write_header(), libx265_encode_init(), main(), matroska_parse_flac(), open_input(), open_input_file(), open_output_file(), open_slave(), opt_default_new(), opt_show_entries(), parse_playlist(), parse_slave_options(), prepare_sdp_description(), put_flac_codecpriv(), read_thread(), rtmp_open(), smvjpeg_decode_init(), transcode(), try_decode_frame(), uninit(), uninit_opts(), uninit_parse_context(), vorbis_update_metadata(), webp_decode_frame(), writer_open(), and X264_init().