Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
DXVA::CEnumeratorHD Class Reference

#include <DXVAEnumeratorHD.h>

Inheritance diagram for DXVA::CEnumeratorHD:
ID3DResource

Public Member Functions

 CEnumeratorHD ()
 
virtual ~CEnumeratorHD ()
 
bool Open (unsigned int width, unsigned int height, DXGI_FORMAT input_dxgi_format)
 
void Close ()
 
void OnCreateDevice () override
 
void OnDestroyDevice (bool) override
 
ProcessorCapabilities ProbeProcessorCaps ()
 
bool CheckConversion (DXGI_FORMAT inputFormat, DXGI_COLOR_SPACE_TYPE inputCS, DXGI_FORMAT outputFormat, DXGI_COLOR_SPACE_TYPE outputCS)
 Check if a conversion is supported by the dxva processor.
 
bool IsFormatSupportedInput (DXGI_FORMAT format)
 Check dxva processor for support of the format as input texture.
 
bool IsFormatSupportedOutput (DXGI_FORMAT format)
 Check dxva processor for support of the format as output texture.
 
void LogSupportedConversions (const DXGI_FORMAT inputFormat, const DXGI_COLOR_SPACE_TYPE inputNativeCS)
 Outputs in the log a list of conversions supported by the DXVA processor.
 
bool IsInitialized () const
 
bool IsEnumerator1Available ()
 Returns the availability of the interface ID3D11VideoProcessorEnumerator1 (Windows 10 supporting HDR and above)
 
ComPtr< ID3D11VideoProcessor > CreateVideoProcessor (UINT RateConversionIndex)
 
ComPtr< ID3D11VideoProcessorInputView > CreateVideoProcessorInputView (ID3D11Resource *pResource, const D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC *pDesc)
 
ComPtr< ID3D11VideoProcessorOutputView > CreateVideoProcessorOutputView (ID3D11Resource *pResource, const D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC *pDesc)
 
ProcessorConversions SupportedConversions (const SupportedConversionsArgs &args)
 Return a list of conversions supported by the processor for the given parameters.
 
- Public Member Functions inherited from ID3DResource
virtual ~ID3DResource ()
 

Static Public Member Functions

static DXGI_COLOR_SPACE_TYPE AvToDxgiColorSpace (const DXGIColorSpaceArgs &csArgs)
 Converts ffmpeg AV parameters to a DXGI color space.
 

Protected Member Functions

void UnInit ()
 
bool OpenEnumerator ()
 
ProcessorFormats GetProcessorFormats (bool inputFormats, bool outputFormats) const
 Retrieve the list of DXGI_FORMAT supported by the DXVA processor.
 
std::vector< DXGI_FORMAT > GetProcessorRGBOutputFormats () const
 Retrieve the list of RGB DXGI_FORMAT supported as output by the DXVA processor.
 
bool CheckConversionInternal (DXGI_FORMAT inputFormat, DXGI_COLOR_SPACE_TYPE inputCS, DXGI_FORMAT outputFormat, DXGI_COLOR_SPACE_TYPE outputCS) const
 Check if a conversion is supported by the dxva processor.
 
bool IsFormatSupportedInternal (DXGI_FORMAT format, D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT support) const
 Check dxva processor for support of the format as input texture.
 
ProcessorConversions ListConversions (DXGI_FORMAT inputFormat, const std::vector< DXGI_COLOR_SPACE_TYPE > &inputColorSpaces, const std::vector< DXGI_FORMAT > &outputFormats, const std::vector< DXGI_COLOR_SPACE_TYPE > &outputColorSpaces) const
 Iterate over all combinations of the input parameters and return a list of the combinations that are supported conversions.
 
ProcessorConversions LogAndListConversions (const DXGIColorSpaceArgs &inputArgs, const DXGIColorSpaceArgs &outputArgs) const
 Helper function that outputs input/output to log and returns the results of ListConversions for the input parameters.
 
AVChromaLocation DefaultChromaSiting (const SupportedConversionsArgs &args) const
 Suggest chroma siting derived from source charateristics. Has limited functionality at this time and supports values that make sense for dxgi.
 
AVChromaLocation AlternativeChromaSiting (const AVChromaLocation &location) const
 Suggest an alternative chroma siting to help with dxva processor that don't support some dxgi color spaces.
 
- Protected Member Functions inherited from ID3DResource
void Register ()
 
void Unregister ()
 

Protected Attributes

CCriticalSection m_section
 
uint32_t m_width = 0
 
uint32_t m_height = 0
 
