Commit Graph

60 Commits

Author SHA1 Message Date
James Almer 65ddc74988 avutil: remove deprecated FF_API_OLD_CHANNEL_LAYOUT
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-07 08:53:30 -03:00
Andreas Rheinhardt 32538dafca avfilter/avfilter: Move frame_pool to FilterLinkInternal
Avoids ugly casts when uninitializing.
(One could actually avoid allocating this separately if one
were willing to expose FFFramePool to those files including
link_internal.h.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-18 16:38:09 +01:00
Andreas Rheinhardt 50ea7389ec avfilter: Deduplicate default audio inputs/outputs
Lots of audio filters use very simple inputs or outputs:
An array with a single AVFilterPad whose name is "default"
and whose type is AVMEDIA_TYPE_AUDIO; everything else is unset.

Given that we never use pointer equality for inputs or outputs*,
we can simply use a single AVFilterPad instead of dozens; this
even saves .data.rel.ro (4784B here) as well as relocations.

*: In fact, several filters (like the filters in af_biquads.c)
already use the same inputs; furthermore, ff_filter_alloc()
duplicates the input and output pads so that we do not even
work with the pads directly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-07 09:21:13 +02:00
James Almer 159f8b8d71 avfilter/audio: move a variable declaration outside of an unrelated deprecated block
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-01 13:57:09 -03:00
James Almer 1f96db959c avfilter: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:46 -03:00
Paul B Mahol 17a59a634c avfilter/framepool: fix alignment requirements for audio and video filters 2022-02-22 09:22:03 +01:00
Andreas Rheinhardt f60c3ca136 avfilter/audio: Don't call av_get_channel_layout_nb_channels twice
Also makes the assert-string shorter.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-17 19:13:40 +02:00
Andreas Rheinhardt 1aa640c7d7 avfilter/internal: Combine get_(audio|video)_buffer into union
These fields are mutually exclusive, so putting them in a union
is possible and makes AVFilterPad smaller.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-17 19:13:16 +02:00
Andreas Rheinhardt 6e66e2c321 avfilter/internal: Don't include framepool.h, thread.h
They are not used by the header at all and only used by very few files;
so include the headers in their users instead of in internal.h.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-04 03:03:25 +02:00
Matthieu Bouron e1f4971209 lavfi: use an audio frame pool for each link of the filtergraph 2017-01-12 10:22:52 +01:00
Clément Bœsch 58672347cb lavfi: remove 2 unused lavc includes 2016-10-23 20:19:28 +02:00
Hendrik Leppkes 033764e015 Merge commit 'f6974fe651d29ef6eb68d66d73f7b6c011062aa0'
* commit 'f6974fe651d29ef6eb68d66d73f7b6c011062aa0':
  lavfi: Drop deprecated AVFilterBuffer* code

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 16:22:03 +02:00
Andreas Cadhalpun e6c20e214e avfilter: add missing FF_API_AVFILTERBUFFER guards
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-30 23:24:22 +02:00
Vittorio Giovara f6974fe651 lavfi: Drop deprecated AVFilterBuffer* code
Deprecated in 11/2012.
2015-08-28 16:01:16 +02:00
Andreas Cadhalpun 095347ffe4 disable deprecation warnings in deprecated code
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-22 19:16:14 +02:00
Michael Niedermayer 00948ff876 avfilter/audio: use av_mallocz_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-03 20:08:18 +02:00
Michael Niedermayer 209cb8afe0 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavfi: switch ff_default_get_audio_buffer() to av_frame_get_buffer()

Conflicts:
	libavfilter/audio.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-19 08:27:35 +02:00
Anton Khirnov c9c7bc4493 lavfi: switch ff_default_get_audio_buffer() to av_frame_get_buffer()
This simplifies the code and avoids using libavcodec-specific
avcodec_fill_audio_frame().
2013-06-18 11:21:16 +02:00
Michael Niedermayer f963c77856 avfilter: avoid direct access to "frame"->channels
This avoids ABI issues

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-10 11:25:54 +01:00
Michael Niedermayer a05a44e205 Merge commit '7e350379f87e7f74420b4813170fe808e2313911'
* commit '7e350379f87e7f74420b4813170fe808e2313911':
  lavfi: switch to AVFrame.

Conflicts:
	doc/filters.texi
	libavfilter/af_ashowinfo.c
	libavfilter/audio.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/buffersink.c
	libavfilter/buffersrc.c
	libavfilter/buffersrc.h
	libavfilter/f_select.c
	libavfilter/f_setpts.c
	libavfilter/fifo.c
	libavfilter/split.c
	libavfilter/src_movie.c
	libavfilter/version.h
	libavfilter/vf_aspect.c
	libavfilter/vf_bbox.c
	libavfilter/vf_blackframe.c
	libavfilter/vf_delogo.c
	libavfilter/vf_drawbox.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_fieldorder.c
	libavfilter/vf_fps.c
	libavfilter/vf_frei0r.c
	libavfilter/vf_gradfun.c
	libavfilter/vf_hqdn3d.c
	libavfilter/vf_lut.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/vf_showinfo.c
	libavfilter/vf_transpose.c
	libavfilter/vf_vflip.c
	libavfilter/vf_yadif.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavfilter/yadif.h

Following are notes about the merge authorship and various technical details.

Michael Niedermayer:
  * Main merge operation, notably avfilter.c and video.c
  * Switch to AVFrame:
    - afade
    - anullsrc
    - apad
    - aresample
    - blackframe
    - deshake
    - idet
    - il
    - mandelbrot
    - mptestsrc
    - noise
    - setfield
    - smartblur
    - tinterlace
  * various merge changes and fixes in:
    - ashowinfo
    - blackdetect
    - field
    - fps
    - select
    - testsrc
    - yadif

Nicolas George:
  * Switch to AVFrame:
    - make rawdec work with refcounted frames. Adapted from commit
      759001c534 by Anton Khirnov.
      Also, fix the use of || instead of | in a flags check.
    - make buffer sink and src, audio and video work all together

Clément Bœsch:
  * Switch to AVFrame:
    - aevalsrc
    - alphaextract
    - blend
    - cellauto
    - colormatrix
    - concat
    - earwax
    - ebur128
    - edgedetect
    - geq
    - histeq
    - histogram
    - hue
    - kerndeint
    - life
    - movie
    - mp (with the help of Michael)
    - overlay
    - pad
    - pan
    - pp
    - pp
    - removelogo
    - sendcmd
    - showspectrum
    - showwaves
    - silencedetect
    - stereo3d
    - subtitles
    - super2xsai
    - swapuv
    - thumbnail
    - tile

Hendrik Leppkes:
  * Switch to AVFrame:
    - aconvert
    - amerge
    - asetnsamples
    - atempo
    - biquads

Matthieu Bouron:
  * Switch to AVFrame
    - alphamerge
    - decimate
    - volumedetect

Stefano Sabatini:
  * Switch to AVFrame:
    - astreamsync
    - flite
    - framestep

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Clément Bœsch <ubitux@gmail.com>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-10 01:40:35 +01:00
Anton Khirnov 7e350379f8 lavfi: switch to AVFrame.
Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it
and use AVFrame instead.
2013-03-08 07:37:18 +01:00
Nicolas George b6afb2dde1 lavfi: support unknown channel layouts. 2013-01-26 11:15:38 +01:00
Nicolas George 82541d8330 lavfi: merge all filtering code into ff_filter_frame. 2013-01-01 15:19:04 +01:00
Nicolas George 2eb2e1798e lavfi: add avfilter_get_audio_buffer_ref_from_arrays_channels.
It is the same as avfilter_get_audio_buffer_ref_from_arrays
except it has a "channels" and the channel layout can be 0.
2013-01-01 02:01:28 +01:00
Nicolas George 34de47aa35 lavfi: add an accessor for ref->audio->channels. 2012-12-20 13:03:41 +01:00
Nicolas George 238edd2fe3 lavfi: add a channels field to AVFilterLink.
Also: fix af_pan and af_aresample, that forgot to update
audio->channels.
2012-12-20 13:03:41 +01:00
Michael Niedermayer 3ed483cdfa libavfilter: Support using filter_frame for video
With this we can mix filters using filter_frame OR start/draw_slice/end

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-28 16:43:34 +01:00
Michael Niedermayer a0b8eec719 default_filter_frame: fix argument name
Based on code by Anton Khirnov
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-28 16:43:34 +01:00
Michael Niedermayer cd7febd33f lavfi: replace filter_samples by filter_frame
Based on patch by Anton Khirnov
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-28 16:43:34 +01:00
Anton Khirnov 565e4993c6 lavfi: merge start_frame/draw_slice/end_frame
Any alleged performance benefits gained from the split are purely
mythological and do not justify added code complexity.
2012-11-28 08:50:19 +01:00
Michael Niedermayer 03b078721c Merge commit '97bf7c03b1338a867da52c159a2afecbdedcfa88'
* commit '97bf7c03b1338a867da52c159a2afecbdedcfa88':
  doc: git-howto: Leave reviewers time to react before pushing patches
  Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
  lavu: rename audioconvert.* to channel_layout.* and deprecate audioconvert.h

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/git-howto.texi
	ffmpeg_filter.c
	libavcodec/flacdec.c
	libavcodec/imc.c
	libavcodec/mpegaudiodec.c
	libavcodec/utils.c
	libavfilter/asrc_anullsrc.c
	libavfilter/audio.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/avfiltergraph.c
	libavfilter/buffer.c
	libavutil/Makefile
	libavutil/audioconvert.h
	libavutil/channel_layout.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-12 11:32:11 +01:00
Justin Ruggles a903f8f087 Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
Also reorder some other #include when applicable.
2012-11-11 13:35:12 -05:00
Nicolas George 8ad54a44eb lavfi: check that buffer and link properties match. 2012-09-13 20:09:53 +02:00
Nicolas George c262ddb8c5 lavfi: set sample_rate in the default allocator. 2012-09-13 20:09:53 +02:00
Nicolas George beeba9161a lavfi: add a closed field to AVFilerLink.
It will help forward errors and maintain consistency.
2012-08-22 19:04:30 +02:00
Nicolas George e54e30c889 lavfi: grant all permissions on mallocated audio buffers.
The permissions not requested by the filter that created
the buffer may be useful for a later filter and avoid a copy.
2012-08-17 18:26:38 +02:00
Michael Niedermayer c581cb4e4f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Fix even more missing includes after the common.h removal
  build: Factor out rangecoder dependencies to CONFIG_RANGECODER
  build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE
  x86: avcodec: Consistently name all init files
  Add more missing includes after removing the implicit common.h
  Add some more missing includes after removing the implicit common.h
  Don't include common.h from avutil.h
  rtmp: Automatically compute the hash for SWFVerification

Conflicts:
	configure
	doc/APIchanges
	doc/examples/decoding_encoding.c
	libavcodec/Makefile
	libavcodec/assdec.c
	libavcodec/audio_frame_queue.c
	libavcodec/avpacket.c
	libavcodec/dv_profile.c
	libavcodec/dwt.c
	libavcodec/libtheoraenc.c
	libavcodec/rawdec.c
	libavcodec/rv40dsp.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c
	libavcodec/v210dec.h
	libavcodec/vc1dsp.c
	libavcodec/x86/Makefile
	libavfilter/asrc_anullsrc.c
	libavfilter/avfilter.c
	libavfilter/buffer.c
	libavfilter/formats.c
	libavfilter/vf_ass.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_select.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavformat/version.h
	libavutil/audioconvert.c
	libavutil/error.h
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-16 16:20:30 +02:00
Martin Storsjö 1d9c2dc89a Don't include common.h from avutil.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:32:06 +03:00
Nicolas George 271ddb116c lavfi: use min_perms and rej_perms for out pads.
There are several reasons for doing that:

1. It documents the code for the reader and helps find
   inconsistencies and bugs.

2. For rej_perms, it guarantees the change will be done
   even if the output reference can be created by several
   code paths.

3. It can be used to predict cases where a copy will,
   or will not happen and optimize buffer allocation
   (for example not request a rare direct-rendering buffer
   from a device sink if it will be copied anyway).

Note that a filter is still allowed to manage the permissions
on its own without using these fields.
2012-08-14 12:00:35 +02:00
Michael Niedermayer b4780d03d0 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  x86: h264_idct: Rename x264_add8x4_idct_sse2 --> h264_add8x4_idct_sse2
  rational: add av_inv_q() returning the inverse of an AVRational
  dpx: Make start offset unsigned
  lavfi: properly signal out-of-memory error in ff_filter_samples
  cosmetics: Fix a few switched periods and linebreaks
  zerocodec: Fix memleak in decode_frame
  zerocodec: Cosmetics

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-05 22:17:02 +02:00
Reinhard Tartler 800750417f lavfi: properly signal out-of-memory error in ff_filter_samples
Found with a clang-scan report on http://fate.libav.org/csa/
2012-08-05 10:26:49 +02:00
Michael Niedermayer f8911b987d Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mss3: use standard zigzag table
  mss3: split DSP functions that are used in MTS2(MSS4) into separate file
  motion-test: do not use getopt()
  tcp: add initial timeout limit for incoming connections
  configure: Change the rdtsc check to a linker check
  avconv: propagate fatal errors from lavfi.
  lavfi: add error handling to filter_samples().
  fate-run: make avconv() properly deal with multiple inputs.
  asplit: don't leak the input buffer.
  af_resample: fix request_frame() behavior.
  af_asyncts: fix request_frame() behavior.
  libx264: support aspect ratio switching
  matroskadec: honor error_recognition when encountering unknown elements.
  lavr: resampling: add support for s32p, fltp, and dblp internal sample formats
  lavr: resampling: add filter type and Kaiser window beta to AVOptions
  lavr: Use AV_SAMPLE_FMT_NONE to auto-select the internal sample format
  lavr: mix: validate internal sample format in ff_audio_mix_init()

Conflicts:
	ffmpeg.c
	ffplay.c
	libavcodec/libx264.c
	libavfilter/audio.c
	libavfilter/split.c
	libavformat/tcp.c
	tests/fate-run.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-09 22:40:12 +02:00
Anton Khirnov cd99146253 lavfi: add error handling to filter_samples(). 2012-07-09 08:25:19 +02:00
Nicolas George 0689d5e17a lavfi: implement samples framing on links.
Links can be set up to group samples into buffers of
specified minimum and maximum size.
2012-06-30 14:03:54 +02:00
Michael Niedermayer 1c60088885 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  x86: Only use optimizations with cmov if the CPU supports the instruction
  x86: Add CPU flag for the i686 cmov instruction
  x86: remove unused inline asm macros from dsputil_mmx.h
  x86: move some inline asm macros to the only places they are used
  lavfi: Add the af_channelmap audio channel mapping filter.
  lavfi: add join audio filter.
  lavfi: allow audio filters to request a given number of samples.
  lavfi: support automatically inserting the fifo filter when needed.
  lavfi/audio: eliminate ff_default_filter_samples().

Conflicts:
	Changelog
	libavcodec/x86/h264dsp_mmx.c
	libavfilter/Makefile
	libavfilter/allfilters.c
	libavfilter/avfilter.h
	libavfilter/avfiltergraph.c
	libavfilter/version.h
	libavutil/x86/cpu.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-24 02:09:53 +02:00
Anton Khirnov fa06623930 lavfi/audio: eliminate ff_default_filter_samples().
It currently does the following:
1) get a zeroed audio buffer
2) copy some properties (but not the data) of the input buffer to it
3) pass this buffer to the output filter
This looks useless and is indeed not used by any filters, therefore
delete it.

