Commit Graph

67 Commits

Author SHA1 Message Date
Andreas Rheinhardt a94a6617a3 avformat/riffdec: Pass logctx as void* instead of AVFormatContext*
Also stop second-guessing error codes from ff_get_extradata().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-30 20:00:55 +02:00
Andreas Rheinhardt 25c8507818 Remove/replace some unnecessary avcodec.h inclusions
Also remove other unnecessary headers and include headers directly while
at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 15:29:46 +02:00
Andreas Rheinhardt 1df1083b6c avformat/wav: Deduplicate codec tags lists
Also saves relocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-23 11:30:57 +01:00
Andreas Rheinhardt 09e6d3a026 avformat/avienc, wtvenc: Deduplicate codec tags list
Also saves relocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-23 11:30:57 +01:00
Gyan Doshi 1ec2b3de5a avformat/riffenc: indicate storage of flipped RGB bitmaps
Some legacy applications such as AVI2MVE expect raw RGB bitmaps
to be stored bottom-up, whereas our RIFF BITMAPINFOHEADER assumes
they are always stored top-down and thus write a negative value
for height. This can prevent reading of these files.

Option flipped_raw_rgb added to AVI and Matroska muxers
which will write positive value for height when enabled.

Note that the user has to flip the bitmaps beforehand using other
means such as the vflip filter.
2020-07-15 20:52:01 +05:30
Marton Balint 2e31774b40 avformat/avidec: add support for recognizing HEVC fourcc when demuxing
Some security cams generate this, as well as some versions of VirtualDub and
VLC so support for _reading_ such files is justified.

Fixes ticket #7110.

See also this discussion: https://patchwork.ffmpeg.org/patch/8744/

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-08-31 17:38:25 +02:00
James Almer 42f27d1b8e Merge commit '0539d84d985e811e5989ef27c13f7e2dda0f9b89'
* commit '0539d84d985e811e5989ef27c13f7e2dda0f9b89':
  asfdec: Account for different Format Data sizes

See 76853a3e0c

Merged-by: James Almer <jamrial@gmail.com>
2017-09-28 00:28:38 -03:00
Aleksandr Slobodeniuk 0aa8fa963f avformat/riff.h : remove unused function parameter "const AVCodecTag *tags" of "void ff_put_bmp_header()"
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-02 15:26:25 +02:00
Thierry Foucu 4bc7268f2b lavf/riff: Support decoding files with broken mediasubtype base guid.
Fixes ticket #6100.
2017-02-17 14:24:53 +01:00
Alexandra Hájková 0539d84d98 asfdec: Account for different Format Data sizes
Some muxers may use the BMP_HEADER Format Data size instead
of the ASF-specific one.

Bug-Id: 1020
CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-02-15 11:21:11 +01:00
Derek Buitenhuis 6f69f7a8bf Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
  lavf: replace AVStream.codec with AVStream.codecpar

This has been a HUGE effort from:
    - Derek Buitenhuis <derek.buitenhuis@gmail.com>
    - Hendrik Leppkes <h.leppkes@gmail.com>
    - wm4 <nfxjfg@googlemail.com>
    - Clément Bœsch <clement@stupeflix.com>
    - James Almer <jamrial@gmail.com>
    - Michael Niedermayer <michael@niedermayer.cc>
    - Rostislav Pehlivanov <atomnuker@gmail.com>

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-10 20:59:55 +01:00
Anton Khirnov 9200514ad8 lavf: replace AVStream.codec with AVStream.codecpar
Currently, AVStream contains an embedded AVCodecContext instance, which
is used by demuxers to export stream parameters to the caller and by
muxers to receive stream parameters from the caller. It is also used
internally as the codec context that is passed to parsers.

In addition, it is also widely used by the callers as the decoding (when
demuxer) or encoding (when muxing) context, though this has been
officially discouraged since Libav 11.

