[英]Delphi XE5 Firemonkey Video Frame Grab and Display
There's a Stackoverflow thread elsewhere that points out that Firemonkey has to display video through the primary thread. 其他地方有一个Stackoverflow线程,指出Firemonkey必须通过主线程显示视频。 I am trying to use a DirectX camera to snag a series of images (in Win8.1 for now--other OS's can wait). 我正在尝试使用DirectX摄像机捕获一系列图像(目前在Win8.1中-其他操作系统可以等待)。 So I use the SampleBufferReady and SampleBufferSync approaches in the Embarcadero example code (that just has a TImage on a form), but with enough changes that I never see anything. 因此,我在Embarcadero示例代码(在表单上只有TImage)中使用了SampleBufferReady和SampleBufferSync方法,但是进行了足够的更改,以至于我什么都看不到。 I need to do my display in a TImageViewer; 我需要在TImageViewer中显示; pointing the tbitmap in the SampleBufferSync at that tbitmap is easy. 将SampleBufferSync中的tbitmap指向该tbitmap很容易。 But nothing displays. 但是什么也没显示。 From a procedural viewpoint, pseudocode of what I want is 从过程的角度来看,我想要的伪代码是
setup whatever
camera.startcapture
repeat
repeat until framecaptured {what SampleBufferReady should do -- only fire when ready}
Imageviewer.repaint {inside SampleBufferReady?}
inc(mycounter) {inside SampleBufferReady?}
until (mycounter>mylimit) or (user interrupts video input)
camera
One could add a ttimer to slow things down. 可以增加一个计时器来减慢速度。 What I don't "get" is 我没有“得到”的是
Suggestions? 建议?
here is a complete code source that i test the c++ version that is same as pascal in term of function calls and mechanism, only the syntax differ: download here the pascal version . 这是一个完整的代码源,我在功能调用和机制方面测试了与pascal相同的c ++版本,只有语法不同: 在此处下载pascal版本 。
the code work fine for both android and desktop( i test the c++ version). 该代码在android和台式机上都可以正常工作(我测试了c ++版本)。 so download, test and confirm for me the pascal code. 因此,请为我下载,测试并确认Pascal代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.