Go to the documentation of this file.
21 #include <mfx/mfxvideo.h>
22 #include <mfx/mfxplugin.h>
23 #include <mfx/mfxjpeg.h>
39 #define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl))
41 #include "mfx/mfxvp8.h"
49 return MFX_CODEC_HEVC;
52 return MFX_CODEC_MPEG2;
58 return MFX_CODEC_JPEG;
61 #if QSV_VERSION_ATLEAST(1, 34)
77 {MFX_IOPATTERN_IN_VIDEO_MEMORY,
"input is video memory surface" },
78 {MFX_IOPATTERN_IN_SYSTEM_MEMORY,
"input is system memory surface" },
79 {MFX_IOPATTERN_IN_OPAQUE_MEMORY,
"input is opaque memory surface" },
80 {MFX_IOPATTERN_OUT_VIDEO_MEMORY,
"output is video memory surface" },
81 {MFX_IOPATTERN_OUT_SYSTEM_MEMORY,
"output is system memory surface" },
82 {MFX_IOPATTERN_OUT_OPAQUE_MEMORY,
"output is opaque memory surface" },
86 const char *extra_string)
96 desc =
"unknown iopattern";
102 static const struct {
107 { MFX_ERR_NONE, 0,
"success" },
109 { MFX_ERR_NULL_PTR,
AVERROR(EINVAL),
"NULL pointer" },
110 { MFX_ERR_UNSUPPORTED,
AVERROR(ENOSYS),
"unsupported" },
111 { MFX_ERR_MEMORY_ALLOC,
AVERROR(ENOMEM),
"failed to allocate memory" },
112 { MFX_ERR_NOT_ENOUGH_BUFFER,
AVERROR(ENOMEM),
"insufficient input/output buffer" },
113 { MFX_ERR_INVALID_HANDLE,
AVERROR(EINVAL),
"invalid handle" },
114 { MFX_ERR_LOCK_MEMORY,
AVERROR(EIO),
"failed to lock the memory block" },
115 { MFX_ERR_NOT_INITIALIZED,
AVERROR_BUG,
"not initialized" },
116 { MFX_ERR_NOT_FOUND,
AVERROR(ENOSYS),
"specified object was not found" },
120 { MFX_ERR_MORE_SURFACE,
AVERROR_UNKNOWN,
"expect more surface at output" },
121 { MFX_ERR_MORE_BITSTREAM,
AVERROR_UNKNOWN,
"expect more bitstream at output" },
123 { MFX_ERR_DEVICE_LOST,
AVERROR(EIO),
"device lost" },
124 { MFX_ERR_INCOMPATIBLE_VIDEO_PARAM,
AVERROR(EINVAL),
"incompatible video parameters" },
125 { MFX_ERR_INVALID_VIDEO_PARAM,
AVERROR(EINVAL),
"invalid video parameters" },
126 { MFX_ERR_UNDEFINED_BEHAVIOR,
AVERROR_BUG,
"undefined behavior" },
127 { MFX_ERR_DEVICE_FAILED,
AVERROR(EIO),
"device failed" },
128 { MFX_ERR_GPU_HANG,
AVERROR(EIO),
"GPU Hang" },
129 { MFX_ERR_REALLOC_SURFACE,
AVERROR_UNKNOWN,
"need bigger surface for output" },
130 { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM,
AVERROR(EINVAL),
"incompatible audio parameters" },
131 { MFX_ERR_INVALID_AUDIO_PARAM,
AVERROR(EINVAL),
"invalid audio parameters" },
133 { MFX_WRN_IN_EXECUTION, 0,
"operation in execution" },
134 { MFX_WRN_DEVICE_BUSY, 0,
"device busy" },
135 { MFX_WRN_VIDEO_PARAM_CHANGED, 0,
"video parameters changed" },
136 { MFX_WRN_PARTIAL_ACCELERATION, 0,
"partial acceleration" },
137 { MFX_WRN_INCOMPATIBLE_VIDEO_PARAM, 0,
"incompatible video parameters" },
138 { MFX_WRN_VALUE_NOT_CHANGED, 0,
"value is saturated" },
139 { MFX_WRN_OUT_OF_RANGE, 0,
"value out of range" },
140 { MFX_WRN_FILTER_SKIPPED, 0,
"filter skipped" },
141 { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0,
"incompatible audio parameters" },
143 #if QSV_VERSION_ATLEAST(1, 31)
144 { MFX_ERR_NONE_PARTIAL_OUTPUT, 0,
"partial output" },
162 *
desc =
"unknown error";
167 const char *error_string)
176 const char *warning_string)
206 *
fourcc = MFX_FOURCC_NV12;
210 *
fourcc = MFX_FOURCC_P010;
213 *
fourcc = MFX_FOURCC_A2RGB10;
216 *
fourcc = MFX_FOURCC_RGB4;
221 *
fourcc = MFX_FOURCC_YUY2;
225 *
fourcc = MFX_FOURCC_Y210;
235 switch (
frame->format) {
238 surface->Data.Y =
frame->data[0];
239 surface->Data.UV =
frame->data[1];
241 surface->Data.V = surface->Data.UV + 1;
245 surface->Data.B =
frame->data[0];
246 surface->Data.G =
frame->data[0] + 1;
247 surface->Data.R =
frame->data[0] + 2;
248 surface->Data.A =
frame->data[0] + 3;
251 surface->Data.Y =
frame->data[0];
252 surface->Data.U =
frame->data[0] + 1;
253 surface->Data.V =
frame->data[0] + 3;
257 surface->Data.Y16 = (mfxU16 *)
frame->data[0];
258 surface->Data.U16 = (mfxU16 *)
frame->data[0] + 1;
259 surface->Data.V16 = (mfxU16 *)
frame->data[0] + 3;
264 surface->Data.PitchLow =
frame->linesize[0];
272 for (
i = 0;
i <
ctx->nb_mids;
i++) {
274 mfxHDLPair *pair = (mfxHDLPair*)
frame->surface.Data.MemId;
285 switch (mfx_pic_struct & 0xF) {
286 case MFX_PICSTRUCT_PROGRESSIVE:
289 case MFX_PICSTRUCT_FIELD_TFF:
292 case MFX_PICSTRUCT_FIELD_BFF:
303 switch (mfx_pic_type & 0x7) {
304 case MFX_FRAMETYPE_I:
305 if (mfx_pic_type & MFX_FRAMETYPE_S)
310 case MFX_FRAMETYPE_B:
313 case MFX_FRAMETYPE_P:
314 if (mfx_pic_type & MFX_FRAMETYPE_S)
319 case MFX_FRAMETYPE_UNKNOWN:
332 if (!load_plugins || !*load_plugins)
335 while (*load_plugins) {
343 if (strlen(plugin) != 2 *
sizeof(
uid.Data)) {
346 goto load_plugin_fail;
349 for (
i = 0;
i <
sizeof(
uid.Data);
i++) {
350 err = sscanf(plugin + 2 *
i,
"%2hhx",
uid.Data +
i);
354 goto load_plugin_fail;
359 ret = MFXVideoUSER_Load(session, &
uid, 1);
362 snprintf(errorbuf,
sizeof(errorbuf),
363 "Could not load the requested plugin '%s'", plugin);
365 goto load_plugin_fail;
383 #ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE
390 av_dict_set(&child_device_opts,
"kernel_driver",
"i915", 0);
391 av_dict_set(&child_device_opts,
"driver",
"iHD", 0);
400 hwctx = qs->va_device_ctx->hwctx;
403 (mfxHandleType)MFX_HANDLE_VA_DISPLAY, (mfxHDL)hwctx->
display);
411 #endif //AVCODEC_QSV_LINUX_SESSION_HANDLE
414 const char *load_plugins,
int gpu_copy)
417 mfxIMPL impl = MFX_IMPL_AUTO_ANY | MFX_IMPL_VIA_D3D11;
419 mfxIMPL impl = MFX_IMPL_AUTO_ANY;
422 mfxInitParam init_par = { MFX_IMPL_AUTO_ANY };
427 init_par.GPUCopy = gpu_copy;
428 init_par.Implementation = impl;
429 init_par.Version = ver;
433 "Error initializing an internal MFX session");
435 #ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE
436 ret = ff_qsv_set_display_handle(avctx, qs);
448 if (
ret != MFX_ERR_NONE)
450 "Error querying the session attributes");
452 switch (MFX_IMPL_BASETYPE(impl)) {
453 case MFX_IMPL_SOFTWARE:
456 case MFX_IMPL_HARDWARE:
457 case MFX_IMPL_HARDWARE2:
458 case MFX_IMPL_HARDWARE3:
459 case MFX_IMPL_HARDWARE4:
460 desc =
"hardware accelerated";
467 "Initialized an internal MFX session using %s implementation\n",
484 int nb_surfaces = frames_hwctx->nb_surfaces;
494 mids =
av_calloc(nb_surfaces,
sizeof(*mids));
508 for (
i = 0;
i < nb_surfaces;
i++) {
510 mid->
handle_pair = (mfxHDLPair*)frames_hwctx->surfaces[
i].Data.MemId;
523 int nb_surfaces = frames_hwctx->nb_surfaces;
529 resp->mids =
av_calloc(nb_surfaces + 2,
sizeof(*resp->mids));
533 for (
i = 0;
i < nb_surfaces;
i++)
534 resp->mids[
i] = &mids[
i];
535 resp->NumFrameActual = nb_surfaces;
537 resp->mids[resp->NumFrameActual] = (mfxMemId)
av_buffer_ref(hw_frames_ref);
538 if (!resp->mids[resp->NumFrameActual]) {
543 resp->mids[resp->NumFrameActual + 1] =
av_buffer_ref(mids_buf);
544 if (!resp->mids[resp->NumFrameActual + 1]) {
554 mfxFrameAllocResponse *resp)
561 if (!(req->Type & (MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET |
562 MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET)) ||
563 !(req->Type & (MFX_MEMTYPE_FROM_DECODE | MFX_MEMTYPE_FROM_ENCODE)))
564 return MFX_ERR_UNSUPPORTED;
566 if (req->Type & MFX_MEMTYPE_EXTERNAL_FRAME) {
570 mfxFrameInfo *
i = &req->Info;
571 mfxFrameInfo *i1 = &frames_hwctx->surfaces[0].Info;
573 if (
i->Width > i1->Width ||
i->Height > i1->Height ||
574 i->FourCC != i1->FourCC ||
i->ChromaFormat != i1->ChromaFormat) {
576 "allocation request: %dx%d %d %d vs %dx%d %d %d\n",
577 i->Width,
i->Height,
i->FourCC,
i->ChromaFormat,
578 i1->Width, i1->Height, i1->FourCC, i1->ChromaFormat);
579 return MFX_ERR_UNSUPPORTED;
585 "Error filling an external frame allocation request\n");
586 return MFX_ERR_MEMORY_ALLOC;
588 }
else if (req->Type & MFX_MEMTYPE_INTERNAL_FRAME) {
591 mfxFrameInfo *
i = &req->Info;
599 return MFX_ERR_MEMORY_ALLOC;
602 frames_hwctx = frames_ctx->hwctx;
606 frames_ctx->width =
i->Width;
607 frames_ctx->height =
i->Height;
608 frames_ctx->initial_pool_size = req->NumFrameSuggested;
610 frames_hwctx->frame_type = req->Type;
615 "Error initializing a frames context for an internal frame "
616 "allocation request\n");
618 return MFX_ERR_MEMORY_ALLOC;
624 return MFX_ERR_MEMORY_ALLOC;
632 "Error filling an internal frame allocation request\n");
633 return MFX_ERR_MEMORY_ALLOC;
636 return MFX_ERR_UNSUPPORTED;
658 return MFX_ERR_UNDEFINED_BEHAVIOR;
663 return MFX_ERR_MEMORY_ALLOC;
686 qsv_mid->
surf.Info = hw_frames_hwctx->surfaces[0].Info;
704 return MFX_ERR_MEMORY_ALLOC;
720 mfxHDLPair *pair_dst = (mfxHDLPair*)hdl;
721 mfxHDLPair *pair_src = (mfxHDLPair*)qsv_mid->
handle_pair;
723 pair_dst->first = pair_src->first;
725 if (pair_src->second != (mfxMemId)MFX_INFINITE)
726 pair_dst->second = pair_src->second;
736 mfxSession parent_session = device_hwctx->session;
737 mfxInitParam init_par = { MFX_IMPL_AUTO_ANY };
738 mfxHDL handle =
NULL;
739 int hw_handle_supported = 0;
744 mfxHandleType handle_type;
748 err = MFXQueryIMPL(parent_session, &impl);
749 if (err == MFX_ERR_NONE)
750 err = MFXQueryVersion(parent_session, &ver);
751 if (err != MFX_ERR_NONE)
753 "Error querying the session attributes");
756 handle_type = MFX_HANDLE_VA_DISPLAY;
757 hw_handle_supported = 1;
759 handle_type = MFX_HANDLE_D3D11_DEVICE;
760 hw_handle_supported = 1;
762 handle_type = MFX_HANDLE_D3D9_DEVICE_MANAGER;
763 hw_handle_supported = 1;
766 if (hw_handle_supported) {
767 err = MFXVideoCORE_GetHandle(parent_session, handle_type, &handle);
768 if (err != MFX_ERR_NONE) {
770 "Error getting handle session");
775 "from the session\n");
778 init_par.GPUCopy = gpu_copy;
779 init_par.Implementation = impl;
780 init_par.Version = ver;
781 err = MFXInitEx(init_par, &session);
782 if (err != MFX_ERR_NONE)
784 "Error initializing a child MFX session");
787 err = MFXVideoCORE_SetHandle(session, handle_type, handle);
788 if (err != MFX_ERR_NONE)
790 "Error setting a HW handle");
794 err = MFXJoinSession(parent_session, session);
795 if (err != MFX_ERR_NONE)
797 "Error joining session");
812 const char *load_plugins,
int opaque,
int gpu_copy)
814 mfxFrameAllocator frame_allocator = {
815 .pthis = qsv_frames_ctx,
832 frames_ctx->
device_ref, load_plugins, gpu_copy);
837 qsv_frames_ctx->
logctx = avctx;
845 qsv_frames_ctx->
nb_mids = frames_hwctx->nb_surfaces;
847 err = MFXVideoCORE_SetFrameAllocator(session, &frame_allocator);
848 if (err != MFX_ERR_NONE)
850 "Error setting a frame allocator");
863 #ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE
870 mfxExtBuffer * param)
874 for (
i = 0;
i <
frame->num_ext_params;
i++) {
875 mfxExtBuffer *ext_buffer =
frame->ext_param[
i];
877 if (ext_buffer->BufferId == param->BufferId) {
885 frame->ext_param[
frame->num_ext_params] = param;
886 frame->num_ext_params++;
887 frame->surface.Data.NumExtParam =
frame->num_ext_params;
890 "have enough space\n");
#define QSV_MAX_FRAME_EXT_PARAMS
void * hwctx
The format-specific data, allocated and freed by libavutil along with this context.
static mfxStatus qsv_frame_unlock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
#define AV_LOG_WARNING
Something somehow does not look correct.
AVPixelFormat
Pixel format.
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 they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
#define QSV_VERSION_MAJOR
AVBufferRef * hw_frames_ctx
char * av_get_token(const char **buf, const char *term)
Unescape the given string until a non escaped terminating char, and return the token corresponding to...
uint8_t * data
The data buffer.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int av_hwframe_ctx_init(AVBufferRef *ref)
Finalize the context before use.
int ff_qsv_close_internal_session(QSVSession *qs)
This structure describes decoded (raw) audio or video data.
enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type)
This struct is allocated as AVHWDeviceContext.hwctx.
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags)
Map a hardware frame.
int ff_qsv_find_surface_idx(QSVFramesContext *ctx, QSVFrame *frame)
#define AV_PIX_FMT_YUV420P10
#define AV_LOG_VERBOSE
Detailed information.
VADisplay display
The VADisplay handle, to be filled by the user.
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
int width
The allocated dimensions of the frames in this pool.
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int ff_qsv_init_session_device(AVCodecContext *avctx, mfxSession *psession, AVBufferRef *device_ref, const char *load_plugins, int gpu_copy)
int ff_qsv_map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface)
static int qsv_load_plugins(mfxSession session, const char *load_plugins, void *logctx)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int ff_qsv_print_warning(void *log_ctx, mfxStatus err, const char *warning_string)
#define FF_ARRAY_ELEMS(a)
#define QSV_VERSION_MINOR
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
#define QSV_RUNTIME_VERSION_ATLEAST(MFX_VERSION, MAJOR, MINOR)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this field
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static void mids_buf_free(void *opaque, uint8_t *data)
int ff_qsv_init_session_frames(AVCodecContext *avctx, mfxSession *psession, QSVFramesContext *qsv_frames_ctx, const char *load_plugins, int opaque, int gpu_copy)
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
AVBufferRef * device_ref
A reference to the parent AVHWDeviceContext.
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
@ AV_PICTURE_TYPE_SI
Switching Intra.
@ AV_PICTURE_TYPE_I
Intra.
int ff_qsv_print_iopattern(void *log_ctx, int mfx_iopattern, const char *extra_string)
#define AV_PIX_FMT_YUV422P10
@ AV_PIX_FMT_QSV
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
@ AV_PICTURE_TYPE_SP
Switching Predicted.
AVBufferRef * av_buffer_create(uint8_t *data, size_t size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
AVCodecID
Identify the syntax and semantics of the bitstream.
int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc)
@ AV_PIX_FMT_X2RGB10LE
packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), little-endian, X=unused/undefined
AVBufferRef * hw_frames_ref
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
@ AV_PICTURE_TYPE_NONE
Undefined.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
AVBufferRef * av_buffer_alloc(size_t size)
Allocate an AVBuffer of the given size using av_malloc().
enum AVFieldOrder ff_qsv_map_picstruct(int mfx_pic_struct)
#define i(width, name, range_min, range_max)
#define AV_PIX_FMT_X2RGB10
static int qsv_map_error(mfxStatus mfx_err, const char **desc)
Convert a libmfx error code into an FFmpeg error code.
void * av_calloc(size_t nmemb, size_t size)
static const struct @121 qsv_errors[]
This struct describes a set or pool of "hardware" frames (i.e.
static mfxStatus qsv_frame_free(mfxHDL pthis, mfxFrameAllocResponse *resp)
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
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
void * hwctx
The format-specific data, allocated and freed automatically along with this context.
int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
static mfxStatus qsv_frame_get_hdl(mfxHDL pthis, mfxMemId mid, mfxHDL *hdl)
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.
AVBufferRef * hw_frames_ctx
For hwaccel-format frames, this should be a reference to the AVHWFramesContext describing the frame.
main external API structure.
static mfxStatus qsv_frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req, mfxFrameAllocResponse *resp)
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
static const struct @120 qsv_iopatterns[]
#define MFX_IMPL_VIA_MASK(impl)
enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc)
This struct is allocated as AVHWFramesContext.hwctx.
@ AV_PICTURE_TYPE_P
Predicted.
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
A reference to a data buffer.
static int qsv_setup_mids(mfxFrameAllocResponse *resp, AVBufferRef *hw_frames_ref, AVBufferRef *mids_buf)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
@ AV_HWFRAME_MAP_DIRECT
The mapping must be direct.
static AVBufferRef * qsv_create_mids(AVBufferRef *hw_frames_ref)
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
VAAPI connection details.
void ff_qsv_frame_add_ext_param(AVCodecContext *avctx, QSVFrame *frame, mfxExtBuffer *param)
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
int ff_qsv_print_error(void *log_ctx, mfxStatus err, const char *error_string)
int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs, const char *load_plugins, int gpu_copy)
static mfxStatus qsv_frame_lock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)