Preambule: 我正在使用Black Magic Design(BMD)Decklink输入卡来获取高清视频信号.他们为他们的SDK提供C++示例.我已成功将c ++示例翻译成Delphi(VCL).我还在TDecklink中隔离了API调用,我希望Delphi社区可以使用它.它在VCL中运行良好(我可以为TDecklnk提供一个演示应用程序,以便在需要时使用它).
现在我需要以FMX格式获取信号(但不能交叉编译到除Windows之外的其他平台).我试图修改TDecklink以便在FMX中使用但没有成功.
核心问题:
在我的VCL版本中,我将TPaintBox参考传递给我的TDecklink.GraphBuilder使用TPaintBox作为显示实时视频的区域.
以下是我在VCL版本中使用的一些代码行,用于将TPaintBox分配给GraphBuilder:
pWnd := WindowFromDC(FpboxPreview.Canvas.Handle); //WindowFromDC retreive HWND from HDC
hr:= pIVMRWindowlessCtrl.SetVideoClippingWindow(pWnd); // set the bounds of the video to the preview window
if hr = S_OK then
begin
previewRect.Left := FpboxPreview.Left;
previewRect.Right := FpboxPreview.Width;
previewRect.Top := FpboxPreview.Top;
previewRect.Bottom := FpboxPreview.Height;
hr:= pIVMRWindowlessCtrl.SetVideoPosition(nil, @previewRect); // show the whole of the source frame in the whole of the client area of the control
hr:= pIVMRWindowlessCtrl.SetAspectRatioMode(VMR_ARMODE_LETTER_BOX); // maintain the aspect ratio of the video
hr:= …Run Code Online (Sandbox Code Playgroud)