summaryrefslogtreecommitdiff
path: root/libavcodec/libopenh264dec.c
Commit message (Collapse)AuthorAge
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-18
| | | | | | | | | | | and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/openh264: return (DE|EN)CODER_NOT_FOUND if version check failsAndreas Schneider2022-07-08
| | | | | | | | A cosmetic change only, it basically just changes the user facing error message to clients that interpret the errors to something that makes sense. Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-05
| | | | | | | | | | | This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Make FFCodec.decode use AVFrame*Andreas Rheinhardt2022-04-05
| | | | | | | | This increases type-safety by avoiding conversions from/through void*. It also avoids the boilerplate "AVFrame *frame = data;" line for non-subtitle decoders. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-21
| | | | | | | | | | | | | | | | Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-21
| | | | | | | | | | Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libopenh264dec: Increase array sizes, fix stack-buffer overreadAndreas Rheinhardt2021-12-06
| | | | | | | | | | | | | | | av_image_copy() expects an array of four pointers and linesizes according to its declaration; it currently only pointers that are actually in use (depending upon the pixel format), but this might change at any time. It has already happened for the linesizes in d7bc52bf456deba0f32d9fe5c288ec441f1ebef5 and so increasing their array fixes a stack-buffer overread. This fixes a -Wstringop-overflow= and -Wstringop-overread warning from GCC 11.2. Reviewed-by: Linjie Fu <linjie.justin.fu@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | 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>
* avutil/frame: Remove deprecated AVFrame.pkt_pts fieldAndreas Rheinhardt2021-04-27
| | | | | | | Deprecated in 32c8359093d1ff4f45ed19518b449b3ac3769d27. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* Merge commit 'eec93e57096aa4804862d62760442380c70d489b'James Almer2019-02-20
|\ | | | | | | | | | | | | * commit 'eec93e57096aa4804862d62760442380c70d489b': libopenh264dec: Use a newer decoding entry point function Merged-by: James Almer <jamrial@gmail.com>
| * libopenh264dec: Use a newer decoding entry point functionMartin Storsjö2019-01-26
| | | | | | | | | | | | | | | | | | | | | | The "new" entry point actually has existed since OpenH264 1.4 in 2015 and is the the recommended decoding entry point. The name of this function, DecodeFrameNoDelay, is rather backwards considering that it doesn't return the latest decoded frame immediately, but actually does proper delaying and reordering of frames. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '83678dbbae64ad8c501e0c732c1117e642c25dae'James Almer2018-09-11
|\| | | | | | | | | | | | | * commit '83678dbbae64ad8c501e0c732c1117e642c25dae': libopenh264dec: Export the decoded profile and level in AVCodecContext Merged-by: James Almer <jamrial@gmail.com>
| * libopenh264dec: Export the decoded profile and level in AVCodecContextMartin Storsjö2018-08-31
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'e1e3a12242347dd11174b2fb9ddac8dc8df16224'James Almer2018-09-02
|\| | | | | | | | | | | | | * commit 'e1e3a12242347dd11174b2fb9ddac8dc8df16224': libopenh264: Add support for decoding of b-frames Merged-by: James Almer <jamrial@gmail.com>
| * libopenh264: Add support for decoding of b-framesMartin Storsjö2018-08-01
| | | | | | | | | | | | | | The current git master version of libopenh264 supports decoding of b-frames. Signed-off-by: Martin Storsjö <martin@martin.st>
| * avcodec: add metadata to identify wrappers and hardware decoderswm42017-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avcodec: add metadata to identify wrappers and hardware decoderswm42017-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 47687a2f8aca3f65b6fdd117b1cb66a7409a7fd1.
* | avcodec/libopenh264dec: check for ff_set_dimensions() return valueJames Almer2017-09-28
| | | | | | | | | | | | Was removed by accident in e9b6212de29a966f200833220ed35f51852f05f6. Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '030de53e9cc225dc767458aedcc87efd457b4f3b'James Almer2017-09-28
|\| | | | | | | | | | | | | * commit '030de53e9cc225dc767458aedcc87efd457b4f3b': libopenh264dec: Let the framework use the h264_mp4toannexb bitstream filter Merged-by: James Almer <jamrial@gmail.com>
| * libopenh264dec: Let the framework use the h264_mp4toannexb bitstream filterMartin Storsjö2017-02-15
| | | | | | | | | | | | This avoids a lot of boilerplate code within the decoder wrapper itself. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avcodec/libopenh264dec: fix return error value when h264_mp4toannexb_bsf is ↵James Almer2017-05-24
| | | | | | | | not found
* | Merge commit '36b380dcd52ef47d7ba0559ed51192c88d82a9bd'Hendrik Leppkes2016-11-18
|\| | | | | | | | | | | | | * commit '36b380dcd52ef47d7ba0559ed51192c88d82a9bd': libopenh264dec: Simplify the init thanks to FF_CODEC_CAP_INIT_CLEANUP being set Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * libopenh264dec: Simplify the init thanks to FF_CODEC_CAP_INIT_CLEANUP being setMartin Storsjö2016-07-15
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
| * libopenh264dec: Fix cleanup if the init failed earlyMartin Storsjö2016-07-15
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
| * libopenh264: Support building with the 1.6 releaseMartin Storsjö2016-07-09
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
| * Add an OpenH264 decoder wrapperMartin Storsjö2016-06-28
| | | | | | | | While it is less featureful (and slower) than the built-in H264 decoder, one could potentially want to use it to take advantage of the cisco patent license offer. Signed-off-by: Martin Storsjö <martin@martin.st>
* Merge commit '32c8359093d1ff4f45ed19518b449b3ac3769d27'Hendrik Leppkes2016-10-07
| | | | | | | * commit '32c8359093d1ff4f45ed19518b449b3ac3769d27': lavc: export the timestamps when decoding in AVFrame.pts Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* libopenh264: Support building with the 1.6 releaseMartin Storsjö2016-07-27
| | | | | | | | | This fixes trac issue #5417. This is cherry-picked from libav commit d825b1a5306576dcd0553b7d0d24a3a46ad92864. Signed-off-by: Martin Storsjö <martin@martin.st>
* Add an OpenH264 decoder wrapperMartin Storsjö2016-07-27
This is cherrypicked from libav, from commits 82b7525173f20702a8cbc26ebedbf4b69b8fecec and d0b1e6049b06eeeeca146ece4d2f199c5dba1565. Signed-off-by: Martin Storsjö <martin@martin.st>