Commit Graph

45 Commits

Author SHA1 Message Date
Marvin Scholz 2508e846a8 avutil/dict: Improve documentation
Mostly consistent formatting and consistently ordering of
warnings/notes to be next to the description.

Additionally group the AV_DICT_* macros.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-11-06 08:26:50 +01:00
Marvin Scholz 9dad237928 avutil/dict: Add av_dict_iterate
This is a more explicit iteration API rather than using the "magic"
av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX) which is not really
trivial to grasp what it does when casually reading through code.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-11-06 08:26:48 +01:00
Andreas Rheinhardt e7bd47e657 Remove obsolete version.h inclusions
These have mostly been added because of FF_API_*; yet when these were
removed, removing the header has been forgotten.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 14:34:31 +02:00
Thilo Borgmann 4ebf0b109c lavu/dict: Add new flag to allow multiple equal keys. 2016-03-25 17:08:11 +01:00
Marton Balint c3c7a879ba avutil/dict: add warning to docs about invalidating existing entries when adding a new entry
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-03-15 00:55:16 +01:00
Derek Buitenhuis 1a12eb4a73 Merge commit '29c2d06d67724e994980045afa055c6c34611b30'
* commit '29c2d06d67724e994980045afa055c6c34611b30':
  cosmetics: Drop empty comment lines

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-24 17:31:44 +00:00
Diego Biurrun 29c2d06d67 cosmetics: Drop empty comment lines 2016-02-18 15:35:30 +01:00
Hendrik Leppkes b994788353 Merge commit '11c5f438ff83da5040e85bfa6299f56b321d32ef'
* commit '11c5f438ff83da5040e85bfa6299f56b321d32ef':
  dict: Change return type of av_dict_copy()

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-14 14:01:11 +02:00
Vittorio Giovara 11c5f438ff dict: Change return type of av_dict_copy()
av_dict_set() could return an error, so forward it appropriately.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-12 13:35:01 +02:00
Michael Niedermayer 5182a2a235 avutil: remove FF_CONST_AVUTIL53, its no longer needed
version is 54 already

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-24 02:22:19 +01:00
Lukasz Marek ab922f9ef1 lavu/dict: add av_dict_get_string
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-21 01:25:54 +01:00
Reimar Döffinger 8fc9bd0d32 dict.c: Free non-strduped av_dict_set arguments on error.
Unfortunately this was not explicitly documented and thus
might be risky.
But all uses I could find in FFmpeg and one in VLC had a memleak
in these cases, and I could not find any that relied on the previous
behaviour.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-08-23 15:28:48 +02:00
Reimar Döffinger c2829dc925 dict.c: Add av_dict_set_int helper function.
This allows getting rid of the many, slightly differing, implementations
of basically the same thing.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-08-16 14:30:18 +02:00
Michael Niedermayer 151f88d507 Merge commit 'd816e125fe1fa5c909b706d47904a4d6c1799996'
* commit 'd816e125fe1fa5c909b706d47904a4d6c1799996':
  dict: const correctness for av_dict_get() and av_dict_copy()

Conflicts:
	libavutil/dict.c
	libavutil/dict.h

See: e12a73246d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-05 18:55:44 +02:00
Diego Biurrun d816e125fe dict: const correctness for av_dict_get() and av_dict_copy() 2014-06-05 09:16:15 -07:00
Michael Niedermayer 3690393f68 avutil/dict: delay addition of const from e12a73246d until next major ABI bump
This unbreaks API

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-14 15:44:01 +02:00
Roman Fietze e12a73246d dict: const pointers to dictionary where possible
This avoids temporaries or ugly casting in the calling code where
const dictionaries are used. Esp. helpful when writing C++ wrappers
for an AVDictionary having const member functions and CTORs with const
references.

