FFmpeg
Data Structures | Macros | Functions
qsv_internal.h File Reference
#include "config.h"
#include <mfxvideo.h>
#include "libavutil/frame.h"
#include "avcodec.h"

Go to the source code of this file.

Data Structures

struct  QSVMid
 
struct  QSVFrame
 
struct  QSVSession
 
struct  QSVFramesContext
 

Macros

#define QSV_VERSION_MAJOR   1
 
#define QSV_VERSION_MINOR   1
 
#define ASYNC_DEPTH_DEFAULT   4
 
#define QSV_MAX_ENC_PAYLOAD   2
 
#define QSV_MAX_ENC_EXTPARAM   8
 
#define QSV_MAX_ROI_NUM   256
 
#define QSV_MAX_FRAME_EXT_PARAMS   4
 
#define QSV_VERSION_ATLEAST(MAJOR, MINOR)
 
#define QSV_RUNTIME_VERSION_ATLEAST(MFX_VERSION, MAJOR, MINOR)
 
#define QSV_ONEVPL   QSV_VERSION_ATLEAST(2, 0)
 
#define QSV_HAVE_OPAQUE   !QSV_ONEVPL
 

Functions

int ff_qsv_print_iopattern (void *log_ctx, int mfx_iopattern, const char *extra_string)
 
int ff_qsv_print_error (void *log_ctx, mfxStatus err, const char *error_string)
 
int ff_qsv_print_warning (void *log_ctx, mfxStatus err, const char *warning_string)
 
int ff_qsv_codec_id_to_mfx (enum AVCodecID codec_id)
 
enum AVPixelFormat ff_qsv_map_fourcc (uint32_t fourcc)
 
int ff_qsv_map_pixfmt (enum AVPixelFormat format, uint32_t *fourcc, uint16_t *shift)
 
enum AVPictureType ff_qsv_map_pictype (int mfx_pic_type)
 
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)
 
int ff_qsv_close_internal_session (QSVSession *qs)
 
int ff_qsv_init_session_device (AVCodecContext *avctx, mfxSession *psession, AVBufferRef *device_ref, const char *load_plugins, int gpu_copy)
 
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_find_surface_idx (QSVFramesContext *ctx, QSVFrame *frame)
 
void ff_qsv_frame_add_ext_param (AVCodecContext *avctx, QSVFrame *frame, mfxExtBuffer *param)
 
int ff_qsv_map_frame_to_surface (const AVFrame *frame, mfxFrameSurface1 *surface)
 

Macro Definition Documentation

◆ QSV_VERSION_MAJOR

#define QSV_VERSION_MAJOR   1

Definition at line 48 of file qsv_internal.h.

◆ QSV_VERSION_MINOR

#define QSV_VERSION_MINOR   1

Definition at line 49 of file qsv_internal.h.

◆ ASYNC_DEPTH_DEFAULT

#define ASYNC_DEPTH_DEFAULT   4

Definition at line 51 of file qsv_internal.h.

◆ QSV_MAX_ENC_PAYLOAD

#define QSV_MAX_ENC_PAYLOAD   2

Definition at line 53 of file qsv_internal.h.

◆ QSV_MAX_ENC_EXTPARAM

#define QSV_MAX_ENC_EXTPARAM   8

Definition at line 54 of file qsv_internal.h.

◆ QSV_MAX_ROI_NUM

#define QSV_MAX_ROI_NUM   256

Definition at line 56 of file qsv_internal.h.

◆ QSV_MAX_FRAME_EXT_PARAMS

#define QSV_MAX_FRAME_EXT_PARAMS   4

Definition at line 58 of file qsv_internal.h.

◆ QSV_VERSION_ATLEAST

#define QSV_VERSION_ATLEAST (   MAJOR,
  MINOR 
)
Value:
(MFX_VERSION_MAJOR > (MAJOR) || \
MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR))

Definition at line 60 of file qsv_internal.h.

◆ QSV_RUNTIME_VERSION_ATLEAST

#define QSV_RUNTIME_VERSION_ATLEAST (   MFX_VERSION,
  MAJOR,
  MINOR 
)
Value:
((MFX_VERSION.Major > (MAJOR)) || \
(MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR)))

Definition at line 64 of file qsv_internal.h.

◆ QSV_ONEVPL

#define QSV_ONEVPL   QSV_VERSION_ATLEAST(2, 0)

