Commit Graph

21 Commits

Author SHA1 Message Date
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