Signed-off-by: Roman Fietze <roman.fietze@telemotive.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-03 13:13:25 +02:00
Michael Niedermayer 6e380cc28f Merge commit '9ecb858775483a76c137e8e1ad45a95e318bca61'
* commit '9ecb858775483a76c137e8e1ad45a95e318bca61':
  doxy: Format @code blocks so they render properly

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-05 03:27:13 +01:00
Luca Barbato 9ecb858775 doxy: Format @code blocks so they render properly
@code command reports verbatim everything between it and @endcode.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-02-04 22:09:47 +01:00
Stefano Sabatini e3eb0988c6 lavu/dict.h: extend/clarify av_dict_get() doxy 2013-12-16 18:30:04 +01:00
Stefano Sabatini e782eea183 lavu/dict.h: extend/clarify docs for av_dict_parse_string() 2013-11-22 15:51:20 +01:00
Stefano Sabatini 320389f88b lavu/dict.h: apply various fixes/extensions to doxy
In particular, document AV_DICT_MATCH_CASE, AV_DICT_IGNORE_SUFFIX, and
extend documentation for av_dict_get().
2013-11-22 15:51:10 +01:00
Michael Niedermayer e7e14bc69a Merge commit '38c1466ca41c73c7ce347da702362cb69c151716'
* commit '38c1466ca41c73c7ce347da702362cb69c151716':
  dict: add av_dict_parse_string()
  doc: support multitable in texi2pod

Conflicts:
	doc/APIchanges
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-26 13:34:30 +01:00
Justin Ruggles 38c1466ca4 dict: add av_dict_parse_string()
Can be used to set multiple key/value pairs from a string.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-25 17:20:03 +01:00
Michael Niedermayer 55c49afc42 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  yuv4mpeg: return proper error codes.
  Give all anonymously typedeffed structs in headers a name
  fate: Add parseutils test
  parseutils-test: Drop random colors from parsing test
  vf_pad/scale: use double precision for aspect ratios.
  build: error on variable-length arrays
  ppc: swscale: rework yuv2planeX_altivec()
  ppc: fmtconvert: kill VLA in float_to_int16_interleave_altivec()
  x86: dsputil: kill VLA in gmc_mmx()
  libspeexenc: Updated commentary to reflect recent changes
  libspeexenc: Add an option for enabling DTX
  doc/APIchanges: fill in missing dates and hashes.
  lavr: bump major to 1 and declare it stable.
  lavr: change the type of the data buffers to uint8_t**.
  lavc: deprecate the audio resampling API.

Conflicts:
	cmdutils.h
	configure
	doc/APIchanges
	ffplay.c
	libavcodec/dwt.h
	libavcodec/libspeexenc.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavformat/asf.h
	tests/fate/libavutil.mak
	tests/ref/fate/parseutils

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-06 13:45:08 +02:00
Diego Biurrun e4cbf7529b Give all anonymously typedeffed structs in headers a name
Anonymous structs cannot be forward declared and have no benefit.
2012-10-06 09:27:11 +02:00
Michael Niedermayer f5f3684fb8 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavf: simplify is_intra_only() by using codec descriptors.
  lavc: add an intra-only codec property.
  lavc: add codec descriptors.
  lavc: fix mixing CODEC_ID/AV_CODEC_ID in C++ code.
  dict: move struct AVDictionary definition to dict.c
  dict: add av_dict_count()

Conflicts:
	doc/APIchanges
	libavcodec/old_codec_ids.h
	libavformat/utils.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-11 15:01:45 +02:00
Mans Rullgard 987170cb9d dict: add av_dict_count()
This adds a function to retrieve the number of entries in a
dictionary and updates the places directly accessing what should
be an opaque struct to use this new function instead.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-10 15:15:00 +01:00
Michael Niedermayer 86e107a7d4 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  cosmetics: Consistently use C-style comments with multiple inclusion guards
  anm: fix a few Doxygen comments
  misc typo and wording fixes
  attributes: add av_noreturn
  attributes: drop pointless define guards
  configure: do not disable av_always_inline with --enable-small
  flvdec: initial stream switch support
  avplay: fix write on freed memory for rawvideo
  snow: remove a VLA used for edge emulation
  x86: lavfi: fix gradfun/yadif build with mmx/sse disabled
  snow: remove the runs[] VLA.
  snow: Check mallocs at init
  flacdec: remove redundant setting of avctx->sample_fmt

