Path: blob/a-new-beginning/libavcodec.xcframework/ios-arm64-simulator/libavcodec.framework/Headers/videotoolbox.h
2 views
/*1* Videotoolbox hardware acceleration2*3* copyright (c) 2012 Sebastien Zwickert4*5* This file is part of FFmpeg.6*7* FFmpeg is free software; you can redistribute it and/or8* modify it under the terms of the GNU Lesser General Public9* License as published by the Free Software Foundation; either10* version 2.1 of the License, or (at your option) any later version.11*12* FFmpeg is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU15* Lesser General Public License for more details.16*17* You should have received a copy of the GNU Lesser General Public18* License along with FFmpeg; if not, write to the Free Software19* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA20*/2122#ifndef AVCODEC_VIDEOTOOLBOX_H23#define AVCODEC_VIDEOTOOLBOX_H2425/**26* @file27* @ingroup lavc_codec_hwaccel_videotoolbox28* Public libavcodec Videotoolbox header.29*/3031/**32* @defgroup lavc_codec_hwaccel_videotoolbox VideoToolbox Decoder33* @ingroup lavc_codec_hwaccel34*35* Hardware accelerated decoding using VideoToolbox on Apple Platforms36*37* @{38*/3940#include <stdint.h>4142#define Picture QuickdrawPicture43#include <VideoToolbox/VideoToolbox.h>44#undef Picture4546#include "libavcodec/avcodec.h"4748#include "libavutil/attributes.h"4950/**51* This struct holds all the information that needs to be passed52* between the caller and libavcodec for initializing Videotoolbox decoding.53* Its size is not a part of the public ABI, it must be allocated with54* av_videotoolbox_alloc_context() and freed with av_free().55*/56typedef struct AVVideotoolboxContext {57/**58* Videotoolbox decompression session object.59*/60VTDecompressionSessionRef session;6162#if FF_API_VT_OUTPUT_CALLBACK63/**64* The output callback that must be passed to the session.65* Set by av_videottoolbox_default_init()66*/67attribute_deprecated68VTDecompressionOutputCallback output_callback;69#endif7071/**72* CVPixelBuffer Format Type that Videotoolbox will use for decoded frames.73* set by the caller. If this is set to 0, then no specific format is74* requested from the decoder, and its native format is output.75*/76OSType cv_pix_fmt_type;7778/**79* CoreMedia Format Description that Videotoolbox will use to create the decompression session.80*/81CMVideoFormatDescriptionRef cm_fmt_desc;8283/**84* CoreMedia codec type that Videotoolbox will use to create the decompression session.85*/86int cm_codec_type;87} AVVideotoolboxContext;8889#if FF_API_VT_HWACCEL_CONTEXT9091/**92* Allocate and initialize a Videotoolbox context.93*94* This function should be called from the get_format() callback when the caller95* selects the AV_PIX_FMT_VIDETOOLBOX format. The caller must then create96* the decoder object (using the output callback provided by libavcodec) that97* will be used for Videotoolbox-accelerated decoding.98*99* When decoding with Videotoolbox is finished, the caller must destroy the decoder100* object and free the Videotoolbox context using av_free().101*102* @return the newly allocated context or NULL on failure103* @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead.104*/105attribute_deprecated106AVVideotoolboxContext *av_videotoolbox_alloc_context(void);107108/**109* This is a convenience function that creates and sets up the Videotoolbox context using110* an internal implementation.111*112* @param avctx the corresponding codec context113*114* @return >= 0 on success, a negative AVERROR code on failure115* @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead.116*/117attribute_deprecated118int av_videotoolbox_default_init(AVCodecContext *avctx);119120/**121* This is a convenience function that creates and sets up the Videotoolbox context using122* an internal implementation.123*124* @param avctx the corresponding codec context125* @param vtctx the Videotoolbox context to use126*127* @return >= 0 on success, a negative AVERROR code on failure128* @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead.129*/130attribute_deprecated131int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx);132133/**134* This function must be called to free the Videotoolbox context initialized with135* av_videotoolbox_default_init().136*137* @param avctx the corresponding codec context138* @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead.139*/140attribute_deprecated141void av_videotoolbox_default_free(AVCodecContext *avctx);142143#endif /* FF_API_VT_HWACCEL_CONTEXT */144145/**146* @}147*/148149#endif /* AVCODEC_VIDEOTOOLBOX_H */150151152