21#ifndef AVCODEC_QSV_INTERNAL_H
22#define AVCODEC_QSV_INTERNAL_H
26#if CONFIG_VAAPI && !defined(_WIN32)
27#define AVCODEC_QSV_LINUX_SESSION_HANDLE
30#ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE
47#define QSV_VERSION_MAJOR 1
48#define QSV_VERSION_MINOR 1
50#define ASYNC_DEPTH_DEFAULT 4
52#define QSV_MAX_ENC_PAYLOAD 2
53#define QSV_MAX_ENC_EXTPARAM 8
55#define QSV_MAX_ROI_NUM 256
57#define QSV_MAX_FRAME_EXT_PARAMS 4
59#define QSV_VERSION_ATLEAST(MAJOR, MINOR) \
60 (MFX_VERSION_MAJOR > (MAJOR) || \
61 MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR))
63#define QSV_RUNTIME_VERSION_ATLEAST(MFX_VERSION, MAJOR, MINOR) \
64 ((MFX_VERSION.Major > (MAJOR)) || \
65 (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR)))
67#define QSV_ONEVPL QSV_VERSION_ATLEAST(2, 0)
68#define QSV_HAVE_OPAQUE !QSV_ONEVPL
84#if QSV_VERSION_ATLEAST(1, 34)
85 mfxExtAV1FilmGrainParam av1_film_grain_param;
88#if QSV_VERSION_ATLEAST(1, 35)
89 mfxExtMasteringDisplayColourVolume mdcv;
90 mfxExtContentLightLevelInfo clli;
107#ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE
129 const char *extra_string);
132 const char *error_string);
135 const char *warning_string);
147 const char *load_plugins,
int gpu_copy);
157 const char *load_plugins,
int opaque,
int gpu_copy);
162 mfxExtBuffer *param);
static const char *const format[]
Libavcodec external API header.
reference-counted frame API
AVCodecID
Identify the syntax and semantics of the bitstream.
API-specific header for AV_HWDEVICE_TYPE_VAAPI.
static int shift(int a, int b)
AVPixelFormat
Pixel format.
#define QSV_MAX_FRAME_EXT_PARAMS
int ff_qsv_init_session_frames(AVCodecContext *avctx, mfxSession *session, QSVFramesContext *qsv_frames_ctx, const char *load_plugins, int opaque, int gpu_copy)
int ff_qsv_map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface)
int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
enum AVFieldOrder ff_qsv_map_picstruct(int mfx_pic_struct)
int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs, const char *load_plugins, int gpu_copy)
#define QSV_MAX_ENC_EXTPARAM
int ff_qsv_print_error(void *log_ctx, mfxStatus err, const char *error_string)
int ff_qsv_close_internal_session(QSVSession *qs)
int ff_qsv_print_iopattern(void *log_ctx, int mfx_iopattern, const char *extra_string)
#define QSV_MAX_ENC_PAYLOAD
void ff_qsv_frame_add_ext_param(AVCodecContext *avctx, QSVFrame *frame, mfxExtBuffer *param)
int ff_qsv_init_session_device(AVCodecContext *avctx, mfxSession *psession, AVBufferRef *device_ref, const char *load_plugins, int gpu_copy)
enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type)
enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc)
int ff_qsv_find_surface_idx(QSVFramesContext *ctx, QSVFrame *frame)
int ff_qsv_print_warning(void *log_ctx, mfxStatus err, const char *warning_string)
int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc, uint16_t *shift)
A reference to a data buffer.
main external API structure.
This structure describes decoded (raw) audio or video data.
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
mfxExtBuffer * extparam[QSV_MAX_ENC_EXTPARAM]
used for enc_ctrl.ExtParam
mfxExtDecodedFrameInfo dec_info
mfxExtBuffer * ext_param[QSV_MAX_FRAME_EXT_PARAMS]
mfxPayload * payloads[QSV_MAX_ENC_PAYLOAD]
used for enc_ctrl.Payload
QSVMid * mids
The memory ids for the external frames.
AVBufferRef * hw_frames_ctx
AVBufferRef * hw_frames_ref
static AVFormatContext * ctx