19 #include <mfx/mfxvideo.h> 77 frames_hwctx = frames_ctx->
hwctx;
84 frames_hwctx->
frame_type = MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET;
int qsv_init(AVCodecContext *s)
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
static int qsv_get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
This structure describes decoded (raw) audio or video data.
int coded_width
Bitstream width / height, may be different from width/height e.g.
int frame_type
A combination of MFX_MEMTYPE_* describing the frame pool.
memory handling functions
This struct is allocated as AVHWFramesContext.hwctx.
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
int width
The allocated dimensions of the frames in this pool.
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
int av_hwdevice_ctx_create(AVBufferRef **pdevice_ref, enum AVHWDeviceType type, const char *device, AVDictionary *opts, int flags)
Open a device of the specified type and create an AVHWDeviceContext for it.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_hwframe_ctx_init(AVBufferRef *ref)
Finalize the context before use.
int av_hwframe_get_buffer(AVBufferRef *hwframe_ref, AVFrame *frame, int flags)
Allocate a new frame attached to the given AVHWFramesContext.
static int qsv_device_init(InputStream *ist)
int initial_pool_size
Initial size of the frame pool.
AVBufferRef * hw_device_ctx
main external API structure.
uint8_t * data
The data buffer.
void * hwctx
The format-specific data, allocated and freed automatically along with this context.
This struct describes a set or pool of "hardware" frames (i.e.
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
static void qsv_uninit(AVCodecContext *s)
An API-specific header for AV_HWDEVICE_TYPE_QSV.
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
void * opaque
Private data of the user, can be used to carry app specific stuff.