Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-19lavc/videotoolbox: deprecate write-only output_callbackAnton Khirnov
This field has never been used for anything, so stop setting it and deprecate it.
2022-09-19lavc/videotoolbox: do not pass AVCodecContext to decoder output callbackAnton Khirnov
The opaque parameter for the callback is set in videotoolbox_start(), called when the hwaccel is initialized. When frame threading is used, avctx will be the context corresponding to the frame thread currently doing the decoding. Using this same codec context in all subsequent invocations of the decoder callback (even those triggered by a different frame thread) is unsafe, and broken after cc867f2c09d2b69cee8a0eccd62aff002cbbfe11, since each frame thread now cleans up its hwaccel state after decoding each frame. Fix this by passing hwaccel_priv_data as the opaque parameter, which exists in a single instance forwarded between all frame threads. The only other use of AVCodecContext in the decoder output callback is as a logging context. For this purpose, store a logging context in hwaccel_priv_data.
2022-06-02lavc/videotoolboxdec: insert emu-prevention bytes for HEVC as wellrcombs
Fixes decoding of files with sync-fooling sequences in their PSs. Signed-off-by: rcombs <rcombs@rcombs.me>
2022-06-02lavc/videotoolboxdec: fix writing too many 1 bits for the reserved fieldsrcombs
Signed-off-by: rcombs <rcombs@rcombs.me>
2022-06-02lavc/videotoolboxdec: fix generating HEVC general_profile_compatibility_flagsrcombs
We store this as an array of bools, not a bitfield. Signed-off-by: rcombs <rcombs@rcombs.me>
2022-06-02lavc/videotoolboxdec: fix escaping sequential zero sequencesrcombs
This ensure that e.g. 0000000000 becomes 00000300 000300, rather than 00000300 0000. Signed-off-by: rcombs <rcombs@rcombs.me>
2022-06-02lavc/videotoolboxdec: warn on nonzero status in the callbackrcombs
Signed-off-by: rcombs <rcombs@rcombs.me>
2022-03-16configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö
This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
2022-02-14avcodec/videotoolbox: add internal.h for header depenedencyLimin Wang
Fixes build failures for videotoolbox Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-05avcodec/videotoolbox: Fix undefined symbol with minimal configurationLimin Wang
Please reproduced with the following minimal configure command: ./configure --enable-shared --disable-all --enable-avcodec --enable-decoder=h264 --enable-hwaccel=h264_videotoolbox You'll get below error: Undefined symbols for architecture x86_64: "_ff_videotoolbox_vpcc_extradata_create", referenced from: _videotoolbox_start in videotoolbox.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Reported-by: Cameron Gutman <aicommander@gmail.com> Tested-by: Cameron Gutman <aicommander@gmail.com> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-12-23lavc/videotoolbox: set attachments on decoded buffersrcombs
VideoToolbox internally sets all the colorspace parameters to BT709, regardless of what the bitstream actually indicates, so we need to replace that with what we've parsed.
2021-12-04avcodec/videotoolbox: fix use of unknown builtin '__builtin_available'Limin Wang
Old system is: OSX version: 10.11.6 Apple LLVM version 8.0.0 (clang-800.0.42.1) Target: x86_64-apple-darwin15.6.0 Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-11-29avcodec/videotoolbox: silence some -Wimplicit-fallthrough warningsJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2021-11-29lavc/videotoolbox: fix build on pre-10.14 SDKsrcombs
Also fixes handling of future codec tags (needed to bswap)
2021-11-29lavc/proresdec: add videotoolbox hwaccelrcombs
2021-11-29videotoolbox: add alpha supportrcombs
2021-11-29lavc/videotoolbox: add VP9 hardware accelerationrcombs
On M1 Max, this supports profiles 0 and 2, but not 1 and 3.
2021-11-29lavc/videotoolbox: call VTRegisterSupplementalVideoDecoderIfAvailablercombs
This is required for VP9 to work.
2021-11-29lavc/videotoolbox: expose some functions as lavc-internalrcombs
2021-11-29lavc/videotoolbox: select 4:2:2 and 4:4:4 formats when applicablercombs
2021-11-29lavc/videotoolbox: fix format computationrcombs
Use sw_pix_fmt instead of pix_fmt (consistent with other hwaccels)
2021-11-29lavc/videotoolbox: escape 0x00000[0-3]s in avcC PSsrcombs
2021-01-02avcodec/videotoolbox: make FFmpeg-to-VT mapping error more informativeJan Ekström
Now logs the actual failed-to-map pixel format as well as range.
2019-10-08avcodec/videotoolbox: add logging context to logSteven Liu
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-09-15lavc/videotoolboxdec: fix crop handling when multithreadedRodger Combs
This was partially fixed by 233cd89, but it made changes to AVFrame fields from within end_frame, which doesn't work consistently when multithreading is enabled. This is what the post_process function is for. Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-09-04avcodec/videotoolbox: add support for full range pixel formatsAkemi
Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-08-24avcodec/videotoolbox_hevc: avoid leaking cached_hw_frames_ctxPavel Koshevoy
vtctx->cached_hw_frames_ctx is unref'd in videotoolbox_uninit, but videotoolbox_hevc used ff_videotoolbox_uninit which doesn't unref cache_hw_frames_ctx. Signed-off-by: Pavel Koshevoy <pkoshevoy@gmail.com>
2019-04-16avcodec/videotoolbox: add support for 10bit pixel formatfumoboy007
this patch was originally posted on issue #7704 and was slightly adjusted to check for the availability of the pixel format.
2019-03-20avcodec/vt_hevc: fix crash if vps_list[0] or sps_list[0] are nullRodger Combs
Instead of assuming id 0 is used, use the same logic as used for PPS, where all available entries in the list are emitted. Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-11-12lavc/videotoolbox: Fix cropping with HEVC and H264 videosAkemi
videotoolbox returns an already cropped stream which led to double cropping. this issue was introduced with the refactor of the cropping mechanism in commit 07596e4 for h264 and 000fb61 for HEVC. to fix this we set the cropping of the frame and the output frame to 0. Tested-by: ponpon Fixes ticket #7544.
2018-05-18avcodec/videotoolbox: fix decoding of some HEVC videosAman Gupta
In a normal hwaccel, the AVHWFramesContext sets AVFrame.hw_frames_ctx when it initializes a new AVFrame in av_hwframe_get_buffer(). But the VT hwaccel doesn't know what hw_frames_ctx to assign when the AVFrame is first created, because it depends on the format of the pixbuf that the decoder eventually decides to return. Thus newly created AVFrames always have a NULL hw_frames_ctx, and the hwaccel would only assign the ctx once a frame was done decoding. This worked fine with the H264 decoder, but with the HEVC decoder the frame's data may be moved to another empty AVFrame. Since the empty AVFrame never had hw_frames_ctx set, a frame with a NULL ctx could be returned to the API user. This patch works around the issue by moving the derived hw_frames_ctx from the AVFrame to a new VTHWFrame which now holds both the CVPixelBufferRef and the AVBuffer. The hw_frames_ctx is only copied to the AVFrame right before it is about to be returned to the user in videotoolbox_postproc_frame() (since in the case of VT, the hw_frames_ctx is only there for the API user anyway). Fixes playback on macOS and iOS of some hevc videos like https://s3.amazonaws.com/tmm1/videotoolbox/germany-hevc-zdf.ts Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-05-09avcodec/videotoolbox: split h264/hevc callbacksAman Gupta
Previously the shared callbacks were trying to interpret avctx->priv_data as H264Context* Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-05-09avcodec/videotoolbox: cleanupsAman Gupta
No functional changes. Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-05-05avcodec/videotoolbox: fix kVTCouldNotFindVideoDecoderErr trying to decode ↵Aman Gupta
HEVC on iOS Older iOS devices don't have a hardware HEVC decoder, but the software decoder offered by VideoToolbox is well-optimized and performs much better than the ffmpeg decoder. Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-05-05avcodec/videotoolbox: improve logging of decoder errorsAman Gupta
Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-04-10lavc/videotoolbox: fix failure to decode PAFFRodger Combs
Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-03-09lavc/videotoolbox: fix threaded decodingRodger Combs
AVHWAccel.end_frame can run on a worker thread. The assumption of the frame threading code is that the worker thread will change the AVFrame image data, not the AVFrame fields. So the AVFrame fields are not synced back to the main thread. But this breaks videotoolbox due to its special requirements (everything else is fine). It actually wants to update AVFrame fields. The actual videotoolbox frame is now stored in the dummy AVBufferRef, so it mimics what happens in non-videotoolbox cases. (Changing the AVBufferRef contents is a bit like changing the image data.) The post_process callback copies that reference to the proper AVFrame field. Based on a patch by wm4. Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-11-28avcodec/videotoolbox: fix SEGV when hwaccel decoding h264 with ffmpeg.cAman Gupta
Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-11-27lavc: Mark all AVHWAccel structures as constMark Thompson
2017-11-20libavcodec/videotoolbox: fix decoding of h264 streams with minor SPS changesAman Gupta
Previously the codec kept an entire copy of the SPS, and restarted the VT decoder session whenever it changed. This fixed decoding errors in [1], as described in 9519983c. On further inspection, that sample features an SPS change from High/4.0 to High/3.2 while moving from one scene to another. Yesterday I received [2], which contains minor SPS changes where the profile and level do not change. These occur frequently and are not associated with scene changes. After 9519983c, the VT decoder session is recreated unnecessarily when these are encountered causing visual glitches. This commit simplifies the state kept in the VTContext to include just the first three bytes of the SPS, containing the profile and level details. This is populated initially when the VT decoder session is created, and used to detect changes and force a restart. This means minor SPS changes are fed directly into the existing decoder, whereas profile/level changes force the decoder session to be recreated with the new parameters. After this commit, both samples [1] and [2] playback as expected. [1] https://s3.amazonaws.com/tmm1/videotoolbox/spschange.ts [2] https://s3.amazonaws.com/tmm1/videotoolbox/spschange2.ts Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-11-14avcodec/videotoolbox: fix opaque_ref handlingwm4
This is a partial fix - to fix videotoolbox fully (with multithreaded hwaccel decoding), much more work would be required. Before this change, an assertion failure would trigger: $ ffmpeg -hwaccel videotoolbox -hwaccel_output_format videotoolbox_vld -i h264.ts -f null -y /dev/null Assertion (frame->private_ref && frame->private_ref->size == sizeof(FrameDecodeData)) || !(avctx->codec->capabilities & (1 << 1)) failed at libavcodec/decode.c:620 Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-11-14avcodec/videotoolbox: reorder functions to avoid forward declarationsAman Gupta
Cosmetic change only. Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-11-14avcodec/videotoolbox: fix whitespaceAman Gupta
Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-11-14avcodec/videotoolbox: pass through hevc param changes to the decoderAman Gupta
This includes the SEI_PREFIX/SEI_SUFFIX NALUs, which can contain updates like HEVC_SEI_TYPE_ACTIVE_PARAMETER_SETS. Previously, hevc samples with this SEI present would not playback correctly. See for example https://github.com/lhc70000/iina/issues/1123 Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-11-14avcodec/videotoolbox: remove unnecessary if statementAman Gupta
Cosmetic change only. Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-11-14avcodec/videotoolbox: create avcC even when h264 extradata is missingAman Gupta
Removes the avctx->extradata_size requirement when creating avcC/hvcC, since avctx->extradata is only used in the esds code path. This fixes an issue where the VideoToolbox decoder would not work unless avformat_find_stream_info() was called. Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-11-14avcodec/videotoolbox: use decode_params to propagate H264 PPS changes and ↵Aman Gupta
restart on SPS changes This fixes decoding of H264 video samples with SPS and PPS changes. See for example https://s3.amazonaws.com/tmm1/videotoolbox/spschange.ts, which previously stalled the decoder and failed to produce any new frames after the SPS change. Also see https://s3.amazonaws.com/tmm1/videotoolbox/ppschange.ts, which uses multiple PPS and would previously cause VT decode failures. If the VideoToolbox session needs to be restarted, and videotoolbox_start() fails for some reason (for instance, if the video is interlaced and the decoder is running on iOS), avcodec will return AVERROR_EXTERNAL. This can be used by the API user to switch to another decoder. Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-11-14avcodec/videotoolbox: print descriptive errors on decode failuresAman Gupta
Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-11-14avcodec/videotoolbox: reset bitstream_size in end_frameAman Gupta
This allows decode_slice to be invoked multiple times before end_frame, causing slices to accumulate before being fed into the VT decoder. An upcoming commit will re-use decode_slice for parameter NALUs, so they can be propagated into the VT decoder session along with slice data. Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-11-14avcodec/videotoolbox: extract videotoolbox_{start,stop} helpersAman Gupta
These helpers will be used in later commits to automatically restart the decoder session when SPS changes are encountered. Signed-off-by: Aman Gupta <aman@tmm1.net>