19 #include <stdatomic.h>
23 #include <mfx/mfxvideo.h>
53 #define QSV_VERSION_ATLEAST(MAJOR, MINOR) \
54 (MFX_VERSION_MAJOR > (MAJOR) || \
55 MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR))
57 #define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl))
109 #if QSV_VERSION_ATLEAST(1, 27)
127 mfxHDLPair *handle_pair;
128 handle_pair = surf->Data.MemId;
129 switch (base_dev_type) {
132 base_handle[0] = handle_pair->first;
137 base_handle[0] = handle_pair->first;
138 base_handle[1] = handle_pair->second;
143 base_handle[0] = handle_pair->first;
161 static uint32_t qsv_get_d3d11va_bind_flags(
int mem_type)
163 uint32_t bind_flags = 0;
165 if ((mem_type & MFX_MEMTYPE_VIDEO_MEMORY_ENCODER_TARGET) && (mem_type & MFX_MEMTYPE_INTERNAL_FRAME))
166 bind_flags = D3D11_BIND_DECODER | D3D11_BIND_VIDEO_ENCODER;
168 bind_flags = D3D11_BIND_DECODER;
170 if ((MFX_MEMTYPE_FROM_VPPOUT & mem_type) || (MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET & mem_type))
171 bind_flags = D3D11_BIND_RENDER_TARGET;
180 int i, planes_nb = 0;
186 for (
i = 0;
i <
desc->nb_components;
i++)
187 planes_nb =
FFMAX(planes_nb,
desc->comp[
i].plane + 1);
189 for (
i = 0;
i < planes_nb;
i++) {
190 int sheight, dheight, y;
198 if (swidth < 0 || dwidth < 0) {
202 sheight =
src->height;
209 for (y = 0; y < sheight; y++) {
212 comp.depth > 8 ? 2 : 1,
216 for (y = sheight; y < dheight; y++) {
229 int hw_handle_supported = 0;
230 mfxHandleType handle_type;
235 err = MFXQueryIMPL(hwctx->
session, &
s->impl);
236 if (err == MFX_ERR_NONE)
237 err = MFXQueryVersion(hwctx->
session, &
s->ver);
238 if (err != MFX_ERR_NONE) {
245 handle_type = MFX_HANDLE_VA_DISPLAY;
248 hw_handle_supported = 1;
252 handle_type = MFX_HANDLE_D3D11_DEVICE;
255 hw_handle_supported = 1;
259 handle_type = MFX_HANDLE_D3D9_DEVICE_MANAGER;
262 hw_handle_supported = 1;
266 if (hw_handle_supported) {
267 err = MFXVideoCORE_GetHandle(hwctx->
session, handle_type, &
s->handle);
268 if (err == MFX_ERR_NONE) {
269 s->handle_type = handle_type;
270 s->child_device_type = device_type;
276 "from the session\n");
285 if (
s->session_download) {
286 MFXVideoVPP_Close(
s->session_download);
287 MFXClose(
s->session_download);
289 s->session_download =
NULL;
290 s->session_download_init = 0;
292 if (
s->session_upload) {
293 MFXVideoVPP_Close(
s->session_upload);
294 MFXClose(
s->session_upload);
296 s->session_upload =
NULL;
297 s->session_upload_init = 0;
323 s->nb_surfaces_used++;
345 if (!device_priv->
handle) {
347 "Cannot create a non-opaque internal surface pool without "
348 "a hardware handle\n");
353 if (!child_device_ref)
360 child_device_hwctx->
display = (VADisplay)device_priv->
handle;
373 child_device_hwctx->
devmgr = (IDirect3DDeviceManager9*)device_priv->
handle;
384 if (!child_frames_ref) {
400 hwctx->
frame_type = MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET;
401 if (hwctx->
frame_type & MFX_MEMTYPE_SHARED_RESOURCE)
402 child_frames_hwctx->
MiscFlags = D3D11_RESOURCE_MISC_SHARED;
409 if (hwctx->
frame_type & MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET)
410 child_frames_hwctx->
surface_type = DXVA2_VideoProcessorRenderTarget;
412 child_frames_hwctx->
surface_type = DXVA2_VideoDecoderRenderTarget;
425 for (
i = 0;
i <
ctx->initial_pool_size;
i++) {
426 s->handle_pairs_internal[
i].first = child_frames_hwctx->
surface_ids +
i;
427 s->handle_pairs_internal[
i].second = (mfxMemId)MFX_INFINITE;
428 s->surfaces_internal[
i].Data.MemId = (mfxMemId)&
s->handle_pairs_internal[
i];
430 hwctx->
frame_type = MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET;
436 for (
i = 0;
i <
ctx->initial_pool_size;
i++) {
438 if(child_frames_hwctx->
BindFlags & D3D11_BIND_RENDER_TARGET) {
439 s->handle_pairs_internal[
i].second = (mfxMemId)MFX_INFINITE;
443 s->surfaces_internal[
i].Data.MemId = (mfxMemId)&
s->handle_pairs_internal[
i];
445 if (child_frames_hwctx->
BindFlags & D3D11_BIND_RENDER_TARGET) {
446 hwctx->
frame_type |= MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET;
448 hwctx->
frame_type |= MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET;
455 for (
i = 0;
i <
ctx->initial_pool_size;
i++) {
456 s->handle_pairs_internal[
i].first = (mfxMemId)child_frames_hwctx->
surfaces[
i];
457 s->handle_pairs_internal[
i].second = (mfxMemId)MFX_INFINITE;
458 s->surfaces_internal[
i].Data.MemId = (mfxMemId)&
s->handle_pairs_internal[
i];
460 if (child_frames_hwctx->
surface_type == DXVA2_VideoProcessorRenderTarget)
461 hwctx->
frame_type = MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET;
463 hwctx->
frame_type = MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET;
467 s->child_frames_ref = child_frames_ref;
468 child_frames_ref =
NULL;
489 surf->Info.BitDepthLuma =
desc->comp[0].depth;
490 surf->Info.BitDepthChroma =
desc->comp[0].depth;
491 surf->Info.Shift =
desc->comp[0].depth > 8;
493 if (
desc->log2_chroma_w &&
desc->log2_chroma_h)
494 surf->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
495 else if (
desc->log2_chroma_w)
496 surf->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
498 surf->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV444;
500 surf->Info.FourCC =
fourcc;
502 surf->Info.CropW =
ctx->width;
504 surf->Info.CropH =
ctx->height;
505 surf->Info.FrameRateExtN = 25;
506 surf->Info.FrameRateExtD = 1;
507 surf->Info.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
519 if (
ctx->initial_pool_size <= 0) {
525 sizeof(*
s->handle_pairs_internal));
526 if (!
s->handle_pairs_internal)
530 sizeof(*
s->surfaces_internal));
531 if (!
s->surfaces_internal)
534 for (
i = 0;
i <
ctx->initial_pool_size;
i++) {
540 if (!(frames_hwctx->
frame_type & MFX_MEMTYPE_OPAQUE_FRAME)) {
548 if (!
ctx->internal->pool_internal)
551 frames_hwctx->
surfaces =
s->surfaces_internal;
557 static mfxStatus
frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req,
558 mfxFrameAllocResponse *resp)
563 mfxFrameInfo *
i = &req->Info;
564 mfxFrameInfo *i1 = &hwctx->
surfaces[0].Info;
566 if (!(req->Type & MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET) ||
567 !(req->Type & (MFX_MEMTYPE_FROM_VPPIN | MFX_MEMTYPE_FROM_VPPOUT)) ||
568 !(req->Type & MFX_MEMTYPE_EXTERNAL_FRAME))
569 return MFX_ERR_UNSUPPORTED;
570 if (
i->Width > i1->Width ||
i->Height > i1->Height ||
571 i->FourCC != i1->FourCC ||
i->ChromaFormat != i1->ChromaFormat) {
573 "allocation request: %dx%d %d %d vs %dx%d %d %d\n",
574 i->Width,
i->Height,
i->FourCC,
i->ChromaFormat,
575 i1->Width, i1->Height, i1->FourCC, i1->ChromaFormat);
576 return MFX_ERR_UNSUPPORTED;
579 resp->mids =
s->mem_ids;
585 static mfxStatus
frame_free(mfxHDL pthis, mfxFrameAllocResponse *resp)
590 static mfxStatus
frame_lock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
592 return MFX_ERR_UNSUPPORTED;
595 static mfxStatus
frame_unlock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
597 return MFX_ERR_UNSUPPORTED;
602 mfxHDLPair *pair_dst = (mfxHDLPair*)hdl;
603 mfxHDLPair *pair_src = (mfxHDLPair*)mid;
605 pair_dst->first = pair_src->first;
607 if (pair_src->second != (mfxMemId)MFX_INFINITE)
608 pair_dst->second = pair_src->second;
613 mfxSession *session,
int upload)
618 int opaque = !!(frames_hwctx->
frame_type & MFX_MEMTYPE_OPAQUE_FRAME);
620 mfxFrameAllocator frame_allocator = {
632 err = MFXInit(device_priv->
impl, &device_priv->
ver, session);
633 if (err != MFX_ERR_NONE) {
638 if (device_priv->
handle) {
639 err = MFXVideoCORE_SetHandle(*session, device_priv->
handle_type,
641 if (err != MFX_ERR_NONE)
646 err = MFXVideoCORE_SetFrameAllocator(*session, &frame_allocator);
647 if (err != MFX_ERR_NONE)
651 memset(&par, 0,
sizeof(par));
654 par.ExtParam =
s->ext_buffers;
656 par.IOPattern = upload ? MFX_IOPATTERN_OUT_OPAQUE_MEMORY :
657 MFX_IOPATTERN_IN_OPAQUE_MEMORY;
659 par.IOPattern = upload ? MFX_IOPATTERN_OUT_VIDEO_MEMORY :
660 MFX_IOPATTERN_IN_VIDEO_MEMORY;
663 par.IOPattern |= upload ? MFX_IOPATTERN_IN_SYSTEM_MEMORY :
664 MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
667 par.vpp.In = frames_hwctx->
surfaces[0].Info;
673 par.vpp.In.FrameRateExtN = 25;
674 par.vpp.In.FrameRateExtD = 1;
675 par.vpp.Out = par.vpp.In;
677 err = MFXVideoVPP_Init(*session, &par);
678 if (err != MFX_ERR_NONE) {
680 "Surface upload/download will not be possible\n");
693 int opaque = !!(frames_hwctx->
frame_type & MFX_MEMTYPE_OPAQUE_FRAME);
714 sizeof(*
s->surface_ptrs));
715 if (!
s->surface_ptrs)
721 s->opaque_alloc.In.Surfaces =
s->surface_ptrs;
722 s->opaque_alloc.In.NumSurface = frames_hwctx->
nb_surfaces;
723 s->opaque_alloc.In.Type = frames_hwctx->
frame_type;
725 s->opaque_alloc.Out =
s->opaque_alloc.In;
727 s->opaque_alloc.Header.BufferId = MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION;
728 s->opaque_alloc.Header.BufferSz =
sizeof(
s->opaque_alloc);
730 s->ext_buffers[0] = (mfxExtBuffer*)&
s->opaque_alloc;
737 s->mem_ids[
i] = frames_hwctx->
surfaces[
i].Data.MemId;
740 s->session_download =
NULL;
741 s->session_upload =
NULL;
743 s->session_download_init = 0;
744 s->session_upload_init = 0;
777 fmts[0] =
ctx->sw_format;
801 mfxHDLPair *pair = (mfxHDLPair*)src_hwctx->
surfaces[
i].Data.MemId;
812 mfxHDLPair *pair = (mfxHDLPair*)src_hwctx->
surfaces[
i].Data.MemId;
813 dst_hwctx->
texture = (ID3D11Texture2D*)pair->first;
814 if (src_hwctx->
frame_type & MFX_MEMTYPE_SHARED_RESOURCE)
815 dst_hwctx->
MiscFlags = D3D11_RESOURCE_MISC_SHARED;
829 mfxHDLPair *pair = (mfxHDLPair*)src_hwctx->
surfaces[
i].Data.MemId;
830 dst_hwctx->
surfaces[
i] = (IDirect3DSurface9*)pair->first;
833 if (src_hwctx->
frame_type == MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET)
834 dst_hwctx->
surface_type = DXVA2_VideoDecoderRenderTarget;
836 dst_hwctx->
surface_type = DXVA2_VideoProcessorRenderTarget;
851 mfxFrameSurface1 *surf = (mfxFrameSurface1*)
src->data[3];
858 if (!
s->child_frames_ref)
862 switch (child_frames_ctx->device_ctx->type) {
866 mfxHDLPair *pair = (mfxHDLPair*)surf->Data.MemId;
871 child_data = (uint8_t*)(intptr_t)*(VASurfaceID*)pair->first;
878 mfxHDLPair *pair = (mfxHDLPair*)surf->Data.MemId;
879 child_data = pair->first;
886 mfxHDLPair *pair = (mfxHDLPair*)surf->Data.MemId;
887 child_data = pair->first;
895 if (dst->
format == child_frames_ctx->format) {
905 mfxHDLPair *pair = (mfxHDLPair*)surf->Data.MemId;
906 dst->
data[0] = pair->first;
907 dst->
data[1] = pair->second;
909 dst->
data[3] = child_data;
930 dummy->format = child_frames_ctx->format;
935 mfxHDLPair *pair = (mfxHDLPair*)surf->Data.MemId;
936 dummy->data[0] = pair->first;
937 dummy->data[1] = pair->second;
939 dummy->data[3] = child_data;
955 int download = !!
src->hw_frames_ctx;
956 mfxFrameSurface1 *surf = (mfxFrameSurface1*)(download ?
src->data[3] : dst->
data[3]);
968 dummy->buf[0] = download ?
src->buf[0] : dst->
buf[0];
969 dummy->data[3] = surf->Data.MemId;
970 dummy->hw_frames_ctx =
s->child_frames_ref;
986 switch (
frame->format) {
989 surface->Data.Y =
frame->data[0];
990 surface->Data.UV =
frame->data[1];
994 surface->Data.Y =
frame->data[0];
995 surface->Data.U =
frame->data[1];
996 surface->Data.V =
frame->data[2];
1000 surface->Data.B =
frame->data[0];
1001 surface->Data.G =
frame->data[0] + 1;
1002 surface->Data.R =
frame->data[0] + 2;
1003 surface->Data.A =
frame->data[0] + 3;
1007 surface->Data.Y =
frame->data[0];
1008 surface->Data.U =
frame->data[0] + 1;
1009 surface->Data.V =
frame->data[0] + 3;
1013 surface->Data.Y16 = (mfxU16 *)
frame->data[0];
1014 surface->Data.U16 = (mfxU16 *)
frame->data[0] + 1;
1015 surface->Data.V16 = (mfxU16 *)
frame->data[0] + 3;
1019 return MFX_ERR_UNSUPPORTED;
1021 surface->Data.Pitch =
frame->linesize[0];
1022 surface->Data.TimeStamp =
frame->pts;
1030 atomic_int *inited = upload ? &
s->session_upload_init : &
s->session_download_init;
1031 mfxSession *session = upload ? &
s->session_upload : &
s->session_download;
1057 mfxFrameSurface1
out = {{ 0 }};
1058 mfxFrameSurface1 *in = (mfxFrameSurface1*)
src->data[3];
1060 mfxSyncPoint sync =
NULL;
1064 AVFrame *tmp_frame = &
s->realigned_download_frame;
1077 if (tmp_frame->format != dst->
format ||
1082 tmp_frame->format = dst->
format;
1091 dst_frame = realigned ? tmp_frame : dst;
1093 if (!
s->session_download) {
1094 if (
s->child_frames_ref)
1101 out.Info = in->Info;
1105 err = MFXVideoVPP_RunFrameVPPAsync(
s->session_download, in, &
out,
NULL, &sync);
1106 if (err == MFX_WRN_DEVICE_BUSY)
1108 }
while (err == MFX_WRN_DEVICE_BUSY);
1110 if (err < 0 || !sync) {
1116 err = MFXVideoCORE_SyncOperation(
s->session_download, sync, 1000);
1117 }
while (err == MFX_WRN_IN_EXECUTION);
1124 tmp_frame->width = dst->
width;
1125 tmp_frame->height = dst->
height;
1140 mfxFrameSurface1 in = {{ 0 }};
1141 mfxFrameSurface1 *
out = (mfxFrameSurface1*)dst->
data[3];
1142 mfxFrameInfo tmp_info;
1144 mfxSyncPoint sync =
NULL;
1148 AVFrame *tmp_frame = &
s->realigned_upload_frame;
1159 if (
src->height & 15 ||
src->linesize[0] & 15) {
1161 if (tmp_frame->format !=
src->format ||
1162 tmp_frame->width !=
FFALIGN(
src->width, 16) ||
1163 tmp_frame->height !=
FFALIGN(
src->height, 16)) {
1166 tmp_frame->format =
src->format;
1168 tmp_frame->height =
FFALIGN(
src->height, 16);
1184 tmp_info =
out->Info;
1185 out->Info.CropW =
FFMIN(
out->Info.Width, tmp_frame->width);
1186 out->Info.CropH =
FFMIN(
out->Info.Height, tmp_frame->height);
1189 src_frame = realigned ? tmp_frame :
src;
1191 if (!
s->session_upload) {
1192 if (
s->child_frames_ref)
1199 in.Info =
out->Info;
1203 err = MFXVideoVPP_RunFrameVPPAsync(
s->session_upload, &in,
out,
NULL, &sync);
1204 if (err == MFX_WRN_DEVICE_BUSY)
1206 }
while (err == MFX_WRN_DEVICE_BUSY);
1208 if (err < 0 || !sync) {
1214 err = MFXVideoCORE_SyncOperation(
s->session_upload, sync, 1000);
1215 }
while (err == MFX_WRN_IN_EXECUTION);
1222 out->Info.CropW = tmp_info.CropW;
1223 out->Info.CropH = tmp_info.CropH;
1238 "mapped to QSV frames.\n");
1248 sizeof(*
s->handle_pairs_internal));
1249 if (!
s->handle_pairs_internal)
1252 sizeof(*
s->surfaces_internal));
1253 if (!
s->surfaces_internal)
1258 s->handle_pairs_internal[
i].second = (mfxMemId)MFX_INFINITE;
1259 s->surfaces_internal[
i].Data.MemId = (mfxMemId)&
s->handle_pairs_internal[
i];
1262 dst_hwctx->
frame_type = MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET;
1271 sizeof(*
s->handle_pairs_internal));
1272 if (!
s->handle_pairs_internal)
1275 sizeof(*
s->surfaces_internal));
1276 if (!
s->surfaces_internal)
1281 if (src_hwctx->
BindFlags & D3D11_BIND_RENDER_TARGET) {
1282 s->handle_pairs_internal[
i].second = (mfxMemId)MFX_INFINITE;
1286 s->surfaces_internal[
i].Data.MemId = (mfxMemId)&
s->handle_pairs_internal[
i];
1289 if (src_hwctx->
BindFlags & D3D11_BIND_RENDER_TARGET) {
1290 dst_hwctx->
frame_type |= MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET;
1292 dst_hwctx->
frame_type |= MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET;
1302 sizeof(*
s->handle_pairs_internal));
1303 if (!
s->handle_pairs_internal)
1306 sizeof(*
s->surfaces_internal));
1307 if (!
s->surfaces_internal)
1311 s->handle_pairs_internal[
i].first = (mfxMemId)src_hwctx->
surfaces[
i];
1312 s->handle_pairs_internal[
i].second = (mfxMemId)MFX_INFINITE;
1313 s->surfaces_internal[
i].Data.MemId = (mfxMemId)&
s->handle_pairs_internal[
i];
1316 if (src_hwctx->
surface_type == DXVA2_VideoProcessorRenderTarget)
1317 dst_hwctx->
frame_type = MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET;
1319 dst_hwctx->
frame_type = MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET;
1327 dst_hwctx->
surfaces =
s->surfaces_internal;
1339 switch(
src->format) {
1343 mfxHDLPair *pair = (mfxHDLPair*)hwctx->
surfaces[
i].Data.MemId;
1344 if (*(VASurfaceID*)pair->first == (VASurfaceID)
src->data[3]) {
1353 mfxHDLPair *pair = (mfxHDLPair*)hwctx->
surfaces[
i].Data.MemId;
1354 if (pair->first ==
src->data[0]
1355 && pair->second ==
src->data[1]) {
1364 mfxHDLPair *pair = (mfxHDLPair*)hwctx->
surfaces[
i].Data.MemId;
1365 if (pair->first ==
src->data[3]) {
1375 "is not in the mapped frames context.\n");
1392 const void *hwconfig,
1430 static const struct {
1434 {
"auto", MFX_IMPL_AUTO },
1435 {
"sw", MFX_IMPL_SOFTWARE },
1436 {
"hw", MFX_IMPL_HARDWARE },
1437 {
"auto_any", MFX_IMPL_AUTO_ANY },
1438 {
"hw_any", MFX_IMPL_HARDWARE_ANY },
1439 {
"hw2", MFX_IMPL_HARDWARE2 },
1440 {
"hw3", MFX_IMPL_HARDWARE3 },
1441 {
"hw4", MFX_IMPL_HARDWARE4 },
1444 mfxIMPL impl = MFX_IMPL_AUTO_ANY;
1449 if (!strcmp(device, impl_map[
i].
name)) {
1450 impl = impl_map[
i].impl;
1454 impl = strtol(device,
NULL, 0);
1457 if (impl != MFX_IMPL_SOFTWARE) {
1459 impl |= MFX_IMPL_VIA_D3D11;
1461 impl |= MFX_IMPL_VIA_D3D9;
1468 mfxIMPL implementation,
1474 mfxVersion ver = { { 3, 1 } };
1476 mfxHandleType handle_type;
1480 switch (child_device_ctx->
type) {
1485 handle_type = MFX_HANDLE_VA_DISPLAY;
1486 handle = (mfxHDL)child_device_hwctx->
display;
1494 handle_type = MFX_HANDLE_D3D11_DEVICE;
1495 handle = (mfxHDL)child_device_hwctx->
device;
1503 handle_type = MFX_HANDLE_D3D9_DEVICE_MANAGER;
1504 handle = (mfxHDL)child_device_hwctx->
devmgr;
1513 err = MFXInit(implementation, &ver, &hwctx->
session);
1514 if (err != MFX_ERR_NONE) {
1521 err = MFXQueryVersion(hwctx->
session, &ver);
1522 if (err != MFX_ERR_NONE) {
1529 "Initialize MFX session: API version is %d.%d, implementation version is %d.%d\n",
1530 MFX_VERSION_MAJOR, MFX_VERSION_MINOR, ver.Major, ver.Minor);
1534 err = MFXInit(implementation, &ver, &hwctx->
session);
1535 if (err != MFX_ERR_NONE) {
1537 "Error initializing an MFX session: %d.\n", err);
1542 err = MFXVideoCORE_SetHandle(hwctx->
session, handle_type, handle);
1543 if (err != MFX_ERR_NONE) {
1565 child_device_ctx,
flags);
1584 ctx->user_opaque = priv;
1592 "\"%s\".\n", e->
value);
1595 }
else if (CONFIG_VAAPI) {
1597 }
else if (CONFIG_DXVA2) {
1599 "WARNING: defaulting child_device_type to AV_HWDEVICE_TYPE_DXVA2 for compatibility "
1600 "with old commandlines. This behaviour will be removed "
1601 "in the future. Please explicitly set device type via \"-init_hw_device\" option.\n");
1603 }
else if (CONFIG_D3D11VA) {
1610 child_device_opts =
NULL;
1611 switch (child_device_type) {
1620 av_dict_set(&child_device_opts,
"kernel_driver",
"i915", 0);
1621 av_dict_set(&child_device_opts,
"driver",
"iHD", 0);
1643 e ? e->
value :
NULL, child_device_opts, 0);