summaryrefslogtreecommitdiff
path: root/libavcodec/mfenc.c
Commit message (Collapse)AuthorAge
* 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: 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>
* mf: convert to new channel layout APIJames Almer2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mfenc: remove usage of avctx->pkt_timebaseJames Almer2021-08-06
| | | | | | The field is documented to be for decoding only. Signed-off-by: James Almer <jamrial@gmail.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>
* avcodec/mfenc: use AVCodecContext.get_encode_buffer()James Almer2021-03-17
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/encode: restructure the core encoding codeJames Almer2020-06-18
| | | | | | | | | | | | | | | | This commit follows the same logic as 061a0c14bb, but for the encode API: The new public encoding API will no longer be a wrapper around the old deprecated one, and the internal API used by the encoders now consists of a single receive_packet() callback that pulls frames as required. amf encoders adapted by James Almer librav1e encoder adapted by James Almer nvidia encoders adapted by James Almer MediaFoundation encoders adapted by James Almer vaapi encoders adapted by Linjie Fu v4l2_m2m encoders adapted by Andriy Gelman Signed-off-by: James Almer <jamrial@gmail.com>
* mfenc: Avoid including codecapi.h, fix building in UWP mode with clangMartin Storsjö2020-05-27
| | | | | | | | | | | | | Including codecapi.h and uuids.h in UWP mode doesn't define all defines properly, ending up with constructs that MSVC silently tolerates, but that clang errors out on, like this: DEFINE_GUIDEX(CODECAPI_AVEncCommonFormatConstraint); Just avoid including codecapi.h completely and hardcode the last few enum values we use from there. We already use local versions of most enums from there, due to older mingw-w64 headers being incomplete. Signed-off-by: Martin Storsjö <martin@martin.st>
* mfenc: Remove an unused includeMartin Storsjö2020-05-27
| | | | | | | This might have been used originally for the decoder parts of the MediaFoundation wrapper, which aren't merged yet. Signed-off-by: Martin Storsjö <martin@martin.st>
* mfenc: Fall back to avctx->time_base if avctx->framerate isn't setMartin Storsjö2020-05-22
| | | | | | | | The framerate field is the one users are supposed to set, but not all users might be setting it, so it might be good to fall back time_base in that case. Signed-off-by: Martin Storsjö <martin@martin.st>
* mfenc: Fix setting has_b_frames for max_b_frames == 1Martin Storsjö2020-05-22
| | | | | | | This was a mistake in my own additions in 050b72ab5ef318605b305aa6cb920e8b52f1002e. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec: Add MediaFoundation encoder wrapperwm42020-05-19
This contains encoder wrappers for H264, HEVC, AAC, AC3 and MP3. This is based on top of an original patch by wm4 <nfxjfg@googlemail.com>. The original patch supported both encoding and decoding, but this patch only includes encoding. The patch contains further changes by Paweł Wegner <pawel.wegner95@gmail.com> (primarily for splitting out the encoding parts of the original patch) and further cleanup, build compatibility fixes and tweaks for use with Qualcomm encoders by Martin Storsjö. Signed-off-by: Martin Storsjö <martin@martin.st>