Make ff_null_filter_samples() (just pass the buffer to the next filter)
the new default.
2012-06-22 20:58:19 +02:00
Michael Niedermayer 87dced8074 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  fix hardcoded tables compililation caused by missing math constants
  lavf: Make codec_tag arrays constant
  twinvq: give massive struct a name.
  lavf, lavu: version bumps and APIchanges for av_gettime() move
  lavfi/audio: don't set cur_buf in ff_filter_samples().
  lavfi/fifo: add audio version of the fifo filter.
  fifo: fix parenthesis placement.
  lavfi: rename vf_fifo.c -> fifo.c
  lavc: remove stats_in from AVCodecContext options table.

Conflicts:
	doc/APIchanges
	libavfilter/Makefile
	libavfilter/allfilters.c
	libavfilter/audio.c
	libavfilter/fifo.c
	libavformat/version.h
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-21 22:37:43 +02:00
Stefano Sabatini c0b3c0ffb7 lavfi/audio: remove unused variable in ff_filter_samples()
Fix warning:
libavfilter/audio.c: In function ‘ff_filter_samples’:
libavfilter/audio.c:193:13: warning: unused variable ‘size’ [-Wunused-variable]
2012-06-21 12:47:48 +02:00
Anton Khirnov e026c9b390 lavfi/audio: don't set cur_buf in ff_filter_samples().
It's redundant, since the input buffer is passed as a parameter to the
filter_samples() callback, and can lead to stale pointers remaining on
the link.
2012-06-21 09:27:05 +02:00
Michael Niedermayer c7b9eab2be Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtmp: Add a new option 'rtmp_buffer', for setting the client buffer time
  rtmp: Set the client buffer time to 3s instead of 0.26s
  rtmp: Handle server bandwidth packets
  rtmp: Display a verbose message when an unknown packet type is received
  lavfi/audio: use av_samples_copy() instead of custom code.
  configure: add all filters hardcoded into avconv to avconv_deps
  avfiltergraph: remove a redundant call to avfilter_get_by_name().
  lavfi: allow building without swscale.
  build: Do not delete tests/vsynth2 directory, which is no longer created.
  lavfi: replace AVFilterContext.input/output_count with nb_inputs/outputs
  lavfi: make AVFilterPad opaque after two major bumps.
  lavfi: add avfilter_pad_get_type() and avfilter_pad_get_name().
  lavfi: make avfilter_get_video_buffer() private on next bump.
  jack: update to new latency range API as the old one has been deprecated
  rtmp: Tokenize the AMF connection parameters manually instead of using strtok_r
  ppc: Rename H.264 optimization template file for consistency.
  lavfi: add channelsplit audio filter.
  golomb: check remaining bits during unary decoding in get_ur_golomb_jpegls()
  sws: fix planar RGB input conversions for 9/10/16 bpp.

Conflicts:
	Changelog
	configure
	doc/APIchanges
	ffmpeg.c
	libavcodec/golomb.h
	libavcodec/v210dec.h
	libavfilter/Makefile
	libavfilter/allfilters.c
	libavfilter/asrc_anullsrc.c
	libavfilter/audio.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/avfiltergraph.c
	libavfilter/buffersrc.c
	libavfilter/formats.c
	libavfilter/version.h
	libavfilter/vf_frei0r.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/video.h
	libavfilter/vsrc_color.c
	libavformat/rtmpproto.c
	libswscale/input.c
	tests/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-13 22:43:57 +02:00