ComPtr< ID3D11VideoDevice > m_pVideoDevice
 
ComPtr< ID3D11VideoProcessorEnumerator > m_pEnumerator
 
ComPtr< ID3D11VideoProcessorEnumerator1 > m_pEnumerator1
 
DXGI_FORMAT m_input_dxgi_format {DXGI_FORMAT_UNKNOWN}
 
- Protected Attributes inherited from ID3DResource
bool m_bRegistered = false
 

Constructor & Destructor Documentation

◆ CEnumeratorHD()

CEnumeratorHD::CEnumeratorHD ( )

◆ ~CEnumeratorHD()

CEnumeratorHD::~CEnumeratorHD ( )
virtual

Member Function Documentation

◆ AlternativeChromaSiting()

AVChromaLocation CEnumeratorHD::AlternativeChromaSiting ( const AVChromaLocation & location) const
protected

Suggest an alternative chroma siting to help with dxva processor that don't support some dxgi color spaces.

Parameters
locationoriginal chroma siting
Returns
suggested alternative chroma siting

◆ AvToDxgiColorSpace()

DXGI_COLOR_SPACE_TYPE CEnumeratorHD::AvToDxgiColorSpace ( const DXGIColorSpaceArgs & csArgs)
static

Converts ffmpeg AV parameters to a DXGI color space.

Parameters
csArgsffmpeg AV picture parameters
Returns
DXGI color space. Special value DXGI_COLOR_SPACE_CUSTOM used when there is no match.

◆ CheckConversion()

bool CEnumeratorHD::CheckConversion ( DXGI_FORMAT inputFormat,
DXGI_COLOR_SPACE_TYPE inputCS,
DXGI_FORMAT outputFormat,
DXGI_COLOR_SPACE_TYPE outputCS )

Check if a conversion is supported by the dxva processor.

Parameters
inputFormatthe input format
inputCSthe input color space
outputFormatthe output format
outputCSthe output color space
Returns
true when the conversion is supported, false when it is not or the API used to validate is not availe (Windows < 10)

◆ CheckConversionInternal()

bool CEnumeratorHD::CheckConversionInternal ( DXGI_FORMAT inputFormat,
DXGI_COLOR_SPACE_TYPE inputCS,
DXGI_FORMAT outputFormat,
DXGI_COLOR_SPACE_TYPE outputCS ) const
protected

Check if a conversion is supported by the dxva processor.

Parameters
inputFormatthe input format
inputCSthe input color space
outputFormatthe output format
outputCSthe output color space
Returns
true when the conversion is supported, false when it is not or the API used to validate is not available (Windows < 10)

◆ Close()

void CEnumeratorHD::Close ( )

◆ CreateVideoProcessor()

ComPtr< ID3D11VideoProcessor > CEnumeratorHD::CreateVideoProcessor ( UINT RateConversionIndex)

◆ CreateVideoProcessorInputView()

ComPtr< ID3D11VideoProcessorInputView > CEnumeratorHD::CreateVideoProcessorInputView ( ID3D11Resource * pResource,
const D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC * pDesc )

◆ CreateVideoProcessorOutputView()

ComPtr< ID3D11VideoProcessorOutputView > CEnumeratorHD::CreateVideoProcessorOutputView ( ID3D11Resource * pResource,
const D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC * pDesc )

◆ DefaultChromaSiting()

AVChromaLocation CEnumeratorHD::DefaultChromaSiting ( const SupportedConversionsArgs & args) const
protected

Suggest chroma siting derived from source charateristics. Has limited functionality at this time and supports values that make sense for dxgi.

Parameters
argsdescription of the sourcce
Returns
suggested chroma siting.

◆ GetProcessorFormats()

ProcessorFormats CEnumeratorHD::GetProcessorFormats ( bool inputFormats,
bool outputFormats ) const
protected

Retrieve the list of DXGI_FORMAT supported by the DXVA processor.

Parameters
inputFormatsyes/no populate the input formats vector of the returned structure
outputFormatsyes/no populate the output formats vector of the returned structure
Returns
requested list of input and/or output formats.

◆ GetProcessorRGBOutputFormats()

std::vector< DXGI_FORMAT > CEnumeratorHD::GetProcessorRGBOutputFormats ( ) const
protected

Retrieve the list of RGB DXGI_FORMAT supported as output by the DXVA processor.

Returns
Vector of formats

◆ IsEnumerator1Available()

bool DXVA::CEnumeratorHD::IsEnumerator1Available ( )
inline

Returns the availability of the interface ID3D11VideoProcessorEnumerator1 (Windows 10 supporting HDR and above)