There are multiple important problems with this approach:
    - the fields in AVCodecContext are in general one of
        * stream parameters
        * codec options
        * codec state
      However, it's not clear which ones are which. It is consequently
      unclear which fields are a demuxer allowed to set or a muxer allowed to
      read. This leads to erratic behaviour depending on whether decoding or
      encoding is being performed or not (and whether it uses the AVStream
      embedded codec context).
    - various synchronization issues arising from the fact that the same
      context is used by several different APIs (muxers/demuxers,
      parsers, bitstream filters and encoders/decoders) simultaneously, with
      there being no clear rules for who can modify what and the different
      processes being typically delayed with respect to each other.
    - avformat_find_stream_info() making it necessary to support opening
      and closing a single codec context multiple times, thus
      complicating the semantics of freeing various allocated objects in the
      codec context.

Those problems are resolved by replacing the AVStream embedded codec
context with a newly added AVCodecParameters instance, which stores only
the stream parameters exported by the demuxers or read by the muxers.
2016-02-23 17:01:58 +01:00
Carl Eugen Hoyos f17ca46009 lavf/riff: Support decoding Ambisonic wav files.
Reported and tested by Andy Furniss, adf d lists at gmail
2015-09-16 14:03:13 +02:00
Tobias Rapp 1416370027 avformat/avienc: add muxer option "write_channel_mask"
Allow writing an empty channel mask into the wave format header. Useful
if the input file contains an unknown channel layout.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-12 14:39:28 +02:00
Michael Niedermayer ba77fb61f7 Merge commit 'd80811c94e068085aab797f9ba35790529126f85'
* commit 'd80811c94e068085aab797f9ba35790529126f85':
  riff: Use the correct logging context

Conflicts:
	libavformat/asfdec_o.c
	libavformat/avidec.c
	libavformat/dxa.c
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/riff.h
	libavformat/riffdec.c
	libavformat/wavdec.c
	libavformat/wtvdec.c
	libavformat/xwma.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-12 15:22:37 +02:00
Luca Barbato d80811c94e riff: Use the correct logging context 2015-07-11 18:45:44 +02:00
Michael Niedermayer 0a23129bfc avformat: Add prefix to get_codec_guid()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-27 19:25:27 +01:00
Thomas Volkert 00d7555f34 wavdec: RIFX file format support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-18 00:10:35 +01:00
Carl Eugen Hoyos 7f6515e491 Also print GUIDs as shown in the Windows registry to ease debugging. 2014-12-02 11:39:06 +01:00
Michael Niedermayer 2d70282254 Merge commit 'd754ed41727b1fcbab335b510248a9758a73320c'
* commit 'd754ed41727b1fcbab335b510248a9758a73320c':
  riffenc: take an AVStream instead of an AVCodecContext

Conflicts:
	libavformat/nutenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-18 17:47:12 +02:00
Anton Khirnov d754ed4172 riffenc: take an AVStream instead of an AVCodecContext
It will be useful in the following commits.

Also, rename the AVCodecContext pointer name from 'stream' to 'codec'.
2014-06-18 15:03:55 +02:00
Daniel Verkamp 5e7d21c7ad ff_put_wav_header: add flag to force WAVEFORMATEX
Partially undoes commit 2c4e08d89327595f7f4be57dda4b3775e1198d5e:

    riff: always generate a proper WAVEFORMATEX structure in
    ff_put_wav_header

A new flag, FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX, is added to force the
use of WAVEFORMATEX rather than PCMWAVEFORMAT even for PCM codecs.

This flag is used in the Matroska muxer (the cause of the original
change) and in the ASF muxer, because the specifications for
these formats indicate explicitly that WAVEFORMATEX should be used.

Muxers for other formats will return to the original behavior of writing
PCMWAVEFORMAT when writing a header for raw PCM.

