Commit Graph

45809 Commits

Author SHA1 Message Date
Clément Bœsch 6fb2fd895e lavc: add lavfi metadata support.
This commit introduces a new AVPacket side data type:
AV_PKT_DATA_STRINGS_METADATA. Its main goal is to provide a way to
transmit the metadata from the AVFilterBufferRef up to the AVFrame. This
is at the moment "only" useful for lavfi input from libavdevice:
lavd/lavfi only outputs packets, and the metadata from the buffer ref
kept in its context needs to be transmitted from the packet to the frame
by the decoders. The buffer ref can be destroyed at any time (along with
the metadata), and a duplication of the AVPacket needs to duplicate the
metadata as well, so the choice of using the side data to store them was
selected.

Making sure lavd/lavfi raises the metadata is useful to allow tools like
ffprobe to access the filters metadata (it is at the moment the only
way); ffprobe will now automatically show the AVFrame metadata in any
customizable output format for users. API users will also be able to
access the AVFrame->metadata pointer the same way ffprobe does
(av_frame_get_metadata).

All the changes are done in this single commit to avoid some memory
leaks: for instances, the changes in lavfi/avcodec.c are meant to
duplicate the metadata from the buffer ref into the AVFrame. Unless we
have an internal way of freeing the AVFrame->metadata automatically, it
will leak in most of the user apps. To fix this problem, we introduce
AVCodecContext->metadata and link avctx->metadata to the current
frame->metadata and free it at each decode frame call (and in the codec
closing callback for the last one). But doing this also means to update
the way the tiff decoder already handles the AVFrame->metadata (it's the
only one decoder with frame metadata at the moment), by making sure it
is not trying to free a pointer already freed by the lavc internals.

The lavfi/avcodec.c buffer ref code is based on an old Thomas Kühnel
work, the rest of the code belongs to the commit author.

Signed-off-by: Thomas Kühnel <kuehnelth@googlemail.com>
Signed-off-by: Clément Bœsch <ubitux@gmail.com>
2012-10-21 17:29:10 +02:00
Michael Niedermayer d7b8a9a589 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  fate: adpcm: cosmetics: Sort test entries
  fate: adpcm: Add dependencies
  svq3: cosmetics: Drop useless parentheses

Conflicts:
	libavcodec/svq3.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-21 17:09:36 +02:00
Michael Niedermayer 0e09761686 Merge commit 'a7d2861d36756b913e85681b86ed3385274e8ced'
* commit 'a7d2861d36756b913e85681b86ed3385274e8ced':
  svq3: K&R formatting cosmetics
  fate: Introduce ENCMUX macro for tests that require encoders and a muxer
  ffv1: Add missing #includes to header file

Conflicts:
	libavcodec/ffv1.h
	libavcodec/svq3.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-21 17:01:01 +02:00
Michael Niedermayer aa760b1735 Merge commit '2d09b36c0379fcda8f984bc8ad8816c8326fd7bd'
* commit '2d09b36c0379fcda8f984bc8ad8816c8326fd7bd':
  doc/platform: Add info on shared builds with MSVC
  doc/platform: Move a caveat down to the notes section
  ARM: reinstate optimised intmath.h
  ffv1: update to ffv1 version 3

Conflicts:
	doc/platform.texi
	libavcodec/ffv1.c
	libavcodec/ffv1.h
	libavcodec/ffv1dec.c
	libavcodec/ffv1enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-21 16:13:55 +02:00
Michael Niedermayer 99ea47fe5a Merge commit '4a2a4524a3f50ed302820ba971ddd48e78c7436f'
* commit '4a2a4524a3f50ed302820ba971ddd48e78c7436f':
  ffv1: propagate errors

Conflicts:
	libavcodec/ffv1dec.c
	libavcodec/ffv1enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-21 14:55:21 +02:00
Michael Niedermayer 69fd0b7adb Merge commit '71f7b22dba60524b2285643ae0b49d8f64977129'
* commit '71f7b22dba60524b2285643ae0b49d8f64977129':
  ffv1: split decoder and encoder

Conflicts:
	libavcodec/Makefile
	libavcodec/ffv1.c
	libavcodec/ffv1.h
	libavcodec/ffv1dec.c
	libavcodec/ffv1enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-21 14:37:15 +02:00