Conflicts:
	ffplay.c
	libavcodec/h264.c
	libavcodec/snow.c
	libavcodec/snow.h
	libavcodec/snowdec.c
	libavcodec/snowenc.c
	libavformat/flvdec.c
	libavutil/attributes.h
	tools/patcheck

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-04 00:32:31 +02:00
Diego Biurrun 1a068bfefd cosmetics: Consistently use C-style comments with multiple inclusion guards 2012-07-03 17:35:12 +02:00
Michael Niedermayer 479fb7b8af Merge remote-tracking branch 'qatar/master'
* qatar/master: (35 commits)
  fix space type in Changelog
  ZeroCodec Decoder
  RealAudio Lossless decoder
  rtpenc: Use AVFormatContext.packet_size instead of a private option
  url: Document the expected behaviour of url_read
  libavformat: Use AVFormatContext.probesize in init_input
  docs: Fix a stray reference to tags in the generic doxy on dicts
  cosmetics: Align some AVInput/OutputFormat declarations
  zmbv: check decompress result
  zmbv: correct indentation
  adpcm: convert adpcm_thp to bytestream2.
  adpcm: convert adpcm_yamaha to bytestream2.
  adpcm: convert adpcm_swf to bytestream2.
  adpcm: convert adpcm_sbpro to bytestream2.
  adpcm: convert adpcm_ct to bytestream2.
  adpcm: convert adpcm_ima_amv/smjpeg to bytestream2.
  adpcm: convert adpcm_ea_xas to bytestream2.
  adpcm: convert adpcm_ea_r1/2/3 to bytestream2.
  adpcm: convert ea_maxis_xa to bytestream2.
  adpcm: convert adpcm_ea to bytestream2.
  ...

Conflicts:
	Changelog
	libavcodec/Makefile
	libavcodec/adpcm.c
	libavcodec/allcodecs.c
	libavcodec/avcodec.h
	libavcodec/version.h
	libavcodec/zerocodec.c
	libavcodec/zmbv.c
	libavformat/riff.c
	libavformat/url.h
	tests/ref/fate/truemotion1-15
	tests/ref/fate/truemotion1-24

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-20 00:03:19 +01:00
Martin Storsjö 27b7459b8d docs: Fix a stray reference to tags in the generic doxy on dicts
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-03-19 16:07:38 +02:00
Michael Niedermayer 0b9a69f244 Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
  aacdec: Fix PS in ADTS.
  avconv: Consistently use PIX_FMT_NONE.
  dsputil: use cpuflags in x86 emu_edge_core
  dsputil: use movups instead of movdqu in ff_emu_edge_core_sse()
  wma: initialize prev_block_len_bits, next_block_len_bits, and block_len_bits.
  mov: Remove some redundant and obsolete comments.
  Add libavutil/mathematics.h #includes for INFINITY
  doxy: structure libavformat groups
  doxy: introduce an empty structure in libavcodec
  doxy: provide a start page and document libavutil
  doxy: cleanup pixfmt.h
  regtest: split video encode/decode tests into individual targets
  ARM: add explicit .arch and .fpu directives to asm.S
  pthread: do not touch has_b_frames
  avconv: cleanup the transcoding loop in output_packet().
  avconv: split subtitle transcoding out of output_packet().
  avconv: split video transcoding out of output_packet().
  avconv: split audio transcoding out of output_packet().
  avconv: reindent.
  avconv: move streamcopy-only code out of decoding loop.
  ...

Conflicts:
	avconv.c
	libavcodec/aaccoder.c
	libavcodec/pthread.c
	libavcodec/version.h
	libavutil/audioconvert.h
	libavutil/avutil.h
	libavutil/mem.h
	tests/ref/vsynth1/dv
	tests/ref/vsynth1/mpeg2thread
	tests/ref/vsynth2/dv
	tests/ref/vsynth2/mpeg2thread

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-23 04:02:17 +01:00
Luca Barbato 757cd8d876 doxy: provide a start page and document libavutil
Introduce a basic layout, the subpages are currently left empty.

Split libavutil in multiple groups as example of the structure
2011-11-22 17:16:02 +01:00
Michael Niedermayer 58257ea29e Merge remote-tracking branch 'qatar/master'
* qatar/master: (28 commits)
  mp3enc: write a xing frame containing number of frames in the file
  lavf: update AVStream.nb_frames when muxing.
  ffmpeg: remove unused variables from InputStream.
  doc: update ffmpeg -ar and -ac documentation to reflect reality.
  ffmpeg: remove pointless if (nb_input_files)
  ffmpeg: merge input_files_ts_offset into input_files.
  ffmpeg: merge input_codecs into input_streams.
  ffmpeg: drop AV prefixes from struct names.
  ffmpeg: deprecate loop_input and loop_output options
  gif: add loop private option.
  img2: add loop private option.
  AVOptions: in av_opt_find() don't return named constants unless unit is specified.
  x11grab: replace undocumented nomouse hackery with a private option.
  dict: extend documentation.
  lls: whitespace cosmetics
  docs: Use proper markup for a literal command line option
  docs: Remove a remark that isn't relevant any longer
  docs: Explain how to regenerate import libraries with MSVC tools
  docs: Mention that libraries for MSVC can be built with a cross compiler
  docs: Remove old docs that mention setting up a build environment with lib.exe
  ...

