Updated bundled libmfx to Media SDK 2013 R2, fix QSVHelper build

This commit is contained in:
Richard Stanway 2013-09-26 22:03:44 +02:00
parent df84336aa0
commit 22ee33bfee
18 changed files with 632 additions and 125 deletions

View File

@ -54,7 +54,7 @@
<ClCompile> <ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>MFX_D3D11_SUPPORT;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../libmfx/include/msdk/include</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../libmfx/include/msdk/include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@ -78,7 +78,7 @@
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>MFX_D3D11_SUPPORT;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>../libmfx/include/msdk/include</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../libmfx/include/msdk/include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>

View File

@ -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 Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:

View File

@ -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 Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
@ -35,14 +35,6 @@ File Name: mfx_dxva2_device.h
#include <mfxdefs.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 namespace MFX
{ {
@ -58,7 +50,7 @@ public:
// Initialize device using DXGI 1.1 interface // Initialize device using DXGI 1.1 interface
virtual virtual
bool Init(const bool countDisplays, const mfxU32 adapterNum) = 0; bool Init(const mfxU32 adapterNum) = 0;
// Obtain graphic card's parameter // Obtain graphic card's parameter
mfxU32 GetVendorID(void) const; mfxU32 GetVendorID(void) const;
@ -102,6 +94,32 @@ private:
void operator=(const DXDevice &); 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 class DXGI1Device : public DXDevice
{ {
public: public:
@ -113,7 +131,7 @@ public:
// Initialize device // Initialize device
virtual virtual
bool Init(const bool countDisplays, const mfxU32 adapterNum); bool Init(const mfxU32 adapterNum);
// Close the object // Close the object
virtual virtual
@ -136,8 +154,11 @@ public:
// Destructor // Destructor
~DXVA2Device(void); ~DXVA2Device(void);
// Initialize device using D3D v9 interface
bool InitD3D9(const mfxU32 adapterNum);
// Initialize device using DXGI 1.1 interface // 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 // Obtain graphic card's parameter
mfxU32 GetVendorID(void) const; mfxU32 GetVendorID(void) const;
@ -151,6 +172,9 @@ public:
protected: protected:
// Get vendor & device IDs by alternative way (D3D9 in Remote Desktop sessions)
void UseAlternativeWay(const D3D9Device *pD3D9Device);
// Number of adapters available // Number of adapters available
mfxU32 m_numAdapters; mfxU32 m_numAdapters;

View File

@ -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 Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
@ -58,11 +58,14 @@ public:
~MFXLibraryIterator(void); ~MFXLibraryIterator(void);
// Initialize the iterator // 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 // Get the next library path
mfxStatus SelectDLLVersion(wchar_t *pPath, size_t pathSize, eMfxImplType *pImplType, mfxVersion minVersion); 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: protected:
// Release the iterator // Release the iterator
@ -70,14 +73,14 @@ protected:
WinRegKey m_baseRegKey; // (WinRegKey) main registry key WinRegKey m_baseRegKey; // (WinRegKey) main registry key
// Required library implementation eMfxImplType m_implType; // Required library implementation
eMfxImplType m_implType; mfxIMPL m_implInterface; // Required interface (D3D9, D3D11)
mfxU32 m_vendorID; // (mfxU32) property of used graphic card mfxU32 m_vendorID; // (mfxU32) property of used graphic card
mfxU32 m_deviceID; // (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_lastLibIndex; // (mfxU32) index of previously returned library
mfxU32 m_lastLibMerit; // (mfxU32) merit of previously returned library mfxU32 m_lastLibMerit; // (mfxU32) merit of previously returned library
private: private:
// unimplemented by intent to make this class non-copyable // unimplemented by intent to make this class non-copyable

View File

@ -1,10 +1,28 @@
/* ****************************************************************************** *\ /* ****************************************************************************** *\
INTEL CORPORATION PROPRIETARY INFORMATION Copyright (C) 2007-2013 Intel Corporation. All rights reserved.
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 Redistribution and use in source and binary forms, with or without
accordance with the terms of that agreement modification, are permitted provided that the following conditions are met:
Copyright(c) 2007-2012 Intel Corporation. All Rights Reserved. - 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 File Name: mfxdefs.h
@ -17,7 +35,8 @@ extern "C"
{ {
#endif /* __cplusplus */ #endif /* __cplusplus */
#if defined( _WIN32 ) || defined ( _WIN64 )
#if (defined( _WIN32 ) || defined ( _WIN64 )) && !defined (__GNUC__)
#define __INT64 __int64 #define __INT64 __int64
#define __UINT64 unsigned __int64 #define __UINT64 unsigned __int64
#else #else

View File

@ -1,10 +1,28 @@
/******************************************************************************* *\ /******************************************************************************* *\
INTEL CORPORATION PROPRIETARY INFORMATION Copyright (C) 2010-2013 Intel Corporation. All rights reserved.
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 Redistribution and use in source and binary forms, with or without
accordance with the terms of that agreement modification, are permitted provided that the following conditions are met:
Copyright(c) 2010 - 2012 Intel Corporation. All Rights Reserved. - 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 File Name: mfxjpeg.h
@ -49,6 +67,12 @@ enum {
MFX_JPEG_COLORFORMAT_RGB = 2 MFX_JPEG_COLORFORMAT_RGB = 2
}; };
enum {
MFX_SCANTYPE_UNKNOWN = 0,
MFX_SCANTYPE_INTERLEAVED = 1,
MFX_SCANTYPE_NONINTERLEAVED = 2
};
typedef struct { typedef struct {
mfxExtBuffer Header; mfxExtBuffer Header;

View File

@ -1,10 +1,28 @@
/******************************************************************************* *\ /******************************************************************************* *\
INTEL CORPORATION PROPRIETARY INFORMATION Copyright (C) 2010-2013 Intel Corporation. All rights reserved.
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 Redistribution and use in source and binary forms, with or without
accordance with the terms of that agreement modification, are permitted provided that the following conditions are met:
Copyright(c) 2010 - 2012 Intel Corporation. All Rights Reserved. - 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 File Name: mfxmvc.h

View File

@ -1,10 +1,28 @@
/* ****************************************************************************** *\ /* ****************************************************************************** *\
INTEL CORPORATION PROPRIETARY INFORMATION Copyright (C) 2007-2013 Intel Corporation. All rights reserved.
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 Redistribution and use in source and binary forms, with or without
accordance with the terms of that agreement modification, are permitted provided that the following conditions are met:
Copyright(c) 2011-2012 Intel Corporation. All Rights Reserved. - 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 File Name: mfxplugin++.h

View File

@ -1,10 +1,28 @@
/******************************************************************************* *\ /******************************************************************************* *\
INTEL CORPORATION PROPRIETARY INFORMATION Copyright (C) 2007-2013 Intel Corporation. All rights reserved.
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 Redistribution and use in source and binary forms, with or without
accordance with the terms of that agreement modification, are permitted provided that the following conditions are met:
Copyright(c) 2007-2012 Intel Corporation. All Rights Reserved. - 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 File Name: mfxplugin.h

View File

@ -1,10 +1,28 @@
/******************************************************************************* *\ /******************************************************************************* *\
INTEL CORPORATION PROPRIETARY INFORMATION Copyright (C) 2007-2013 Intel Corporation. All rights reserved.
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 Redistribution and use in source and binary forms, with or without
accordance with the terms of that agreement modification, are permitted provided that the following conditions are met:
Copyright(c) 2007-2012 Intel Corporation. All Rights Reserved. - 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 File Name: mfxstructures.h
@ -228,7 +246,8 @@ typedef struct {
mfxU16 JPEGChromaFormat; mfxU16 JPEGChromaFormat;
mfxU16 Rotation; mfxU16 Rotation;
mfxU16 JPEGColorFormat; mfxU16 JPEGColorFormat;
mfxU16 reserved3[10]; mfxU16 InterleavedDec;
mfxU16 reserved3[9];
}; };
struct { /* JPEG Encoding Options */ struct { /* JPEG Encoding Options */
mfxU16 Interleaved; mfxU16 Interleaved;
@ -354,10 +373,18 @@ enum {
/* TargetUsages: from 1 to 7 inclusive */ /* TargetUsages: from 1 to 7 inclusive */
enum { 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_UNKNOWN =0,
MFX_TARGETUSAGE_BEST_QUALITY =1, MFX_TARGETUSAGE_BEST_QUALITY =MFX_TARGETUSAGE_1,
MFX_TARGETUSAGE_BALANCED =4, MFX_TARGETUSAGE_BALANCED =MFX_TARGETUSAGE_4,
MFX_TARGETUSAGE_BEST_SPEED =7 MFX_TARGETUSAGE_BEST_SPEED =MFX_TARGETUSAGE_7
}; };
/* RateControlMethod */ /* RateControlMethod */
@ -368,7 +395,18 @@ enum {
MFX_RATECONTROL_AVBR =4, MFX_RATECONTROL_AVBR =4,
MFX_RATECONTROL_RESERVED1 =5, MFX_RATECONTROL_RESERVED1 =5,
MFX_RATECONTROL_RESERVED2 =6, 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 { typedef struct {
@ -419,7 +457,9 @@ typedef struct {
mfxU16 BitrateLimit; /* tri-state option */ mfxU16 BitrateLimit; /* tri-state option */
mfxU16 MBBRC; /* tri-state option */ mfxU16 MBBRC; /* tri-state option */
mfxU16 ExtBRC; /* tri-state option */ mfxU16 ExtBRC; /* tri-state option */
mfxU16 reserved2[18]; mfxU16 LookAheadDepth;
mfxU16 Trellis;
mfxU16 reserved2[16];
} mfxExtCodingOption2; } mfxExtCodingOption2;
/* IntraPredBlockSize/InterPredBlockSize */ /* IntraPredBlockSize/InterPredBlockSize */
@ -449,7 +489,11 @@ typedef struct _mfxEncryptedData mfxEncryptedData;
typedef struct { typedef struct {
union { union {
mfxEncryptedData* EncryptedData; struct {
mfxEncryptedData* EncryptedData;
mfxExtBuffer **ExtParam;
mfxU16 NumExtParam;
};
mfxU32 reserved[6]; mfxU32 reserved[6];
}; };
mfxI64 DecodeTimeStamp; mfxI64 DecodeTimeStamp;
@ -491,7 +535,10 @@ enum {
MFX_EXTBUFF_AVC_TEMPORAL_LAYERS = MFX_MAKEFOURCC('A','T','M','L'), MFX_EXTBUFF_AVC_TEMPORAL_LAYERS = MFX_MAKEFOURCC('A','T','M','L'),
MFX_EXTBUFF_CODING_OPTION2 = MFX_MAKEFOURCC('C','D','O','2'), MFX_EXTBUFF_CODING_OPTION2 = MFX_MAKEFOURCC('C','D','O','2'),
MFX_EXTBUFF_VPP_IMAGE_STABILIZATION = MFX_MAKEFOURCC('I','S','T','B'), 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 */ /* VPP Conf: Do not use certain algorithms */
@ -747,10 +794,12 @@ typedef struct {
mfxU32 FrameOrder; mfxU32 FrameOrder;
mfxU16 PicStruct; mfxU16 PicStruct;
mfxU16 ViewId; mfxU16 ViewId;
mfxU32 reserved[2]; mfxU16 LongTermIdx;
mfxU16 reserved[3];
} PreferredRefList[32], RejectedRefList[16], LongTermRefList[16]; } PreferredRefList[32], RejectedRefList[16], LongTermRefList[16];
mfxU32 reserved[8]; mfxU16 ApplyLongTermIdx;
mfxU16 reserved[15];
} mfxExtAVCRefListCtrl; } mfxExtAVCRefListCtrl;
enum { enum {
@ -812,6 +861,36 @@ typedef struct {
}Layer[8]; }Layer[8];
} mfxExtAvcTemporalLayers; } 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 #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif

View File

@ -1,10 +1,28 @@
/* ****************************************************************************** *\ /* ****************************************************************************** *\
INTEL CORPORATION PROPRIETARY INFORMATION Copyright (C) 2007-2013 Intel Corporation. All rights reserved.
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 Redistribution and use in source and binary forms, with or without
accordance with the terms of that agreement modification, are permitted provided that the following conditions are met:
Copyright(c) 2007-2010 Intel Corporation. All Rights Reserved. - 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 File Name: mfxvideo++.h

View File

@ -1,10 +1,28 @@
/* ****************************************************************************** *\ /* ****************************************************************************** *\
INTEL CORPORATION PROPRIETARY INFORMATION Copyright (C) 2007-2013 Intel Corporation. All rights reserved.
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 Redistribution and use in source and binary forms, with or without
accordance with the terms of that agreement modification, are permitted provided that the following conditions are met:
Copyright(c) 2007-2012 Intel Corporation. All Rights Reserved. - 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 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 */ /* This is the external include file for the Intel(R) Media Software Development Kit product */
#define MFX_VERSION_MAJOR 1 #define MFX_VERSION_MAJOR 1
#define MFX_VERSION_MINOR 6 #define MFX_VERSION_MINOR 7
#ifdef _WIN32 #ifdef _WIN32
#define MFX_CDECL __cdecl #define MFX_CDECL __cdecl

View File

@ -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 Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: 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 // implementation method masked from the input parameter
const mfxIMPL implMethod = impl & (MFX_IMPL_VIA_ANY - 1); const mfxIMPL implMethod = impl & (MFX_IMPL_VIA_ANY - 1);
// implementation interface masked from the input parameter // 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}; mfxVersion requiredVersion = {MFX_VERSION_MINOR, MFX_VERSION_MAJOR};
// check error(s) // check error(s)
@ -172,7 +173,7 @@ mfxStatus DISPATCHER_EXPOSED_PREFIX(MFXInit)(mfxIMPL impl, mfxVersion *pVer, mfx
{ {
// initialize the library iterator // initialize the library iterator
mfxRes = libIterator.Init(implTypes[curImplIdx].implType, mfxRes = libIterator.Init(implTypes[curImplIdx].implType,
implInterface != MFX_IMPL_VIA_D3D11, implInterface,
implTypes[curImplIdx].adapterID, implTypes[curImplIdx].adapterID,
currentStorage); currentStorage);
@ -180,6 +181,14 @@ mfxStatus DISPATCHER_EXPOSED_PREFIX(MFXInit)(mfxIMPL impl, mfxVersion *pVer, mfx
// looking for a suitable library with higher merit value. // looking for a suitable library with higher merit value.
if (MFX_ERR_NONE == mfxRes) if (MFX_ERR_NONE == mfxRes)
{ {
if (
!implInterface ||
implInterface == MFX_IMPL_VIA_ANY)
{
implInterface = libIterator.GetImplementationType();
}
do do
{ {
eMfxImplType implType; eMfxImplType implType;
@ -216,6 +225,7 @@ mfxStatus DISPATCHER_EXPOSED_PREFIX(MFXInit)(mfxIMPL impl, mfxVersion *pVer, mfx
// use the default DLL search mechanism fail, // use the default DLL search mechanism fail,
// if hard-coded software library's path from the registry fails // if hard-coded software library's path from the registry fails
implInterface = implInterfaceOrig;
if (MFX_ERR_NONE != mfxRes) if (MFX_ERR_NONE != mfxRes)
{ {
// set current library index again // set current library index again

View File

@ -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 Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: 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" 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.Major
, apiVersion.Minor , apiVersion.Minor
, &session)); , &session));

View File

@ -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 Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: 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: case DL_SINK_PRINTF:
{ {
char msg_formated[1024]; char msg_formated[1024] = {0};
if (NULL != msg && level != DL_LOADED_LIBRARY) if (NULL != msg && level != DL_LOADED_LIBRARY)
{ {
@ -259,8 +259,8 @@ class ETWHandler : public IMsgHandler
public: public:
ETWHandler(const wchar_t * guid_str) ETWHandler(const wchar_t * guid_str)
: m_bUseFormatter(DISPATCHER_LOG_USE_FORMATING) : m_bUseFormatter(DISPATCHER_LOG_USE_FORMATING)
, m_EventHandle()
, m_bProviderEnable() , m_bProviderEnable()
, m_EventHandle()
{ {
GUID rguid = GUID_NULL; GUID rguid = GUID_NULL;
if (FAILED(CLSIDFromString(guid_str, &rguid))) if (FAILED(CLSIDFromString(guid_str, &rguid)))

View File

@ -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 Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
@ -32,6 +32,7 @@ File Name: mfx_dxva2_device.cpp
#include <sstream> #include <sstream>
#define INITGUID #define INITGUID
#include <d3d9.h>
#include <dxgi.h> #include <dxgi.h>
#include "mfx_dxva2_device.h" #include "mfx_dxva2_device.h"
@ -130,6 +131,147 @@ void DXDevice::UnloadDLLModule(void)
} // void DXDevice::UnloaDLLdModule(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 typedef
HRESULT (WINAPI *DXGICreateFactoryFunc) (REFIID riid, void **ppFactory); HRESULT (WINAPI *DXGICreateFactoryFunc) (REFIID riid, void **ppFactory);
@ -164,7 +306,7 @@ void DXGI1Device::Close(void)
} // 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 // release the object before initialization
Close(); Close();
@ -181,6 +323,7 @@ bool DXGI1Device::Init(const bool countDisplays, const mfxU32 adapterNum)
IDXGIFactory1 *pFactory; IDXGIFactory1 *pFactory;
IDXGIAdapter1 *pAdapter; IDXGIAdapter1 *pAdapter;
DXGI_ADAPTER_DESC1 desc; DXGI_ADAPTER_DESC1 desc;
mfxU32 curAdapter, maxAdapters;
HRESULT hRes; HRESULT hRes;
// load address of procedure to create DXGI 1.1 factory // 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; m_pDXGIFactory1 = pFactory;
if(countDisplays) // get the number of adapters
curAdapter = 0;
maxAdapters = 0;
do
{ {
UINT display = 0; // get the required adapted
for(UINT adapter = 0; pFactory->EnumAdapters1(adapter, &pAdapter) != DXGI_ERROR_NOT_FOUND; adapter++) hRes = pFactory->EnumAdapters1(curAdapter, &pAdapter);
if (FAILED(hRes))
{ {
IDXGIOutput *out; break;
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;
// if it is the required adapter, save the interface
if (curAdapter == adapterNum)
{
m_pDXGIAdapter1 = pAdapter;
}
else
{
pAdapter->Release(); pAdapter->Release();
} }
// there is no required adapter // get the next adapter
if (adapterNum > display) curAdapter += 1;
return false;
}
else
{
hRes = pFactory->EnumAdapters1(adapterNum, &pAdapter);
if(FAILED(hRes))
return false;
m_pDXGIAdapter1 = pAdapter; } while (SUCCEEDED(hRes));
maxAdapters = curAdapter;
// there is no required adapter
if (adapterNum >= maxAdapters)
{
return false;
} }
pAdapter = (IDXGIAdapter1 *) m_pDXGIAdapter1; pAdapter = (IDXGIAdapter1 *) m_pDXGIAdapter1;
if(!pAdapter)
return false;
// get the adapter's parameters // get the adapter's parameters
hRes = pAdapter->GetDesc1(&desc); hRes = pAdapter->GetDesc1(&desc);
if (FAILED(hRes)) if (FAILED(hRes))
@ -283,7 +421,42 @@ void DXVA2Device::Close(void)
} // 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; DXGI1Device dxgi1Device;
bool bRes; bool bRes;
@ -292,7 +465,7 @@ bool DXVA2Device::InitDXGI1(const bool countDisplays, const mfxU32 adapterNum)
Close(); Close();
// create modern DXGI device // create modern DXGI device
bRes = dxgi1Device.Init(countDisplays, adapterNum); bRes = dxgi1Device.Init(adapterNum);
if (false == bRes) if (false == bRes)
{ {
return false; return false;
@ -308,6 +481,49 @@ bool DXVA2Device::InitDXGI1(const bool countDisplays, const mfxU32 adapterNum)
} // bool DXVA2Device::InitDXGI1(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 mfxU32 DXVA2Device::GetVendorID(void) const
{ {
return m_vendorID; return m_vendorID;

View File

@ -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 Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
@ -90,7 +90,7 @@ void MFXLibraryIterator::Release(void)
} // 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; DXVA2Device dxvaDevice;
HKEY rootHKey; HKEY rootHKey;
@ -119,15 +119,52 @@ mfxStatus MFXLibraryIterator::Init(eMfxImplType implType, const bool countDispla
// set the required library's implementation type // set the required library's implementation type
m_implType = implType; m_implType = implType;
m_implInterface = implInterface != 0
? implInterface
: MFX_IMPL_VIA_ANY;
// try to open DXGI 1.1 device to get hardware ID if (MFX_IMPL_VIA_D3D9 == m_implInterface)
if (!dxvaDevice.InitDXGI1(countDisplays, adapterNum))
{ {
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; return MFX_ERR_UNSUPPORTED;
} }
// obtain card's parameters // obtain card's parameters
m_vendorID = dxvaDevice.GetVendorID(); m_vendorID = dxvaDevice.GetVendorID();
m_deviceID = dxvaDevice.GetDeviceID(); m_deviceID = dxvaDevice.GetDeviceID();
@ -368,7 +405,12 @@ mfxStatus MFXLibraryIterator::SelectDLLVersion(wchar_t *pPath, size_t pathSize,
return MFX_ERR_NONE; 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 } // namespace MFX

View File

@ -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 Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met: