Go to the documentation of this file.
21 #ifndef AVCODEC_QSV_INTERNAL_H
22 #define AVCODEC_QSV_INTERNAL_H
27 #define AVCODEC_QSV_LINUX_SESSION_HANDLE
30 #ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE
38 #include <va/va_drm.h>
42 #include <mfx/mfxvideo.h>
48 #define QSV_VERSION_MAJOR 1
49 #define QSV_VERSION_MINOR 1
51 #define ASYNC_DEPTH_DEFAULT 4 // internal parallelism
53 #define QSV_MAX_ENC_PAYLOAD 2 // # of mfxEncodeCtrl payloads supported
55 #define QSV_VERSION_ATLEAST(MAJOR, MINOR) \
56 (MFX_VERSION_MAJOR > (MAJOR) || \
57 MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR))
59 #define QSV_RUNTIME_VERSION_ATLEAST(MFX_VERSION, MAJOR, MINOR) \
60 ((MFX_VERSION.Major > (MAJOR)) || \
61 (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR)))
87 #ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE
107 const char *extra_string);
115 const char *error_string);
118 const char *warning_string);
131 const char *load_plugins,
int gpu_copy);
141 const char *load_plugins,
int opaque,
int gpu_copy);
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)
AVBufferRef * hw_frames_ctx
This structure describes decoded (raw) audio or video data.
int ff_qsv_map_error(mfxStatus mfx_err, const char **desc)
Convert a libmfx error code into an ffmpeg error code.
int ff_qsv_level_to_mfx(enum AVCodecID codec_id, int level)
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_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc)
int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
int ff_qsv_print_warning(void *log_ctx, mfxStatus err, const char *warning_string)
AVCodecID
Identify the syntax and semantics of the bitstream.
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)
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
main external API structure.
enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc)
A reference to a data buffer.
mfxExtDecodedFrameInfo dec_info
int ff_qsv_print_error(void *log_ctx, mfxStatus err, const char *error_string)
int ff_qsv_close_internal_session(QSVSession *qs)