Exception in dstFrame = (Bgra32VideoFrame)srcFrame

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

cristhiangr

  • Posts: 4
  • Joined: Wed Mar 27, 2019 12:45 am
  • Real Name: Cristhian Gallo

Exception in dstFrame = (Bgra32VideoFrame)srcFrame

PostWed Mar 27, 2019 1:15 am

Hi,

I'm using C# code provided in the SDK as example and I'm getting an error while capturing still

Solution: StillsCSharp
Issue In Function :
public Bgra32VideoFrame ConvertFrame(IDeckLinkVideoFrame srcFrame)
{
Bgra32VideoFrame dstFrame;

// Check whether srcFrame is already bmdFormat8BitBGRA
if (srcFrame.GetPixelFormat() == _BMDPixelFormat.bmdFormat8BitBGRA)
dstFrame = (Bgra32VideoFrame)srcFrame;

else
{
dstFrame = new Bgra32VideoFrame(srcFrame.GetWidth(), srcFrame.GetHeight(), srcFrame.GetFlags());
m_deckLinkConversion.ConvertFrame(srcFrame, (IDeckLinkVideoFrame)dstFrame);
}

return dstFrame;
}

Issue in line:
dstFrame = (Bgra32VideoFrame)srcFrame;

Exception:
Unable to cast COM object of type 'System.__ComObject' to class type 'StillsCSharp.Bgra32VideoFrame'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.

Windows OS:
Windows 10

Please help me in resolving the issue

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 17 guests