Conflicts:
	doc/ffmpeg.texi
	doc/general.texi
	ffmpeg.c
	libavcodec/Makefile
	libavcodec/dnxhddata.c
	libavformat/mp3enc.c
	libavformat/utils.c
	libavutil/Makefile
	tests/copycooker.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-09 02:06:40 +02:00
Anton Khirnov 8c28e01d31 dict: extend documentation. 2011-07-08 18:29:27 +02:00
Michael Niedermayer 3074f03a07 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  get_bits: remove x86 inline asm in A32 bitstream reader
  doc: Remove outdated information about our issue tracker
  avidec: Factor out the sync fucntionality.
  fate-aac: Expand coverage.
  ac3dsp: add x86-optimized versions of ac3dsp.extract_exponents().
  ac3dsp: simplify extract_exponents() now that it does not need to do clipping.
  ac3enc: clip coefficients after MDCT.
  ac3enc: add int32_t array clipping function to DSPUtil, including x86 versions.
  swscale: for >8bit scaling, read in native bit-depth.
  matroskadec: matroska_read_seek after after EBML_STOP leads to failure.
  doxygen: fix usage of @file directive in libavutil/{dict,file}.h
  doxygen: Help doxygen parser to understand the DECLARE_ALIGNED and offsetof macros

Conflicts:
	doc/issue_tracker.txt
	libavformat/avidec.c
	libavutil/dict.h
	libswscale/swscale.c
	libswscale/utils.c
	tests/ref/lavfi/pixfmts_scale

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-02 03:24:32 +02:00
Reinhard Tartler 134557f3a4 doxygen: fix usage of @file directive in libavutil/{dict,file}.h 2011-07-01 15:12:33 +02:00
Stefano Sabatini 34ab23f226 dict: fix another typo
achive -> achieve
2011-07-01 10:50:24 +02:00
Stefano Sabatini ca699ac24e dict: fix various typos 2011-06-28 10:35:30 +02:00
Michael Niedermayer c029ea39bd AVDictionary: warn about its shortcommings and mention available replacements.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-28 04:10:40 +02:00
Michael Niedermayer 2905e3ff64 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavc: add opt_find to AVCodecContext class.
  h264: Complexify frame num gap shortening code
  intreadwrite.h: fix AV_RL32/AV_RB32 signedness.
  Fix decoding of mpegts streams with h264 video that does *NOT* have b frames
  Add minor bumps and APIChanges entries for lavf private options.
  ffmpeg: deprecate -vc and -tvstd
  ffmpeg: use new avformat_open_* API.
  ffserver: use new avformat_open_* API.
  ffprobe: use new avformat_open_* API.
  ffplay: use new avformat_open_* API.
  cmdutils: add opt_default2().
  dict: add AV_DICT_APPEND flag.
  lavf: add avformat_write_header() as a replacement for av_write_header().
  Deprecate av_open_input_* and remove their uses.
  lavf: add avformat_open_input() as a replacement for av_open_input_*
  AVOptions: add av_opt_find() as a replacement for av_find_opt.
  AVOptions: add av_opt_set_dict() mapping a dictionary struct to a context.
  ffmpeg: don't abuse a global for passing frame size from input to output
  ffmpeg: don't abuse a global for passing pixel format from input to output
  ffmpeg: initialise encoders earlier.

Conflicts:
	cmdutils.c
	doc/APIchanges
	ffmpeg.c
	ffplay.c
	ffprobe.c
	libavcodec/h264.c
	libavformat/avformat.h
	libavformat/utils.c
	libavformat/version.h
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-18 05:10:38 +02:00
Anton Khirnov 1b9b37b8a4 dict: add AV_DICT_APPEND flag. 2011-06-16 20:24:56 +02:00
Michael Niedermayer 6a137dde3e dict: This code was developed in ffmpeg and not libav, nor by libav developers.
Correct copyright notices.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-10 00:19:25 +02:00
Anton Khirnov d9f80ea2a7 Move metadata API from lavf to lavu.
Rename it to AVDictionary, since it will be used as such.  Tags
documentation and metadata conversion API is lavf-specific, so remains
there.
2011-06-08 07:43:45 +02:00