Commit Graph

76 Commits

Author SHA1 Message Date
Clément Bœsch f4a39ceea0 Merge commit '24130234cd9dd733116d17b724ea4c8e12ce097a'
* commit '24130234cd9dd733116d17b724ea4c8e12ce097a':
  rtpdec_mpeg4: validate fmtp fields

Merged with fixed log message.

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-19 18:24:35 +01:00
Carl Eugen Hoyos ed491db3e5 lavf/rtpdec_mpeg4: Constify a function parameter.
Silences an "assignment discards ‘const’ qualifier" warning.
2017-02-11 16:19:37 +01:00
Luca Barbato 24130234cd rtpdec_mpeg4: validate fmtp fields 2016-08-23 18:58:10 +02:00
Clément Bœsch 8ef57a0d61 Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb':
  cosmetics: Fix spelling mistakes

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-21 21:55:34 +02:00
Vittorio Giovara 41ed7ab45f cosmetics: Fix spelling mistakes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02: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
Vittorio Giovara 059a934806 lavc: Consistently prefix input buffer defines
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:59 +01:00
Michael Niedermayer 3130e5be92 Merge commit 'd594dbecce5f3af7f80bbf5bb1b516d740b69ccd'
* commit 'd594dbecce5f3af7f80bbf5bb1b516d740b69ccd':
  rtpdec: Rename the free method to close

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 00:58:39 +01:00
Michael Niedermayer fa80b76b11 Merge commit 'bb4a310bb85f43e62240145a656b1e5285b14239'
* commit 'bb4a310bb85f43e62240145a656b1e5285b14239':
  rtpdec: Don't free the payload context in the .free function

Conflicts:
	libavformat/rtpdec_latm.c
	libavformat/rtpdec_mpeg4.c
	libavformat/rtpdec_mpegts.c
	libavformat/rtpdec_xiph.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 00:25:12 +01:00
Michael Niedermayer d2a5c6f210 Merge commit 'ec96a89c3e507cf0fb1f2b159b28a53f2bad9a74'
* commit 'ec96a89c3e507cf0fb1f2b159b28a53f2bad9a74':
  rtpdec: Don't pass non-const pointers to fmtp attribute parsing functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 23:44:25 +01:00
Michael Niedermayer 499da717b8 Merge commit 'ac0e54fda9305cc7d149007f5b512bb8619f7c78'
* commit 'ac0e54fda9305cc7d149007f5b512bb8619f7c78':
  rtpdec: Add const to string parameters in internal fmtp parsing functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 23:38:19 +01:00
Michael Niedermayer 3804d73e46 Merge commit '5d8cae45737bed6239bd6b6e0698802dbe1463c8'
* commit '5d8cae45737bed6239bd6b6e0698802dbe1463c8':
  rtpdec: Get rid of all trivial .alloc/.free functions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 22:55:20 +01:00
Michael Niedermayer 11fb625858 Merge commit '2b982e92f42a6e661d90b12b6592cd13cae496d4'
* commit '2b982e92f42a6e661d90b12b6592cd13cae496d4':
  rtpdec: Set need_parsing via a handler field

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 22:34:08 +01:00
Martin Storsjö d594dbecce rtpdec: Rename the free method to close
Many of these functions were named foo_free_context, and since
the functions no longer should free the context itself, only
allocated elements within it, the previous naming was slightly
misleading.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 23:07:50 +02:00
Martin Storsjö bb4a310bb8 rtpdec: Don't free the payload context in the .free function
This makes it more consistent with depacketizers that don't have any
.free function at all, where the payload context is freed by the
surrounding framework. Always free the context in the surrounding
framework, having the individual depacketizers only free any data
they've specifically allocated themselves.