Michael Niedermayer e4255eaf47 ffv1: split decoder and encoder
This is not based on lucas work due to code divergence (its less work this way
than trying to merge from a split based on 2 years outdated code)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-21 14:26:23 +02:00
Michael Niedermayer dcbff35199 Merge commit 'd15c21e5fa3961f10026da1a3080a3aa3cf4cec9'
* commit 'd15c21e5fa3961f10026da1a3080a3aa3cf4cec9':
  avutil: Add a copy of ff_sqrt_tab back into avutil to restore ABI compatibility
  avutil: make some tables visible again
  avutil: remove inline av_log2 from public API
  celp_math: rename ff_log2 to ff_log2_q15

Conflicts:
	libavutil/libavutil.v

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-21 13:35:42 +02:00
Michael Niedermayer 05f228b0a0 ffv1: fix gray
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-21 04:25:30 +02:00
Michael Niedermayer b6267901c4 mp3demux: Rewrite xing TOC based seeking
The libav code depends on mp3 startcodes only occuring at the start of
frames. But there is nothing in mp3 that prevents them occuring elsewhere
by chance. Thus the code would fail randomly, the new code searches for 3
consecutive valid frames. If this turns out to be still insufficient the
number can be raised further, or additional checks added.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-21 03:13:46 +02:00
Michael Niedermayer 7696a392e2 mp3dec: propagate error code correctly.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-21 02:52:10 +02:00
Clément Bœsch 273fca9ac0 lavfi/silencedetect: increase duration precision.
This should also fix CID717889.
2012-10-21 01:28:19 +02:00
Clément Bœsch 99a520000d lavf/webvttdec: fix potential timing overflows.
Should fix CID733781 and CID733782.
2012-10-21 01:16:49 +02:00
Clément Bœsch 1ea3c03743 lavf/subviewerdec: fix potential timing overflows.
Should fix CID733779 and CID733780.
2012-10-21 01:08:17 +02:00
Michael Niedermayer 044c0e62ea udp: add missing mutex unlock
Fixes CID703688
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 23:31:32 +02:00
Michael Niedermayer c4503a2e40 rtpdec: check av_new_packet() return value
Fixes CID733715
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 23:07:16 +02:00
Michael Niedermayer 3a8b66af6c rtmp_write_amf_data: remove dead code
Fixes CID732199
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 22:57:30 +02:00
Michael Niedermayer e4ef2e073c riff_has_valid_tags: remove unused variable
Fixes CID739471
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 22:34:01 +02:00
Diego Biurrun 620345f930 fate: adpcm: cosmetics: Sort test entries
This also places tests of related formats together.
2012-10-20 21:10:21 +02:00
Diego Biurrun a7d2861d36 svq3: K&R formatting cosmetics 2012-10-20 21:10:21 +02:00
Diego Biurrun 2e0c410485 fate: adpcm: Add dependencies 2012-10-20 21:10:21 +02:00
Diego Biurrun 8860878291 fate: Introduce ENCMUX macro for tests that require encoders and a muxer 2012-10-20 21:10:21 +02:00
Diego Biurrun af1ede069c svq3: cosmetics: Drop useless parentheses 2012-10-20 21:10:21 +02:00
Diego Biurrun 6cfca5b6ae ffv1: Add missing #includes to header file 2012-10-20 21:10:21 +02:00
Michael Niedermayer 73581afe01 nutdec: fix integer overflow
Fixes CID700575
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 20:45:32 +02:00
Michael Niedermayer d633e15d7d nsvdec: fix division by 0
Fixes CID717749
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 20:20:39 +02:00
Michael Niedermayer ee23dcf534 avformat_free_context: allow NULL as argument
Fixes CID703682
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 20:13:18 +02:00
Michael Niedermayer 830f7f189f mmsh: fix integer overflow in mmsh_seek()
Fixes CID703745
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 20:13:18 +02:00
Stefano Sabatini d3b8d56e06 examples/decoding_encoding: prefer 'frame' over 'picture' for an AVFrame
Decrease confusion.
2012-10-20 19:42:55 +02:00
Michael Niedermayer dd84efe3c7 matroskaenc: Fix hypothetical integer overflows
Fixes CID700562-7
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 19:05:15 +02:00
Michael Niedermayer b1f517f503 matroskaenc: check avio_open_dyn_buf() retuen code
Fixes CID703629
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 19:05:15 +02:00
Derek Buitenhuis eed7406416 doc/platform: Add info on shared builds with MSVC
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-10-20 13:00:12 -04:00
Derek Buitenhuis 11a73745d5 doc/platform: Move a caveat down to the notes section
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-10-20 12:59:20 -04:00
Derek Buitenhuis 2d09b36c03 doc/platform: Add info on shared builds with MSVC
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-10-20 12:55:59 -04:00
Derek Buitenhuis f2a7236d0c doc/platform: Move a caveat down to the notes section
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-10-20 12:55:59 -04:00
Mans Rullgard ebe46b8063 ARM: reinstate optimised intmath.h
Use of the ARM optimised intmath.h was accidentally dropped in 9734b8b.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-20 17:26:37 +01:00
Luca Barbato 0f13cd3187 ffv1: update to ffv1 version 3
Based on code from Carl Eugen Hoyos, Michael Niedermayer and Paul B Mahol.
2012-10-20 18:14:52 +02:00
Luca Barbato 4a2a4524a3 ffv1: propagate errors 2012-10-20 18:14:51 +02:00
Luca Barbato 71f7b22dba ffv1: split decoder and encoder 2012-10-20 18:14:43 +02:00
Hendrik Leppkes 79393a8363 Replace usage of the deprecated av_pix_fmt_descriptors array with av_pix_fmt_desc_get
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 18:00:13 +02:00
Michael Niedermayer 2c5b92fe90 matroskadec: fix double negation typo
Fixes CID602563
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 16:58:33 +02:00
Michael Niedermayer 1116491c53 matroska_parse_rm_audio: check for malloc failure
Fixes CID733712
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 16:55:45 +02:00
Michael Niedermayer d7cabb3c7e bgmc: check the correct pointers
Fixes CID90539, CID90538
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 15:33:44 +02:00
Michael Niedermayer bf52ad1e49 lavc: revert broken hunk from 1cd9c81ddb
This should fix fate failures

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 13:59:53 +02:00
Martin Storsjö d15c21e5fa avutil: Add a copy of ff_sqrt_tab back into avutil to restore ABI compatibility
Earlier versions of for instance of libavcodec expect this symbol to be
present in libavutil. This commit can be reverted after the next major
bump.