Definition at line 68 of file qsv_internal.h.

◆ QSV_HAVE_OPAQUE

#define QSV_HAVE_OPAQUE   !QSV_ONEVPL

Definition at line 69 of file qsv_internal.h.

Function Documentation

◆ ff_qsv_print_iopattern()

int ff_qsv_print_iopattern ( void *  log_ctx,
int  mfx_iopattern,
const char *  extra_string 
)

Definition at line 100 of file qsv.c.

Referenced by ff_qsv_enc_init(), and qsv_decode_preinit().

◆ ff_qsv_print_error()

int ff_qsv_print_error ( void *  log_ctx,
mfxStatus  err,
const char *  error_string 
)

◆ ff_qsv_print_warning()

int ff_qsv_print_warning ( void *  log_ctx,
mfxStatus  err,
const char *  warning_string 
)

Definition at line 194 of file qsv.c.

Referenced by encode_frame(), ff_qsv_enc_init(), qsv_create_mfx_session(), and qsv_decode().

◆ ff_qsv_codec_id_to_mfx()

int ff_qsv_codec_id_to_mfx ( enum AVCodecID  codec_id)

Definition at line 54 of file qsv.c.

Referenced by init_video_param(), init_video_param_jpeg(), and qsv_decode_header().

◆ ff_qsv_map_fourcc()

enum AVPixelFormat ff_qsv_map_fourcc ( uint32_t  fourcc)

Definition at line 203 of file qsv.c.

Referenced by qsv_decode_init_context(), qsv_frame_alloc(), and qsv_process_data().

◆ ff_qsv_map_pixfmt()

int ff_qsv_map_pixfmt ( enum AVPixelFormat  format,
uint32_t *  fourcc,
uint16_t *  shift 
)

Definition at line 226 of file qsv.c.

Referenced by init_video_param(), and init_video_param_jpeg().

◆ ff_qsv_map_pictype()

enum AVPictureType ff_qsv_map_pictype ( int  mfx_pic_type)

Definition at line 379 of file qsv.c.

Referenced by qsv_decode().

◆ ff_qsv_map_picstruct()

enum AVFieldOrder ff_qsv_map_picstruct ( int  mfx_pic_struct)

Definition at line 361 of file qsv.c.

Referenced by qsv_decode_init_context().

◆ ff_qsv_init_internal_session()

int ff_qsv_init_internal_session ( AVCodecContext avctx,
QSVSession qs,
const char *  load_plugins,
int  gpu_copy 
)

Definition at line 681 of file qsv.c.

Referenced by qsv_init_session(), and qsvenc_init_session().

◆ ff_qsv_close_internal_session()

int ff_qsv_close_internal_session ( QSVSession qs)

Definition at line 1116 of file qsv.c.

Referenced by ff_qsv_enc_close(), and qsv_decode_close_qsvcontext().

◆ ff_qsv_init_session_device()

int ff_qsv_init_session_device ( AVCodecContext avctx,
mfxSession *  psession,
AVBufferRef device_ref,
const char *  load_plugins,
int  gpu_copy 
)

Definition at line 992 of file qsv.c.

Referenced by ff_qsv_init_session_frames(), qsv_init_session(), and qsvenc_init_session().

◆ ff_qsv_init_session_frames()

int ff_qsv_init_session_frames ( AVCodecContext avctx,
mfxSession *  session,
QSVFramesContext qsv_frames_ctx,
const char *  load_plugins,
int  opaque,
int  gpu_copy 
)

Definition at line 1069 of file qsv.c.

Referenced by qsv_init_session(), and qsvenc_init_session().

◆ ff_qsv_find_surface_idx()

int ff_qsv_find_surface_idx ( QSVFramesContext ctx,
QSVFrame frame 
)

Definition at line 348 of file qsv.c.

Referenced by alloc_frame(), and submit_frame().

◆ ff_qsv_frame_add_ext_param()

void ff_qsv_frame_add_ext_param ( AVCodecContext avctx,
QSVFrame frame,
mfxExtBuffer *  param 
)

Definition at line 1134 of file qsv.c.

Referenced by alloc_frame().

◆ ff_qsv_map_frame_to_surface()

int ff_qsv_map_frame_to_surface ( const AVFrame frame,
mfxFrameSurface1 *  surface 
)

Definition at line 287 of file qsv.c.

Referenced by alloc_frame(), and submit_frame().