Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-02-15 12:31:37 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2016-02-15 12:31:37 +0300
commitffe29728270fedda5bb293ebf15e9fed065e38d1 (patch)
tree5b5703c7e96ea193cf7900a7250ac850bef304da /decoder
parent17d72401023ea6c3a9c3db262c998d86cf06e87c (diff)
Show the active device name for CUVID as well.
Diffstat (limited to 'decoder')
-rw-r--r--decoder/LAVVideo/decoders/cuvid.cpp19
-rw-r--r--decoder/LAVVideo/decoders/cuvid.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/decoder/LAVVideo/decoders/cuvid.cpp b/decoder/LAVVideo/decoders/cuvid.cpp
index 94bee641..a8af956a 100644
--- a/decoder/LAVVideo/decoders/cuvid.cpp
+++ b/decoder/LAVVideo/decoders/cuvid.cpp
@@ -438,6 +438,7 @@ select_device:
int major, minor;
cuda.cuDeviceComputeCapability(&major, &minor, best_device);
m_bVDPAULevelC = (major >= 2);
+ cuda.cuDeviceGetName(m_cudaDeviceName, sizeof(m_cudaDeviceName), best_device);
DbgLog((LOG_TRACE, 10, L"InitCUDA(): pure CUDA context of device with compute %d.%d", major, minor));
}
}
@@ -529,6 +530,7 @@ STDMETHODIMP CDecCuvid::InitD3D9(int best_device, DWORD requested_device)
m_pD3DDevice9 = pDev;
m_cudaContext = cudaCtx;
m_bVDPAULevelC = isLevelC;
+ cuda.cuDeviceGetName(m_cudaDeviceName, sizeof(m_cudaDeviceName), best_device);
// Is this the one we want?
if (device == best_device)
break;
@@ -1299,3 +1301,20 @@ STDMETHODIMP_(BOOL) CDecCuvid::IsInterlaced()
{
return (m_bInterlaced || m_pSettings->GetDeinterlacingMode() == DeintMode_Force) && (m_VideoDecoderInfo.DeinterlaceMode == cudaVideoDeinterlaceMode_Weave);
}
+
+
+STDMETHODIMP CDecCuvid::GetHWAccelActiveDevice(BSTR *pstrDeviceName)
+{
+ CheckPointer(pstrDeviceName, E_POINTER);
+
+ if (strlen(m_cudaDeviceName) == 0)
+ return E_UNEXPECTED;
+
+ int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, m_cudaDeviceName, -1, nullptr, 0);
+ if (len == 0)
+ return E_FAIL;
+
+ *pstrDeviceName = SysAllocStringLen(nullptr, len);
+ MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, m_cudaDeviceName, -1, *pstrDeviceName, len);
+ return S_OK;
+}
diff --git a/decoder/LAVVideo/decoders/cuvid.h b/decoder/LAVVideo/decoders/cuvid.h
index d780c531..0ec9ecfb 100644
--- a/decoder/LAVVideo/decoders/cuvid.h
+++ b/decoder/LAVVideo/decoders/cuvid.h
@@ -52,6 +52,7 @@ public:
STDMETHODIMP_(REFERENCE_TIME) GetFrameDuration();
STDMETHODIMP_(BOOL) IsInterlaced();
STDMETHODIMP_(const WCHAR*) GetDecoderName() { return L"cuvid"; }
+ STDMETHODIMP GetHWAccelActiveDevice(BSTR *pstrDeviceName);
// CDecBase
STDMETHODIMP Init();
@@ -145,6 +146,7 @@ private:
CUstream m_hStream = 0;
BOOL m_bVDPAULevelC = FALSE;
+ char m_cudaDeviceName[256] = { 0 };
BOOL m_bForceSequenceUpdate = FALSE;
BOOL m_bInterlaced = FALSE;