New shared builds of avcodec will link to the internal copy of the
table within that library, so those builds won't rely on this table
being present in avutil any longer either.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-20 14:31:55 +03:00
Reinhard Tartler def8c94699 avutil: make some tables visible again
These tables are used for instance by older versions of libavcodec and
need to remain visible until the next SONAME bump.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-20 14:31:55 +03:00
Mans Rullgard 8c0a3d5fe0 avutil: remove inline av_log2 from public API
This removes inline av_log2 and av_log2_16bit from the public API,
instead exporting them as regular functions.  In-tree code still
gets the inline and otherwise optimised variants.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-20 12:28:45 +01:00
Mans Rullgard f0c07be649 celp_math: rename ff_log2 to ff_log2_q15
This name is more descriptive as the function returns a fixed-point
value with 15 fraction bits.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-20 12:28:45 +01:00
Michael Niedermayer 6912e7a008 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  configure: Group math functions into a separate variable
  avutil/mem: K&R formatting cosmetics
  avutil/lzo: K&R formatting cosmetics

Conflicts:
	configure
	libavutil/mem.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 13:18:59 +02:00
Michael Niedermayer 04c6ecb7da Merge commit 'c9ef43215c7d68c2cdcdbe02287aa114f27a32ed'
* commit 'c9ef43215c7d68c2cdcdbe02287aa114f27a32ed':
  fate-vc1: add dependencies
  ARM: fix overreads in neon h264 chroma mc
  rtsp: Make sure the ret variable is initialized in ff_rtsp_fetch_packet
  gitignore: ignore files created by msvc
  fate: Add proper dependencies for the tests in video.mak
  configure: Disable Snow decoder and encoder by default
  lzo: Drop obsolete fast_memcpy reference
  build: Drop OBJS declaration for non-existing PCM_DVD encoder
  mpeg4videodec: Disable frame multithreading for GMC, its not implemented at all

Conflicts:
	libavcodec/mpegvideo.c
	libavformat/rtsp.c
	tests/fate/microsoft.mak
	tests/fate/video.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-20 12:37:52 +02:00