Go to the documentation of this file.
21 #ifndef AVCODEC_QSV_INTERNAL_H
22 #define AVCODEC_QSV_INTERNAL_H
26 #if CONFIG_VAAPI && !defined(_WIN32) // Do not enable for libva-win32 on Windows
27 #define AVCODEC_QSV_LINUX_SESSION_HANDLE
28 #endif //CONFIG_VAAPI && !defined(_WIN32)
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 // internal parallelism
52 #define QSV_MAX_ENC_PAYLOAD 2 // # of mfxEncodeCtrl payloads supported
53 #define QSV_MAX_ENC_EXTPARAM 8 // # of mfxEncodeCtrl extparam supported
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);
#define QSV_MAX_FRAME_EXT_PARAMS
enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type)
AVPixelFormat
Pixel format.
int ff_qsv_print_iopattern(void *log_ctx, int mfx_iopattern, const char *extra_string)
int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc, uint16_t *shift)
AVBufferRef * hw_frames_ctx
mfxExtBuffer * extparam[QSV_MAX_ENC_EXTPARAM]
used for enc_ctrl.ExtParam
This structure describes decoded (raw) audio or video data.
mfxExtBuffer * ext_param[QSV_MAX_FRAME_EXT_PARAMS]
int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs, const char *load_plugins, int gpu_copy)
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
int ff_qsv_init_session_frames(AVCodecContext *avctx, mfxSession *session, QSVFramesContext *qsv_frames_ctx, const char *load_plugins, int opaque, int gpu_copy)
enum AVFieldOrder ff_qsv_map_picstruct(int mfx_pic_struct)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
mfxPayload * payloads[QSV_MAX_ENC_PAYLOAD]
used for enc_ctrl.Payload
int ff_qsv_print_warning(void *log_ctx, mfxStatus err, const char *warning_string)
AVCodecID
Identify the syntax and semantics of the bitstream.
#define QSV_MAX_ENC_EXTPARAM
static int shift(int a, int b)
AVBufferRef * hw_frames_ref
int ff_qsv_init_session_device(AVCodecContext *avctx, mfxSession *psession, AVBufferRef *device_ref, const char *load_plugins, int gpu_copy)
int ff_qsv_find_surface_idx(QSVFramesContext *ctx, QSVFrame *frame)
QSVMid * mids
The memory ids for the external frames.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
int ff_qsv_map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface)
main external API structure.
enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc)
#define QSV_MAX_ENC_PAYLOAD
A reference to a data buffer.
mfxExtDecodedFrameInfo dec_info
int ff_qsv_print_error(void *log_ctx, mfxStatus err, const char *error_string)
void ff_qsv_frame_add_ext_param(AVCodecContext *avctx, QSVFrame *frame, mfxExtBuffer *param)
int ff_qsv_close_internal_session(QSVSession *qs)