summaryrefslogtreecommitdiff
path: root/libavcodec/videotoolboxenc.c
Commit message (Collapse)AuthorAge
* lavc/videotoolboxenc: Fix compilation on osx 10.10.5 YosemiteThilo Borgmann2018-08-14
| | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/videotoolboxenc: fix undefined behavior with rc_max_rate=0Thomas Guillem2018-07-19
| | | | | | | | | | | On macOS, a zero rc_max_rate cause an error from VTSessionSetProperty(kVTCompressionPropertyKey_DataRateLimits). on iOS (depending on device/version), a zero rc_max_rate cause invalid arguments from the vtenc_output_callback after few frames and then a crash within the VideoToolbox library. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/videotoolboxenc: fix invalid session on iOSThomas Guillem2018-06-18
| | | | | | | Cf. comment. Restart the VT session when the APP goes from foreground to background and vice versa. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/videotoolboxenc: split initializationThomas Guillem2018-06-18
| | | | | | | | | Split vtenc_init() into vtenc_init() (VTEncContext initialization) and vtenc_configure_encoder() (creates the vt session). This commit will allow to restart the vt session while encoding. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/videotoolboxenc: fix mutex/cond leak in error pathThomas Guillem2018-06-18
| | | | | | The leak could happen when the vtenc_create_encoder() function failed. Signed-off-by: Aman Gupta <aman@tmm1.net>
* 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/videotoolboxenc: remove spurious warningAman Gupta2017-11-13
| | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/videotoolboxenc: re-indent codeAman Gupta2017-11-13
| | | | | | Cosmetic change only. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/videotoolboxenc: add hevc_videotoolbox encoderAman Gupta2017-11-13
| | | | | Signed-off-by: Aman Gupta <aman@tmm1.net> Reviewed-by: Rodger Combs <rodger.combs@gmail.com>
* h264_sei: Add namespace prefix to all SEI valuesMark Thompson2017-09-12
| | | | | | | This avoids confusion with equivalent H.265 SEI values when both are being used at the same time. (cherry picked from commit 6ea220cbeec8863e2006a03b73bed52db2b13ee7)
* lavc/videotoolboxenc: fix open videotoolbox bug on iOS8.4jerett2017-06-23
| | | | | | Checks for NULL before using object. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: fix loadVTEncSymbols crash when symbol not foundjerett2017-06-23
| | | | Signed-off-by: Rick Kern <kernrj@gmail.com>
* avcodec: do not use AVFrame accessorMuhammad Faiz2017-04-23
| | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* avcodec/videotoolboxenc: remove unused atomic headerJames Almer2017-03-23
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/videotoolboxenc: add rc_max_bitrate control into videotoolboxSteven Liu2017-03-15
| | | | | | | add kVTCompressionPropertyKey_DataRateLimits support by rc_max_bitrate Reviewed-by: Rick Kern <kernrj@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavc/videotoolboxenc: fix symbol linkingRick Kern2017-03-01
| | | | | | Removes explicit reference to symbols and fixes dereferencing issue. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: check for dictionary key symbolsRick Kern2017-02-23
| | | | | | | Fixes #6081. Some dictionary keys are not present on OS X 10.8. This loads the symbols and uses a default value if not present. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: skip SEI allocation when side data is not presentAman Gupta2016-10-18
| | | | Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Enable a53cc by default.Carl Eugen Hoyos2016-10-17
|
* lavc/videotoolboxenc: Error log formatting.Rick Kern2016-10-17
| | | | Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Update a53cc handlingRick Kern2016-10-17
| | | | | | | Handles insertion into existing SEI NAL unit, inserts emulation prevention bytes. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: flush/free frames on closeRick Kern2016-10-17
| | | | | | | Prevents encode callback from running after codec is closed. Fixes a crash when an error is returned. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: implement a53ccAman Gupta2016-10-17
| | | | Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: remove unnecessary loggingRick Kern2016-06-16
| | | | Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: set extradata when opening codecRick Kern2016-06-11
| | | | | | | | VideoToolbox doesn't supply parameter sets until the first frame is done encoding. This spins up a temporary encoder and encodes a single frame to get this data. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: fix allocated buffer sizeRick Kern2016-06-11
| | | | | | | Allocates a buffer with padding, and with enough room for start codes when length codes are smaller. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Set colorimetry valuesRick Kern2016-05-04
| | | | Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Support pixel aspect ratioRick Kern2016-05-04
| | | | Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Support for forced I-framesRick Kern2016-05-04
| | | | | | Setting AVFrame.pic_type to AV_PICTURE_TYPE_I will force an I-frame. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: add concatentation propertiesRick Kern2016-05-04
| | | | | | | | Add frames_before and frames_after as hints that there will be frames before or after the frames produced in this session. This may help with concatenation issues like bit rate spikes. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Add realtime encoding propertyRick Kern2016-05-04
| | | | | | | Hint to the encoder that encoding should be done in real-time, even at the expense of quality. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Handle out-of-memory and fix memory leakRick Kern2016-05-04
| | | | Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Fix DTSRick Kern2016-05-04
| | | | | | | Some devices output an invalid DTS when B-frames aren't used. Using PTS for the DTS in this case. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Fix AVCodecContext.has_b_frames usage.Rick Kern2016-05-04
| | | | | | Now set by the encoder, not used as an input parameter. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Add entropy settingRick Kern2016-05-04
| | | | | | Add an entropy setting to choose between CAVLC and CABAC. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Require hardware encodingRick Kern2016-05-04
| | | | | | Software encoding can be allowed by setting allow_sw to 1. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Handle hwaccel format as inputRick Kern2016-05-04
| | | | | | | | Handle AV_PIX_FMT_VIDEOTOOLBOX. This results in better energy usage and faster encoding, especially on iOS. When the buffer comes from the media server, no memcpy's are needed. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Use shared pixel buffer poolRick Kern2016-05-04
| | | | | | This reduces the chance of a memcpy in the media server. Signed-off-by: Rick Kern <kernrj@gmail.com>
* lavc/videotoolboxenc: Workaround encoder errorRick Kern2016-04-02
| | | | | | | | CMVideoFormatDescriptionGetH264ParameterSetAtIndex() fails on some hardware/OS versions when retrieving the parameter set count alone. Signed-off-by: Rick Kern <kernrj@gmail.com> Signed-off-by: wm4 <nfxjfg@googlemail.com>
* lavc/videotoolboxenc: Fix crash when closing codec after errorRick Kern2016-04-02
| | | | | | | | | | Fixes crash in #5352. VTCompressionSessionInvalidate() crashes if the internal encoder hasn't completed, but hasn't experienced an error. The function call isn't needed since the encoder is invalidated when the reference count reaches 0 anyway. Signed-off-by: Rick Kern <kernrj@gmail.com> Signed-off-by: wm4 <nfxjfg@googlemail.com>
* lavc/videotoolboxenc: remove *_NULLABLE annotations; fixes pre-10.11 buildRodger Combs2016-03-02
| | | | | | | These macros were added in OS X 10.11, and the file compiles without warnings on both 10.10 and 10.11 with them removed. Thanks to mark4o on IRC for pointing out the failure and testing the patch.
* lavc: add VideoToolbox H.264 EncoderRick Kern2016-03-02
Autodetected by default. Encode using -codec:v h264_videotoolbox. Signed-off-by: Rick Kern <kernrj@gmail.com> Signed-off-by: wm4 <nfxjfg@googlemail.com>