Commit Graph

30 Commits

Author SHA1 Message Date
Andreas Rheinhardt 1be3d8a0cb avcodec/avcodec: Stop including channel_layout.h in avcodec.h
Also include channel_layout.h directly wherever used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 11:14:31 +02:00
Andreas Rheinhardt a247ac640d avcodec: Constify AVCodecs
Given that the AVCodec.next pointer has now been removed, most of the
AVCodecs are not modified at all any more and can therefore be made
const (as this patch does); the only exceptions are the very few codecs
for external libraries that have a init_static_data callback.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:15 -03:00
Andreas Rheinhardt ef6a9e5e31 avutil/buffer: Switch AVBuffer API to size_t
Announced in 14040a1d91.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt 6e30b35b85 avutil/frame: Remove deprecated AVFrame.pkt_pts field
Deprecated in 32c8359093.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
James Almer d8a18c8fc2 avcodec: use the buffer_size_t typedef where required
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:36 -03:00
Andreas Rheinhardt 74bffc00c5 avcodec: Constify some AVPackets
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-09 13:41:22 +01:00
rcombs eabf5e6d6b All: update names in copyright headers 2021-01-20 01:02:56 -06:00
Hendrik Leppkes 494f868e93 avcodec: set AV_CODEC_CAP_CHANNEL_CONF on decoders which set their own channels
The decoders in this set either have a fixed channel count, or read it
from the bitstream, and thus do not require the channel count as
external information.

Fixes various regressions since
81503ac58a, which requires a valid channel
count for decoders which do not set this capability.

Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
2020-12-10 13:28:35 +01:00
Andreas Rheinhardt c3cd6b765b avcodec, avformat: Remove unnecessary initializations of side data size
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-22 12:20:37 +02:00
wm4 b945fed629 avcodec: add metadata to identify wrappers and hardware decoders
Explicitly identify decoder/encoder wrappers with a common name. This
saves API users from guessing by the name suffix. For example, they
don't have to guess that "h264_qsv" is the h264 QSV implementation, and
instead they can just check the AVCodec .codec and .wrapper_name fields.

Explicitly mark AVCodec entries that are hardware decoders or most
likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing
API users listing hardware decoders in a more generic way. The proposed
AVCodecHWConfig does not provide this information fully, because it's
concerned with decoder configuration, not information about the fact
whether the hardware is used or not.

AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software
implementations in case the hardware is not capable.

Based on a patch by Philip Langdale <philipl@overt.org>.

Merges Libav commit 47687a2f8a.
2017-12-14 19:37:56 +01:00
James Almer 2d11218877 avcodec/audiotoolboxdec: fix ac3_parser header include 2017-10-27 19:41:38 -03:00
James Almer e0250cf365 Merge commit '50a1c66cf6ab7eb683daaa9e2da3869fa3a54609'
* commit '50a1c66cf6ab7eb683daaa9e2da3869fa3a54609':
  ac3_parser: add a public function for parsing the data required by the demuxer

avpriv_ac3_parse_header() is left in place but without the
GetBitContext parameter, as the mov muxer requires a lot more fields
than just bitstream_id and frame_size from the AC3HeaderInfo struct.

Merged-by: James Almer <jamrial@gmail.com>
2017-10-27 18:15:37 -03:00
James Almer f4e593f7b5 avcodec/audiotoolboxdec: use av_freep()
This prevents leaving dangling pointers.
2017-09-06 13:04:21 -03:00
James Almer 3242babf64 avcodec/audiotoolboxdec: switch to the new generic filtering mechanism
Tested-by: ubitux
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-06 12:54:27 -03:00
James Almer e49338a9c0 avcodec/audiotoolboxdec: add FF_CODEC_CAP_INIT_CLEANUP to the decoder capabilities
Extradata may be allocated and the AudioConverterRef may be created during init(),
which in case of a failure would not be freed as close() isn't called afterwards.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-06 11:35:14 -03:00
James Almer 7273e234de avcodec/audiotoolboxdec: always use a copy of the AVCodecContext extradata
Fixes memleaks introduced by 954e2b3d34

Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-06 11:35:07 -03:00
James Almer 954e2b3d34 avcodec/audiotoolboxdec: check packet side data for AAC extradata updates
Tested-by: rcombs
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-25 01:26:02 -03:00
Dmitry Kalinkin dc23e359ef lavc/audiotoolboxdec: fix OSX SDK detection
__MAC_10_11 can be present in updated revision of an older SDK so it
can't reliably detect availability of kAudioFormatEnhancedAC3 constant.

Fixes: b4daa2c40f ('lavc/audiotoolboxdec: add eac3 decoder')
Cc: Rodger Combs <rodger.combs@gmail.com>
Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Previous version reviewed by: Rodger Combs <rodger.combs@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-14 02:35:26 +01:00
Hendrik Leppkes 3f9137c57d Merge commit '32c8359093d1ff4f45ed19518b449b3ac3769d27'
* commit '32c8359093d1ff4f45ed19518b449b3ac3769d27':
  lavc: export the timestamps when decoding in AVFrame.pts

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-10-07 13:03:36 +02:00
Carl Eugen Hoyos dcdf69561f lavc/audiotoolboxdec: Forward extradata for QDMC and QDM2.
Fixes audiotoolbox decoding of QDMC and QDM2.
2016-06-20 12:23:59 +02:00
Rodger Combs e1c20485c1
lavc/audiotoolboxdec: move to new BSF API 2016-04-26 10:35:09 -05:00
Rodger Combs 95116bf35f
lavc/audiotoolboxdec: fix memory leak 2016-04-26 10:35:09 -05:00
Rodger Combs c890bcbacf
lavf/audiotoolboxdec: only provide block alignment for ILBC
Fixes decode errors for some AVI files
2016-04-13 03:27:29 -05:00
Rodger Combs c11157c09a
lavf/audiotoolboxdec: only send extradata for formats that use it
Fixes initialization errors for some AVI files
2016-04-13 03:27:29 -05:00
Rodger Combs acd5910e39
lavc/audiotoolboxdec: reindent 2016-04-13 03:27:29 -05:00
Rodger Combs b20d3bf4a4
lavc/audiotoolboxdec: avoid relying on consumer-provided params when possible 2016-04-13 03:27:29 -05:00
Rodger Combs b4daa2c40f lavc/audiotoolboxdec: add eac3 decoder
This is added in 10.11, so we add a #define when building against older SDKs.

The decoder actually supports 7.1-channel eac3, but since the parser only
reports 6 channels, we end up decoding the 5.1 downmix (same as the internal
decoder) for now.
2016-04-02 03:03:13 -05:00
Rodger Combs 1b9e90ee80 lavc/audiotoolboxdec: fix a number of config and timestamp issues
- ADTS-formatted AAC didn't work
- Channel layouts were never exported
- Channel mappings were incorrect beyond stereo
- Channel counts weren't updated after packets were decoded
- Timestamps were exported incorrectly
2016-04-02 03:03:13 -05:00
Rodger Combs 59a4492371 lavc/audiotoolboxdec: support ADTS AAC input 2016-04-02 03:03:13 -05:00
Rodger Combs d5d328059e lavc: add AudioToolbox decoders
Part of trac #4828
2016-03-22 12:43:14 -05:00