In particular, this causes raw PCM in WAV to generate the canonical
44-byte header expected by some tools.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-30 16:41:35 +02:00
Michael Niedermayer d32926db7f avformat/riff: return error code from ff_get_guid()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-12 15:59:15 +01:00
Carl Eugen Hoyos 862174ec83 Move GUID-related objects to riffenc.c and riff.c.
This simplifies the following eac3-in-wav patch.
2014-01-29 00:44:59 +01:00
Peter Ross fcbb94712d riffenc: add option to ff_put_bmp_header to ignore extradata
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-23 15:42:35 +01:00
Michael Niedermayer f5b2718c0a Merge commit '971cce7ebb48a58e72e4dc57b3008e2682bcf4e7'
* commit '971cce7ebb48a58e72e4dc57b3008e2682bcf4e7':
  riff.h: Remove stray extern declaration for non-existing symbol

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-06 16:41:44 +02:00
Diego Biurrun 971cce7ebb riff.h: Remove stray extern declaration for non-existing symbol 2013-08-05 22:44:48 +02:00
Michael Niedermayer 52e40155a8 Merge commit 'e544782623caf1eb4b2429e9c4f35d6b627accba'
* commit 'e544782623caf1eb4b2429e9c4f35d6b627accba':
  riff: Move guid structs and helper functions into riff

Conflicts:
	libavformat/asf.h
	libavformat/riff.c
	libavformat/wtv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-22 12:20:04 +02:00
Peter Ross e544782623 riff: Move guid structs and helper functions into riff
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-04-21 18:20:30 +02:00
rogerdpack 12c71f648c dshow: Fix MSVC support, remove av_export, which was apparently unneeded anyway.
Also cleanup exported symbols

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-15 00:08:12 +01:00
rogerdpack aa715cdcf5 dshow: attempt to build shared as well as static
Signed-off-by: rogerdpack <rogerpack2005@gmail.com>
2013-02-06 23:37:46 -07:00
Michael Niedermayer 076300bf8b Merge commit 'bfe5454cd238b16e7977085f880205229103eccb'
* commit 'bfe5454cd238b16e7977085f880205229103eccb':
  lavf: move ff_codec_get_tag() and ff_codec_get_id() definitions to internal.h
  lavf: move "MP3 " fourcc from riff to nut
  fate: vpx: Add dependencies
  fate: Fix wavpack-matroskamode test dependencies
  x86: dsputilenc: port to cpuflags

Conflicts:
	libavformat/internal.h
	libavformat/nut.c
	tests/fate/vpx.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-29 13:45:57 +01:00
Justin Ruggles bfe5454cd2 lavf: move ff_codec_get_tag() and ff_codec_get_id() definitions to internal.h 2012-11-28 11:18:49 -05:00
Michael Niedermayer fadfbb354b Merge commit '71e92414bfd79e56ea6fff174a665ff7b9b86e68'
* commit '71e92414bfd79e56ea6fff174a665ff7b9b86e68':
  lavf: move RIFF INFO tag writing from avienc to riff
  avconv: fix disabling auto mappings with -map_metadata

Conflicts:
	ffmpeg_opt.c
	libavformat/riff.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-17 14:30:25 +02:00
