[host] removed incomplete h264

This commit is contained in:
Geoffrey McRae 2018-12-07 20:52:47 +11:00
parent 2a30bb718a
commit 2cb18a3f8f
3 changed files with 2 additions and 74 deletions

View file

@ -30,7 +30,6 @@ typedef enum FrameType
FRAME_TYPE_RGBA , // RGBA interleaved: R,G,B,A 32bpp
FRAME_TYPE_RGBA10 , // RGBA interleaved: R,G,B,A 10,10,10,2 bpp
FRAME_TYPE_YUV420 , // YUV420
FRAME_TYPE_H264 , // H264 compressed
FRAME_TYPE_MAX , // sentinel value
}
FrameType;

View file

@ -414,19 +414,6 @@ bool DXGI::InitYUV420Capture()
return true;
}
bool DXGI::InitH264Capture()
{
m_textureConverter = new TextureConverter();
if (!m_textureConverter->Initialize(m_deviceContext, m_device, m_width, m_height, FRAME_TYPE_YUV420))
return false;
m_h264 = new MFT::H264();
if (!m_h264->Initialize(m_device, m_width, m_height))
return false;
return true;
}
void DXGI::DeInitialize()
{
if (m_h264)
@ -667,13 +654,9 @@ unsigned int Capture::DXGI::Capture()
for(CaptureOptions::const_iterator it = m_options->cbegin(); it != m_options->cend(); ++it)
{
if (_stricmp(*it, "h264" ) == 0) m_frameType = FRAME_TYPE_H264;
if (_stricmp(*it, "yuv420") == 0) m_frameType = FRAME_TYPE_YUV420;
}
if (m_frameType == FRAME_TYPE_H264)
DEBUG_WARN("Enabling experimental H.264 compression");
bool ok = false;
switch (m_frameType)
{
@ -821,55 +804,6 @@ GrabStatus Capture::DXGI::GrabFrameYUV420(struct FrameInfo & frame)
return GRAB_STATUS_OK;
}
GrabStatus Capture::DXGI::GrabFrameH264(struct FrameInfo & frame)
{
return GRAB_STATUS_ERROR;
#if 0
while(true)
{
unsigned int events = m_h264->Process();
if (events & MFT::H264_EVENT_ERROR)
return GRAB_STATUS_ERROR;
if (events & MFT::H264_EVENT_NEEDS_DATA)
{
GrabStatus result;
ID3D11Texture2DPtr texture;
bool timeout;
result = GrabFrameTexture(frame, cursor, texture, timeout);
if (result != GRAB_STATUS_OK)
{
ReleaseFrame();
continue;
}
if (!timeout)
{
if (!m_textureConverter->Convert(texture))
{
SafeRelease(&texture);
return GRAB_STATUS_ERROR;
}
}
if (!m_h264->ProvideFrame(texture))
return GRAB_STATUS_ERROR;
ReleaseFrame();
}
if (events & MFT::H264_EVENT_HAS_DATA)
{
if (!m_h264->GetFrame(frame.buffer, frame.bufferSize, frame.pitch))
return GRAB_STATUS_ERROR;
return GRAB_STATUS_OK;
}
}
#endif
}
GrabStatus DXGI::GetFrame(struct FrameInfo & frame)
{
if (!m_ftexture)
@ -881,11 +815,8 @@ GrabStatus DXGI::GetFrame(struct FrameInfo & frame)
frame.width = m_width;
frame.height = m_height;
switch (m_frameType)
{
case FRAME_TYPE_YUV420: return GrabFrameYUV420(frame);
case FRAME_TYPE_H264 : return GrabFrameH264 (frame);
}
if (m_frameType == FRAME_TYPE_YUV420)
return GrabFrameYUV420(frame);
return GrabFrameRaw(frame);
}

View file

@ -70,7 +70,6 @@ namespace Capture
bool InitRawCapture();
bool InitYUV420Capture();
bool InitH264Capture();
CursorInfo m_cursorRing[DXGI_CURSOR_RING_SIZE];
unsigned int m_cursorRPos, m_cursorWPos;
@ -80,7 +79,6 @@ namespace Capture
GrabStatus ReleaseFrame();
GrabStatus GrabFrameRaw (struct FrameInfo & frame);
GrabStatus GrabFrameYUV420 (struct FrameInfo & frame);
GrabStatus GrabFrameH264 (struct FrameInfo & frame);
CaptureOptions * m_options;