This is similar to how this works for demuxer/muxers/codecs - a
component shouldn't free the priv_data that the framework has
allocated for it.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 23:07:35 +02:00
Martin Storsjö ec96a89c3e rtpdec: Don't pass non-const pointers to fmtp attribute parsing functions
This makes it clear that the individual parsing functions can't
touch the parsed out value.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 23:07:22 +02:00
Martin Storsjö ac0e54fda9 rtpdec: Add const to string parameters in internal fmtp parsing functions
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 23:07:18 +02:00
Michael Niedermayer 30c863fdfa Merge commit '3cd5828fc0007e6d056067444de053a34ddedd02'
* commit '3cd5828fc0007e6d056067444de053a34ddedd02':
  rtpdec: Add missing trailing commas

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-24 22:03:19 +01:00
Martin Storsjö 5d8cae4573 rtpdec: Get rid of all trivial .alloc/.free functions
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 16:24:19 +02:00
Martin Storsjö 2b982e92f4 rtpdec: Set need_parsing via a handler field
This avoids implementing a full function just to set this one
field.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 16:22:41 +02:00
Martin Storsjö 3cd5828fc0 rtpdec: Add missing trailing commas
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-24 16:20:02 +02:00
Michael Niedermayer 20f5a17956 Merge commit '44dc138ed29c4dfbaf57ebc774da4c75ef113ca4'
* commit '44dc138ed29c4dfbaf57ebc774da4c75ef113ca4':
  rtpdec_mpeg4: reassemble fragmented AAC frames

Conflicts:
	libavformat/rtpdec_mpeg4.c

See: fee2cc39be
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-22 01:59:44 +01:00
Gilles Chanteperdrix fee2cc39be avformat/rtpdec_mpeg4: reassemble fragmented AAC frames
Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Reviewed-by: Thomas Volkert <silvo@gmx.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-22 00:56:18 +01:00
Gilles Chanteperdrix 44dc138ed2 rtpdec_mpeg4: reassemble fragmented AAC frames
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-21 23:38:07 +02:00
Gilles Chanteperdrix dcf969e98d rtpdec_mpeg4: add more verbose error logging
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-21 23:37:58 +02:00
Michael Niedermayer a0fe1a25fa Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'
* commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e':
  avformat: Don't anonymously typedef structs

Conflicts:
	libavformat/adtsenc.c
	libavformat/aiffenc.c
	libavformat/avidec.c
	libavformat/gif.c
	libavformat/iff.c
	libavformat/img2dec.c
	libavformat/jvdec.c
	libavformat/matroskadec.c
	libavformat/udp.c
	libavformat/wtvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-14 21:07:40 +01:00
Diego Biurrun daf8cf358a avformat: Don't anonymously typedef structs 2015-02-14 10:13:47 -08:00
Michael Niedermayer 3f56224a9a avformat/rtpdec_mpeg4: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-24 13:14:07 +01:00
Michael Niedermayer 0051e3c233 avformat/rtpdec_mpeg4: Use av_freep() to avoid leaving stale extradata pointer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-15 15:48:35 +01:00
Michael Niedermayer 19b9e07ef5 Merge commit '0307cc2253e76772b1c645ac6117d08da87a147c'
* commit '0307cc2253e76772b1c645ac6117d08da87a147c':
  rtpdec: pass an AVFormatContext to ff_parse_fmtp()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-09 23:40:13 +02:00
Anton Khirnov 0307cc2253 rtpdec: pass an AVFormatContext to ff_parse_fmtp()
Use it for logging, instead of NULL or the stream codec context.
2014-07-09 13:40:54 +00:00
Paul B Mahol a807c68253 avformat: use ff_alloc_extradata()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-10-13 20:13:38 +00:00
Michael Niedermayer 5c2ccf83df Merge commit '7abd35a1ffaecfd79fa07b801621ee11ab595c43'
* commit '7abd35a1ffaecfd79fa07b801621ee11ab595c43':
  avformat: Add av_cold attributes to init functions missing them

Conflicts:
	libavformat/rtpdec_xiph.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-06 10:19:56 +02:00
Diego Biurrun 7abd35a1ff avformat: Add av_cold attributes to init functions missing them 2013-05-05 18:33:04 +02:00
Michael Niedermayer 0a5da9cc14 Merge commit 'c6f1dc8e4cd967ae056698eafb891a08003c211c'
* commit 'c6f1dc8e4cd967ae056698eafb891a08003c211c':
  rtpdec: Move setting the parsing flags to the actual depacketizers
  rtpdec: Split handling of mpeg12 audio/video to a separate depacketizer

Conflicts:
	libavformat/rtpdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 14:02:01 +01:00