Victor Vasiliev 71e92414bf lavf: move RIFF INFO tag writing from avienc to riff
It will be useful in the wav muxer.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-10-16 18:50:36 +02:00
Michael Niedermayer bb2f13c19f rename missed CodecID to AVCodecID
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 23:57:21 +02:00
Michael Niedermayer 7a72695c05 Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'
* commit '36ef5369ee9b336febc2c270f8718cec4476cb85':
  Replace all CODEC_ID_* with AV_CODEC_ID_*
  lavc: add AV prefix to codec ids.

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	ffprobe.c
	ffserver.c
	libavcodec/8svx.c
	libavcodec/avcodec.h
	libavcodec/dnxhd_parser.c
	libavcodec/dvdsubdec.c
	libavcodec/error_resilience.c
	libavcodec/h263dec.c
	libavcodec/libvorbisenc.c
	libavcodec/mjpeg_parser.c
	libavcodec/mjpegenc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pcm.c
	libavcodec/r210dec.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/version.h
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/v4l2.c
	libavformat/asfdec.c
	libavformat/asfenc.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/caf.c
	libavformat/electronicarts.c
	libavformat/flacdec.c
	libavformat/flvdec.c
	libavformat/flvenc.c
	libavformat/framecrcenc.c
	libavformat/img2.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/matroska.c
	libavformat/matroskadec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/movenc.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegts.c
	libavformat/mxf.c
	libavformat/mxfdec.c
	libavformat/mxfenc.c
	libavformat/nsvdec.c
	libavformat/nut.c
	libavformat/oggenc.c
	libavformat/pmpdec.c
	libavformat/rawdec.c
	libavformat/rawenc.c
	libavformat/riff.c
	libavformat/sdp.c
	libavformat/utils.c
	libavformat/vocenc.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 22:45:46 +02:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Michael Niedermayer 76853a3e0c libavformat: ff_get_bmp_header: return esize too
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-31 00:46:02 +02:00
Michael Niedermayer 1e19927f12 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  vc1: use an enum for Frame Coding Mode
  doc: cleanup filter section
  indeo3: error out if no motion vector is set.
  x86inc: Flag shufps as an floating-point instruction for the AVX emulation code.
  mpegaudio: do not use init_static_data() for initializing tables.
  musepack: fix signed shift overflow in mpc_read_packet()
  mov: Make format string match variable type.
  wmavoice: Make format string match variable type.
  vc1: select interlaced scan table by FCM element
  Generalize RIFF INFO tag support; support reading INFO tag in wav
  pthread: track thread existence in a separate variable.

Conflicts:
	doc/filters.texi
	libavcodec/pthread.c
	libavformat/avi.c
	libavformat/riff.c
	libavformat/riff.h
	libavformat/wav.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-28 01:07:11 +01:00
Victor Vasiliev 12bc20502a Generalize RIFF INFO tag support; support reading INFO tag in wav
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-11-26 17:14:13 -08:00
Michael Niedermayer 85b2114759 Merge commit 'a3a0af4fb1237bed0af75868073f9a63db8b1864'
* commit 'a3a0af4fb1237bed0af75868073f9a63db8b1864':
  avutil: make aes and sha api public
  handle malloc failures in ff_get_wav_header
  add xWMA demuxer
  mpegts: force the default timebase
  libavcodec: Bump micro after adding the dtx AVOptions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-15 04:50:06 +02:00
Max Horn ca402f32e3 handle malloc failures in ff_get_wav_header
ff_get_wav_header is reading data from a WAVE file and then uses it
(without validation) to malloc a buffer. It then proceeded to read
data into the buffer, without verifying that the allocation succeeded.

To address this, change ff_get_wav_header to return an error if
allocation failed, and adapted all calling code to handle that error.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-04-14 13:56:09 +02:00
Peter Ross 36ffabc4ee move PRI_GUID, ARG_GUID, AVCodecGuid, ff_codec_guid_get_id, MEDIASUBTYPE_BASE_GUID and audio_guids[] to riff.c/h (add FF_ prefix to PRI_GUID, ARG_GUID, and MEDIASUBTYPE_BASE_GUID; rename audio_guids to ff_codec_wav_guids)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-07 17:54:52 +02:00
Peter Ross c1309b27d2 move ff_asf_guid, ff_guidcmp and ff_get_guid into riff.h
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-07 17:54:52 +02:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Anton Khirnov 471fe57e1a avio: rename ByteIOContext to AVIOContext.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit ae628ec1fd)
2011-02-20 19:05:47 +01:00
Anton Khirnov ae628ec1fd avio: rename ByteIOContext to AVIOContext.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-20 08:37:15 -05:00
Peter Ross 456a70aeb8 add ff_get_bmp_header
Originally committed as revision 26091 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-26 01:23:44 +00:00
Francesco Lavra 80b39e1ca6 Move AVCodecTag from riff.h into internal.h.
Patch by Francesco Lavra, francescolavra interfree it

Originally committed as revision 23250 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-05-22 16:01:32 +00:00