FFmpeg
Functions | Variables
qsvdec.c File Reference
#include <string.h>
#include <sys/types.h>
#include <mfx/mfxvideo.h>
#include "libavutil/common.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_qsv.h"
#include "libavutil/mem.h"
#include "libavutil/log.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "libavutil/time.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "internal.h"
#include "decode.h"
#include "qsv.h"
#include "qsv_internal.h"
#include "qsvdec.h"

Go to the source code of this file.

Functions

static int ff_qsv_get_continuous_buffer (AVCodecContext *avctx, AVFrame *frame, AVBufferPool *pool)
 
static int qsv_init_session (AVCodecContext *avctx, QSVContext *q, mfxSession session, AVBufferRef *hw_frames_ref, AVBufferRef *hw_device_ref)
 
static unsigned int qsv_fifo_item_size (void)
 
static unsigned int qsv_fifo_size (const AVFifoBuffer *fifo)
 
static int qsv_decode_preinit (AVCodecContext *avctx, QSVContext *q, enum AVPixelFormat pix_fmt, mfxVideoParam *param)
 
static int qsv_decode_init (AVCodecContext *avctx, QSVContext *q, mfxVideoParam *param)
 
static int qsv_decode_header (AVCodecContext *avctx, QSVContext *q, AVPacket *avpkt, enum AVPixelFormat pix_fmt, mfxVideoParam *param)
 
static int alloc_frame (AVCodecContext *avctx, QSVContext *q, QSVFrame *frame)
 
static void qsv_clear_unused_frames (QSVContext *q)
 
static int get_surface (AVCodecContext *avctx, QSVContext *q, mfxFrameSurface1 **surf)
 
static QSVFramefind_frame (QSVContext *q, mfxFrameSurface1 *surf)
 
static int qsv_decode (AVCodecContext *avctx, QSVContext *q, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 
int ff_qsv_decode_close (QSVContext *q)
 
int ff_qsv_process_data (AVCodecContext *avctx, QSVContext *q, AVFrame *frame, int *got_frame, AVPacket *pkt)
 
void ff_qsv_decode_flush (AVCodecContext *avctx, QSVContext *q)
 

Variables

const AVCodecHWConfigInternalff_qsv_hw_configs []
 

Function Documentation

◆ ff_qsv_get_continuous_buffer()

static int ff_qsv_get_continuous_buffer ( AVCodecContext avctx,
AVFrame frame,
AVBufferPool pool 
)
static

Definition at line 59 of file qsvdec.c.

Referenced by alloc_frame().

◆ qsv_init_session()

static int qsv_init_session ( AVCodecContext avctx,
QSVContext q,
mfxSession  session,
AVBufferRef hw_frames_ref,
AVBufferRef hw_device_ref 
)
static

Definition at line 96 of file qsvdec.c.

Referenced by qsv_decode_preinit().

◆ qsv_fifo_item_size()

static unsigned int qsv_fifo_item_size ( void  )
inlinestatic

Definition at line 159 of file qsvdec.c.

Referenced by qsv_decode_preinit(), and qsv_fifo_size().

◆ qsv_fifo_size()

static unsigned int qsv_fifo_size ( const AVFifoBuffer fifo)
inlinestatic

Definition at line 164 of file qsvdec.c.

Referenced by qsv_decode().

◆ qsv_decode_preinit()

static int qsv_decode_preinit ( AVCodecContext avctx,
QSVContext q,
enum AVPixelFormat  pix_fmt,
mfxVideoParam *  param 
)
static

Definition at line 169 of file qsvdec.c.

Referenced by ff_qsv_process_data(), and qsv_decode_header().

◆ qsv_decode_init()

static int qsv_decode_init ( AVCodecContext avctx,
QSVContext q,
mfxVideoParam *  param 
)
static

Definition at line 231 of file qsvdec.c.

Referenced by ff_qsv_process_data().

◆ qsv_decode_header()

static int qsv_decode_header ( AVCodecContext avctx,
QSVContext q,
AVPacket avpkt,
enum AVPixelFormat  pix_fmt,
mfxVideoParam *  param 
)
static

Definition at line 257 of file qsvdec.c.

Referenced by ff_qsv_process_data().

◆ alloc_frame()

static int alloc_frame ( AVCodecContext avctx,
QSVContext q,
QSVFrame frame 
)
static

Definition at line 296 of file qsvdec.c.

Referenced by get_surface().

◆ qsv_clear_unused_frames()

static void qsv_clear_unused_frames ( QSVContext q)
static

Definition at line 336 of file qsvdec.c.

Referenced by get_surface().

◆ get_surface()

static int get_surface ( AVCodecContext avctx,
QSVContext q,
mfxFrameSurface1 **  surf 
)
static

Definition at line 348 of file qsvdec.c.

Referenced by qsv_decode().

◆ find_frame()

static QSVFrame* find_frame ( QSVContext q,
mfxFrameSurface1 *  surf 
)
static

Definition at line 389 of file qsvdec.c.

Referenced by qsv_decode().

◆ qsv_decode()

static int qsv_decode ( AVCodecContext avctx,
QSVContext q,
AVFrame frame,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 400 of file qsvdec.c.

Referenced by ff_qsv_process_data().

◆ ff_qsv_decode_close()

int ff_qsv_decode_close ( QSVContext q)

Definition at line 533 of file qsvdec.c.

Referenced by qsv_decode_close().

◆ ff_qsv_process_data()

int ff_qsv_process_data ( AVCodecContext avctx,
QSVContext q,
AVFrame frame,
int got_frame,
AVPacket pkt 
)

Definition at line 569 of file qsvdec.c.

Referenced by qsv_decode_frame().

◆ ff_qsv_decode_flush()

void ff_qsv_decode_flush ( AVCodecContext avctx,
QSVContext q 
)

Definition at line 631 of file qsvdec.c.

Referenced by qsv_decode_flush().

Variable Documentation

◆ ff_qsv_hw_configs

const AVCodecHWConfigInternal* ff_qsv_hw_configs[]
Initial value:
= {
.public = {
.pix_fmt = AV_PIX_FMT_QSV,
.device_type = AV_HWDEVICE_TYPE_QSV,
},
.hwaccel = NULL,
},
}

Definition at line 46 of file qsvdec.c.

NULL
#define NULL
Definition: coverity.c:32
AV_PIX_FMT_QSV
@ AV_PIX_FMT_QSV
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
Definition: pixfmt.h:222
AVCodecHWConfigInternal
Definition: hwconfig.h:29
AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX
@ AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX
The codec supports this format via the hw_frames_ctx interface.
Definition: codec.h:406
AV_HWDEVICE_TYPE_QSV
@ AV_HWDEVICE_TYPE_QSV
Definition: hwcontext.h:33
AV_CODEC_HW_CONFIG_METHOD_AD_HOC
@ AV_CODEC_HW_CONFIG_METHOD_AD_HOC
The codec supports this format by some ad-hoc method.
Definition: codec.h:422