在过滤器关闭时,我可以使用什么 Directshow 过滤器事件来解除对源流线程的阻塞?
我有一个使用 DSPACK 组件库用 Delphi 6 编写的 DirectShow 过滤器。它是一个推源视频过滤器。过滤器会阻止在生成视频帧的另一个线程中发出信号的事件。当帧准备好时,它会被写入到 FillBuffer() 方法在解除阻塞时访问的共享内存区域。当 DirectShow 关闭过滤器时,是否有一个方便的 DirectShow 事件可以搭载它来解锁 FillBuffer() 线程?如果不是,该领域的“标准做法”是什么?
I have a DirectShow filter written in Delphi 6 using the DSPACK component library. It is a push source video filter. The filter blocks on an event that is signaled in another thread that generates the video frames. When a frame is ready, it is written into a shared memory area that the FillBuffer() method accesses when it is unblocked. Is there a convenient DirectShow event that I can piggyback to unblock the FillBuffer() thread when the filter is being shutdown by DirectShow? If not, what is "standard practice" in this area?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
标准做法是
WaitForMultipleObjects
函数和朋友。您正在等待解锁FillBiffer
的事件之一:来自外部源的新视频帧的可用性、停止请求到达您的过滤器等。Standard practice is
WaitForMultipleObjects
function and friends. You are waiting for one of the events that unlock yourFillBiffer
: availability of new video frame from external source, stop request arriving to your filter etc.