summaryrefslogtreecommitdiff
path: root/libavcodec/mmaldec.c
Commit message (Collapse)AuthorAge
* All: update names in copyright headersrcombs2021-01-20
|
* lavc: Mark hw_config pointer arrays as constMark Thompson2020-11-08
| | | | They are read-only just like the HWConfig structures they point to.
* avcodec/decode: move the ff_decode_frame_props() prototype to the proper headerJames Almer2020-08-20
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavc: Rename hwaccel.h to hwconfig.hMark Thompson2020-04-26
| | | | | This already applied to decoders as well as hwaccels, and adding encoder support was going to make the name even more inaccurate.
* 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.
* lavc: Delete all fake hwaccelsMark Thompson2017-11-26
| | | | They are now unused.
* lavc: Add hardware config metadata for decoders supporting hardware outputMark Thompson2017-11-26
| | | | | | | | | This includes a pointer to the associated hwaccel for decoders using hwaccels - these will be used later to implement the hwaccel setup without needing a global list. Also added is a new file listing all hwaccels as external declarations - this will be used later to generate the hwaccel list at configure time.
* Merge commit '04f691cd4fb7d226e54df886a21ba201cb5019f4'James Almer2017-11-01
|\ | | | | | | | | | | | | * commit '04f691cd4fb7d226e54df886a21ba201cb5019f4': mmal: Add missing .item_name to AVClass declaration Merged-by: James Almer <jamrial@gmail.com>
| * mmal: Add missing .item_name to AVClass declarationDiego Biurrun2017-06-13
| |
* | Merge commit 'd82d5379caca21005d8906829b35361c4a65408e'Clément Bœsch2017-04-08
|\| | | | | | | | | | | | | * commit 'd82d5379caca21005d8906829b35361c4a65408e': mmaldec: initialize refcount using atomic_init() Merged-by: Clément Bœsch <u@pkh.me>
| * mmaldec: initialize refcount using atomic_init()Wan-Teh Chang2016-12-02
| | | | | | | | | | | | | | This is how we initialize refcount in libavutil/buffer.c. Signed-off-by: Wan-Teh Chang <wtc@google.com> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | lavc: fix usages of av_get_codec_tag_string()Clément Bœsch2017-03-29
| |
* | Merge commit '8385ba53f115401a67a4748c0d107769ebfb2941'Clément Bœsch2017-03-22
|\| | | | | | | | | | | | | * commit '8385ba53f115401a67a4748c0d107769ebfb2941': mmaldec: convert to stdatomic Merged-by: Clément Bœsch <u@pkh.me>
| * mmaldec: convert to stdatomicAnton Khirnov2016-10-02
| |
* | 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>
| * lavc: export the timestamps when decoding in AVFrame.ptsAnton Khirnov2016-06-21
| | | | | | | | | | | | | | | | | | | | | | Currently it's exported as AVFrame.pkt_pts, which is also the only use for that field. The reason it is done like this is that lavc used to export various codec-specific "timing" information in AVFrame.pts, which is not done anymore. Since it is confusing to the callers to have a separate field which is used only for decoder timestamps and nothing else, deprecate pkt_pts and use just AVFrame.pts everywhere.
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | libavcodec/mmaldec.c: set AVFrame interlaced_frame and top_field_first, ↵Jens Ziller2016-09-12
| | | | | | | | | | | | AVCodecContext framerate Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/mmaldec: reduce some diffs with Libav missed in previous skipped mergesClément Bœsch2016-06-21
| |
* | Merge commit '74beead9bd596180bcac6108548fc0a86d8eb4ae'Clément Bœsch2016-06-21
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '74beead9bd596180bcac6108548fc0a86d8eb4ae': mmaldec: limit internal buffering See 14a90c9ef09a4b046500dceab5ca1875e330a376 The introduction of the MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS check is merged. Merged-by: Clément Bœsch <clement@stupeflix.com>
| * mmaldec: limit internal bufferingwm42016-04-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses a new MMAL feature, which limits the number of extra frames that can be buffered within the decoder. VIDEO_MAX_NUM_CALLBACKS can be defined as positive or negative number. Positive numbers are absolute, and can lead to deadlocks if the user underestimates the number of required buffers. Negative numbers specify the number of extra buffers, e.g. -1 means no extra buffer, (-1-N) means N extra buffers. Set a gratuitous default of -11 (N=10). This is much lower than the firmware default, which appears to be 96. This is backwards compatible, but needs a symbol only present in newer firmware headers. (It's an enum item, so it requires a check in configure.) Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * mmaldec: print the MMAL format FourCC automaticallywm42016-04-30
| | | | | | | | | | | | | | Slight simplification. The result is the same. Also, change the wording of the message as requested in patch review. Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * mmaldec: send only a single EOS packet on flushingwm42016-04-30
| | | | | | | | | | | | | | | | Fixes apparent mmal_port_disable() freezes in ffmmal_stop_decoder() when calling ffmmal_decode() with flush semantics a large number of times in a row. Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * mmaldec: correct package buffering accountingwm42016-04-30
| | | | | | | | | | | | | | | | | | | | | | The assert in ffmmal_stop_decoder() could trigger sometimes. The packets_buffered counter was indeed not correctly maintained, and packets were not subtracted from it if they were still in the waiting queue. For some reason, this happened especially with VC-1. Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * mmaldec: add vc1 decoding supportwm42016-04-30
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * mmaldec: Add mpeg2 decoding supportJulian Scheel2016-04-30
| | | | | | | | | | | | | | | | | | | | | | Register mmaldec as mpeg2 decoder. Supporting mpeg2 in mmaldec is just a matter of setting the correct MMAL_ENCODING on the input port. To ease the addition of further supported mmal codecs a macro is introduced to generate the decoder and decoder class structs. Signed-off-by: Julian Scheel <julian@jusst.de> Signed-off-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * mmaldec: Fix avpriv_atomic_get usageJulian Scheel2016-04-30
| | | | | | | | | | | | | | | | | | There is no avpriv_atomic_get, instead avpriv_atomic_int_get is to be used for integers. This fixes building mmaldec. Signed-off-by: Julian Scheel <julian@jusst.de> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * mmaldec: Use av_assert0() instead of assert()Michael Niedermayer2016-04-30
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit 'b8e899f4bf5f09900aa71552112d32a5566b6baf'Derek Buitenhuis2016-05-11
|\| | | | | | | | | | | | | * commit 'b8e899f4bf5f09900aa71552112d32a5566b6baf': mmaldec: Use imgutils.h for copying frames Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * mmaldec: Use imgutils.h for copying framesMartin Storsjö2016-04-12
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | mmaldec: limit internal bufferingwm42016-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses a new MMAL feature, which limits the number of extra frames that can be buffered within the decoder. VIDEO_MAX_NUM_CALLBACKS can be defined as positive or negative number. Positive numbers are absolute, and can lead to deadlocks if the user underestimates the number of required buffers. Negative numbers specify the number of extra buffers, e.g. -1 means no extra buffer, (-1-N) means N extra buffers. Set a gratuitous default of -11 (N=10). This is much lower than the firmware default, which appears to be 96. This is backwards compatible, but needs a symbol only present in newer firmware headers. (It's an enum item, so it requires a check in configure.)
* | mmaldec: support MPEG-4wm42016-01-28
| | | | | | | | | | I guess this means part 2 in both cases. Not sure which profiles exactly are actually supported properly.
* | mmaldec: print the MMAL format FourCC automaticallywm42016-01-28
| | | | | | | | | | Slight simplification. The result is the same. Also, change the wording of the message as requested in patch review.
* | mmaldec: send only a single EOS packet on flushingwm42015-11-10
| | | | | | | | | | | | Fixes apparent mmal_port_disable() freezes in ffmmal_stop_decoder() when calling ffmmal_decode() with flush semantics a large number of times in a row.
* | mmaldec: correct package buffering accountingwm42015-11-07
| | | | | | | | | | | | | | | | | | The assert in ffmmal_stop_decoder() could trigger sometimes. The packets_buffered counter was indeed not correctly maintained, and packets were not subtracted from it if they were still in the waiting queue. For some reason, this happened especially with VC-1.
* | mmaldec: add vc1 decoding supportwm42015-11-07
| |
* | mmaldec: Add mpeg2 decoding supportJulian Scheel2015-10-22
| | | | | | | | | | | | | | | | | | | | Register mmaldec as mpeg2 decoder. Supporting mpeg2 in mmaldec is just a matter of setting the correct MMAL_ENCODING on the input port. To ease the addition of further supported mmal codecs a macro is introduced to generate the decoder and decoder class structs. Signed-off-by: Julian Scheel <julian@jusst.de> Signed-off-by: wm4 <nfxjfg@googlemail.com>
* | mmaldec: Fix avpriv_atomic_get usageJulian Scheel2015-10-21
| | | | | | | | | | | | | | | | | | There is no avpriv_atomic_get, instead avpriv_atomic_int_get is to be used for integers. This fixes building mmaldec. Signed-off-by: Julian Scheel <julian@jusst.de> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mmaldec: Use av_assert0() instead of assert()Michael Niedermayer2015-10-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '39f01e346cab464ef6c0d4ec58cc13b7123e60d8'Hendrik Leppkes2015-10-05
|\| | | | | | | | | | | | | * commit '39f01e346cab464ef6c0d4ec58cc13b7123e60d8': mmaldec: be more tolerant against MMAL not returning decoded output Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mmaldec: be more tolerant against MMAL not returning decoded outputwm42015-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some situations, MMAL won't return a decoded frame for certain input frames. This can happen if a frame fails to decode, or if a packet does not actually contain a complete frame. In these situations, we would deadlock (or actually timeout) waiting for an expected output frame, which is not ideal. On the other hand, there are situations where we definitely have to block to avoid deadlocks. (This mess is a consequence of trying to map MMAL's asynchronous and flexible dataflow to libavcodec, which is more static and rigid.) Solve this by doing a blocking wait only if the amount of buffered data is too big. The whole purpose of the blocking wait is to avoid excessive buffering of input data, so we can skip it if it appears to be low. The consequence is that libavcodec can gracefully return no frame to the API user. We want to track the number of full packets to make our heuristic work. But MMAL buffers are fixed-size, requiring splitting large packets. This is why the previous commit is needed. We use the ..._FRAME_END flag to remember packet boundaries, but MMAL does not preserve these buffer flags when returning buffers to the user. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '65db4899fa8790049bec3af16ecdb75dd81051fd'Hendrik Leppkes2015-10-05
|\| | | | | | | | | | | | | * commit '65db4899fa8790049bec3af16ecdb75dd81051fd': mmaldec: refactor to have more context per MMAL input buffer Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mmaldec: refactor to have more context per MMAL input bufferwm42015-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The next commit needs 1 bit of additional information per MMAL buffer sent to the MMAL input port. This information will be needed when the buffer is recycled (i.e. returned by the input port's callback). Normally, we could use MMAL_BUFFER_HEADER_FLAG_USER0, but that is unexpectedly not preserved. Do this by storing a pointer to FFBufferEntry in the MMAL buffer's user data, instead of an AVBufferRef. This also changes the lifetime of FFBufferEntry. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'a9b8c638cfe2f82191db65e3e3a39f3b35df81f5'Hendrik Leppkes2015-09-26
|\| | | | | | | | | | | | | * commit 'a9b8c638cfe2f82191db65e3e3a39f3b35df81f5': mmal: Fix AVBufferRef usage Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mmal: Fix AVBufferRef usagewm42015-09-24
| | | | | | | | | | | | | | | | AVBufferRef.data and AVPacket.data don't need to have the same value. AVPacket could point anywhere into the buffer. Likewise, the sizes don't need to be the same. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '49623f531972be5dc2dd8c1b4b8748cad7c424ff'Hendrik Leppkes2015-09-26
|\| | | | | | | | | | | | | * commit '49623f531972be5dc2dd8c1b4b8748cad7c424ff': mmal: Remove setting extradata on input format Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mmal: Remove setting extradata on input formatwm42015-09-24
| | | | | | | | | | | | | | | | This works only for extradata sizes up to 128 bytes. Additionally, I could never actually see it doing anything. The new code using MMAL_BUFFER_HEADER_FLAG_CONFIG now takes care of this. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'f290e48d86e10f34b5ddc519127636bcebec7c43'Hendrik Leppkes2015-09-26
|\| | | | | | | | | | | | | * commit 'f290e48d86e10f34b5ddc519127636bcebec7c43': mmal: drop the h264 BSF Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mmal: drop the h264 BSFwm42015-09-24
| | | | | | | | | | | | | | | | We can send mp4-style data directly. But for some reason, this requires sending the extradata as buffer with MMAL_BUFFER_HEADER_FLAG_CONFIG set. Reuse the infrastructure for sending AVPackets to do this. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '99404597201911de90cff2ef85f2d44176d39147'Hendrik Leppkes2015-09-12
|\| | | | | | | | | | | | | * commit '99404597201911de90cff2ef85f2d44176d39147': mmaldec: fix pkt_dts determination Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>