Michael Niedermayer c3f3c22563 Merge commit 'a717f9904227d7979473bad40c50eb40af41d01d'
* commit 'a717f9904227d7979473bad40c50eb40af41d01d':
  mpegts: Share the cleanup code between the demuxer and lavf-internal parser functions
  rtpdec_mpeg4: Return one AAC AU per AVPacket
  ppc: Include string.h for memset

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 13:45:36 +01:00
Martin Storsjö c6f1dc8e4c rtpdec: Move setting the parsing flags to the actual depacketizers
This gets rid of almost all the codec specific details from the
generic rtpdec code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:20:42 +02:00
Martin Storsjö 21f5c24b80 rtpdec_mpeg4: Return one AAC AU per AVPacket
This makes the returned data valid to stream copy into other
containers as well, not only for decoding straight away.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:12:38 +02:00
Michael Niedermayer 5c7e9e16c9 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavc: Move vector_fmul_window to AVFloatDSPContext
  rtpdec_mpeg4: Check the remaining amount of data before reading

Conflicts:
	libavcodec/dsputil.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-16 12:38:41 +01:00
Michael Niedermayer 1459f34251 Merge commit '977d4a3b8a2dbc2fb5e747c7072485016c9cdfaa'
* commit '977d4a3b8a2dbc2fb5e747c7072485016c9cdfaa':
  rtpdec_mpeg4: Check the return value from malloc
  srtp: Mark a few variables as uninitialized

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-16 12:13:16 +01:00
Martin Storsjö a7ba324413 rtpdec_mpeg4: Check the remaining amount of data before reading
This fixes possible buffer overreads.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-16 11:12:39 +02:00
Martin Storsjö 977d4a3b8a rtpdec_mpeg4: Check the return value from malloc
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-15 23:18:33 +02:00
Michael Niedermayer bb3420d88e Merge commit '90c784cc13f6bf21a8eb69f3b88b50c7a70f6c59'
* commit '90c784cc13f6bf21a8eb69f3b88b50c7a70f6c59':
  rtpdec: Pass the sequence number to depacketizers
  configure: Make avconv depend on null, anull and resample filters

Conflicts:
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-21 17:46:43 +01:00
Martin Storsjö 90c784cc13 rtpdec: Pass the sequence number to depacketizers
This allows depacketizers to figure out if packets have been lost.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-12-21 14:14:40 +02:00
Michael Niedermayer 2e5e2bf935 Merge commit 'f3f60dcbdd6ff2201526a603fe28293975bb7667'
* commit 'f3f60dcbdd6ff2201526a603fe28293975bb7667':
  rtpdec_mpeg4: Cosmetic cleanup
  rtpdec: Cosmetic cleanup of the header
  rtpdec: Get rid of a useless _s suffix on a struct name

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-13 12:18:12 +01:00
Martin Storsjö f3f60dcbdd rtpdec_mpeg4: Cosmetic cleanup
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-12-12 12:18:50 +02:00
Michael Niedermayer eadba3e94d Merge commit 'cbcd497f384f0f8ef3f76f85b29b644b900d6b9f'
* commit 'cbcd497f384f0f8ef3f76f85b29b644b900d6b9f':
  adxdec: use planar sample format
  adpcmdec: use planar sample format for adpcm_thp
  adpcmdec: use planar sample format for adpcm_ea_xas
  adpcmdec: use planar sample format for adpcm_ea_r1/r2/r3
  adpcmdec: use planar sample format for adpcm_xa
  adpcmdec: use planar sample format for adpcm_ima_ws for vqa version 3
  adpcmdec: use planar sample format for adpcm_4xm
  adpcmdec: use planar sample format for adpcm_ima_wav
  adpcmdec: use planar sample format for adpcm_ima_qt
  pcmdec: use planar sample format for pcm_lxf
  mace: use planar sample format
  atrac1: use planar sample format
  build: non-x86: Only compile mpegvideo optimizations when necessary
  rtpdec_mpeg4: au_headers is a single array, simple av_free is enough
  avcodec: free extended_data instead address of it
  fate: Add tests of the ff_make_absolute_url function
  url: Handle relative urls starting with two slashes
  url: Handle relative urls being just a new query string
  url: Don't treat slashes in query parameters as directory separators

Conflicts:
	libavcodec/adxdec.c
	libavcodec/mips/Makefile
	libavcodec/pcm.c
	libavcodec/utils.c
	libavformat/Makefile
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-10 13:01:27 +02:00
Janne Grunau 8dd0650fe6 rtpdec_mpeg4: au_headers is a single array, simple av_free is enough
Fixes CID700204.
2012-10-09 14:24:36 +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