Updated bundled libmfx to Media SDK 2013 R2, fix QSVHelper build
This commit is contained in:
parent
df84336aa0
commit
22ee33bfee
@ -54,7 +54,7 @@
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>MFX_D3D11_SUPPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>../libmfx/include/msdk/include</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
@ -78,7 +78,7 @@
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>MFX_D3D11_SUPPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>../libmfx/include/msdk/include</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
Copyright (C) 2012 Intel Corporation. All rights reserved.
|
||||
Copyright (C) 2012-2013 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:
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
Copyright (C) 2012 Intel Corporation. All rights reserved.
|
||||
Copyright (C) 2012-2013 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:
|
||||
@ -35,14 +35,6 @@ File Name: mfx_dxva2_device.h
|
||||
|
||||
#include <mfxdefs.h>
|
||||
|
||||
#ifdef DXVA2DEVICE_LOG
|
||||
#include <stdio.h>
|
||||
#define DXVA2DEVICE_TRACE(expr) printf expr;
|
||||
#define DXVA2DEVICE_TRACE_OPERATION(expr) expr;
|
||||
#else
|
||||
#define DXVA2DEVICE_TRACE(expr)
|
||||
#define DXVA2DEVICE_TRACE_OPERATION(expr)
|
||||
#endif
|
||||
|
||||
namespace MFX
|
||||
{
|
||||
@ -58,7 +50,7 @@ public:
|
||||
|
||||
// Initialize device using DXGI 1.1 interface
|
||||
virtual
|
||||
bool Init(const bool countDisplays, const mfxU32 adapterNum) = 0;
|
||||
bool Init(const mfxU32 adapterNum) = 0;
|
||||
|
||||
// Obtain graphic card's parameter
|
||||
mfxU32 GetVendorID(void) const;
|
||||
@ -102,6 +94,32 @@ private:
|
||||
void operator=(const DXDevice &);
|
||||
};
|
||||
|
||||
class D3D9Device : public DXDevice
|
||||
{
|
||||
public:
|
||||
// Default constructor
|
||||
D3D9Device(void);
|
||||
// Destructor
|
||||
virtual
|
||||
~D3D9Device(void);
|
||||
|
||||
// Initialize device using D3D v9 interface
|
||||
virtual
|
||||
bool Init(const mfxU32 adapterNum);
|
||||
|
||||
// Close the object
|
||||
virtual
|
||||
void Close(void);
|
||||
|
||||
protected:
|
||||
|
||||
// Pointer to the D3D v9 interface
|
||||
void *m_pD3D9;
|
||||
// Pointer to the D3D v9 extended interface
|
||||
void *m_pD3D9Ex;
|
||||
|
||||
};
|
||||
|
||||
class DXGI1Device : public DXDevice
|
||||
{
|
||||
public:
|
||||
@ -113,7 +131,7 @@ public:
|
||||
|
||||
// Initialize device
|
||||
virtual
|
||||
bool Init(const bool countDisplays, const mfxU32 adapterNum);
|
||||
bool Init(const mfxU32 adapterNum);
|
||||
|
||||
// Close the object
|
||||
virtual
|
||||
@ -136,8 +154,11 @@ public:
|
||||
// Destructor
|
||||
~DXVA2Device(void);
|
||||
|
||||
// Initialize device using D3D v9 interface
|
||||
bool InitD3D9(const mfxU32 adapterNum);
|
||||
|
||||
// Initialize device using DXGI 1.1 interface
|
||||
bool InitDXGI1(const bool countDisplays, const mfxU32 adapterNum);
|
||||
bool InitDXGI1(const mfxU32 adapterNum);
|
||||
|
||||
// Obtain graphic card's parameter
|
||||
mfxU32 GetVendorID(void) const;
|
||||
@ -151,6 +172,9 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
// Get vendor & device IDs by alternative way (D3D9 in Remote Desktop sessions)
|
||||
void UseAlternativeWay(const D3D9Device *pD3D9Device);
|
||||
|
||||
// Number of adapters available
|
||||
mfxU32 m_numAdapters;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
Copyright (C) 2012 Intel Corporation. All rights reserved.
|
||||
Copyright (C) 2012-2013 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:
|
||||
@ -58,26 +58,29 @@ public:
|
||||
~MFXLibraryIterator(void);
|
||||
|
||||
// Initialize the iterator
|
||||
mfxStatus Init(eMfxImplType implType, const bool countDisplays, const mfxU32 adapterNum, int storageID);
|
||||
mfxStatus Init(eMfxImplType implType, mfxIMPL implInterface, const mfxU32 adapterNum, int storageID);
|
||||
|
||||
// Get the next library path
|
||||
mfxStatus SelectDLLVersion(wchar_t *pPath, size_t pathSize, eMfxImplType *pImplType, mfxVersion minVersion);
|
||||
|
||||
// Return interface type on which Intel adapter was found (if any): D3D9 or D3D11
|
||||
mfxIMPL GetImplementationType();
|
||||
|
||||
protected:
|
||||
|
||||
// Release the iterator
|
||||
void Release(void);
|
||||
|
||||
WinRegKey m_baseRegKey; // (WinRegKey) main registry key
|
||||
WinRegKey m_baseRegKey; // (WinRegKey) main registry key
|
||||
|
||||
// Required library implementation
|
||||
eMfxImplType m_implType;
|
||||
eMfxImplType m_implType; // Required library implementation
|
||||
mfxIMPL m_implInterface; // Required interface (D3D9, D3D11)
|
||||
|
||||
mfxU32 m_vendorID; // (mfxU32) property of used graphic card
|
||||
mfxU32 m_deviceID; // (mfxU32) property of used graphic card
|
||||
|
||||
mfxU32 m_lastLibIndex; // (mfxU32) index of previously returned library
|
||||
mfxU32 m_lastLibMerit; // (mfxU32) merit of previously returned library
|
||||
mfxU32 m_lastLibIndex; // (mfxU32) index of previously returned library
|
||||
mfxU32 m_lastLibMerit; // (mfxU32) merit of previously returned library
|
||||
|
||||
private:
|
||||
// unimplemented by intent to make this class non-copyable
|
||||
|
@ -1,10 +1,28 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
INTEL CORPORATION PROPRIETARY INFORMATION
|
||||
This software is supplied under the terms of a license agreement or nondisclosure
|
||||
agreement with Intel Corporation and may not be copied or disclosed except in
|
||||
accordance with the terms of that agreement
|
||||
Copyright(c) 2007-2012 Intel Corporation. All Rights Reserved.
|
||||
Copyright (C) 2007-2013 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:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
File Name: mfxdefs.h
|
||||
|
||||
@ -17,7 +35,8 @@ extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if defined( _WIN32 ) || defined ( _WIN64 )
|
||||
|
||||
#if (defined( _WIN32 ) || defined ( _WIN64 )) && !defined (__GNUC__)
|
||||
#define __INT64 __int64
|
||||
#define __UINT64 unsigned __int64
|
||||
#else
|
||||
|
@ -1,10 +1,28 @@
|
||||
/******************************************************************************* *\
|
||||
|
||||
INTEL CORPORATION PROPRIETARY INFORMATION
|
||||
This software is supplied under the terms of a license agreement or nondisclosure
|
||||
agreement with Intel Corporation and may not be copied or disclosed except in
|
||||
accordance with the terms of that agreement
|
||||
Copyright(c) 2010 - 2012 Intel Corporation. All Rights Reserved.
|
||||
Copyright (C) 2010-2013 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:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
File Name: mfxjpeg.h
|
||||
|
||||
@ -49,6 +67,12 @@ enum {
|
||||
MFX_JPEG_COLORFORMAT_RGB = 2
|
||||
};
|
||||
|
||||
enum {
|
||||
MFX_SCANTYPE_UNKNOWN = 0,
|
||||
MFX_SCANTYPE_INTERLEAVED = 1,
|
||||
MFX_SCANTYPE_NONINTERLEAVED = 2
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
mfxExtBuffer Header;
|
||||
|
||||
|
@ -1,10 +1,28 @@
|
||||
/******************************************************************************* *\
|
||||
|
||||
INTEL CORPORATION PROPRIETARY INFORMATION
|
||||
This software is supplied under the terms of a license agreement or nondisclosure
|
||||
agreement with Intel Corporation and may not be copied or disclosed except in
|
||||
accordance with the terms of that agreement
|
||||
Copyright(c) 2010 - 2012 Intel Corporation. All Rights Reserved.
|
||||
Copyright (C) 2010-2013 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:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
File Name: mfxmvc.h
|
||||
|
||||
|
@ -1,10 +1,28 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
INTEL CORPORATION PROPRIETARY INFORMATION
|
||||
This software is supplied under the terms of a license agreement or nondisclosure
|
||||
agreement with Intel Corporation and may not be copied or disclosed except in
|
||||
accordance with the terms of that agreement
|
||||
Copyright(c) 2011-2012 Intel Corporation. All Rights Reserved.
|
||||
Copyright (C) 2007-2013 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:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
File Name: mfxplugin++.h
|
||||
|
@ -1,10 +1,28 @@
|
||||
/******************************************************************************* *\
|
||||
|
||||
INTEL CORPORATION PROPRIETARY INFORMATION
|
||||
This software is supplied under the terms of a license agreement or nondisclosure
|
||||
agreement with Intel Corporation and may not be copied or disclosed except in
|
||||
accordance with the terms of that agreement
|
||||
Copyright(c) 2007-2012 Intel Corporation. All Rights Reserved.
|
||||
Copyright (C) 2007-2013 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:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
File Name: mfxplugin.h
|
||||
|
||||
|
@ -1,10 +1,28 @@
|
||||
/******************************************************************************* *\
|
||||
|
||||
INTEL CORPORATION PROPRIETARY INFORMATION
|
||||
This software is supplied under the terms of a license agreement or nondisclosure
|
||||
agreement with Intel Corporation and may not be copied or disclosed except in
|
||||
accordance with the terms of that agreement
|
||||
Copyright(c) 2007-2012 Intel Corporation. All Rights Reserved.
|
||||
Copyright (C) 2007-2013 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:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
File Name: mfxstructures.h
|
||||
|
||||
@ -228,7 +246,8 @@ typedef struct {
|
||||
mfxU16 JPEGChromaFormat;
|
||||
mfxU16 Rotation;
|
||||
mfxU16 JPEGColorFormat;
|
||||
mfxU16 reserved3[10];
|
||||
mfxU16 InterleavedDec;
|
||||
mfxU16 reserved3[9];
|
||||
};
|
||||
struct { /* JPEG Encoding Options */
|
||||
mfxU16 Interleaved;
|
||||
@ -354,10 +373,18 @@ enum {
|
||||
|
||||
/* TargetUsages: from 1 to 7 inclusive */
|
||||
enum {
|
||||
MFX_TARGETUSAGE_1 =1,
|
||||
MFX_TARGETUSAGE_2 =2,
|
||||
MFX_TARGETUSAGE_3 =3,
|
||||
MFX_TARGETUSAGE_4 =4,
|
||||
MFX_TARGETUSAGE_5 =5,
|
||||
MFX_TARGETUSAGE_6 =6,
|
||||
MFX_TARGETUSAGE_7 =7,
|
||||
|
||||
MFX_TARGETUSAGE_UNKNOWN =0,
|
||||
MFX_TARGETUSAGE_BEST_QUALITY =1,
|
||||
MFX_TARGETUSAGE_BALANCED =4,
|
||||
MFX_TARGETUSAGE_BEST_SPEED =7
|
||||
MFX_TARGETUSAGE_BEST_QUALITY =MFX_TARGETUSAGE_1,
|
||||
MFX_TARGETUSAGE_BALANCED =MFX_TARGETUSAGE_4,
|
||||
MFX_TARGETUSAGE_BEST_SPEED =MFX_TARGETUSAGE_7
|
||||
};
|
||||
|
||||
/* RateControlMethod */
|
||||
@ -368,7 +395,18 @@ enum {
|
||||
MFX_RATECONTROL_AVBR =4,
|
||||
MFX_RATECONTROL_RESERVED1 =5,
|
||||
MFX_RATECONTROL_RESERVED2 =6,
|
||||
MFX_RATECONTROL_RESERVED3 =100
|
||||
MFX_RATECONTROL_RESERVED3 =100,
|
||||
MFX_RATECONTROL_RESERVED4 =7,
|
||||
MFX_RATECONTROL_LA =8
|
||||
};
|
||||
|
||||
/* Trellis control*/
|
||||
enum {
|
||||
MFX_TRELLIS_UNKNOWN =0,
|
||||
MFX_TRELLIS_OFF =0x01,
|
||||
MFX_TRELLIS_I =0x02,
|
||||
MFX_TRELLIS_P =0x04,
|
||||
MFX_TRELLIS_B =0x08
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
@ -419,7 +457,9 @@ typedef struct {
|
||||
mfxU16 BitrateLimit; /* tri-state option */
|
||||
mfxU16 MBBRC; /* tri-state option */
|
||||
mfxU16 ExtBRC; /* tri-state option */
|
||||
mfxU16 reserved2[18];
|
||||
mfxU16 LookAheadDepth;
|
||||
mfxU16 Trellis;
|
||||
mfxU16 reserved2[16];
|
||||
} mfxExtCodingOption2;
|
||||
|
||||
/* IntraPredBlockSize/InterPredBlockSize */
|
||||
@ -449,7 +489,11 @@ typedef struct _mfxEncryptedData mfxEncryptedData;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
mfxEncryptedData* EncryptedData;
|
||||
struct {
|
||||
mfxEncryptedData* EncryptedData;
|
||||
mfxExtBuffer **ExtParam;
|
||||
mfxU16 NumExtParam;
|
||||
};
|
||||
mfxU32 reserved[6];
|
||||
};
|
||||
mfxI64 DecodeTimeStamp;
|
||||
@ -491,7 +535,10 @@ enum {
|
||||
MFX_EXTBUFF_AVC_TEMPORAL_LAYERS = MFX_MAKEFOURCC('A','T','M','L'),
|
||||
MFX_EXTBUFF_CODING_OPTION2 = MFX_MAKEFOURCC('C','D','O','2'),
|
||||
MFX_EXTBUFF_VPP_IMAGE_STABILIZATION = MFX_MAKEFOURCC('I','S','T','B'),
|
||||
MFX_EXTBUFF_VPP_PICSTRUCT_DETECTION = MFX_MAKEFOURCC('I','D','E','T')
|
||||
MFX_EXTBUFF_VPP_PICSTRUCT_DETECTION = MFX_MAKEFOURCC('I','D','E','T'),
|
||||
MFX_EXTBUFF_ENCODER_CAPABILITY = MFX_MAKEFOURCC('E','N','C','P'),
|
||||
MFX_EXTBUFF_ENCODER_RESET_OPTION = MFX_MAKEFOURCC('E','N','R','O'),
|
||||
MFX_EXTBUFF_ENCODED_FRAME_INFO = MFX_MAKEFOURCC('E','N','F','I')
|
||||
};
|
||||
|
||||
/* VPP Conf: Do not use certain algorithms */
|
||||
@ -747,10 +794,12 @@ typedef struct {
|
||||
mfxU32 FrameOrder;
|
||||
mfxU16 PicStruct;
|
||||
mfxU16 ViewId;
|
||||
mfxU32 reserved[2];
|
||||
mfxU16 LongTermIdx;
|
||||
mfxU16 reserved[3];
|
||||
} PreferredRefList[32], RejectedRefList[16], LongTermRefList[16];
|
||||
|
||||
mfxU32 reserved[8];
|
||||
mfxU16 ApplyLongTermIdx;
|
||||
mfxU16 reserved[15];
|
||||
} mfxExtAVCRefListCtrl;
|
||||
|
||||
enum {
|
||||
@ -812,6 +861,36 @@ typedef struct {
|
||||
}Layer[8];
|
||||
} mfxExtAvcTemporalLayers;
|
||||
|
||||
typedef struct {
|
||||
mfxExtBuffer Header;
|
||||
|
||||
mfxU32 MBPerSec;
|
||||
mfxU16 reserved[58];
|
||||
} mfxExtEncoderCapability;
|
||||
|
||||
typedef struct {
|
||||
mfxExtBuffer Header;
|
||||
|
||||
mfxU16 StartNewSequence;
|
||||
mfxU16 reserved[11];
|
||||
} mfxExtEncoderResetOption;
|
||||
|
||||
typedef struct {
|
||||
mfxExtBuffer Header;
|
||||
|
||||
mfxU32 FrameOrder;
|
||||
mfxU16 PicStruct;
|
||||
mfxU16 LongTermIdx;
|
||||
mfxU16 reserved[8];
|
||||
|
||||
struct {
|
||||
mfxU32 FrameOrder;
|
||||
mfxU16 PicStruct;
|
||||
mfxU16 LongTermIdx;
|
||||
mfxU16 reserved[4];
|
||||
} UsedRefListL0[32], UsedRefListL1[32];
|
||||
} mfxExtAVCEncodedFrameInfo;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
@ -1,10 +1,28 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
INTEL CORPORATION PROPRIETARY INFORMATION
|
||||
This software is supplied under the terms of a license agreement or nondisclosure
|
||||
agreement with Intel Corporation and may not be copied or disclosed except in
|
||||
accordance with the terms of that agreement
|
||||
Copyright(c) 2007-2010 Intel Corporation. All Rights Reserved.
|
||||
Copyright (C) 2007-2013 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:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
File Name: mfxvideo++.h
|
||||
|
@ -1,10 +1,28 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
INTEL CORPORATION PROPRIETARY INFORMATION
|
||||
This software is supplied under the terms of a license agreement or nondisclosure
|
||||
agreement with Intel Corporation and may not be copied or disclosed except in
|
||||
accordance with the terms of that agreement
|
||||
Copyright(c) 2007-2012 Intel Corporation. All Rights Reserved.
|
||||
Copyright (C) 2007-2013 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:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
File Name: mfxvideo.h
|
||||
|
||||
@ -15,7 +33,7 @@ File Name: mfxvideo.h
|
||||
|
||||
/* This is the external include file for the Intel(R) Media Software Development Kit product */
|
||||
#define MFX_VERSION_MAJOR 1
|
||||
#define MFX_VERSION_MINOR 6
|
||||
#define MFX_VERSION_MINOR 7
|
||||
|
||||
#ifdef _WIN32
|
||||
#define MFX_CDECL __cdecl
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
Copyright (C) 2012 Intel Corporation. All rights reserved.
|
||||
Copyright (C) 2012-2013 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,8 @@ mfxStatus DISPATCHER_EXPOSED_PREFIX(MFXInit)(mfxIMPL impl, mfxVersion *pVer, mfx
|
||||
// implementation method masked from the input parameter
|
||||
const mfxIMPL implMethod = impl & (MFX_IMPL_VIA_ANY - 1);
|
||||
// implementation interface masked from the input parameter
|
||||
const mfxIMPL implInterface = impl & -MFX_IMPL_VIA_ANY;
|
||||
mfxIMPL implInterface = impl & -MFX_IMPL_VIA_ANY;
|
||||
mfxIMPL implInterfaceOrig = implInterface;
|
||||
mfxVersion requiredVersion = {MFX_VERSION_MINOR, MFX_VERSION_MAJOR};
|
||||
|
||||
// check error(s)
|
||||
@ -171,8 +172,8 @@ mfxStatus DISPATCHER_EXPOSED_PREFIX(MFXInit)(mfxIMPL impl, mfxVersion *pVer, mfx
|
||||
do
|
||||
{
|
||||
// initialize the library iterator
|
||||
mfxRes = libIterator.Init(implTypes[curImplIdx].implType,
|
||||
implInterface != MFX_IMPL_VIA_D3D11,
|
||||
mfxRes = libIterator.Init(implTypes[curImplIdx].implType,
|
||||
implInterface,
|
||||
implTypes[curImplIdx].adapterID,
|
||||
currentStorage);
|
||||
|
||||
@ -180,6 +181,14 @@ mfxStatus DISPATCHER_EXPOSED_PREFIX(MFXInit)(mfxIMPL impl, mfxVersion *pVer, mfx
|
||||
// looking for a suitable library with higher merit value.
|
||||
if (MFX_ERR_NONE == mfxRes)
|
||||
{
|
||||
|
||||
if (
|
||||
!implInterface ||
|
||||
implInterface == MFX_IMPL_VIA_ANY)
|
||||
{
|
||||
implInterface = libIterator.GetImplementationType();
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
eMfxImplType implType;
|
||||
@ -216,6 +225,7 @@ mfxStatus DISPATCHER_EXPOSED_PREFIX(MFXInit)(mfxIMPL impl, mfxVersion *pVer, mfx
|
||||
|
||||
// use the default DLL search mechanism fail,
|
||||
// if hard-coded software library's path from the registry fails
|
||||
implInterface = implInterfaceOrig;
|
||||
if (MFX_ERR_NONE != mfxRes)
|
||||
{
|
||||
// set current library index again
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
Copyright (C) 2012 Intel Corporation. All rights reserved.
|
||||
Copyright (C) 2012-2013 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:
|
||||
@ -192,7 +192,7 @@ mfxStatus MFX_DISP_HANDLE::LoadSelectedDLL(const msdk_disp_char *pPath, eMfxImpl
|
||||
|
||||
{
|
||||
DISPATCHER_LOG_BLOCK( ("MFXInit(%s,ver=%u.%u,session=0x%p)\n"
|
||||
, DispatcherLog_GetMFXImplString(impl).c_str()
|
||||
, DispatcherLog_GetMFXImplString(impl| implInterface).c_str()
|
||||
, apiVersion.Major
|
||||
, apiVersion.Minor
|
||||
, &session));
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
Copyright (C) 2012 Intel Corporation. All rights reserved.
|
||||
Copyright (C) 2012-2013 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:
|
||||
@ -224,7 +224,7 @@ void DispatchLog::Write(int level, int opcode, char * msg, va_list argptr)
|
||||
|
||||
case DL_SINK_PRINTF:
|
||||
{
|
||||
char msg_formated[1024];
|
||||
char msg_formated[1024] = {0};
|
||||
|
||||
if (NULL != msg && level != DL_LOADED_LIBRARY)
|
||||
{
|
||||
@ -259,8 +259,8 @@ class ETWHandler : public IMsgHandler
|
||||
public:
|
||||
ETWHandler(const wchar_t * guid_str)
|
||||
: m_bUseFormatter(DISPATCHER_LOG_USE_FORMATING)
|
||||
, m_EventHandle()
|
||||
, m_bProviderEnable()
|
||||
, m_EventHandle()
|
||||
{
|
||||
GUID rguid = GUID_NULL;
|
||||
if (FAILED(CLSIDFromString(guid_str, &rguid)))
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
Copyright (C) 2012 Intel Corporation. All rights reserved.
|
||||
Copyright (C) 2012-2013 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,6 +32,7 @@ File Name: mfx_dxva2_device.cpp
|
||||
#include <sstream>
|
||||
|
||||
#define INITGUID
|
||||
#include <d3d9.h>
|
||||
#include <dxgi.h>
|
||||
|
||||
#include "mfx_dxva2_device.h"
|
||||
@ -130,6 +131,147 @@ void DXDevice::UnloadDLLModule(void)
|
||||
|
||||
} // void DXDevice::UnloaDLLdModule(void)
|
||||
|
||||
|
||||
D3D9Device::D3D9Device(void)
|
||||
{
|
||||
m_pD3D9 = (void *) 0;
|
||||
m_pD3D9Ex = (void *) 0;
|
||||
|
||||
} // D3D9Device::D3D9Device(void)
|
||||
|
||||
D3D9Device::~D3D9Device(void)
|
||||
{
|
||||
Close();
|
||||
|
||||
} // D3D9Device::~D3D9Device(void)
|
||||
|
||||
void D3D9Device::Close(void)
|
||||
{
|
||||
// release the interfaces
|
||||
if (m_pD3D9Ex)
|
||||
{
|
||||
((IDirect3D9Ex *) m_pD3D9Ex)->Release();
|
||||
}
|
||||
|
||||
// release the interfaces
|
||||
if (m_pD3D9)
|
||||
{
|
||||
((IDirect3D9 *) m_pD3D9)->Release();
|
||||
}
|
||||
|
||||
m_pD3D9 = (void *) 0;
|
||||
m_pD3D9Ex = (void *) 0;
|
||||
|
||||
} // void D3D9Device::Close(void)
|
||||
|
||||
typedef
|
||||
IDirect3D9 * (WINAPI *D3DCreateFunctionPtr_t) (UINT);
|
||||
|
||||
typedef
|
||||
HRESULT (WINAPI *D3DExCreateFunctionPtr_t) (UINT, IDirect3D9Ex **);
|
||||
|
||||
bool D3D9Device::Init(const mfxU32 adapterNum)
|
||||
{
|
||||
// close the device before initialization
|
||||
Close();
|
||||
|
||||
// load the library
|
||||
if (NULL == m_hModule)
|
||||
{
|
||||
LoadDLLModule(L"d3d9.dll");
|
||||
}
|
||||
|
||||
if (m_hModule)
|
||||
{
|
||||
D3DCreateFunctionPtr_t pFunc;
|
||||
|
||||
// load address of procedure to create D3D device
|
||||
pFunc = (D3DCreateFunctionPtr_t) GetProcAddress(m_hModule, "Direct3DCreate9");
|
||||
if (pFunc)
|
||||
{
|
||||
D3DADAPTER_IDENTIFIER9 adapterIdent;
|
||||
IDirect3D9 *pD3D9;
|
||||
HRESULT hRes;
|
||||
|
||||
// create D3D object
|
||||
m_pD3D9 = pFunc(D3D_SDK_VERSION);
|
||||
|
||||
if (NULL == m_pD3D9)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// cast the interface
|
||||
pD3D9 = (IDirect3D9 *) m_pD3D9;
|
||||
|
||||
m_numAdapters = pD3D9->GetAdapterCount();
|
||||
if (adapterNum >= m_numAdapters)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// get the card's parameters
|
||||
hRes = pD3D9->GetAdapterIdentifier(adapterNum, 0, &adapterIdent);
|
||||
if (D3D_OK != hRes)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_vendorID = adapterIdent.VendorId;
|
||||
m_deviceID = adapterIdent.DeviceId;
|
||||
m_driverVersion = (mfxU64)adapterIdent.DriverVersion.QuadPart;
|
||||
|
||||
// load LUID
|
||||
do
|
||||
{
|
||||
IDirect3D9Ex *pD3D9Ex;
|
||||
D3DExCreateFunctionPtr_t pFuncEx;
|
||||
LUID d3d9LUID;
|
||||
|
||||
// find the appropriate function
|
||||
pFuncEx = (D3DExCreateFunctionPtr_t) GetProcAddress(m_hModule, "Direct3DCreate9Ex");
|
||||
if (NULL == pFuncEx)
|
||||
{
|
||||
// the extended interface is not supported
|
||||
break;
|
||||
}
|
||||
|
||||
// create extended interface
|
||||
hRes = pFuncEx(D3D_SDK_VERSION, &pD3D9Ex);
|
||||
if (FAILED(hRes))
|
||||
{
|
||||
// can't create extended interface
|
||||
break;
|
||||
}
|
||||
m_pD3D9Ex = pD3D9Ex;
|
||||
|
||||
// obtain D3D9 device LUID
|
||||
hRes = pD3D9Ex->GetAdapterLUID(adapterNum, &d3d9LUID);
|
||||
if (FAILED(hRes))
|
||||
{
|
||||
// can't get extended interface
|
||||
break;
|
||||
}
|
||||
|
||||
// copy the LUID
|
||||
*((LUID *) &m_luid) = d3d9LUID;
|
||||
|
||||
} while (FAILED(hRes));
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
} // bool D3D9Device::Init(const mfxU32 adapterNum)
|
||||
|
||||
typedef
|
||||
HRESULT (WINAPI *DXGICreateFactoryFunc) (REFIID riid, void **ppFactory);
|
||||
|
||||
@ -164,7 +306,7 @@ void DXGI1Device::Close(void)
|
||||
|
||||
} // void DXGI1Device::Close(void)
|
||||
|
||||
bool DXGI1Device::Init(const bool countDisplays, const mfxU32 adapterNum)
|
||||
bool DXGI1Device::Init(const mfxU32 adapterNum)
|
||||
{
|
||||
// release the object before initialization
|
||||
Close();
|
||||
@ -181,6 +323,7 @@ bool DXGI1Device::Init(const bool countDisplays, const mfxU32 adapterNum)
|
||||
IDXGIFactory1 *pFactory;
|
||||
IDXGIAdapter1 *pAdapter;
|
||||
DXGI_ADAPTER_DESC1 desc;
|
||||
mfxU32 curAdapter, maxAdapters;
|
||||
HRESULT hRes;
|
||||
|
||||
// load address of procedure to create DXGI 1.1 factory
|
||||
@ -202,46 +345,41 @@ bool DXGI1Device::Init(const bool countDisplays, const mfxU32 adapterNum)
|
||||
}
|
||||
m_pDXGIFactory1 = pFactory;
|
||||
|
||||
if(countDisplays)
|
||||
// get the number of adapters
|
||||
curAdapter = 0;
|
||||
maxAdapters = 0;
|
||||
do
|
||||
{
|
||||
UINT display = 0;
|
||||
for(UINT adapter = 0; pFactory->EnumAdapters1(adapter, &pAdapter) != DXGI_ERROR_NOT_FOUND; adapter++)
|
||||
// get the required adapted
|
||||
hRes = pFactory->EnumAdapters1(curAdapter, &pAdapter);
|
||||
if (FAILED(hRes))
|
||||
{
|
||||
IDXGIOutput *out;
|
||||
for(UINT start_display = display; pAdapter->EnumOutputs(display-start_display, &out) != DXGI_ERROR_NOT_FOUND; display++)
|
||||
{
|
||||
out->Release();
|
||||
|
||||
if (display != adapterNum)
|
||||
continue;
|
||||
|
||||
m_pDXGIAdapter1 = pAdapter;
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_pDXGIAdapter1)
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
// if it is the required adapter, save the interface
|
||||
if (curAdapter == adapterNum)
|
||||
{
|
||||
m_pDXGIAdapter1 = pAdapter;
|
||||
}
|
||||
else
|
||||
{
|
||||
pAdapter->Release();
|
||||
}
|
||||
|
||||
// there is no required adapter
|
||||
if (adapterNum > display)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
hRes = pFactory->EnumAdapters1(adapterNum, &pAdapter);
|
||||
if(FAILED(hRes))
|
||||
return false;
|
||||
// get the next adapter
|
||||
curAdapter += 1;
|
||||
|
||||
m_pDXGIAdapter1 = pAdapter;
|
||||
} while (SUCCEEDED(hRes));
|
||||
maxAdapters = curAdapter;
|
||||
|
||||
// there is no required adapter
|
||||
if (adapterNum >= maxAdapters)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pAdapter = (IDXGIAdapter1 *) m_pDXGIAdapter1;
|
||||
|
||||
if(!pAdapter)
|
||||
return false;
|
||||
|
||||
// get the adapter's parameters
|
||||
hRes = pAdapter->GetDesc1(&desc);
|
||||
if (FAILED(hRes))
|
||||
@ -283,7 +421,42 @@ void DXVA2Device::Close(void)
|
||||
|
||||
} // void DXVA2Device::Close(void)
|
||||
|
||||
bool DXVA2Device::InitDXGI1(const bool countDisplays, const mfxU32 adapterNum)
|
||||
bool DXVA2Device::InitD3D9(const mfxU32 adapterNum)
|
||||
{
|
||||
D3D9Device d3d9Device;
|
||||
bool bRes;
|
||||
|
||||
// release the object before initialization
|
||||
Close();
|
||||
|
||||
// create 'old fashion' device
|
||||
bRes = d3d9Device.Init(adapterNum);
|
||||
if (false == bRes)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_numAdapters = d3d9Device.GetAdapterCount();
|
||||
|
||||
// check if the application is under Remote Desktop
|
||||
if ((0 == d3d9Device.GetVendorID()) || (0 == d3d9Device.GetDeviceID()))
|
||||
{
|
||||
// get the required parameters alternative way and ...
|
||||
UseAlternativeWay(&d3d9Device);
|
||||
}
|
||||
else
|
||||
{
|
||||
// save the parameters and ...
|
||||
m_vendorID = d3d9Device.GetVendorID();
|
||||
m_deviceID = d3d9Device.GetDeviceID();
|
||||
m_driverVersion = d3d9Device.GetDriverVersion();
|
||||
}
|
||||
|
||||
// ... say goodbye
|
||||
return true;
|
||||
} // bool InitD3D9(const mfxU32 adapterNum)
|
||||
|
||||
bool DXVA2Device::InitDXGI1(const mfxU32 adapterNum)
|
||||
{
|
||||
DXGI1Device dxgi1Device;
|
||||
bool bRes;
|
||||
@ -292,7 +465,7 @@ bool DXVA2Device::InitDXGI1(const bool countDisplays, const mfxU32 adapterNum)
|
||||
Close();
|
||||
|
||||
// create modern DXGI device
|
||||
bRes = dxgi1Device.Init(countDisplays, adapterNum);
|
||||
bRes = dxgi1Device.Init(adapterNum);
|
||||
if (false == bRes)
|
||||
{
|
||||
return false;
|
||||
@ -308,6 +481,49 @@ bool DXVA2Device::InitDXGI1(const bool countDisplays, const mfxU32 adapterNum)
|
||||
|
||||
} // bool DXVA2Device::InitDXGI1(const mfxU32 adapterNum)
|
||||
|
||||
void DXVA2Device::UseAlternativeWay(const D3D9Device *pD3D9Device)
|
||||
{
|
||||
mfxU64 d3d9LUID = pD3D9Device->GetLUID();
|
||||
|
||||
// work only with valid LUIDs
|
||||
if (0 == d3d9LUID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DXGI1Device dxgi1Device;
|
||||
mfxU32 curDevice = 0;
|
||||
bool bRes = false;
|
||||
|
||||
do
|
||||
{
|
||||
// initialize the next DXGI1 or DXGI device
|
||||
bRes = dxgi1Device.Init(curDevice);
|
||||
if (false == bRes)
|
||||
{
|
||||
// there is no more devices
|
||||
break;
|
||||
}
|
||||
|
||||
// is it required device ?
|
||||
if (d3d9LUID == dxgi1Device.GetLUID())
|
||||
{
|
||||
m_vendorID = dxgi1Device.GetVendorID();
|
||||
m_deviceID = dxgi1Device.GetDeviceID();
|
||||
m_driverVersion = dxgi1Device.GetDriverVersion();
|
||||
return ;
|
||||
}
|
||||
|
||||
// get the next device
|
||||
curDevice += 1;
|
||||
|
||||
} while (bRes);
|
||||
|
||||
dxgi1Device.Close();
|
||||
// we need to match a DXGI(1) device to the D3D9 device
|
||||
|
||||
} // void DXVA2Device::UseAlternativeWay(const D3D9Device *pD3D9Device)
|
||||
|
||||
mfxU32 DXVA2Device::GetVendorID(void) const
|
||||
{
|
||||
return m_vendorID;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
Copyright (C) 2012 Intel Corporation. All rights reserved.
|
||||
Copyright (C) 2012-2013 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:
|
||||
@ -90,7 +90,7 @@ void MFXLibraryIterator::Release(void)
|
||||
|
||||
} // void MFXLibraryIterator::Release(void)
|
||||
|
||||
mfxStatus MFXLibraryIterator::Init(eMfxImplType implType, const bool countDisplays, const mfxU32 adapterNum, int storageID)
|
||||
mfxStatus MFXLibraryIterator::Init(eMfxImplType implType, mfxIMPL implInterface, const mfxU32 adapterNum, int storageID)
|
||||
{
|
||||
DXVA2Device dxvaDevice;
|
||||
HKEY rootHKey;
|
||||
@ -119,15 +119,52 @@ mfxStatus MFXLibraryIterator::Init(eMfxImplType implType, const bool countDispla
|
||||
|
||||
// set the required library's implementation type
|
||||
m_implType = implType;
|
||||
m_implInterface = implInterface != 0
|
||||
? implInterface
|
||||
: MFX_IMPL_VIA_ANY;
|
||||
|
||||
// try to open DXGI 1.1 device to get hardware ID
|
||||
if (!dxvaDevice.InitDXGI1(countDisplays, adapterNum))
|
||||
if (MFX_IMPL_VIA_D3D9 == m_implInterface)
|
||||
{
|
||||
DISPATCHER_LOG_INFO((("dxvaDevice.InitDXGI1(%d) Failed "), adapterNum ));
|
||||
// try to create the Direct3D 9 device and find right adapter
|
||||
if (!dxvaDevice.InitD3D9(adapterNum))
|
||||
{
|
||||
DISPATCHER_LOG_INFO((("dxvaDevice.InitD3D9(%d) Failed "), adapterNum ));
|
||||
return MFX_ERR_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
else if (MFX_IMPL_VIA_D3D11 == m_implInterface)
|
||||
{
|
||||
// try to open DXGI 1.1 device to get hardware ID
|
||||
if (!dxvaDevice.InitDXGI1(adapterNum))
|
||||
{
|
||||
DISPATCHER_LOG_INFO((("dxvaDevice.InitDXGI1(%d) Failed "), adapterNum ));
|
||||
return MFX_ERR_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
else if (MFX_IMPL_VIA_ANY == m_implInterface)
|
||||
{
|
||||
// try the Direct3D 9 device
|
||||
if (dxvaDevice.InitD3D9(adapterNum))
|
||||
{
|
||||
m_implInterface = MFX_IMPL_VIA_D3D9; // store value for GetImplementationType() call
|
||||
}
|
||||
// else try to open DXGI 1.1 device to get hardware ID
|
||||
else if (dxvaDevice.InitDXGI1(adapterNum))
|
||||
{
|
||||
m_implInterface = MFX_IMPL_VIA_D3D11; // store value for GetImplementationType() call
|
||||
}
|
||||
else
|
||||
{
|
||||
DISPATCHER_LOG_INFO((("Unsupported adapter %d "), adapterNum ));
|
||||
return MFX_ERR_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DISPATCHER_LOG_ERROR((("Unknown implementation type %d "), m_implInterface ));
|
||||
return MFX_ERR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
|
||||
// obtain card's parameters
|
||||
m_vendorID = dxvaDevice.GetVendorID();
|
||||
m_deviceID = dxvaDevice.GetDeviceID();
|
||||
@ -368,7 +405,12 @@ mfxStatus MFXLibraryIterator::SelectDLLVersion(wchar_t *pPath, size_t pathSize,
|
||||
|
||||
return MFX_ERR_NONE;
|
||||
|
||||
} // mfxStatus MFXLibraryIterator::SelectDLLVersion(wchar_t *pPath, size_t pathSize,
|
||||
} // mfxStatus MFXLibraryIterator::SelectDLLVersion(wchar_t *pPath, size_t pathSize, eMfxImplType *pImplType, mfxVersion minVersion)
|
||||
|
||||
mfxIMPL MFXLibraryIterator::GetImplementationType()
|
||||
{
|
||||
return m_implInterface;
|
||||
} // mfxIMPL MFXLibraryIterator::GetImplementationType()
|
||||
|
||||
} // namespace MFX
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* ****************************************************************************** *\
|
||||
|
||||
Copyright (C) 2012 Intel Corporation. All rights reserved.
|
||||
Copyright (C) 2012-2013 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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user