This commit is contained in:
Linnea May 2021-11-11 11:12:24 -08:00
Родитель 7cf979e8de
Коммит 449ea73dec
2 изменённых файлов: 1 добавлений и 34 удалений

Просмотреть файл

@ -71,7 +71,6 @@ TransformBlur::TransformBlur(HRESULT& hr) :
m_imageWidthInPixels(0),
m_imageHeightInPixels(0),
m_cbImageSize(0),
m_pTransformFn(NULL),
m_pD3DDeviceManager(NULL),
m_pHandle(NULL),
m_pD3DDevice(NULL),
@ -1403,9 +1402,7 @@ HRESULT TransformBlur::OnProcessOutput(IMFMediaBuffer* pIn, IMFMediaBuffer* pOut
// Lock the output buffer.
CHECK_HR(hr = outputLock.LockBuffer(lDefaultStride, m_imageHeightInPixels, &pDest, &lDestStride));
// TODO: Implement a LearningModelBuilder for grayscale
// Invoke the image transform function.
//assert(m_pTransformFn != NULL);
if (true)
{
TransformImage_Stub(pDest, pSrc, m_cbImageSize, m_segmentModel);
@ -1455,37 +1452,12 @@ HRESULT TransformBlur::UpdateFormatInfo()
m_videoFOURCC = 0;
m_cbImageSize = 0;
m_pTransformFn = NULL;
if (m_pInputType != NULL)
{
CHECK_HR(hr = m_pInputType->GetGUID(MF_MT_SUBTYPE, &subtype));
m_videoFOURCC = subtype.Data1;
switch (m_videoFOURCC)
{
case FOURCC_YUY2:
//m_pTransformFn = TransformImage_YUY2;
break;
case FOURCC_UYVY:
//m_pTransformFn = TransformImage_UYVY;
break;
case FOURCC_NV12:
//m_pTransformFn = TransformImage_NV12;
break;
case FOURCC_RGB24:
break;
case FOURCC_RGB32:
break;
default:
CHECK_HR(hr = E_UNEXPECTED);
}
CHECK_HR(hr = MFGetAttributeSize(
m_pInputType,
MF_MT_FRAME_SIZE,
@ -1499,7 +1471,6 @@ HRESULT TransformBlur::UpdateFormatInfo()
CHECK_HR(hr = GetImageSize(m_videoFOURCC, m_imageWidthInPixels, m_imageHeightInPixels, &m_cbImageSize));
// Set the size of the SegmentModel
// TODO: Check an HR?
m_segmentModel = SegmentModel(m_imageWidthInPixels, m_imageHeightInPixels);
}

Просмотреть файл

@ -202,19 +202,15 @@ private:
IMFMediaType* m_pInputType; // Input media type.
IMFMediaType* m_pOutputType; // Output media type.
// Fomat information- tbd if needed
// Fomat information
FOURCC m_videoFOURCC;
UINT32 m_imageWidthInPixels;
UINT32 m_imageHeightInPixels;
DWORD m_cbImageSize; // Image size, in bytes.
// Image transform function. (Changes based on the media type.)
IMAGE_TRANSFORM_FN m_pTransformFn;
// D3D fields
IMFDXGIDeviceManager* m_pD3DDeviceManager;
HANDLE m_pHandle; // Handle to the current device
// IDirectXVideoDecoderService*m_pDecoderService;
ID3D11Device* m_pD3DDevice;
ID3D11VideoDevice* m_pD3DVideoDevice;