Returns
true when the interface is available and initialized, false otherwise

◆ IsFormatSupportedInput()

bool CEnumeratorHD::IsFormatSupportedInput ( DXGI_FORMAT format)

Check dxva processor for support of the format as input texture.

Parameters
formatthe format
Returns
true supported, false not supported

◆ IsFormatSupportedInternal()

bool CEnumeratorHD::IsFormatSupportedInternal ( DXGI_FORMAT format,
D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT support ) const
protected

Check dxva processor for support of the format as input texture.

Parameters
formatthe format
Returns
true supported, false not supported

◆ IsFormatSupportedOutput()

bool CEnumeratorHD::IsFormatSupportedOutput ( DXGI_FORMAT format)

Check dxva processor for support of the format as output texture.

Parameters
formatthe format
Returns
true supported, false not supported

◆ IsInitialized()

bool DXVA::CEnumeratorHD::IsInitialized ( ) const
inline

◆ ListConversions()

ProcessorConversions CEnumeratorHD::ListConversions ( DXGI_FORMAT inputFormat,
const std::vector< DXGI_COLOR_SPACE_TYPE > & inputColorSpaces,
const std::vector< DXGI_FORMAT > & outputFormats,
const std::vector< DXGI_COLOR_SPACE_TYPE > & outputColorSpaces ) const
protected

Iterate over all combinations of the input parameters and return a list of the combinations that are supported conversions.

Parameters
inputFormatThe input format
inputColorSpacesThe possible source color spaces
outputFormatsThe possible output formats
outputColorSpacesThe possible output color spaces
Returns
List of the supported conversion.

◆ LogAndListConversions()

ProcessorConversions CEnumeratorHD::LogAndListConversions ( const DXGIColorSpaceArgs & inputArgs,
const DXGIColorSpaceArgs & outputArgs ) const
protected

Helper function that outputs input/output to log and returns the results of ListConversions for the input parameters.

Parameters
inputArgsdescription of the source
outputColorSpacesdescription of the destination
Returns
List of the supported conversion.

◆ LogSupportedConversions()

void CEnumeratorHD::LogSupportedConversions ( const DXGI_FORMAT inputFormat,
const DXGI_COLOR_SPACE_TYPE inputNativeCS )

Outputs in the log a list of conversions supported by the DXVA processor.

Parameters
inputFormatthe source format
inputNativeCSthe input color space that would be used with a direct mapping from avcodec to D3D11, without any workarounds or tricks.

◆ OnCreateDevice()

void DXVA::CEnumeratorHD::OnCreateDevice ( void )
inlineoverridevirtual

Implements ID3DResource.

◆ OnDestroyDevice()

void DXVA::CEnumeratorHD::OnDestroyDevice ( bool )
inlineoverridevirtual

Implements ID3DResource.

◆ Open()

bool CEnumeratorHD::Open ( unsigned int width,
unsigned int height,
DXGI_FORMAT input_dxgi_format )

◆ OpenEnumerator()

bool CEnumeratorHD::OpenEnumerator ( )
protected

◆ ProbeProcessorCaps()

ProcessorCapabilities CEnumeratorHD::ProbeProcessorCaps ( )

◆ SupportedConversions()

ProcessorConversions CEnumeratorHD::SupportedConversions ( const SupportedConversionsArgs & args)

Return a list of conversions supported by the processor for the given parameters.

Parameters
argsparameters
Returns
list of conversions

◆ UnInit()

void CEnumeratorHD::UnInit ( )
protected

Member Data Documentation

◆ m_height

uint32_t DXVA::CEnumeratorHD::m_height = 0
protected

◆ m_input_dxgi_format

DXGI_FORMAT DXVA::CEnumeratorHD::m_input_dxgi_format {DXGI_FORMAT_UNKNOWN}
protected

◆ m_pEnumerator

ComPtr<ID3D11VideoProcessorEnumerator> DXVA::CEnumeratorHD::m_pEnumerator
protected

◆ m_pEnumerator1

ComPtr<ID3D11VideoProcessorEnumerator1> DXVA::CEnumeratorHD::m_pEnumerator1
protected

◆ m_pVideoDevice

ComPtr<ID3D11VideoDevice> DXVA::CEnumeratorHD::m_pVideoDevice
protected

◆ m_section

CCriticalSection DXVA::CEnumeratorHD::m_section
protected

◆ m_width

uint32_t DXVA::CEnumeratorHD::m_width = 0
protected

The documentation for this class was generated from the following files: