0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

obs-qsv: Update libmfx, fix QSV with new DCH drivers

This patch fixes QSV failing with new DCH graphics drivers. QSV is not
initializing under certain conditions when the graphics adapter 0 is not
set to iGFX due to outdated MSDK dispatcher. Updating to MSDK with new
dispatcher to enable proper initialization of QSV encoder with DCH
drivers.
This commit is contained in:
brittneysclark 2019-03-28 10:25:24 -07:00 committed by jp9000
parent 4991113abc
commit 092c35b2d7
25 changed files with 1396 additions and 533 deletions

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2012-2015 Intel Corporation. All rights reserved.
Copyright (C) 2012-2017 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -40,6 +40,7 @@ File Name: mfx_dispatcher.h
#include "mfxenc.h"
#include "mfxpak.h"
#define INTEL_VENDOR_ID 0x8086
mfxStatus MFXQueryVersion(mfxSession session, mfxVersion *version);
@ -75,6 +76,16 @@ enum eFunc
eVideoFuncTotal
};
enum ePluginFunc
{
eMFXVideoUSER_Load,
eMFXVideoUSER_LoadByPath,
eMFXVideoUSER_UnLoad,
eMFXAudioUSER_Load,
eMFXAudioUSER_UnLoad,
ePluginFuncTotal
};
enum eAudioFunc
{
eFakeAudioEnum = eMFXGetPriority,
@ -111,8 +122,21 @@ enum
MFX_DISPATCHER_VERSION_MINOR = 2
};
struct _mfxSession
{
// A real handle from MFX engine passed to a called function
mfxSession session;
mfxFunctionPointer callTable[eVideoFuncTotal];
mfxFunctionPointer callPlugInsTable[ePluginFuncTotal];
mfxFunctionPointer callAudioTable[eAudioFuncTotal];
// Current library's implementation (exact implementation)
mfxIMPL impl;
};
// declare a dispatcher's handle
struct MFX_DISP_HANDLE
struct MFX_DISP_HANDLE : public _mfxSession
{
// Default constructor
MFX_DISP_HANDLE(const mfxVersion requiredVersion);
@ -133,15 +157,11 @@ struct MFX_DISP_HANDLE
// Library's implementation type (hardware or software)
eMfxImplType implType;
// Current library's implementation (exact implementation)
mfxIMPL impl;
// Current library's VIA interface
mfxIMPL implInterface;
// Dispatcher's version. If version is 1.1 or lower, then old dispatcher's
// architecture is used. Otherwise it means current dispatcher's version.
mfxVersion dispVersion;
// A real handle passed to a called function
mfxSession session;
// Required API version of session initialized
const mfxVersion apiVersion;
// Actual library API version
@ -159,10 +179,6 @@ struct MFX_DISP_HANDLE
MFX::MFXPluginStorage pluginHive;
MFX::MFXPluginFactory pluginFactory;
// function call table
mfxFunctionPointer callTable[eVideoFuncTotal];
mfxFunctionPointer callAudioTable[eAudioFuncTotal];
private:
// Declare assignment operator and copy constructor to prevent occasional assignment
MFX_DISP_HANDLE(const MFX_DISP_HANDLE &);

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2013-2015 Intel Corporation. All rights reserved.
Copyright (C) 2013-2017 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -37,6 +37,9 @@ File Name: mfx_dispatcher_defs.h
#include <string.h>
#endif
#define MAX_PLUGIN_PATH 4096
#define MAX_PLUGIN_NAME 4096
#if defined(_WIN32) || defined(_WIN64)
typedef wchar_t msdk_disp_char;
#define MSDK2WIDE(x) x
@ -73,7 +76,7 @@ inline std::wstring getWideString(const char * string)
#endif
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(_WIN32) && !defined(_WIN64)
#define sscanf_s sscanf
#define swscanf_s swscanf
#endif

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2012-2013 Intel Corporation. All rights reserved.
Copyright (C) 2012-2017 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -33,6 +33,24 @@ File Name: mfx_dxva2_device.h
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#define TOSTRING(L) #L
#define STRINGIFY(L) TOSTRING(L)
#if defined(MEDIASDK_UWP_LOADER) || defined(MEDIASDK_UWP_PROCTABLE)
#if defined(MFX_D3D9_ENABLED) && !defined(MFX_FORCE_D3D9_ENABLED)
#undef MFX_D3D9_ENABLED
// if you really like to use D3D9 from intel_gfx_api-x64/x86.dll, use MFX_FORCE_D3D9_ENABLED
#pragma message("\n\nATTENTION:\nin file\n\t" __FILE__ " (" STRINGIFY(__LINE__) "):\nUsing of D3D9 disabled for UWP!\n\n")
#endif
#if defined(MFX_FORCE_D3D9_ENABLED)
#define MFX_D3D9_ENABLED
#endif
#else
#define MFX_D3D9_ENABLED
#pragma message("\n\nATTENTION:\nin file\n\t" __FILE__ " (" STRINGIFY(__LINE__) "):\nUsing of D3D9 enabled!\n\n")
#endif
#endif // #if defined(_WIN32) || defined(_WIN64)
#include <mfxdefs.h>
@ -106,7 +124,10 @@ private:
void operator=(const DXDevice &);
};
#if defined(_WIN32) || defined(_WIN64)
#ifdef MFX_D3D9_ENABLED
class D3D9Device : public DXDevice
{
public:
@ -132,6 +153,7 @@ protected:
void *m_pD3D9Ex;
};
#endif // MFX_D3D9_ENABLED
class DXGI1Device : public DXDevice
{
@ -186,9 +208,10 @@ public:
protected:
#ifdef MFX_D3D9_ENABLED
// Get vendor & device IDs by alternative way (D3D9 in Remote Desktop sessions)
void UseAlternativeWay(const D3D9Device *pD3D9Device);
#endif // MFX_D3D9_ENABLED
// Number of adapters available
mfxU32 m_numAdapters;

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
Copyright (C) 2012-2016 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -140,3 +140,12 @@ FUNCTION(mfxStatus, MFXVideoPAK_ProcessFrameAsync, (mfxSession session, mfxPAKIn
FUNCTION(mfxStatus, MFXDoWork, (mfxSession session), (session))
#undef API_VERSION
#define API_VERSION {{19, 1}}
FUNCTION(mfxStatus, MFXVideoENC_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par))
FUNCTION(mfxStatus, MFXVideoPAK_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par))
FUNCTION(mfxStatus, MFXVideoCORE_QueryPlatform, (mfxSession session, mfxPlatform* platform), (session, platform))
FUNCTION(mfxStatus, MFXVideoUSER_GetPlugin, (mfxSession session, mfxU32 type, mfxPlugin *par), (session, type, par))
#undef API_VERSION

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
Copyright (C) 2012-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -33,7 +33,11 @@ File Name: mfx_library_iterator.h
#include <mfxvideo.h>
#if !defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
#include "mfx_win_reg_key.h"
#endif
#include "mfx_dispatcher.h"
#if !defined(_WIN32) && !defined(_WIN64)
@ -71,15 +75,21 @@ enum
MFX_CURRENT_USER_KEY = 0,
MFX_LOCAL_MACHINE_KEY = 1,
MFX_APP_FOLDER = 2,
#if defined(MEDIASDK_USE_REGISTRY) || (!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE))
MFX_PATH_MSDK_FOLDER = 3,
MFX_STORAGE_ID_FIRST = MFX_CURRENT_USER_KEY,
MFX_STORAGE_ID_LAST = MFX_LOCAL_MACHINE_KEY
MFX_STORAGE_ID_LAST = MFX_PATH_MSDK_FOLDER
#else
MFX_PATH_MSDK_FOLDER = 3,
MFX_STORAGE_ID_FIRST = MFX_PATH_MSDK_FOLDER,
MFX_STORAGE_ID_LAST = MFX_PATH_MSDK_FOLDER
#endif // !defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
};
#else
enum
{
MFX_UNKNOWN_KEY = -1,
MFX_STORAGE_ID_OPT = 0, // storage is: /opt/intel
MFX_STORAGE_ID_OPT = 0, // storage is: MFX_MODULES_DIR
MFX_APP_FOLDER = 1,
MFX_STORAGE_ID_FIRST = MFX_STORAGE_ID_OPT,
@ -91,6 +101,8 @@ enum
// Params: adapterNum - in, pImplInterface - in/out, pVendorID - out, pDeviceID - out
mfxStatus SelectImplementationType(const mfxU32 adapterNum, mfxIMPL *pImplInterface, mfxU32 *pVendorID, mfxU32 *pDeviceID);
const mfxU32 msdk_disp_path_len = 1024;
class MFXLibraryIterator
{
public:
@ -134,7 +146,10 @@ protected:
int m_StorageID;
#if defined(_WIN32) || defined(_WIN64)
#if defined(MEDIASDK_USE_REGISTRY) || (!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE))
WinRegKey m_baseRegKey; // (WinRegKey) main registry key
#endif
mfxU32 m_lastLibIndex; // (mfxU32) index of previously returned library
mfxU32 m_lastLibMerit; // (mfxU32) merit of previously returned library
@ -148,7 +163,7 @@ protected:
struct mfx_libs* m_libs;
#endif // #if defined(_WIN32) || defined(_WIN64)
msdk_disp_char m_path[260];
msdk_disp_char m_path[msdk_disp_path_len];
private:
// unimplemented by intent to make this class non-copyable

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2013-2014 Intel Corporation. All rights reserved.
Copyright (C) 2013-2016 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -60,7 +60,9 @@ namespace MFX
mfxPluginParam plgParams;
PluginModule module;
mfxPlugin plugin;
FactoryRecord () {}
FactoryRecord ()
: plugin()
{}
FactoryRecord(const mfxPluginParam &plgParams,
PluginModule &module,
mfxPlugin plugin)

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2013-2014 Intel Corporation. All rights reserved.
Copyright (C) 2013-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -42,16 +42,6 @@ struct MFX_DISP_HANDLE;
namespace MFX {
enum
{
MAX_PLUGIN_PATH = 4096
};
enum
{
MAX_PLUGIN_NAME = 4096
};
inline bool operator == (const mfxPluginUID &lhs, const mfxPluginUID & rhs)
{
return !memcmp(lhs.Data, rhs.Data, sizeof(mfxPluginUID));
@ -108,6 +98,7 @@ namespace MFX {
MFXPluginsInHive(int mfxStorageID, const msdk_disp_char *msdkLibSubKey, mfxVersion currentAPIVersion);
};
#if defined(MEDIASDK_USE_CFGFILES) || (!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE))
//plugins are loaded from FS close to executable
class MFXPluginsInFS : public MFXPluginStorageBase
{
@ -119,7 +110,7 @@ namespace MFX {
bool ParseFile(FILE * f, PluginDescriptionRecord & des);
bool ParseKVPair( msdk_disp_char *key, msdk_disp_char * value, PluginDescriptionRecord & des);
};
#endif //#if defined(MEDIASDK_USE_CFGFILES) || (!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE))
//plugins are loaded from FS close to Runtime library
class MFXDefaultPlugins : public MFXPluginStorageBase

View File

@ -1,6 +1,6 @@
/*******************************************************************************
Copyright (C) 2013-2015 Intel Corporation. All rights reserved.
Copyright (C) 2013-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -62,7 +62,6 @@ enum {
MFX_IMPL_HARDWARE3 = 0x0006, /* Hardware accelerated implementation (3rd device) */
MFX_IMPL_HARDWARE4 = 0x0007, /* Hardware accelerated implementation (4th device) */
MFX_IMPL_RUNTIME = 0x0008,
MFX_IMPL_VIA_ANY = 0x0100,
MFX_IMPL_VIA_D3D9 = 0x0200,
MFX_IMPL_VIA_D3D11 = 0x0300,
@ -151,6 +150,30 @@ typedef struct {
mfxU16 reserved[55];
} mfxExtThreadsParam;
/* PlatformCodeName */
enum {
MFX_PLATFORM_UNKNOWN = 0,
MFX_PLATFORM_SANDYBRIDGE = 1,
MFX_PLATFORM_IVYBRIDGE = 2,
MFX_PLATFORM_HASWELL = 3,
MFX_PLATFORM_BAYTRAIL = 4,
MFX_PLATFORM_BROADWELL = 5,
MFX_PLATFORM_CHERRYTRAIL = 6,
MFX_PLATFORM_SKYLAKE = 7,
MFX_PLATFORM_APOLLOLAKE = 8,
MFX_PLATFORM_KABYLAKE = 9,
MFX_PLATFORM_GEMINILAKE = 10,
MFX_PLATFORM_COFFEELAKE = 11,
MFX_PLATFORM_CANNONLAKE = 20,
MFX_PLATFORM_ICELAKE = 30,
};
typedef struct {
mfxU16 CodeName;
mfxU16 DeviceId;
mfxU16 reserved[14];
} mfxPlatform;
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2007-2015 Intel Corporation. All rights reserved.
Copyright (C) 2007-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -30,6 +30,15 @@ File Name: mfxdefs.h
#ifndef __MFXDEFS_H__
#define __MFXDEFS_H__
#define MFX_VERSION_MAJOR 1
#define MFX_VERSION_MINOR 27
#define MFX_VERSION_NEXT 1028
#ifndef MFX_VERSION
#define MFX_VERSION (MFX_VERSION_MAJOR * 1000 + MFX_VERSION_MINOR)
#endif
#ifdef __cplusplus
extern "C"
{
@ -118,6 +127,8 @@ typedef enum
MFX_ERR_MORE_BITSTREAM = -18, /* expect more bitstream buffers at output */
MFX_ERR_INCOMPATIBLE_AUDIO_PARAM = -19, /* incompatible audio parameters */
MFX_ERR_INVALID_AUDIO_PARAM = -20, /* invalid audio parameters */
MFX_ERR_GPU_HANG = -21, /* device operation failure caused by GPU hang */
MFX_ERR_REALLOC_SURFACE = -22, /* bigger output surface required */
/* warnings >0 */
MFX_WRN_IN_EXECUTION = 1, /* the previous asynchronous operation is in execution */
@ -133,7 +144,10 @@ typedef enum
/* threading statuses */
MFX_TASK_DONE = MFX_ERR_NONE, /* task has been completed */
MFX_TASK_WORKING = 8, /* there is some more work to do */
MFX_TASK_BUSY = 9 /* task is waiting for resources */
MFX_TASK_BUSY = 9, /* task is waiting for resources */
/* plug-in statuses */
MFX_ERR_MORE_DATA_SUBMIT_TASK = -10000, /* return MFX_ERR_MORE_DATA but submit internal asynchronous task */
} mfxStatus;

View File

@ -1,6 +1,6 @@
/******************************************************************************* *\
Copyright (C) 2014 Intel Corporation. All rights reserved.
Copyright (C) 2014-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -51,6 +51,7 @@ struct _mfxENCInput{
mfxU16 NumExtParam;
mfxExtBuffer **ExtParam;
} ;
typedef struct _mfxENCOutput mfxENCOutput;
struct _mfxENCOutput{
mfxU32 reserved[32];
@ -70,6 +71,7 @@ mfxStatus MFX_CDECL MFXVideoENC_Close(mfxSession session);
mfxStatus MFX_CDECL MFXVideoENC_ProcessFrameAsync(mfxSession session, mfxENCInput *in, mfxENCOutput *out, mfxSyncPoint *syncp);
mfxStatus MFX_CDECL MFXVideoENC_GetVideoParam(mfxSession session, mfxVideoParam *par);
#ifdef __cplusplus
} // extern "C"

View File

@ -1,6 +1,6 @@
/******************************************************************************* *\
Copyright (C) 2010-2013 Intel Corporation. All rights reserved.
Copyright (C) 2010-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -73,6 +73,10 @@ enum {
MFX_SCANTYPE_NONINTERLEAVED = 2
};
enum {
MFX_CHROMAFORMAT_JPEG_SAMPLING = 6
};
typedef struct {
mfxExtBuffer Header;

View File

@ -1,6 +1,6 @@
/******************************************************************************* *\
Copyright (C) 2014 Intel Corporation. All rights reserved.
Copyright (C) 2014-2017 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -38,7 +38,7 @@ extern "C"
#endif /* __cplusplus */
typedef struct {
mfxU32 reserved[32];
mfxU16 reserved[32];
mfxFrameSurface1 *InSurface;
@ -49,9 +49,14 @@ typedef struct {
mfxU16 NumExtParam;
mfxExtBuffer **ExtParam;
mfxU16 NumPayload;
mfxPayload **Payload;
} mfxPAKInput;
typedef struct {
mfxU16 reserved[32];
mfxBitstream *Bs;
mfxFrameSurface1 *OutSurface;
@ -62,13 +67,14 @@ typedef struct {
typedef struct _mfxSession *mfxSession;
mfxStatus MFX_CDECL MFXVideoPAK_Query(mfxSession session, mfxVideoParam *in, mfxVideoParam *out);
mfxStatus MFX_CDECL MFXVideoPAK_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request);
mfxStatus MFX_CDECL MFXVideoPAK_QueryIOSurf(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest request[2]);
mfxStatus MFX_CDECL MFXVideoPAK_Init(mfxSession session, mfxVideoParam *par);
mfxStatus MFX_CDECL MFXVideoPAK_Reset(mfxSession session, mfxVideoParam *par);
mfxStatus MFX_CDECL MFXVideoPAK_Close(mfxSession session);
mfxStatus MFX_CDECL MFXVideoPAK_ProcessFrameAsync(mfxSession session, mfxPAKInput *in, mfxPAKOutput *out, mfxSyncPoint *syncp);
mfxStatus MFX_CDECL MFXVideoPAK_GetVideoParam(mfxSession session, mfxVideoParam *par);
#ifdef __cplusplus
} // extern "C"

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2007-2014 Intel Corporation. All rights reserved.
Copyright (C) 2007-2016 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -292,7 +292,18 @@ public:
mfxFrameAllocator & FrameAllocator() {
return m_core.FrameAllocator;
}
mfxStatus GetFrameHandle(mfxFrameData *fd, mfxHDL *handle) {
if (!IsCoreSet()) {
return MFX_ERR_NULL_PTR;
}
return m_core.GetFrameHandle(m_core.pthis, fd, handle);
}
mfxStatus QueryPlatform(mfxPlatform *platform) {
if (!IsCoreSet()) {
return MFX_ERR_NULL_PTR;
}
return m_core.QueryPlatform(m_core.pthis, platform);
}
} ;
/* Class adapter between "C" structure mfxPlugin and C++ interface MFXPlugin */
@ -306,11 +317,13 @@ namespace detail
mfxPlugin m_mfxAPI;
public:
MFXPluginAdapterBase( T *plugin, mfxVideoCodecPlugin *pCodec = NULL)
: m_mfxAPI()
{
SetupCallbacks(plugin, pCodec);
}
MFXPluginAdapterBase( T *plugin, mfxAudioCodecPlugin *pCodec)
: m_mfxAPI()
{
SetupCallbacks(plugin, pCodec);
}

View File

@ -1,6 +1,6 @@
/******************************************************************************* *\
Copyright (C) 2007-2015 Intel Corporation. All rights reserved.
Copyright (C) 2007-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -45,6 +45,7 @@ static const mfxPluginUID MFX_PLUGINID_HEVCD_SW = {{0x15, 0xdd, 0x93, 0x68,
static const mfxPluginUID MFX_PLUGINID_HEVCD_HW = {{0x33, 0xa6, 0x1c, 0x0b, 0x4c, 0x27, 0x45, 0x4c, 0xa8, 0xd8, 0x5d, 0xde, 0x75, 0x7c, 0x6f, 0x8e}};
static const mfxPluginUID MFX_PLUGINID_HEVCE_SW = {{0x2f, 0xca, 0x99, 0x74, 0x9f, 0xdb, 0x49, 0xae, 0xb1, 0x21, 0xa5, 0xb6, 0x3e, 0xf5, 0x68, 0xf7}};
static const mfxPluginUID MFX_PLUGINID_HEVCE_GACC = {{0xe5, 0x40, 0x0a, 0x06, 0xc7, 0x4d, 0x41, 0xf5, 0xb1, 0x2d, 0x43, 0x0b, 0xba, 0xa2, 0x3d, 0x0b}};
static const mfxPluginUID MFX_PLUGINID_HEVCE_DP_GACC = {{0x2b, 0xad, 0x6f, 0x9d, 0x77, 0x54, 0x41, 0x2d, 0xbf, 0x63, 0x03, 0xed, 0x4b, 0xb5, 0x09, 0x68}};
static const mfxPluginUID MFX_PLUGINID_HEVCE_HW = {{0x6f, 0xad, 0xc7, 0x91, 0xa0, 0xc2, 0xeb, 0x47, 0x9a, 0xb6, 0xdc, 0xd5, 0xea, 0x9d, 0xa3, 0x47}};
static const mfxPluginUID MFX_PLUGINID_VP8D_HW = {{0xf6, 0x22, 0x39, 0x4d, 0x8d, 0x87, 0x45, 0x2f, 0x87, 0x8c, 0x51, 0xf2, 0xfc, 0x9b, 0x41, 0x31}};
static const mfxPluginUID MFX_PLUGINID_VP8E_HW = {{0xbf, 0xfc, 0x51, 0x8c, 0xde, 0x13, 0x4d, 0xf9, 0x8a, 0x96, 0xf4, 0xcf, 0x81, 0x6c, 0x0f, 0xac}};
@ -57,6 +58,7 @@ static const mfxPluginUID MFX_PLUGINID_H264LA_HW = {{0x58, 0x8f, 0x11, 0x85,
static const mfxPluginUID MFX_PLUGINID_AACD = {{0xe9, 0x34, 0x67, 0x25, 0xac, 0x2f, 0x4c, 0x93, 0xaa, 0x58, 0x5c, 0x11, 0xc7, 0x08, 0x7c, 0xf4}};
static const mfxPluginUID MFX_PLUGINID_AACE = {{0xb2, 0xa2, 0xa0, 0x5a, 0x4e, 0xac, 0x46, 0xbf, 0xa9, 0xde, 0x7e, 0x80, 0xc9, 0x8d, 0x2e, 0x18}};
static const mfxPluginUID MFX_PLUGINID_HEVCE_FEI_HW = {{0x87, 0xe0, 0xe8, 0x02, 0x07, 0x37, 0x52, 0x40, 0x85, 0x25, 0x15, 0xcf, 0x4a, 0x5e, 0xdd, 0xe6}};
static const mfxPluginUID MFX_PLUGINID_HEVC_FEI_ENCODE = {{0x54, 0x18, 0xa7, 0x06, 0x66, 0xf9, 0x4d, 0x5c, 0xb4, 0xf7, 0xb1, 0xca, 0xee, 0x86, 0x33, 0x9b}};
typedef enum {
@ -114,11 +116,13 @@ typedef struct mfxCoreInterface {
mfxStatus (MFX_CDECL *GetOpaqueSurface)(mfxHDL pthis, mfxFrameSurface1 *surf, mfxFrameSurface1 **op_surf);
mfxStatus (MFX_CDECL *CreateAccelerationDevice)(mfxHDL pthis, mfxHandleType type, mfxHDL *handle);
mfxStatus (MFX_CDECL *GetFrameHandle) (mfxHDL pthis, mfxFrameData *fd, mfxHDL *handle);
mfxStatus (MFX_CDECL *QueryPlatform) (mfxHDL pthis, mfxPlatform *platform);
mfxHDL reserved4[3];
mfxHDL reserved4[1];
} mfxCoreInterface;
/* video codec plugin extension*/
/* video codec plugin extension */
typedef struct _mfxENCInput mfxENCInput;
typedef struct _mfxENCOutput mfxENCOutput;
typedef struct mfxVideoCodecPlugin{
@ -186,6 +190,7 @@ typedef struct mfxPlugin{
mfxStatus MFX_CDECL MFXVideoUSER_Register(mfxSession session, mfxU32 type, const mfxPlugin *par);
mfxStatus MFX_CDECL MFXVideoUSER_Unregister(mfxSession session, mfxU32 type);
mfxStatus MFX_CDECL MFXVideoUSER_GetPlugin(mfxSession session, mfxU32 type, mfxPlugin *par);
mfxStatus MFX_CDECL MFXVideoUSER_ProcessFrameAsync(mfxSession session, const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxSyncPoint *syncp);
mfxStatus MFX_CDECL MFXVideoUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32 version);

View File

@ -1,6 +1,6 @@
/******************************************************************************* *\
Copyright (C) 2007-2015 Intel Corporation. All rights reserved.
Copyright (C) 2007-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -115,7 +115,9 @@ enum {
MFX_FOURCC_R16 = MFX_MAKEFOURCC('R','1','6','U'),
MFX_FOURCC_AYUV = MFX_MAKEFOURCC('A','Y','U','V'), /* YUV 4:4:4, AYUV in that order, A channel is 8 MSBs */
MFX_FOURCC_AYUV_RGB4 = MFX_MAKEFOURCC('A','V','U','Y'), /* ARGB in that order, A channel is 8 MSBs stored in AYUV surface*/
MFX_FOURCC_UYVY = MFX_MAKEFOURCC('U','Y','V','Y')
MFX_FOURCC_UYVY = MFX_MAKEFOURCC('U','Y','V','Y'),
MFX_FOURCC_Y210 = MFX_MAKEFOURCC('Y','2','1','0'),
MFX_FOURCC_Y410 = MFX_MAKEFOURCC('Y','4','1','0'),
};
/* PicStruct */
@ -127,7 +129,13 @@ enum {
MFX_PICSTRUCT_FIELD_REPEATED=0x10, /* first field repeated, pic_struct=5 or 6 in H.264 */
MFX_PICSTRUCT_FRAME_DOUBLING=0x20, /* pic_struct=7 in H.264 */
MFX_PICSTRUCT_FRAME_TRIPLING=0x40 /* pic_struct=8 in H.264 */
MFX_PICSTRUCT_FRAME_TRIPLING=0x40, /* pic_struct=8 in H.264 */
MFX_PICSTRUCT_FIELD_SINGLE =0x100,
MFX_PICSTRUCT_FIELD_TOP =MFX_PICSTRUCT_FIELD_SINGLE | MFX_PICSTRUCT_FIELD_TFF,
MFX_PICSTRUCT_FIELD_BOTTOM =MFX_PICSTRUCT_FIELD_SINGLE | MFX_PICSTRUCT_FIELD_BFF,
MFX_PICSTRUCT_FIELD_PAIRED_PREV =0x200,
MFX_PICSTRUCT_FIELD_PAIRED_NEXT =0x400,
};
/* ColorFormat */
@ -139,7 +147,8 @@ enum {
MFX_CHROMAFORMAT_YUV400 = MFX_CHROMAFORMAT_MONOCHROME,
MFX_CHROMAFORMAT_YUV411 = 4,
MFX_CHROMAFORMAT_YUV422H = MFX_CHROMAFORMAT_YUV422,
MFX_CHROMAFORMAT_YUV422V = 5
MFX_CHROMAFORMAT_YUV422V = 5,
MFX_CHROMAFORMAT_RESERVED1 = 6
};
enum {
@ -165,6 +174,27 @@ enum {
MFX_CORRUPTION_REFERENCE_LIST = 0x0020
};
#pragma pack(push, 4)
typedef struct
{
mfxU32 U : 10;
mfxU32 Y : 10;
mfxU32 V : 10;
mfxU32 A : 2;
} mfxY410;
#pragma pack(pop)
#pragma pack(push, 4)
typedef struct
{
mfxU32 B : 10;
mfxU32 G : 10;
mfxU32 R : 10;
mfxU32 A : 2;
} mfxA2RGB10;
#pragma pack(pop)
/* Frame Data Info */
typedef struct {
union {
@ -173,7 +203,8 @@ typedef struct {
};
mfxU16 NumExtParam;
mfxU16 reserved[10];
mfxU16 reserved[9];
mfxU16 MemType;
mfxU16 PitchHigh;
mfxU64 TimeStamp;
@ -199,12 +230,14 @@ typedef struct {
mfxU8 *U;
mfxU16 *U16;
mfxU8 *G;
mfxY410 *Y410; /* for Y410 format (merged AVYU) */
};
union {
mfxU8 *Cr;
mfxU8 *V;
mfxU16 *V16;
mfxU8 *B;
mfxA2RGB10 *A2RGB10; /* for A2RGB10 format (merged ARGB) */
};
mfxU8 *A;
mfxMemId MemId;
@ -240,7 +273,7 @@ typedef struct {
mfxU16 NumThread;
union {
struct { /* MPEG-2/H.264 Encoding Options */
struct { /* Encoding Options */
mfxU16 TargetUsage;
mfxU16 GopPicSize;
@ -270,20 +303,23 @@ typedef struct {
mfxU16 NumRefFrame;
mfxU16 EncodedOrder;
};
struct { /* H.264, MPEG-2 and VC-1 Decoding Options */
struct { /* Decoding Options */
mfxU16 DecodedOrder;
mfxU16 ExtendedPicStruct;
mfxU16 TimeStampCalc;
mfxU16 SliceGroupsPresent;
mfxU16 MaxDecFrameBuffering;
mfxU16 reserved2[8];
mfxU16 EnableReallocRequest;
mfxU16 reserved2[7];
};
struct { /* JPEG Decoding Options */
mfxU16 JPEGChromaFormat;
mfxU16 Rotation;
mfxU16 JPEGColorFormat;
mfxU16 InterleavedDec;
mfxU16 reserved3[9];
mfxU8 SamplingFactorH[4];
mfxU8 SamplingFactorV[4];
mfxU16 reserved3[5];
};
struct { /* JPEG Encoding Options */
mfxU16 Interleaved;
@ -333,7 +369,9 @@ enum {
MFX_CODEC_HEVC =MFX_MAKEFOURCC('H','E','V','C'),
MFX_CODEC_MPEG2 =MFX_MAKEFOURCC('M','P','G','2'),
MFX_CODEC_VC1 =MFX_MAKEFOURCC('V','C','1',' '),
MFX_CODEC_CAPTURE =MFX_MAKEFOURCC('C','A','P','T')
MFX_CODEC_CAPTURE =MFX_MAKEFOURCC('C','A','P','T'),
MFX_CODEC_VP9 =MFX_MAKEFOURCC('V','P','9',' '),
MFX_CODEC_AV1 =MFX_MAKEFOURCC('A','V','1',' ')
};
/* CodecProfile, CodecLevel */
@ -426,6 +464,13 @@ enum {
MFX_TIER_HEVC_MAIN = 0,
MFX_TIER_HEVC_HIGH = 0x100,
/* VP9 Profiles */
MFX_PROFILE_VP9_0 = 1,
MFX_PROFILE_VP9_1 = 2,
MFX_PROFILE_VP9_2 = 3,
MFX_PROFILE_VP9_3 = 4,
};
/* GopOptFlag */
@ -466,7 +511,7 @@ enum {
MFX_RATECONTROL_LA_ICQ =11,
MFX_RATECONTROL_LA_EXT =12,
MFX_RATECONTROL_LA_HRD =13,
MFX_RATECONTROL_QVBR =14
MFX_RATECONTROL_QVBR =14,
};
/* Trellis control*/
@ -538,6 +583,14 @@ enum {
MFX_SKIPFRAME_BRC_ONLY = 3,
};
/* Intra refresh types */
enum {
MFX_REFRESH_NO = 0,
MFX_REFRESH_VERTICAL = 1,
MFX_REFRESH_HORIZONTAL = 2,
MFX_REFRESH_SLICE = 3
};
typedef struct {
mfxExtBuffer Header;
@ -606,6 +659,7 @@ enum {
MFX_P_REF_PYRAMID = 2
};
typedef struct {
mfxExtBuffer Header;
@ -632,14 +686,46 @@ typedef struct {
mfxU16 OverscanAppropriate; /* tri-state option */
mfxU16 TimingInfoPresent; /* tri-state option */
mfxU16 BitstreamRestriction; /* tri-state option */
mfxU16 reserved1[4];
mfxU16 LowDelayHrd; /* tri-state option */
mfxU16 MotionVectorsOverPicBoundaries; /* tri-state option */
mfxU16 reserved1[2];
mfxU16 ScenarioInfo;
mfxU16 ContentInfo;
mfxU16 PRefType;
mfxU16 FadeDetection; /* tri-state option */
mfxU16 reserved[225];
mfxU16 reserved2[2];
mfxU16 GPB; /* tri-state option */
mfxU32 MaxFrameSizeI;
mfxU32 MaxFrameSizeP;
mfxU32 reserved3[3];
mfxU16 EnableQPOffset; /* tri-state option */
mfxI16 QPOffset[8]; /* FrameQP = QPX + QPOffset[pyramid_layer]; QPX = QPB for B-pyramid, QPP for P-pyramid */
mfxU16 NumRefActiveP[8];
mfxU16 NumRefActiveBL0[8];
mfxU16 NumRefActiveBL1[8];
mfxU16 reserved6;
mfxU16 TransformSkip; /* tri-state option; HEVC transform_skip_enabled_flag */
mfxU16 TargetChromaFormatPlus1; /* Minus 1 specifies target encoding chroma format (see ColorFormat enum). May differ from input one. */
mfxU16 TargetBitDepthLuma; /* Target encoding bit depth for luma samples. May differ from input one. */
mfxU16 TargetBitDepthChroma; /* Target encoding bit depth for chroma samples. May differ from input one. */
mfxU16 BRCPanicMode; /* tri-state option */
mfxU16 LowDelayBRC; /* tri-state option */
mfxU16 EnableMBForceIntra; /* tri-state option */
mfxU16 AdaptiveMaxFrameSize; /* tri-state option */
mfxU16 RepartitionCheckEnable; /* tri-state option */
mfxU16 reserved5[3];
mfxU16 EncodedUnitsInfo; /* tri-state option */
mfxU16 EnableNalUnitType; /* tri-state option */
mfxU16 ExtBrcAdaptiveLTR; /* tri-state option for ExtBRC */
mfxU16 reserved[163];
} mfxExtCodingOption3;
/* IntraPredBlockSize/InterPredBlockSize */
@ -670,7 +756,6 @@ enum {
MFX_BITSTREAM_COMPLETE_FRAME = 0x0001, /* the bitstream contains a complete frame or field pair of data */
MFX_BITSTREAM_EOS = 0x0002
};
/* Extended Buffer Ids */
enum {
MFX_EXTBUFF_CODING_OPTION = MFX_MAKEFOURCC('C','D','O','P'),
@ -700,10 +785,12 @@ enum {
MFX_EXTBUFF_ENCODER_ROI = MFX_MAKEFOURCC('E','R','O','I'),
MFX_EXTBUFF_VPP_DEINTERLACING = MFX_MAKEFOURCC('V','P','D','I'),
MFX_EXTBUFF_AVC_REFLISTS = MFX_MAKEFOURCC('R','L','T','S'),
MFX_EXTBUFF_DEC_VIDEO_PROCESSING = MFX_MAKEFOURCC('D','E','C','V'),
MFX_EXTBUFF_VPP_FIELD_PROCESSING = MFX_MAKEFOURCC('F','P','R','O'),
MFX_EXTBUFF_CODING_OPTION3 = MFX_MAKEFOURCC('C','D','O','3'),
MFX_EXTBUFF_CHROMA_LOC_INFO = MFX_MAKEFOURCC('C','L','I','N'),
MFX_EXTBUFF_MBQP = MFX_MAKEFOURCC('M','B','Q','P'),
MFX_EXTBUFF_MB_FORCE_INTRA = MFX_MAKEFOURCC('M','B','F','I'),
MFX_EXTBUFF_HEVC_TILES = MFX_MAKEFOURCC('2','6','5','T'),
MFX_EXTBUFF_MB_DISABLE_SKIP_MAP = MFX_MAKEFOURCC('M','D','S','M'),
MFX_EXTBUFF_HEVC_PARAM = MFX_MAKEFOURCC('2','6','5','P'),
@ -714,7 +801,27 @@ enum {
MFX_EXTBUFF_DIRTY_RECTANGLES = MFX_MAKEFOURCC('D','R','O','I'),
MFX_EXTBUFF_MOVING_RECTANGLES = MFX_MAKEFOURCC('M','R','O','I'),
MFX_EXTBUFF_CODING_OPTION_VPS = MFX_MAKEFOURCC('C','O','V','P'),
MFX_EXTBUFF_VPP_ROTATION = MFX_MAKEFOURCC('R','O','T',' ')
MFX_EXTBUFF_VPP_ROTATION = MFX_MAKEFOURCC('R','O','T',' '),
MFX_EXTBUFF_ENCODED_SLICES_INFO = MFX_MAKEFOURCC('E','N','S','I'),
MFX_EXTBUFF_VPP_SCALING = MFX_MAKEFOURCC('V','S','C','L'),
MFX_EXTBUFF_HEVC_REFLIST_CTRL = MFX_EXTBUFF_AVC_REFLIST_CTRL,
MFX_EXTBUFF_HEVC_REFLISTS = MFX_EXTBUFF_AVC_REFLISTS,
MFX_EXTBUFF_HEVC_TEMPORAL_LAYERS = MFX_EXTBUFF_AVC_TEMPORAL_LAYERS,
MFX_EXTBUFF_VPP_MIRRORING = MFX_MAKEFOURCC('M','I','R','R'),
MFX_EXTBUFF_MV_OVER_PIC_BOUNDARIES = MFX_MAKEFOURCC('M','V','P','B'),
MFX_EXTBUFF_VPP_COLORFILL = MFX_MAKEFOURCC('V','C','L','F'),
MFX_EXTBUFF_DECODE_ERROR_REPORT = MFX_MAKEFOURCC('D', 'E', 'R', 'R'),
MFX_EXTBUFF_VPP_COLOR_CONVERSION = MFX_MAKEFOURCC('V', 'C', 'S', 'C'),
MFX_EXTBUFF_CONTENT_LIGHT_LEVEL_INFO = MFX_MAKEFOURCC('L', 'L', 'I', 'S'),
MFX_EXTBUFF_MASTERING_DISPLAY_COLOUR_VOLUME = MFX_MAKEFOURCC('D', 'C', 'V', 'S'),
MFX_EXTBUFF_MULTI_FRAME_PARAM = MFX_MAKEFOURCC('M', 'F', 'R', 'P'),
MFX_EXTBUFF_MULTI_FRAME_CONTROL = MFX_MAKEFOURCC('M', 'F', 'R', 'C'),
MFX_EXTBUFF_ENCODED_UNITS_INFO = MFX_MAKEFOURCC('E', 'N', 'U', 'I'),
MFX_EXTBUFF_VPP_MCTF = MFX_MAKEFOURCC('M', 'C', 'T', 'F'),
MFX_EXTBUFF_VP9_SEGMENTATION = MFX_MAKEFOURCC('9', 'S', 'E', 'G'),
MFX_EXTBUFF_VP9_TEMPORAL_LAYERS = MFX_MAKEFOURCC('9', 'T', 'M', 'L'),
MFX_EXTBUFF_VP9_PARAM = MFX_MAKEFOURCC('9', 'P', 'A', 'R'),
MFX_EXTBUFF_AVC_ROUNDING_OFFSET = MFX_MAKEFOURCC('R','N','D','O'),
};
/* VPP Conf: Do not use certain algorithms */
@ -781,8 +888,14 @@ typedef struct {
mfxU16 RepeatedFrame;
} mfxExtVppAuxData;
/* CtrlFlags */
enum {
MFX_PAYLOAD_CTRL_SUFFIX = 0x00000001 /* HEVC suffix SEI */
};
typedef struct {
mfxU32 reserved[4];
mfxU32 CtrlFlags;
mfxU32 reserved[3];
mfxU8 *Data; /* buffer pointer */
mfxU32 NumBit; /* number of bits */
mfxU16 Type; /* SEI message type in H.264 or user data start_code in MPEG-2 */
@ -791,7 +904,9 @@ typedef struct {
typedef struct {
mfxExtBuffer Header;
mfxU32 reserved[5];
mfxU32 reserved[4];
mfxU16 reserved1;
mfxU16 MfxNalUnitType;
mfxU16 SkipFrame;
mfxU16 QP; /* per frame QP */
@ -812,7 +927,7 @@ enum {
};
/* Frame Memory Types */
#define MFX_MEMTYPE_BASE(x) (0xf0ff & (x))
#define MFX_MEMTYPE_BASE(x) (0x90ff & (x))
enum {
MFX_MEMTYPE_DXVA2_DECODER_TARGET =0x0010,
@ -826,13 +941,15 @@ enum {
MFX_MEMTYPE_FROM_DECODE = 0x0200,
MFX_MEMTYPE_FROM_VPPIN = 0x0400,
MFX_MEMTYPE_FROM_VPPOUT = 0x0800,
MFX_MEMTYPE_FROM_ENC = 0x2000,
MFX_MEMTYPE_FROM_PAK = 0x4000, //reserved
MFX_MEMTYPE_INTERNAL_FRAME = 0x0001,
MFX_MEMTYPE_EXTERNAL_FRAME = 0x0002,
MFX_MEMTYPE_OPAQUE_FRAME = 0x0004,
MFX_MEMTYPE_EXPORT_FRAME = 0x0008,
MFX_MEMTYPE_RESERVED2 = 0x1000
MFX_MEMTYPE_SHARED_RESOURCE = MFX_MEMTYPE_EXPORT_FRAME,
MFX_MEMTYPE_VIDEO_MEMORY_ENCODER_TARGET = 0x1000
};
typedef struct {
@ -877,13 +994,26 @@ enum {
MFX_FRAMETYPE_xIDR =0x8000
};
enum {
MFX_HEVC_NALU_TYPE_UNKNOWN = 0,
MFX_HEVC_NALU_TYPE_TRAIL_N = ( 0+1),
MFX_HEVC_NALU_TYPE_TRAIL_R = ( 1+1),
MFX_HEVC_NALU_TYPE_RADL_N = ( 6+1),
MFX_HEVC_NALU_TYPE_RADL_R = ( 7+1),
MFX_HEVC_NALU_TYPE_RASL_N = ( 8+1),
MFX_HEVC_NALU_TYPE_RASL_R = ( 9+1),
MFX_HEVC_NALU_TYPE_IDR_W_RADL = (19+1),
MFX_HEVC_NALU_TYPE_IDR_N_LP = (20+1),
MFX_HEVC_NALU_TYPE_CRA_NUT = (21+1)
};
typedef enum {
MFX_HANDLE_DIRECT3D_DEVICE_MANAGER9 =1, /* IDirect3DDeviceManager9 */
MFX_HANDLE_D3D9_DEVICE_MANAGER = MFX_HANDLE_DIRECT3D_DEVICE_MANAGER9,
MFX_HANDLE_RESERVED1 = 2,
MFX_HANDLE_D3D11_DEVICE = 3,
MFX_HANDLE_VA_DISPLAY = 4,
MFX_HANDLE_RESERVED3 = 5
MFX_HANDLE_RESERVED3 = 5,
} mfxHandleType;
typedef enum {
@ -983,6 +1113,36 @@ typedef struct {
mfxU16 reserved[11];
} mfxExtVPPImageStab;
enum {
MFX_PAYLOAD_OFF = 0,
MFX_PAYLOAD_IDR = 1
};
typedef struct {
mfxExtBuffer Header;
mfxU16 reserved[15];
mfxU16 InsertPayloadToggle;
mfxU16 DisplayPrimariesX[3];
mfxU16 DisplayPrimariesY[3];
mfxU16 WhitePointX;
mfxU16 WhitePointY;
mfxU32 MaxDisplayMasteringLuminance;
mfxU32 MinDisplayMasteringLuminance;
} mfxExtMasteringDisplayColourVolume;
typedef struct {
mfxExtBuffer Header;
mfxU16 reserved[9];
mfxU16 InsertPayloadToggle;
mfxU16 MaxContentLightLevel;
mfxU16 MaxPicAverageLightLevel;
} mfxExtContentLightLevelInfo;
typedef struct {
mfxExtBuffer Header;
mfxU32 reserved[14];
@ -1018,6 +1178,7 @@ typedef struct {
}Layer[8];
} mfxExtAvcTemporalLayers;
typedef struct {
mfxExtBuffer Header;
@ -1069,10 +1230,11 @@ typedef struct mfxVPPCompInputStream {
mfxU16 GlobalAlphaEnable;
mfxU16 GlobalAlpha;
mfxU16 PixelAlphaEnable;
mfxU16 reserved2[18];
mfxU16 TileId;
mfxU16 reserved2[17];
} mfxVPPCompInputStream;
typedef struct {
@ -1091,8 +1253,8 @@ typedef struct {
mfxU16 V;
mfxU16 B;
};
mfxU16 reserved1[24];
mfxU16 NumTiles;
mfxU16 reserved1[23];
mfxU16 NumInputStream;
mfxVPPCompInputStream *InputStream;
@ -1116,26 +1278,44 @@ typedef struct {
mfxExtBuffer Header;
mfxU16 reserved1[4];
union {
struct { // Init
struct {
mfxU16 TransferMatrix;
mfxU16 NominalRange;
mfxU16 reserved2[6];
} In, Out;
};
struct { // Runtime
mfxU16 TransferMatrix;
mfxU16 NominalRange;
mfxU16 reserved3[14];
};
};
} mfxExtVPPVideoSignalInfo;
/* ROI encoding mode */
enum {
MFX_ROI_MODE_PRIORITY = 0,
MFX_ROI_MODE_QP_DELTA = 1
};
typedef struct {
mfxExtBuffer Header;
mfxU16 NumROI;
mfxU16 reserved1[11];
mfxU16 ROIMode;
mfxU16 reserved1[10];
struct {
mfxU32 Left;
mfxU32 Top;
mfxU32 Right;
mfxU32 Bottom;
union {
mfxI16 Priority;
mfxI16 DeltaQP;
};
mfxU16 reserved2[7];
} ROI[256];
} mfxExtEncoderROI;
@ -1152,7 +1332,9 @@ enum {
MFX_DEINTERLACING_FIXED_TELECINE_PATTERN = 8,
MFX_DEINTERLACING_30FPS_OUT = 9,
MFX_DEINTERLACING_DETECT_INTERLACE = 10,
MFX_DEINTERLACING_ADVANCED_NOREF = 11
MFX_DEINTERLACING_ADVANCED_NOREF = 11,
MFX_DEINTERLACING_ADVANCED_SCD = 12,
MFX_DEINTERLACING_FIELD_WEAVING = 13
};
/*TelecinePattern*/
@ -1209,6 +1391,35 @@ typedef struct {
mfxU16 reserved[25];
} mfxExtVPPFieldProcessing;
typedef struct {
mfxExtBuffer Header;
struct mfxIn{
mfxU16 CropX;
mfxU16 CropY;
mfxU16 CropW;
mfxU16 CropH;
mfxU16 reserved[12];
}In;
struct mfxOut{
mfxU32 FourCC;
mfxU16 ChromaFormat;
mfxU16 reserved1;
mfxU16 Width;
mfxU16 Height;
mfxU16 CropX;
mfxU16 CropY;
mfxU16 CropW;
mfxU16 CropH;
mfxU16 reserved[22];
}Out;
mfxU16 reserved[13];
} mfxExtDecVideoProcessing;
typedef struct {
mfxExtBuffer Header;
@ -1218,16 +1429,36 @@ typedef struct {
mfxU16 reserved[9];
} mfxExtChromaLocInfo;
/* MBQPMode */
enum {
MFX_MBQP_MODE_QP_VALUE = 0, // supported in CQP mode only
MFX_MBQP_MODE_QP_DELTA = 1
};
typedef struct {
mfxExtBuffer Header;
mfxU32 reserved[10];
mfxU16 Mode; // see MBQPMode enum
mfxU16 BlockSize; // QP block size, valid for HEVC only during Init and Runtime
mfxU32 NumQPAlloc; // Size of allocated by application QP or DeltaQP array
union {
mfxU8 *QP; // Block QP value. Valid when Mode = MFX_MBQP_MODE_QP_VALUE
mfxI8 *DeltaQP; // For block i: QP[i] = BrcQP[i] + DeltaQP[i]. Valid when Mode = MFX_MBQP_MODE_QP_DELTA
mfxU64 reserved2;
};
} mfxExtMBQP;
typedef struct {
mfxExtBuffer Header;
mfxU32 reserved[11];
mfxU32 NumQPAlloc;
mfxU32 MapSize;
union {
mfxU8 *QP;
mfxU8 *Map;
mfxU64 reserved2;
};
} mfxExtMBQP;
} mfxExtMBForceIntra;
typedef struct {
mfxExtBuffer Header;
@ -1248,6 +1479,7 @@ typedef struct {
};
} mfxExtMBDisableSkipMap;
/*GeneralConstraintFlags*/
enum {
/* REXT Profile constraint flags*/
@ -1262,6 +1494,16 @@ enum {
MFX_HEVC_CONSTR_REXT_LOWER_BIT_RATE = (1 << 8)
};
/* SampleAdaptiveOffset */
enum {
MFX_SAO_UNKNOWN = 0x00,
MFX_SAO_DISABLE = 0x01,
MFX_SAO_ENABLE_LUMA = 0x02,
MFX_SAO_ENABLE_CHROMA = 0x04
};
#pragma pack(push, 4)
typedef struct {
mfxExtBuffer Header;
@ -1269,10 +1511,29 @@ typedef struct {
mfxU16 PicWidthInLumaSamples;
mfxU16 PicHeightInLumaSamples;
mfxU64 GeneralConstraintFlags;
mfxU16 reserved[118];
mfxU16 SampleAdaptiveOffset; /* see enum SampleAdaptiveOffset, valid during Init and Runtime */
mfxU16 LCUSize;
mfxU16 reserved[116];
} mfxExtHEVCParam;
#pragma pack(pop)
/*ErrorTypes in mfxExtDecodeErrorReport*/
enum {
MFX_ERROR_PPS = (1 << 0),
MFX_ERROR_SPS = (1 << 1),
MFX_ERROR_SLICEHEADER = (1 << 2),
MFX_ERROR_SLICEDATA = (1 << 3),
MFX_ERROR_FRAME_GAP = (1 << 4),
};
typedef struct {
mfxExtBuffer Header;
mfxU32 ErrorTypes;
mfxU16 reserved[10];
} mfxExtDecodeErrorReport;
typedef struct {
mfxExtBuffer Header;
@ -1322,6 +1583,18 @@ typedef struct {
mfxU16 reserved[58];
} mfxExtPredWeightTable;
typedef struct {
mfxExtBuffer Header;
mfxU16 EnableRoundingIntra; // tri-state option
mfxU16 RoundingOffsetIntra; // valid value [0,7]
mfxU16 EnableRoundingInter; // tri-state option
mfxU16 RoundingOffsetInter; // valid value [0,7]
mfxU16 reserved[24];
} mfxExtAVCRoundingOffset;
typedef struct {
mfxExtBuffer Header;
@ -1356,6 +1629,7 @@ typedef struct {
} Rect[256];
} mfxExtMoveRect;
/* Angle */
enum {
MFX_ANGLE_0 = 0,
@ -1371,9 +1645,226 @@ typedef struct {
mfxU16 reserved[11];
} mfxExtVPPRotation;
typedef struct {
mfxExtBuffer Header;
mfxU16 SliceSizeOverflow;
mfxU16 NumSliceNonCopliant;
mfxU16 NumEncodedSlice;
mfxU16 NumSliceSizeAlloc;
union {
mfxU16 *SliceSize;
mfxU64 reserved1;
};
mfxU16 reserved[20];
} mfxExtEncodedSlicesInfo;
/* ScalingMode */
enum {
MFX_SCALING_MODE_DEFAULT = 0,
MFX_SCALING_MODE_LOWPOWER = 1,
MFX_SCALING_MODE_QUALITY = 2
};
typedef struct {
mfxExtBuffer Header;
mfxU16 ScalingMode;
mfxU16 reserved[11];
} mfxExtVPPScaling;
typedef mfxExtAVCRefListCtrl mfxExtHEVCRefListCtrl;
typedef mfxExtAVCRefLists mfxExtHEVCRefLists;
typedef mfxExtAvcTemporalLayers mfxExtHEVCTemporalLayers;
/* MirroringType */
enum
{
MFX_MIRRORING_DISABLED = 0,
MFX_MIRRORING_HORIZONTAL = 1,
MFX_MIRRORING_VERTICAL = 2
};
typedef struct {
mfxExtBuffer Header;
mfxU16 Type;
mfxU16 reserved[11];
} mfxExtVPPMirroring;
typedef struct {
mfxExtBuffer Header;
mfxU16 StickTop; /* tri-state option */
mfxU16 StickBottom; /* tri-state option */
mfxU16 StickLeft; /* tri-state option */
mfxU16 StickRight; /* tri-state option */
mfxU16 reserved[8];
} mfxExtMVOverPicBoundaries;
typedef struct {
mfxExtBuffer Header;
mfxU16 Enable; /* tri-state option */
mfxU16 reserved[11];
} mfxExtVPPColorFill;
/* ChromaSiting */
enum {
MFX_CHROMA_SITING_UNKNOWN = 0x0000,
MFX_CHROMA_SITING_VERTICAL_TOP = 0x0001, /* Chroma samples are co-sited vertically on the top with the luma samples. */
MFX_CHROMA_SITING_VERTICAL_CENTER = 0x0002, /* Chroma samples are not co-sited vertically with the luma samples. */
MFX_CHROMA_SITING_VERTICAL_BOTTOM = 0x0004, /* Chroma samples are co-sited vertically on the bottom with the luma samples. */
MFX_CHROMA_SITING_HORIZONTAL_LEFT = 0x0010, /* Chroma samples are co-sited horizontally on the left with the luma samples. */
MFX_CHROMA_SITING_HORIZONTAL_CENTER = 0x0020 /* Chroma samples are not co-sited horizontally with the luma samples. */
};
typedef struct {
mfxExtBuffer Header;
mfxU16 ChromaSiting;
mfxU16 reserved[27];
} mfxExtColorConversion;
/* VP9ReferenceFrame */
enum {
MFX_VP9_REF_INTRA = 0,
MFX_VP9_REF_LAST = 1,
MFX_VP9_REF_GOLDEN = 2,
MFX_VP9_REF_ALTREF = 3
};
/* SegmentIdBlockSize */
enum {
MFX_VP9_SEGMENT_ID_BLOCK_SIZE_UNKNOWN = 0,
MFX_VP9_SEGMENT_ID_BLOCK_SIZE_8x8 = 8,
MFX_VP9_SEGMENT_ID_BLOCK_SIZE_16x16 = 16,
MFX_VP9_SEGMENT_ID_BLOCK_SIZE_32x32 = 32,
MFX_VP9_SEGMENT_ID_BLOCK_SIZE_64x64 = 64,
};
/* SegmentFeature */
enum {
MFX_VP9_SEGMENT_FEATURE_QINDEX = 0x0001,
MFX_VP9_SEGMENT_FEATURE_LOOP_FILTER = 0x0002,
MFX_VP9_SEGMENT_FEATURE_REFERENCE = 0x0004,
MFX_VP9_SEGMENT_FEATURE_SKIP = 0x0008 /* (0,0) MV, no residual */
};
typedef struct {
mfxU16 FeatureEnabled; /* see enum SegmentFeature */
mfxI16 QIndexDelta;
mfxI16 LoopFilterLevelDelta;
mfxU16 ReferenceFrame; /* see enum VP9ReferenceFrame */
mfxU16 reserved[12];
} mfxVP9SegmentParam;
typedef struct {
mfxExtBuffer Header;
mfxU16 NumSegments; /* 0..8 */
mfxVP9SegmentParam Segment[8];
mfxU16 SegmentIdBlockSize; /* see enum SegmentIdBlockSize */
mfxU32 NumSegmentIdAlloc; /* >= (Ceil(Width / SegmentIdBlockSize) * Ceil(Height / SegmentIdBlockSize)) */
union {
mfxU8 *SegmentId; /*[NumSegmentIdAlloc] = 0..7, index in Segment array, blocks of SegmentIdBlockSize map */
mfxU64 reserved1;
};
mfxU16 reserved[52];
} mfxExtVP9Segmentation;
typedef struct {
mfxU16 FrameRateScale; /* Layer[n].FrameRateScale = Layer[n - 1].FrameRateScale * (uint)m */
mfxU16 TargetKbps; /* affected by BRCParamMultiplier, Layer[n].TargetKbps > Layer[n - 1].TargetKbps */
mfxU16 reserved[14];
} mfxVP9TemporalLayer;
typedef struct {
mfxExtBuffer Header;
mfxVP9TemporalLayer Layer[8];
mfxU16 reserved[60];
} mfxExtVP9TemporalLayers;
typedef struct {
mfxExtBuffer Header;
mfxU16 FrameWidth;
mfxU16 FrameHeight;
mfxU16 WriteIVFHeaders; /* tri-state option */
mfxI16 reserved1[6];
mfxI16 QIndexDeltaLumaDC;
mfxI16 QIndexDeltaChromaAC;
mfxI16 QIndexDeltaChromaDC;
mfxU16 reserved[112];
} mfxExtVP9Param;
/* Multi-Frame Mode */
enum {
MFX_MF_DEFAULT = 0,
MFX_MF_DISABLED = 1,
MFX_MF_AUTO = 2,
MFX_MF_MANUAL = 3
};
/* Multi-Frame Initialization parameters */
typedef struct {
mfxExtBuffer Header;
mfxU16 MFMode;
mfxU16 MaxNumFrames;
mfxU16 reserved[58];
} mfxExtMultiFrameParam;
/* Multi-Frame Run-time controls */
typedef struct {
mfxExtBuffer Header;
mfxU32 Timeout; /* timeout in millisecond */
mfxU16 Flush; /* Flush internal frame buffer, e.g. submit all collected frames. */
mfxU16 reserved[57];
} mfxExtMultiFrameControl;
typedef struct {
mfxU16 Type;
mfxU16 reserved1;
mfxU32 Offset;
mfxU32 Size;
mfxU32 reserved[5];
} mfxEncodedUnitInfo;
typedef struct {
mfxExtBuffer Header;
union {
mfxEncodedUnitInfo *UnitInfo;
mfxU64 reserved1;
};
mfxU16 NumUnitsAlloc;
mfxU16 NumUnitsEncoded;
mfxU16 reserved[22];
} mfxExtEncodedUnitsInfo;
/* MCTF initialization & runtime */
typedef struct {
mfxExtBuffer Header;
mfxU16 FilterStrength;
mfxU16 reserved[27];
} mfxExtVppMctf;
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2007-2014 Intel Corporation. All rights reserved.
Copyright (C) 2007-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -64,6 +64,7 @@ public:
virtual mfxStatus SetFrameAllocator(mfxFrameAllocator *allocator) { return MFXVideoCORE_SetFrameAllocator(m_session, allocator); }
virtual mfxStatus SetHandle(mfxHandleType type, mfxHDL hdl) { return MFXVideoCORE_SetHandle(m_session, type, hdl); }
virtual mfxStatus GetHandle(mfxHandleType type, mfxHDL *hdl) { return MFXVideoCORE_GetHandle(m_session, type, hdl); }
virtual mfxStatus QueryPlatform(mfxPlatform* platform) { return MFXVideoCORE_QueryPlatform(m_session, platform); }
virtual mfxStatus SyncOperation(mfxSyncPoint syncp, mfxU32 wait) { return MFXVideoCORE_SyncOperation(m_session, syncp, wait); }
@ -164,6 +165,7 @@ public:
virtual mfxStatus Reset(mfxVideoParam *par) { return MFXVideoENC_Reset(m_session, par); }
virtual mfxStatus Close(void) { return MFXVideoENC_Close(m_session); }
virtual mfxStatus GetVideoParam(mfxVideoParam *par) { return MFXVideoENC_GetVideoParam(m_session, par); }
virtual mfxStatus ProcessFrameAsync(mfxENCInput *in, mfxENCOutput *out, mfxSyncPoint *syncp) { return MFXVideoENC_ProcessFrameAsync(m_session, in, out, syncp); }
protected:
@ -184,7 +186,7 @@ public:
virtual mfxStatus Reset(mfxVideoParam *par) { return MFXVideoPAK_Reset(m_session, par); }
virtual mfxStatus Close(void) { return MFXVideoPAK_Close(m_session); }
//virtual mfxStatus GetVideoParam(mfxVideoParam *par) { return MFXVideoENCODE_GetVideoParam(m_session, par); }
virtual mfxStatus GetVideoParam(mfxVideoParam *par) { return MFXVideoPAK_GetVideoParam(m_session, par); }
//virtual mfxStatus GetEncodeStat(mfxEncodeStat *stat) { return MFXVideoENCODE_GetEncodeStat(m_session, stat); }
virtual mfxStatus ProcessFrameAsync(mfxPAKInput *in, mfxPAKOutput *out, mfxSyncPoint *syncp) { return MFXVideoPAK_ProcessFrameAsync(m_session, in, out, syncp); }

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2007-2015 Intel Corporation. All rights reserved.
Copyright (C) 2007-2017 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -32,9 +32,6 @@ File Name: mfxvideo.h
#include "mfxsession.h"
#include "mfxvstructures.h"
#define MFX_VERSION_MAJOR 1
#define MFX_VERSION_MINOR 17
#ifdef __cplusplus
extern "C"
{
@ -66,6 +63,7 @@ mfxStatus MFX_CDECL MFXVideoCORE_SetBufferAllocator(mfxSession session, mfxBuffe
mfxStatus MFX_CDECL MFXVideoCORE_SetFrameAllocator(mfxSession session, mfxFrameAllocator *allocator);
mfxStatus MFX_CDECL MFXVideoCORE_SetHandle(mfxSession session, mfxHandleType type, mfxHDL hdl);
mfxStatus MFX_CDECL MFXVideoCORE_GetHandle(mfxSession session, mfxHandleType type, mfxHDL *hdl);
mfxStatus MFX_CDECL MFXVideoCORE_QueryPlatform(mfxSession session, mfxPlatform* platform);
mfxStatus MFX_CDECL MFXVideoCORE_SyncOperation(mfxSession session, mfxSyncPoint syncp, mfxU32 wait);
/* VideoENCODE */

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2012-2015 Intel Corporation. All rights reserved.
Copyright (C) 2012-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -28,6 +28,9 @@ File Name: main.cpp
\* ****************************************************************************** */
#include <new>
#include <memory>
#include "mfx_dispatcher.h"
#include "mfx_load_dll.h"
#include "mfx_dispatcher_log.h"
@ -35,7 +38,7 @@ File Name: main.cpp
#include "mfx_critical_section.h"
#include <string.h> /* for memset on Linux */
#include <memory>
#include <stdlib.h> /* for qsort on Linux */
#include "mfx_load_plugin.h"
#include "mfx_plugin_hive.h"
@ -66,7 +69,7 @@ namespace
{MFX_LIB_HARDWARE, MFX_IMPL_HARDWARE3, 2},
{MFX_LIB_HARDWARE, MFX_IMPL_HARDWARE4, 3},
{MFX_LIB_SOFTWARE, MFX_IMPL_SOFTWARE, 0},
{MFX_LIB_SOFTWARE, MFX_IMPL_SOFTWARE | MFX_IMPL_AUDIO, 0}
{MFX_LIB_SOFTWARE, MFX_IMPL_SOFTWARE | MFX_IMPL_AUDIO, 0},
};
const
@ -88,6 +91,7 @@ namespace
{4, 4}, // MFX_IMPL_HARDWARE3
{5, 5}, // MFX_IMPL_HARDWARE4
{2, 6}, // MFX_IMPL_RUNTIME, same as MFX_IMPL_HARDWARE_ANY
{8, 11}, // MFX_SINGLE_THREAD,
{7, 7} // MFX_IMPL_AUDIO
};
@ -96,6 +100,36 @@ namespace
} // namespace
using namespace MFX;
#if defined(MEDIASDK_UWP_LOADER)
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
//
// intel_gfx_api-*.dll calls these functions to do not mix MFXInitEx exposed
// from dispatcher_proc_table.lib with the libmfx[hw/sw] engines' call MFXInitEx
//
mfxStatus InitMediaSDKSession(mfxInitParam par, mfxSession* session)
{
return MFXInitEx(par, session);
}
mfxStatus DisposeMediaSDKSession(mfxSession session)
{
return MFXClose(session);
}
#ifdef __cplusplus
}; //extern "C"
#endif /* __cplusplus */
#endif // defined(MEDIASDK_UWP_LOADER)
#if !defined(MEDIASDK_UWP_PROCTABLE)
//
// Implement DLL exposed functions. MFXInit and MFXClose have to do
// slightly more than other. They require to be implemented explicitly.
@ -151,24 +185,8 @@ int HandleSort (const void * plhs, const void * prhs)
return 0;
}
mfxStatus MFXInit(mfxIMPL impl, mfxVersion *pVer, mfxSession *session)
{
mfxInitParam par = {};
par.Implementation = impl;
if (pVer)
{
par.Version = *pVer;
}
else
{
par.Version.Major = DEFAULT_API_VERSION_MAJOR;
par.Version.Minor = DEFAULT_API_VERSION_MINOR;
}
par.ExternalThreads = 0;
return MFXInitEx(par, session);
}
// for LEGACY and UWP_LOADER purposes implementation of MFXinitEx is traditionally loading
// required libmfx*.dll and fill the array of API functions' with corresponded pointers to instantiated libmfx*.dll
mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
{
@ -186,8 +204,9 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
VectorHandleGuard handleGuard(allocatedHandle);
MFX_DISP_HANDLE *pHandle;
msdk_disp_char dllName[MFX_MAX_DLL_PATH];
msdk_disp_char dllName[MFX_MAX_DLL_PATH] = { 0 };
MFX::MFXLibraryIterator libIterator;
// there iterators are used only if the caller specified implicit type like AUTO
mfxU32 curImplIdx, maxImplIdx;
// particular implementation value
@ -232,7 +251,6 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
// Load HW library or RT from system location
curImplIdx = implTypesRange[implMethod].minIndex;
maxImplIdx = implTypesRange[implMethod].maxIndex;
mfxU32 hwImplIdx = 0;
do
{
int currentStorage = MFX::MFX_STORAGE_ID_FIRST;
@ -260,7 +278,7 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
do
{
eMfxImplType implType;
eMfxImplType implType = implTypes[curImplIdx].implType;
// select a desired DLL
mfxRes = libIterator.SelectDLLVersion(dllName,
@ -272,8 +290,6 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
break;
}
DISPATCHER_LOG_INFO((("loading library %S\n"), MSDK2WIDE(dllName)));
if (MFX_LIB_HARDWARE == implTypes[curImplIdx].implType)
hwImplIdx = curImplIdx;
// try to load the selected DLL
curImpl = implTypes[curImplIdx].impl;
mfxRes = pHandle->LoadSelectedDLL(dllName, implType, curImpl, implInterface, par);
@ -284,7 +300,7 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
}
else
{
libIterator.GetSubKeyName(pHandle->subkeyName, sizeof(pHandle->subkeyName)/sizeof(pHandle->subkeyName[0])) ;
libIterator.GetSubKeyName(pHandle->subkeyName, sizeof(pHandle->subkeyName) / sizeof(pHandle->subkeyName[0]));
pHandle->storageID = libIterator.GetStorageID();
allocatedHandle.push_back(pHandle);
pHandle = new MFX_DISP_HANDLE(requiredVersion);
@ -293,7 +309,7 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
} while (MFX_ERR_NONE != mfxRes);
}
// select another registry key
// select another place for loading engine
currentStorage += 1;
} while ((MFX_ERR_NONE != mfxRes) && (MFX::MFX_STORAGE_ID_LAST >= currentStorage));
@ -304,6 +320,9 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
curImplIdx = implTypesRange[implMethod].minIndex;
maxImplIdx = implTypesRange[implMethod].maxIndex;
// SOLID dispatcher checks if there are other available media sdk engines implementations in working dir
// UWP dispatcher does not use libraries other than in System32 folder
#if !defined(MEDIASDK_UWP_LOADER)
// Load RT from app folder (libmfxsw64 with API >= 1.10)
do
{
@ -365,16 +384,13 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
}
} while ((MFX_ERR_NONE != mfxRes) && (++curImplIdx <= maxImplIdx));
#endif // !defined(MEDIASDK_UWP_LOADER)
// Load HW and SW libraries using legacy default DLL search mechanism
// set current library index again
curImplIdx = implTypesRange[implMethod].minIndex;
do
{
mfxU32 backupIdx = curImplIdx;
if (MFX_LIB_HARDWARE == implTypes[curImplIdx].implType)
{
curImplIdx = hwImplIdx;
}
implInterface = implInterfaceOrig;
if (par.Implementation & MFX_IMPL_AUDIO)
@ -401,7 +417,10 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
{
implInterface = MFX_IMPL_VIA_ANY;
}
mfxRes = MFX::SelectImplementationType(implTypes[curImplIdx].adapterID, &implInterface, NULL, NULL);
mfxU32 curVendorID = 0, curDeviceID = 0;
mfxRes = MFX::SelectImplementationType(implTypes[curImplIdx].adapterID, &implInterface, &curVendorID, &curDeviceID);
if (curVendorID != INTEL_VENDOR_ID)
mfxRes = MFX_ERR_UNKNOWN;
}
if (MFX_ERR_NONE == mfxRes)
{
@ -425,7 +444,6 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
pHandle = new MFX_DISP_HANDLE(requiredVersion);
}
}
curImplIdx = backupIdx;
}
while ((MFX_ERR_NONE > mfxRes) && (++curImplIdx <= maxImplIdx));
delete pHandle;
@ -433,6 +451,7 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
if (allocatedHandle.size() == 0)
return MFX_ERR_UNSUPPORTED;
{ // sort candidate list
bool NeedSort = false;
HandleVector::iterator first = allocatedHandle.begin(),
it = allocatedHandle.begin(),
@ -444,16 +463,16 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
// select dll with version with lowest version number still greater or equal to requested
if (NeedSort)
qsort(&(*allocatedHandle.begin()), allocatedHandle.size(), sizeof(MFX_DISP_HANDLE*), &HandleSort);
}
HandleVector::iterator candidate = allocatedHandle.begin();
// check the final result of loading
try
{
pHandle = *candidate;
//pulling up current mediasdk version, that required to match plugin version
mfxVersion apiVerActual;
mfxStatus stsQueryVersion;
stsQueryVersion = MFXQueryVersion((mfxSession)pHandle, &apiVerActual);
mfxVersion apiVerActual = { 0 };
mfxStatus stsQueryVersion = MFXQueryVersion((mfxSession)pHandle, &apiVerActual);
if (MFX_ERR_NONE != stsQueryVersion)
{
DISPATCHER_LOG_ERROR((("MFXQueryVersion returned: %d, cannot load plugins\n"), mfxRes))
@ -485,9 +504,20 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
hive.insert(hive.end(), plgsInHive.begin(), plgsInHive.end());
}
#if defined(MEDIASDK_USE_CFGFILES) || !defined(MEDIASDK_UWP_LOADER)
// SOLID dispatcher also loads plug-ins from file system
MFX::MFXPluginsInFS plgsInFS(apiVerActual);
hive.insert(hive.end(), plgsInFS.begin(), plgsInFS.end());
#endif // defined(MEDIASDK_USE_CFGFILES) || !defined(MEDIASDK_UWP_LOADER)
}
// UWP dispatcher uses stubs
pHandle->callPlugInsTable[eMFXVideoUSER_Load] = (mfxFunctionPointer)MFXVideoUSER_Load;
pHandle->callPlugInsTable[eMFXVideoUSER_LoadByPath] = (mfxFunctionPointer)MFXVideoUSER_LoadByPath;
pHandle->callPlugInsTable[eMFXVideoUSER_UnLoad] = (mfxFunctionPointer)MFXVideoUSER_UnLoad;
pHandle->callPlugInsTable[eMFXAudioUSER_Load] = (mfxFunctionPointer)MFXAudioUSER_Load;
pHandle->callPlugInsTable[eMFXAudioUSER_UnLoad] = (mfxFunctionPointer)MFXAudioUSER_UnLoad;
}
catch(...)
{
@ -500,7 +530,7 @@ mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
return pHandle->loadStatus;
} // mfxStatus MFXInit(mfxIMPL impl, mfxVersion *ver, mfxSession *session)
} // mfxStatus MFXInitEx(mfxIMPL impl, mfxVersion *ver, mfxSession *session)
mfxStatus MFXClose(mfxSession session)
{
@ -535,73 +565,6 @@ mfxStatus MFXClose(mfxSession session)
} // mfxStatus MFXClose(mfxSession session)
mfxStatus MFXJoinSession(mfxSession session, mfxSession child_session)
{
mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE;
MFX_DISP_HANDLE *pHandle = (MFX_DISP_HANDLE *) session;
MFX_DISP_HANDLE *pChildHandle = (MFX_DISP_HANDLE *) child_session;
// get the function's address and make a call
if ((pHandle) && (pChildHandle) && (pHandle->apiVersion == pChildHandle->apiVersion))
{
/* check whether it is audio session or video */
int tableIndex = eMFXJoinSession;
mfxFunctionPointer pFunc;
if (pHandle->impl & MFX_IMPL_AUDIO)
{
pFunc = pHandle->callAudioTable[tableIndex];
}
else
{
pFunc = pHandle->callTable[tableIndex];
}
if (pFunc)
{
// pass down the call
mfxRes = (*(mfxStatus (MFX_CDECL *) (mfxSession, mfxSession)) pFunc) (pHandle->session,
pChildHandle->session);
}
}
return mfxRes;
} // mfxStatus MFXJoinSession(mfxSession session, mfxSession child_session)
mfxStatus MFXCloneSession(mfxSession session, mfxSession *clone)
{
mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE;
MFX_DISP_HANDLE *pHandle = (MFX_DISP_HANDLE *) session;
mfxVersion apiVersion;
mfxIMPL impl;
// check error(s)
if (pHandle)
{
// initialize the clone session
apiVersion = pHandle->apiVersion;
impl = pHandle->impl | pHandle->implInterface;
mfxRes = MFXInit(impl, &apiVersion, clone);
if (MFX_ERR_NONE != mfxRes)
{
return mfxRes;
}
// join the sessions
mfxRes = MFXJoinSession(session, *clone);
if (MFX_ERR_NONE != mfxRes)
{
MFXClose(*clone);
*clone = NULL;
return mfxRes;
}
}
return mfxRes;
} // mfxStatus MFXCloneSession(mfxSession session, mfxSession *clone)
mfxStatus MFXVideoUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32 version)
{
mfxStatus sts = MFX_ERR_NONE;
@ -617,7 +580,7 @@ mfxStatus MFXVideoUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32
DISPATCHER_LOG_ERROR((("MFXVideoUSER_Load: uid=NULL\n")));
return MFX_ERR_NULL_PTR;
}
DISPATCHER_LOG_INFO((("MFXVideoUSER_Load: uid="MFXGUIDTYPE()" version=%d\n")
DISPATCHER_LOG_INFO((("MFXVideoUSER_Load: uid=" MFXGUIDTYPE()" version=%d\n")
, MFXGUIDTOHEX(uid)
, version))
size_t pluginsChecked = 0;
@ -631,7 +594,7 @@ mfxStatus MFXVideoUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32
//check rest in records
if (i->PluginVersion < version)
{
DISPATCHER_LOG_INFO((("MFXVideoUSER_Load: registered \"Plugin Version\" for GUID="MFXGUIDTYPE()" is %d, that is smaller that requested\n")
DISPATCHER_LOG_INFO((("MFXVideoUSER_Load: registered \"Plugin Version\" for GUID=" MFXGUIDTYPE()" is %d, that is smaller that requested\n")
, MFXGUIDTOHEX(uid)
, i->PluginVersion))
continue;
@ -698,7 +661,7 @@ mfxStatus MFXVideoUSER_LoadByPath(mfxSession session, const mfxPluginUID *uid, m
return MFX_ERR_NULL_PTR;
}
DISPATCHER_LOG_INFO((("MFXVideoUSER_LoadByPath: %S uid="MFXGUIDTYPE()" version=%d\n")
DISPATCHER_LOG_INFO((("MFXVideoUSER_LoadByPath: %S uid=" MFXGUIDTYPE()" version=%d\n")
, MSDK2WIDE(path)
, MFXGUIDTOHEX(uid)
, version))
@ -708,15 +671,17 @@ mfxStatus MFXVideoUSER_LoadByPath(mfxSession session, const mfxPluginUID *uid, m
#ifdef _WIN32
msdk_disp_char wPath[MAX_PLUGIN_PATH];
int res = ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, path, len, wPath, MAX_PLUGIN_PATH);
int res = ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, path, len<MAX_PLUGIN_PATH-1 ? len : MAX_PLUGIN_PATH-1, wPath, MAX_PLUGIN_PATH);
wPath[res]=0;
if (!res)
{
DISPATCHER_LOG_ERROR((("MFXVideoUSER_LoadByPath: cant convert UTF-8 path to UTF-16\n")));
return MFX_ERR_NOT_FOUND;
}
msdk_disp_char_cpy_s(record.sPath, res < MAX_PLUGIN_PATH ? res : MAX_PLUGIN_PATH, wPath);
msdk_disp_char_cpy_s(record.sPath, MAX_PLUGIN_PATH, wPath);
#else // Linux/Android
msdk_disp_char_cpy_s(record.sPath, len < MAX_PLUGIN_PATH ? len : MAX_PLUGIN_PATH, path);
msdk_disp_char_cpy_s(record.sPath, MAX_PLUGIN_PATH, path);
#endif
record.PluginUID = *uid;
@ -744,17 +709,17 @@ mfxStatus MFXVideoUSER_UnLoad(mfxSession session, const mfxPluginUID *uid)
}
if (!uid)
{
DISPATCHER_LOG_ERROR((("MFXVideoUSER_Load: uid=NULL\n")));
DISPATCHER_LOG_ERROR((("MFXVideoUSER_UnLoad: uid=NULL\n")));
return MFX_ERR_NULL_PTR;
}
bool bDestroyed = rHandle.pluginFactory.Destroy(*uid);
if (bDestroyed)
{
DISPATCHER_LOG_INFO((("MFXVideoUSER_UnLoad : plugin with GUID="MFXGUIDTYPE()" unloaded\n"), MFXGUIDTOHEX(uid)));
DISPATCHER_LOG_INFO((("MFXVideoUSER_UnLoad : plugin with GUID=" MFXGUIDTYPE()" unloaded\n"), MFXGUIDTOHEX(uid)));
} else
{
DISPATCHER_LOG_ERROR((("MFXVideoUSER_UnLoad : plugin with GUID="MFXGUIDTYPE()" not found\n"), MFXGUIDTOHEX(uid)));
DISPATCHER_LOG_ERROR((("MFXVideoUSER_UnLoad : plugin with GUID=" MFXGUIDTYPE()" not found\n"), MFXGUIDTOHEX(uid)));
}
return bDestroyed ? MFX_ERR_NONE : MFX_ERR_NOT_FOUND;
@ -773,7 +738,7 @@ mfxStatus MFXAudioUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32
DISPATCHER_LOG_ERROR((("MFXAudioUSER_Load: uid=NULL\n")));
return MFX_ERR_NULL_PTR;
}
DISPATCHER_LOG_INFO((("MFXAudioUSER_Load: uid="MFXGUIDTYPE()" version=%d\n")
DISPATCHER_LOG_INFO((("MFXAudioUSER_Load: uid=" MFXGUIDTYPE()" version=%d\n")
, MFXGUIDTOHEX(uid)
, version))
size_t pluginsChecked = 0;
@ -791,7 +756,7 @@ mfxStatus MFXAudioUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32
//check rest in records
if (i->PluginVersion < version)
{
DISPATCHER_LOG_INFO((("MFXAudioUSER_Load: registered \"Plugin Version\" for GUID="MFXGUIDTYPE()" is %d, that is smaller that requested\n")
DISPATCHER_LOG_INFO((("MFXAudioUSER_Load: registered \"Plugin Version\" for GUID=" MFXGUIDTYPE()" is %d, that is smaller that requested\n")
, MFXGUIDTOHEX(uid)
, i->PluginVersion))
continue;
@ -839,15 +804,160 @@ mfxStatus MFXAudioUSER_UnLoad(mfxSession session, const mfxPluginUID *uid)
bool bDestroyed = rHandle.pluginFactory.Destroy(*uid);
if (bDestroyed)
{
DISPATCHER_LOG_INFO((("MFXAudioUSER_UnLoad : plugin with GUID="MFXGUIDTYPE()" unloaded\n"), MFXGUIDTOHEX(uid)));
DISPATCHER_LOG_INFO((("MFXAudioUSER_UnLoad : plugin with GUID=" MFXGUIDTYPE()" unloaded\n"), MFXGUIDTOHEX(uid)));
} else
{
DISPATCHER_LOG_ERROR((("MFXAudioUSER_UnLoad : plugin with GUID="MFXGUIDTYPE()" not found\n"), MFXGUIDTOHEX(uid)));
DISPATCHER_LOG_ERROR((("MFXAudioUSER_UnLoad : plugin with GUID=" MFXGUIDTYPE()" not found\n"), MFXGUIDTOHEX(uid)));
}
return bDestroyed ? MFX_ERR_NONE : MFX_ERR_NOT_FOUND;
}
#else // relates to !defined (MEDIASDK_UWP_PROCTABLE) from line 137, i.e. #else part as if MEDIASDK_UWP_PROCTABLE defined
#include <windows.h>
#include "intel_api_factory.h"
// for the UWP_PROCTABLE purposes implementation of MFXinitEx is calling
// InitializeInstance() implemented in intel_uwp-api.dll
mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
{
HRESULT hr = InitialiseMediaSession((HANDLE*)session, &par, nullptr);
return (hr == S_OK) ? mfxStatus::MFX_ERR_NONE : (mfxStatus)hr;
}
// for the UWP_PROCTABLE purposes implementation of MFXClose is calling
// DisposeInstance() implemented in intel_uwp-api.dll
mfxStatus MFXClose(mfxSession session)
{
if (nullptr == session) {
return MFX_ERR_INVALID_HANDLE;
}
HRESULT hr = DisposeMediaSession(HANDLE(session));
session = (mfxSession)NULL;
return (hr == S_OK) ? MFX_ERR_NONE : mfxStatus(hr);
}
#undef FUNCTION
#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \
return_value func_name formal_param_list \
{ \
mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE; \
\
_mfxSession *pHandle = (_mfxSession *) session; \
\
/* get the function's address and make a call */ \
if (pHandle) \
{ \
mfxFunctionPointer pFunc = pHandle->callPlugInsTable[e##func_name]; \
if (pFunc) \
{ \
/* pass down the call */ \
mfxRes = (*(mfxStatus (MFX_CDECL *) formal_param_list) pFunc) actual_param_list; \
} \
} \
return mfxRes; \
}
FUNCTION(mfxStatus, MFXVideoUSER_Load, (mfxSession session, const mfxPluginUID *uid, mfxU32 version), (session, uid, version))
FUNCTION(mfxStatus, MFXVideoUSER_LoadByPath, (mfxSession session, const mfxPluginUID *uid, mfxU32 version, const mfxChar *path, mfxU32 len), (session, uid, version, path, len))
FUNCTION(mfxStatus, MFXVideoUSER_UnLoad, (mfxSession session, const mfxPluginUID *uid), (session, uid))
FUNCTION(mfxStatus, MFXAudioUSER_Load, (mfxSession session, const mfxPluginUID *uid, mfxU32 version), (session, uid, version))
FUNCTION(mfxStatus, MFXAudioUSER_UnLoad, (mfxSession session, const mfxPluginUID *uid), (session, uid))
#endif //!defined(MEDIASDK_UWP_PROCTABLE)
#if !defined(MEDIASDK_UWP_LOADER)
mfxStatus MFXJoinSession(mfxSession session, mfxSession child_session)
{
mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE;
MFX_DISP_HANDLE *pHandle = (MFX_DISP_HANDLE *)session;
MFX_DISP_HANDLE *pChildHandle = (MFX_DISP_HANDLE *)child_session;
// get the function's address and make a call
if ((pHandle) && (pChildHandle) && (pHandle->apiVersion == pChildHandle->apiVersion))
{
/* check whether it is audio session or video */
int tableIndex = eMFXJoinSession;
mfxFunctionPointer pFunc;
if (pHandle->impl & MFX_IMPL_AUDIO)
{
pFunc = pHandle->callAudioTable[tableIndex];
}
else
{
pFunc = pHandle->callTable[tableIndex];
}
if (pFunc)
{
// pass down the call
mfxRes = (*(mfxStatus(MFX_CDECL *) (mfxSession, mfxSession)) pFunc) (pHandle->session,
pChildHandle->session);
}
}
return mfxRes;
} // mfxStatus MFXJoinSession(mfxSession session, mfxSession child_session)
mfxStatus MFXCloneSession(mfxSession session, mfxSession *clone)
{
mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE;
MFX_DISP_HANDLE *pHandle = (MFX_DISP_HANDLE *)session;
mfxVersion apiVersion;
mfxIMPL impl;
// check error(s)
if (pHandle)
{
// initialize the clone session
apiVersion = pHandle->apiVersion;
impl = pHandle->impl | pHandle->implInterface;
mfxRes = MFXInit(impl, &apiVersion, clone);
if (MFX_ERR_NONE != mfxRes)
{
return mfxRes;
}
// join the sessions
mfxRes = MFXJoinSession(session, *clone);
if (MFX_ERR_NONE != mfxRes)
{
MFXClose(*clone);
*clone = NULL;
return mfxRes;
}
}
return mfxRes;
} // mfxStatus MFXCloneSession(mfxSession session, mfxSession *clone)
#endif // !defined(MEDIASDK_UWP_LOADER)
mfxStatus MFXInit(mfxIMPL impl, mfxVersion *pVer, mfxSession *session)
{
mfxInitParam par = {};
par.Implementation = impl;
if (pVer)
{
par.Version = *pVer;
}
else
{
par.Version.Major = DEFAULT_API_VERSION_MAJOR;
par.Version.Minor = DEFAULT_API_VERSION_MINOR;
}
par.ExternalThreads = 0;
return MFXInitEx(par, session);
}
//
//
// implement all other calling functions.
// They just call a procedure of DLL library from the table.
@ -859,7 +969,7 @@ mfxStatus MFXAudioUSER_UnLoad(mfxSession session, const mfxPluginUID *uid)
return_value func_name formal_param_list \
{ \
mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE; \
MFX_DISP_HANDLE *pHandle = (MFX_DISP_HANDLE *) session; \
_mfxSession *pHandle = (_mfxSession *) session; \
/* get the function's address and make a call */ \
if (pHandle) \
{ \
@ -887,16 +997,23 @@ mfxStatus MFXAudioUSER_UnLoad(mfxSession session, const mfxPluginUID *uid)
FUNCTION(mfxStatus, MFXQueryIMPL, (mfxSession session, mfxIMPL *impl), (session, impl))
FUNCTION(mfxStatus, MFXQueryVersion, (mfxSession session, mfxVersion *version), (session, version))
#if !defined(MEDIASDK_UWP_LOADER)
// these functions are not necessary in LOADER part of dispatcher and
// need to be included only in in SOLID dispatcher or PROCTABLE part of dispatcher
FUNCTION(mfxStatus, MFXDisjoinSession, (mfxSession session), (session))
FUNCTION(mfxStatus, MFXSetPriority, (mfxSession session, mfxPriority priority), (session, priority))
FUNCTION(mfxStatus, MFXGetPriority, (mfxSession session, mfxPriority *priority), (session, priority))
#endif // !defined(MEDIASDK_UWP_LOADER)
#undef FUNCTION
#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \
return_value func_name formal_param_list \
{ \
mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE; \
MFX_DISP_HANDLE *pHandle = (MFX_DISP_HANDLE *) session; \
_mfxSession *pHandle = (_mfxSession *) session;\
/* get the function's address and make a call */ \
if (pHandle) \
{ \
@ -918,7 +1035,7 @@ FUNCTION(mfxStatus, MFXGetPriority, (mfxSession session, mfxPriority *priority),
return_value func_name formal_param_list \
{ \
mfxStatus mfxRes = MFX_ERR_INVALID_HANDLE; \
MFX_DISP_HANDLE *pHandle = (MFX_DISP_HANDLE *) session; \
_mfxSession *pHandle = (_mfxSession *) session; \
/* get the function's address and make a call */ \
if (pHandle) \
{ \

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2012-2015 Intel Corporation. All rights reserved.
Copyright (C) 2012-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -32,20 +32,22 @@ File Name: mfx_dispatcher.cpp
#include "mfx_dispatcher_log.h"
#include "mfx_load_dll.h"
#include <assert.h>
#include <string.h>
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#pragma warning(disable:4355)
#else
#include <dlfcn.h>
#include <iostream>
#include <dlfcn.h>
#include <iostream>
#endif // defined(_WIN32) || defined(_WIN64)
MFX_DISP_HANDLE::MFX_DISP_HANDLE(const mfxVersion requiredVersion) :
apiVersion(requiredVersion),
pluginFactory((mfxSession)this)
_mfxSession()
,apiVersion(requiredVersion)
,pluginFactory((mfxSession)this)
{
actualApiVersion.Version = 0;
implType = MFX_LIB_SOFTWARE;
@ -53,13 +55,11 @@ MFX_DISP_HANDLE::MFX_DISP_HANDLE(const mfxVersion requiredVersion) :
loadStatus = MFX_ERR_NOT_FOUND;
dispVersion.Major = MFX_DISPATCHER_VERSION_MAJOR;
dispVersion.Minor = MFX_DISPATCHER_VERSION_MINOR;
session = (mfxSession) 0;
storageID = 0;
implInterface = MFX_IMPL_HARDWARE_ANY;
hModule = (mfxModuleHandle) 0;
memset(callTable, 0, sizeof(callTable));
memset(callAudioTable, 0, sizeof(callAudioTable));
} // MFX_DISP_HANDLE::MFX_DISP_HANDLE(const mfxVersion requiredVersion)
MFX_DISP_HANDLE::~MFX_DISP_HANDLE(void)
@ -82,38 +82,34 @@ mfxStatus MFX_DISP_HANDLE::Close(void)
loadStatus = MFX_ERR_NOT_FOUND;
dispVersion.Major = MFX_DISPATCHER_VERSION_MAJOR;
dispVersion.Minor = MFX_DISPATCHER_VERSION_MINOR;
session = (mfxSession) 0;
*static_cast<_mfxSession*>(this) = _mfxSession();
hModule = (mfxModuleHandle) 0;
memset(callTable, 0, sizeof(callTable));
memset(callAudioTable, 0, sizeof(callAudioTable));
}
return mfxRes;
} // mfxStatus MFX_DISP_HANDLE::Close(void)
mfxStatus MFX_DISP_HANDLE::LoadSelectedDLL(const msdk_disp_char *pPath, eMfxImplType implType,
mfxIMPL impl, mfxIMPL implInterface, mfxInitParam &par)
mfxStatus MFX_DISP_HANDLE::LoadSelectedDLL(const msdk_disp_char *pPath, eMfxImplType reqImplType,
mfxIMPL reqImpl, mfxIMPL reqImplInterface, mfxInitParam &par)
{
mfxStatus mfxRes = MFX_ERR_NONE;
// check error(s)
if ((MFX_LIB_SOFTWARE != implType) &&
(MFX_LIB_HARDWARE != implType))
if ((MFX_LIB_SOFTWARE != reqImplType) &&
(MFX_LIB_HARDWARE != reqImplType))
{
DISPATCHER_LOG_ERROR((("implType == %s, should be either MFX_LIB_SOFTWARE ot MFX_LIB_HARDWARE\n"), DispatcherLog_GetMFXImplString(implType).c_str()));
DISPATCHER_LOG_ERROR((("implType == %s, should be either MFX_LIB_SOFTWARE ot MFX_LIB_HARDWARE\n"), DispatcherLog_GetMFXImplString(reqImplType).c_str()));
loadStatus = MFX_ERR_ABORTED;
return loadStatus;
}
// only exact types of implementation is allowed
if (!(impl & MFX_IMPL_AUDIO) &&
(MFX_IMPL_SOFTWARE != impl) &&
(MFX_IMPL_HARDWARE != impl) &&
(MFX_IMPL_HARDWARE2 != impl) &&
(MFX_IMPL_HARDWARE3 != impl) &&
(MFX_IMPL_HARDWARE4 != impl))
if (!(reqImpl & MFX_IMPL_AUDIO) &&
(MFX_IMPL_SOFTWARE != reqImpl) &&
(MFX_IMPL_HARDWARE != reqImpl) &&
(MFX_IMPL_HARDWARE2 != reqImpl) &&
(MFX_IMPL_HARDWARE3 != reqImpl) &&
(MFX_IMPL_HARDWARE4 != reqImpl))
{
DISPATCHER_LOG_ERROR((("invalid implementation impl == %s\n"), DispatcherLog_GetMFXImplString(impl).c_str()));
loadStatus = MFX_ERR_ABORTED;
@ -139,12 +135,14 @@ mfxStatus MFX_DISP_HANDLE::LoadSelectedDLL(const msdk_disp_char *pPath, eMfxImpl
Close();
// save the library's type
this->implType = implType;
this->impl = impl;
this->implInterface = implInterface;
this->implType = reqImplType;
this->impl = reqImpl;
this->implInterface = reqImplInterface;
{
assert(hModule == (mfxModuleHandle)0);
DISPATCHER_LOG_BLOCK(("invoking LoadLibrary(%S)\n", MSDK2WIDE(pPath)));
// load the DLL into the memory
hModule = MFX::mfx_dll_load(pPath);

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
Copyright (C) 2012-2017 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -104,26 +104,30 @@ void DXDevice::Close(void)
void DXDevice::LoadDLLModule(const wchar_t *pModuleName)
{
DWORD prevErrorMode = 0;
// unload the module if it is required
UnloadDLLModule();
#if !defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
DWORD prevErrorMode = 0;
// set the silent error mode
#if (_WIN32_WINNT >= 0x0600) && !(__GNUC__)
SetThreadErrorMode(SEM_FAILCRITICALERRORS, &prevErrorMode);
#else
prevErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
#endif
#endif // !defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
// load specified library
m_hModule = LoadLibraryExW(pModuleName, NULL, 0);
#if !defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
// set the previous error mode
#if (_WIN32_WINNT >= 0x0600) && !(__GNUC__)
SetThreadErrorMode(prevErrorMode, NULL);
#else
SetErrorMode(prevErrorMode);
#endif
#endif //!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
} // void LoadDLLModule(const wchar_t *pModuleName)
@ -137,7 +141,7 @@ void DXDevice::UnloadDLLModule(void)
} // void DXDevice::UnloaDLLdModule(void)
#ifdef MFX_D3D9_ENABLED
D3D9Device::D3D9Device(void)
{
m_pD3D9 = (void *) 0;
@ -280,6 +284,7 @@ bool D3D9Device::Init(const mfxU32 adapterNum)
return true;
} // bool D3D9Device::Init(const mfxU32 adapterNum)
#endif //MFX_D3D9_ENABLED
typedef
HRESULT (WINAPI *DXGICreateFactoryFunc) (REFIID riid, void **ppFactory);
@ -328,15 +333,17 @@ bool DXGI1Device::Init(const mfxU32 adapterNum)
if (m_hModule)
{
DXGICreateFactoryFunc pFunc;
IDXGIFactory1 *pFactory;
IDXGIAdapter1 *pAdapter;
DXGI_ADAPTER_DESC1 desc;
mfxU32 curAdapter, maxAdapters;
HRESULT hRes;
DXGICreateFactoryFunc pFunc = NULL;
IDXGIFactory1 *pFactory = NULL;
IDXGIAdapter1 *pAdapter = NULL;
DXGI_ADAPTER_DESC1 desc = { 0 };
mfxU32 curAdapter = 0;
mfxU32 maxAdapters = 0;
HRESULT hRes = E_FAIL;
// load address of procedure to create DXGI 1.1 factory
pFunc = (DXGICreateFactoryFunc) GetProcAddress(m_hModule, "CreateDXGIFactory1");
if (NULL == pFunc)
{
return false;
@ -413,6 +420,7 @@ DXVA2Device::DXVA2Device(void)
m_vendorID = 0;
m_deviceID = 0;
m_driverVersion = 0;
} // DXVA2Device::DXVA2Device(void)
DXVA2Device::~DXVA2Device(void)
@ -428,8 +436,10 @@ void DXVA2Device::Close(void)
m_vendorID = 0;
m_deviceID = 0;
m_driverVersion = 0;
} // void DXVA2Device::Close(void)
#ifdef MFX_D3D9_ENABLED
bool DXVA2Device::InitD3D9(const mfxU32 adapterNum)
{
D3D9Device d3d9Device;
@ -464,6 +474,13 @@ bool DXVA2Device::InitD3D9(const mfxU32 adapterNum)
// ... say goodbye
return true;
} // bool InitD3D9(const mfxU32 adapterNum)
#else // MFX_D3D9_ENABLED
bool DXVA2Device::InitD3D9(const mfxU32 adapterNum)
{
(void)adapterNum;
return false;
}
#endif // MFX_D3D9_ENABLED
bool DXVA2Device::InitDXGI1(const mfxU32 adapterNum)
{
@ -490,6 +507,7 @@ bool DXVA2Device::InitDXGI1(const mfxU32 adapterNum)
} // bool DXVA2Device::InitDXGI1(const mfxU32 adapterNum)
#ifdef MFX_D3D9_ENABLED
void DXVA2Device::UseAlternativeWay(const D3D9Device *pD3D9Device)
{
mfxU64 d3d9LUID = pD3D9Device->GetLUID();
@ -532,6 +550,7 @@ void DXVA2Device::UseAlternativeWay(const D3D9Device *pD3D9Device)
// we need to match a DXGI(1) device to the D3D9 device
} // void DXVA2Device::UseAlternativeWay(const D3D9Device *pD3D9Device)
#endif // MFX_D3D9_ENABLED
mfxU32 DXVA2Device::GetVendorID(void) const
{

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2012-2015 Intel Corporation. All rights reserved.
Copyright (C) 2012-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -41,6 +41,8 @@ File Name: mfx_library_iterator.cpp
#include <tchar.h>
#include <windows.h>
#include <vector>
namespace MFX
{
@ -72,9 +74,10 @@ mfxStatus SelectImplementationType(const mfxU32 adapterNum, mfxIMPL *pImplInterf
{
return MFX_ERR_NULL_PTR;
}
mfxIMPL impl_via = *pImplInterface;
DXVA2Device dxvaDevice;
if (MFX_IMPL_VIA_D3D9 == *pImplInterface)
if (MFX_IMPL_VIA_D3D9 == impl_via)
{
// try to create the Direct3D 9 device and find right adapter
if (!dxvaDevice.InitD3D9(adapterNum))
@ -83,7 +86,7 @@ mfxStatus SelectImplementationType(const mfxU32 adapterNum, mfxIMPL *pImplInterf
return MFX_ERR_UNSUPPORTED;
}
}
else if (MFX_IMPL_VIA_D3D11 == *pImplInterface)
else if (MFX_IMPL_VIA_D3D11 == impl_via)
{
// try to open DXGI 1.1 device to get hardware ID
if (!dxvaDevice.InitDXGI1(adapterNum))
@ -92,7 +95,7 @@ mfxStatus SelectImplementationType(const mfxU32 adapterNum, mfxIMPL *pImplInterf
return MFX_ERR_UNSUPPORTED;
}
}
else if (MFX_IMPL_VIA_ANY == *pImplInterface)
else if (MFX_IMPL_VIA_ANY == impl_via)
{
// try the Direct3D 9 device
if (dxvaDevice.InitD3D9(adapterNum))
@ -163,6 +166,62 @@ void MFXLibraryIterator::Release(void)
} // void MFXLibraryIterator::Release(void)
DECLSPEC_NOINLINE HMODULE GetThisDllModuleHandle()
{
HMODULE hDll = HMODULE(-1);
GetModuleHandleExW( GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast<LPCWSTR>(&GetThisDllModuleHandle), &hDll);
return hDll;
}
// msdk_disp_char* sImplPath must be allocated with size not less then msdk_disp_path_len
bool GetImplPath(int storageID, msdk_disp_char* sImplPath)
{
HMODULE hModule = NULL;
sImplPath[0] = L'\0';
switch (storageID) {
case MFX_APP_FOLDER:
hModule = 0;
break;
#if defined(MEDIASDK_UWP_LOADER) || defined(MEDIASDK_UWP_PROCTABLE)
case MFX_PATH_MSDK_FOLDER:
hModule = GetThisDllModuleHandle();
break;
#endif
}
if(hModule == HMODULE(-1)) {
return false;
}
DWORD nSize = 0;
DWORD allocSize = msdk_disp_path_len;
nSize = GetModuleFileNameW(hModule, &sImplPath[0], allocSize);
if (nSize == 0 || nSize == allocSize) {
// nSize == 0 meanse that system can't get this info for hModule
// nSize == allocSize buffer is too small
return false;
}
// for any case because WinXP implementation of GetModuleFileName does not add \0 to the end of string
sImplPath[nSize] = L'\0';
msdk_disp_char * dirSeparator = wcsrchr(sImplPath, L'\\');
if (dirSeparator != NULL && dirSeparator < (sImplPath + msdk_disp_path_len))
{
*++dirSeparator = 0;
}
return true;
}
mfxStatus MFXLibraryIterator::Init(eMfxImplType implType, mfxIMPL implInterface, const mfxU32 adapterNum, int storageID)
{
// check error(s)
@ -177,29 +236,26 @@ mfxStatus MFXLibraryIterator::Init(eMfxImplType implType, mfxIMPL implInterface,
m_StorageID = storageID;
m_lastLibIndex = 0;
#if defined(MEDIASDK_USE_REGISTRY) || (!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE))
if (storageID == MFX_CURRENT_USER_KEY || storageID == MFX_LOCAL_MACHINE_KEY)
{
return InitRegistry(implType, implInterface, adapterNum, storageID);
}
else if (storageID == MFX_APP_FOLDER)
{
msdk_disp_char path[_MAX_PATH] = {};
#endif
::GetModuleFileNameW(0, path, _MAX_PATH);
msdk_disp_char * dirSeparator = wcsrchr(path, L'\\');
if (dirSeparator < (path + _MAX_PATH))
{
*++dirSeparator = 0;
}
return InitFolder(implType, implInterface, adapterNum, path);
}
msdk_disp_char sCurrentModulePath[msdk_disp_path_len];
if(!GetImplPath(storageID, sCurrentModulePath)) {
return MFX_ERR_UNSUPPORTED;
}
return InitFolder(implType, implInterface, adapterNum, sCurrentModulePath);
} // mfxStatus MFXLibraryIterator::Init(eMfxImplType implType, const mfxU32 adapterNum, int storageID)
mfxStatus MFXLibraryIterator::InitRegistry(eMfxImplType implType, mfxIMPL implInterface, const mfxU32 adapterNum, int storageID)
{
#if defined(MEDIASDK_USE_REGISTRY) || (!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE))
HKEY rootHKey;
bool bRes;
@ -235,6 +291,14 @@ mfxStatus MFXLibraryIterator::InitRegistry(eMfxImplType implType, mfxIMPL implIn
rootDispPath))
return MFX_ERR_NONE;
#else
(void) storageID;
(void) adapterNum;
(void) implInterface;
(void) implType;
return MFX_ERR_UNSUPPORTED;
#endif // #if !defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
} // mfxStatus MFXLibraryIterator::InitRegistry(eMfxImplType implType, mfxIMPL implInterface, const mfxU32 adapterNum, int storageID)
mfxStatus MFXLibraryIterator::InitFolder(eMfxImplType implType, mfxIMPL implInterface, const mfxU32 adapterNum, const msdk_disp_char * path)
@ -244,8 +308,12 @@ mfxStatus MFXLibraryIterator::InitFolder(eMfxImplType implType, mfxIMPL implInte
msdk_disp_char_cpy_s(m_path, maxPathLen, path);
size_t pathLen = wcslen(m_path);
#if !defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
// we looking for runtime in application folder, it should be named libmfxsw64 or libmfxsw32
mfx_get_default_dll_name(m_path + pathLen, maxPathLen - pathLen, MFX_LIB_SOFTWARE);
mfx_get_default_dll_name(m_path + pathLen, msdk_disp_path_len - pathLen, MFX_LIB_SOFTWARE);
#else
mfx_get_default_dll_name(m_path + pathLen, msdk_disp_path_len - pathLen, implType);
#endif
// set the required library's implementation type
m_implType = implType;
@ -275,6 +343,8 @@ mfxStatus MFXLibraryIterator::SelectDLLVersion(wchar_t *pPath
{
if (m_lastLibIndex != 0)
return MFX_ERR_NOT_FOUND;
if (m_vendorID != INTEL_VENDOR_ID)
return MFX_ERR_UNKNOWN;
m_lastLibIndex = 1;
msdk_disp_char_cpy_s(pPath, pathSize, m_path);
@ -282,6 +352,25 @@ mfxStatus MFXLibraryIterator::SelectDLLVersion(wchar_t *pPath
return MFX_ERR_NONE;
}
#if defined(MEDIASDK_UWP_LOADER) || defined(MEDIASDK_UWP_PROCTABLE)
if (m_StorageID == MFX_PATH_MSDK_FOLDER) {
if (m_lastLibIndex != 0)
return MFX_ERR_NOT_FOUND;
if (m_vendorID != INTEL_VENDOR_ID)
return MFX_ERR_UNKNOWN;
m_lastLibIndex = 1;
msdk_disp_char_cpy_s(pPath, pathSize, m_path);
// do not change impl type
//*pImplType = MFX_LIB_HARDWARE;
return MFX_ERR_NONE;
}
#endif
#if defined(MEDIASDK_USE_REGISTRY) || (!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE))
wchar_t libPath[MFX_MAX_DLL_PATH] = L"";
DWORD libIndex = 0;
DWORD libMerit = 0;
@ -294,7 +383,7 @@ mfxStatus MFXLibraryIterator::SelectDLLVersion(wchar_t *pPath
do
{
WinRegKey subKey;
wchar_t subKeyName[MFX_MAX_REGISTRY_KEY_NAME];
wchar_t subKeyName[MFX_MAX_REGISTRY_KEY_NAME] = { 0 };
DWORD subKeyNameSize = sizeof(subKeyName) / sizeof(subKeyName[0]);
// query next value name
@ -424,7 +513,6 @@ mfxStatus MFXLibraryIterator::SelectDLLVersion(wchar_t *pPath
if ((0 == vendorID) || (0 == deviceID))
{
*pImplType = MFX_LIB_SOFTWARE;
DISPATCHER_LOG_INFO((("Library type is MFX_LIB_SOFTWARE\n")));
}
else
@ -456,6 +544,8 @@ mfxStatus MFXLibraryIterator::SelectDLLVersion(wchar_t *pPath
m_lastLibMerit = libMerit;
m_bIsSubKeyValid = true;
#endif
return MFX_ERR_NONE;
} // mfxStatus MFXLibraryIterator::SelectDLLVersion(wchar_t *pPath, size_t pathSize, eMfxImplType *pImplType, mfxVersion minVersion)

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
Copyright (C) 2012-2017 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -164,7 +164,7 @@ mfxModuleHandle mfx_dll_load(const msdk_disp_char *pFileName)
{
return NULL;
}
#if !defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
// set the silent error mode
DWORD prevErrorMode = 0;
#if (_WIN32_WINNT >= 0x0600) && !(__GNUC__)
@ -172,14 +172,19 @@ mfxModuleHandle mfx_dll_load(const msdk_disp_char *pFileName)
#else
prevErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
#endif
#endif // !defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
// load the library's module
hModule = LoadLibraryExW(pFileName,NULL,0);
hModule = LoadLibraryExW(pFileName, NULL, 0);
#if !defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
// set the previous error mode
#if (_WIN32_WINNT >= 0x0600) && !(__GNUC__)
SetThreadErrorMode(prevErrorMode, NULL);
#else
SetErrorMode(prevErrorMode);
#endif
#endif // !defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
return hModule;
@ -207,6 +212,7 @@ bool mfx_dll_free(mfxModuleHandle handle)
return !!bRes;
} // bool mfx_dll_free(mfxModuleHandle handle)
#if !defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
mfxModuleHandle mfx_get_dll_handle(const msdk_disp_char *pFileName)
{
mfxModuleHandle hModule = (mfxModuleHandle) 0;
@ -234,6 +240,7 @@ mfxModuleHandle mfx_get_dll_handle(const msdk_disp_char *pFileName)
#endif
return hModule;
}
#endif //!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE)
} // namespace MFX

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2013-2014 Intel Corporation. All rights reserved.
Copyright (C) 2013-2017 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -32,8 +32,8 @@ File Name: mfx_load_plugin.h
#include "mfx_load_dll.h"
#include "mfx_dispatcher_log.h"
#define TRACE_PLUGIN_ERROR(str, ...) DISPATCHER_LOG_ERROR((("[PLUGIN]: "str), __VA_ARGS__))
#define TRACE_PLUGIN_INFO(str, ...) DISPATCHER_LOG_INFO((("[PLUGIN]: "str), __VA_ARGS__))
#define TRACE_PLUGIN_ERROR(str, ...) DISPATCHER_LOG_ERROR((("[PLUGIN]: " str), __VA_ARGS__))
#define TRACE_PLUGIN_INFO(str, ...) DISPATCHER_LOG_INFO((("[PLUGIN]: " str), __VA_ARGS__))
#define CREATE_PLUGIN_FNC "CreatePlugin"
@ -110,6 +110,8 @@ MFX::PluginModule::~PluginModule(void)
Tidy();
}
#if !defined(MEDIASDK_UWP_PROCTABLE)
bool MFX::MFXPluginFactory::RunVerification( const mfxPlugin & plg, const PluginDescriptionRecord &dsc, mfxPluginParam &pluginParams)
{
if (plg.PluginInit == 0)
@ -160,7 +162,7 @@ bool MFX::MFXPluginFactory::RunVerification( const mfxPlugin & plg, const Plugin
{
if (!dsc.onlyVersionRegistered && pluginParams.CodecId != dsc.CodecId)
{
TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned CodecId="MFXFOURCCTYPE()", but registration has CodecId="MFXFOURCCTYPE()"\n"
TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned CodecId=" MFXFOURCCTYPE()", but registration has CodecId=" MFXFOURCCTYPE()"\n"
, MFXU32TOFOURCC(pluginParams.CodecId), MFXU32TOFOURCC(dsc.CodecId));
return false;
}
@ -173,7 +175,7 @@ bool MFX::MFXPluginFactory::RunVerification( const mfxPlugin & plg, const Plugin
if (pluginParams.PluginUID != dsc.PluginUID)
{
TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned UID="MFXGUIDTYPE()", but registration has UID="MFXGUIDTYPE()"\n"
TRACE_PLUGIN_ERROR("plg->GetPluginParam() returned UID=" MFXGUIDTYPE()", but registration has UID=" MFXGUIDTYPE()"\n"
, MFXGUIDTOHEX(&pluginParams.PluginUID), MFXGUIDTOHEX(&dsc.PluginUID));
return false;
}
@ -414,6 +416,7 @@ MFX::MFXPluginFactory::~MFXPluginFactory()
MFX::MFXPluginFactory::MFXPluginFactory( mfxSession session )
{
mSession = session;
nPlugins = 0;
}
bool MFX::MFXPluginFactory::Destroy( const mfxPluginUID & uidToDestroy)
@ -456,3 +459,5 @@ void MFX::MFXPluginFactory::DestroyPlugin( FactoryRecord & record)
TRACE_PLUGIN_INFO(" MFXVideoUSER_Unregister for Type=%d, returned %d\n", record.plgParams.Type, sts);
}
}
#endif //!defined(MEDIASDK_UWP_PROCTABLE)

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2013-2014 Intel Corporation. All rights reserved.
Copyright (C) 2013-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -36,9 +36,9 @@ File Name: mfx_plugin_hive.cpp
#include "mfx_dispatcher_log.h"
#include "mfx_load_dll.h"
#define TRACE_HIVE_ERROR(str, ...) DISPATCHER_LOG_ERROR((("[HIVE]: "str), __VA_ARGS__))
#define TRACE_HIVE_INFO(str, ...) DISPATCHER_LOG_INFO((("[HIVE]: "str), __VA_ARGS__))
#define TRACE_HIVE_WRN(str, ...) DISPATCHER_LOG_WRN((("[HIVE]: "str), __VA_ARGS__))
#define TRACE_HIVE_ERROR(str, ...) DISPATCHER_LOG_ERROR((("[HIVE]: " str), __VA_ARGS__))
#define TRACE_HIVE_INFO(str, ...) DISPATCHER_LOG_INFO((("[HIVE]: " str), __VA_ARGS__))
#define TRACE_HIVE_WRN(str, ...) DISPATCHER_LOG_WRN((("[HIVE]: " str), __VA_ARGS__))
namespace
{
@ -82,6 +82,7 @@ namespace
MFX::MFXPluginsInHive::MFXPluginsInHive(int mfxStorageID, const msdk_disp_char *msdkLibSubKey, mfxVersion currentAPIVersion)
: MFXPluginStorageBase(currentAPIVersion)
{
#if defined(MEDIASDK_USE_REGISTRY) || (!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE))
HKEY rootHKey;
bool bRes;
WinRegKey regKey;
@ -222,8 +223,16 @@ MFX::MFXPluginsInHive::MFXPluginsInHive(int mfxStorageID, const msdk_disp_char *
TRACE_HIVE_ERROR("operator[](%d) = descriptionRecord; - threw exception \n", index);
}
}
#else
(void)mfxStorageID;
(void)msdkLibSubKey;
(void)currentAPIVersion;
#endif //#if defined(MEDIASDK_USE_REGISTRY) || (!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE))
}
#if defined(MEDIASDK_USE_CFGFILES) || (!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE))
MFX::MFXPluginsInFS::MFXPluginsInFS( mfxVersion currentAPIVersion )
: MFXPluginStorageBase(currentAPIVersion)
, mIsVersionParsed()
@ -453,6 +462,7 @@ bool MFX::MFXPluginsInFS::ParseKVPair( msdk_disp_char * key, msdk_disp_char* val
return true;
}
#endif //#if defined(MEDIASDK_USE_CFGFILES) || (!defined(MEDIASDK_UWP_LOADER) && !defined(MEDIASDK_UWP_PROCTABLE))
MFX::MFXDefaultPlugins::MFXDefaultPlugins(mfxVersion currentAPIVersion, MFX_DISP_HANDLE * hdl, int implType)
: MFXPluginStorageBase(currentAPIVersion)

View File

@ -1,6 +1,6 @@
/* ****************************************************************************** *\
Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
Copyright (C) 2012-2017 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -33,7 +33,7 @@ File Name: mfx_win_reg_key.cpp
#include "mfx_win_reg_key.h"
#include "mfx_dispatcher_log.h"
#define TRACE_WINREG_ERROR(str, ...) DISPATCHER_LOG_ERROR((("[WINREG]: "str), __VA_ARGS__))
#define TRACE_WINREG_ERROR(str, ...) DISPATCHER_LOG_ERROR((("[WINREG]: " str), __VA_ARGS__))
namespace MFX
{