FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
qsv.c File Reference
#include <mfx/mfxvideo.h>
#include <mfx/mfxplugin.h>
#include <stdio.h>
#include <string.h>
#include "libavutil/avstring.h"
#include "libavutil/common.h"
#include "libavutil/error.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_qsv.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "qsv_internal.h"

Go to the source code of this file.

Functions

int ff_qsv_codec_id_to_mfx (enum AVCodecID codec_id)
 
int ff_qsv_profile_to_mfx (enum AVCodecID codec_id, int profile)
 
int ff_qsv_map_error (mfxStatus mfx_err, const char **desc)
 Convert a libmfx error code into an ffmpeg error code. More...
 
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)
 
static enum AVPixelFormat qsv_map_fourcc (uint32_t fourcc)
 
int ff_qsv_map_pixfmt (enum AVPixelFormat format, uint32_t *fourcc)
 
int ff_qsv_find_surface_idx (QSVFramesContext *ctx, QSVFrame *frame)
 
static int qsv_load_plugins (mfxSession session, const char *load_plugins, void *logctx)
 
int ff_qsv_init_internal_session (AVCodecContext *avctx, mfxSession *session, const char *load_plugins)
 
static void mids_buf_free (void *opaque, uint8_t *data)
 
static AVBufferRefqsv_create_mids (AVBufferRef *hw_frames_ref)
 
static int qsv_setup_mids (mfxFrameAllocResponse *resp, AVBufferRef *hw_frames_ref, AVBufferRef *mids_buf)
 
static mfxStatus qsv_frame_alloc (mfxHDL pthis, mfxFrameAllocRequest *req, mfxFrameAllocResponse *resp)
 
static mfxStatus qsv_frame_free (mfxHDL pthis, mfxFrameAllocResponse *resp)
 
static mfxStatus qsv_frame_lock (mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
 
static mfxStatus qsv_frame_unlock (mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
 
static mfxStatus qsv_frame_get_hdl (mfxHDL pthis, mfxMemId mid, mfxHDL *hdl)
 
int ff_qsv_init_session_hwcontext (AVCodecContext *avctx, mfxSession *psession, QSVFramesContext *qsv_frames_ctx, const char *load_plugins, int opaque)
 

Variables

struct {
   mfxStatus   mfxerr
 
   int   averr
 
   const char *   desc
 
qsv_errors []
 

Function Documentation

int ff_qsv_codec_id_to_mfx ( enum AVCodecID  codec_id)

Definition at line 41 of file qsv.c.

Referenced by init_video_param(), and qsv_decode_init().

int ff_qsv_profile_to_mfx ( enum AVCodecID  codec_id,
int  profile 
)

Definition at line 66 of file qsv.c.

Referenced by qsv_decode_init().

int ff_qsv_map_error ( mfxStatus  mfx_err,
const char **  desc 
)

Convert a libmfx error code into an ffmpeg error code.

Definition at line 120 of file qsv.c.

Referenced by ff_qsv_print_error(), and ff_qsv_print_warning().

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 
)

Definition at line 145 of file qsv.c.

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

static enum AVPixelFormat qsv_map_fourcc ( uint32_t  fourcc)
static

Definition at line 155 of file qsv.c.

Referenced by qsv_frame_alloc().

int ff_qsv_map_pixfmt ( enum AVPixelFormat  format,
uint32_t *  fourcc 
)

Definition at line 165 of file qsv.c.

Referenced by ff_qsv_process_data(), and init_video_param().

int ff_qsv_find_surface_idx ( QSVFramesContext ctx,
QSVFrame frame 
)

Definition at line 182 of file qsv.c.

Referenced by alloc_frame(), and submit_frame().

static int qsv_load_plugins ( mfxSession  session,
const char *  load_plugins,
void logctx 
)
static

Definition at line 193 of file qsv.c.

Referenced by ff_qsv_init_internal_session(), and ff_qsv_init_session_hwcontext().

int ff_qsv_init_internal_session ( AVCodecContext avctx,
mfxSession *  session,
const char *  load_plugins 
)

Definition at line 244 of file qsv.c.

Referenced by qsv_init_session(), and qsvenc_init_session().

static void mids_buf_free ( void opaque,
uint8_t data 
)
static

Definition at line 287 of file qsv.c.

Referenced by qsv_create_mids().

static AVBufferRef* qsv_create_mids ( AVBufferRef hw_frames_ref)
static

Definition at line 294 of file qsv.c.

Referenced by ff_qsv_init_session_hwcontext(), and qsv_frame_alloc().

static int qsv_setup_mids ( mfxFrameAllocResponse *  resp,
AVBufferRef hw_frames_ref,
AVBufferRef mids_buf 
)
static

Definition at line 331 of file qsv.c.

Referenced by qsv_frame_alloc().

static mfxStatus qsv_frame_alloc ( mfxHDL  pthis,
mfxFrameAllocRequest *  req,
mfxFrameAllocResponse *  resp 
)
static

Definition at line 367 of file qsv.c.

Referenced by ff_qsv_init_session_hwcontext().

static mfxStatus qsv_frame_free ( mfxHDL  pthis,
mfxFrameAllocResponse *  resp 
)
static

Definition at line 456 of file qsv.c.

Referenced by ff_qsv_init_session_hwcontext().

static mfxStatus qsv_frame_lock ( mfxHDL  pthis,
mfxMemId  mid,
mfxFrameData *  ptr 
)
static

Definition at line 464 of file qsv.c.

Referenced by ff_qsv_init_session_hwcontext().

static mfxStatus qsv_frame_unlock ( mfxHDL  pthis,
mfxMemId  mid,
mfxFrameData *  ptr 
)
static

Definition at line 521 of file qsv.c.

Referenced by ff_qsv_init_session_hwcontext().

static mfxStatus qsv_frame_get_hdl ( mfxHDL  pthis,
mfxMemId  mid,
mfxHDL *  hdl 
)
static

Definition at line 531 of file qsv.c.

Referenced by ff_qsv_init_session_hwcontext().

int ff_qsv_init_session_hwcontext ( AVCodecContext avctx,
mfxSession *  psession,
QSVFramesContext qsv_frames_ctx,
const char *  load_plugins,
int  opaque 
)

Definition at line 538 of file qsv.c.

Referenced by qsv_init_session(), and qsvenc_init_session().

Variable Documentation

mfxStatus mfxerr

Definition at line 83 of file qsv.c.

Referenced by ff_qsv_map_error().

int averr

Definition at line 84 of file qsv.c.

const char* desc

Definition at line 85 of file qsv.c.

Referenced by ff_qsv_init_internal_session(), ff_qsv_print_error(), and ff_qsv_print_warning().

const { ... } qsv_errors[]

Referenced by ff_qsv_map_error().