VMR9分配器-PresentImage()滞后 [英] VMR9 Allocator - PresentImage( ) lags

查看:108
本文介绍了VMR9分配器-PresentImage()滞后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有一个WPF(.NET 4)应用程序,并使用托管的DirectX(DirectShow)渲染视频.

在UI上的某些操作(WPF窗口)中,分配器中对PresentImage()的调用以某种方式滞后.这会导致正在播放的视频闪烁.尽管测试表明PresentImage()确实以FPS的速率被调用,但这只是因为调用之间的间隔不相等而导致闪烁.

是否有人遇到相同的情况或有解决此问题的想法?

在此先感谢您.

Hi all,


I have a WPF (.NET 4) app and uses managed DirectX (DirectShow) for rendering videos.

During some operations on the UI (WPF Window), the calls to PresentImage() in our Allocator somehow lags behind. This causes flickering of the video being played. Although testing suggests that PresentImage() does get called at rate of the FPS, it''s just that the calls are not equally spaced which causes the flickering.

Anyone faced with same scenario or have any idea to get it fixed?

Thanks in advance.

推荐答案

您可以在渲染循环中使用Thread.Sleep(milliseconds)函数.可能是可以解决您的问题.当我在.net3.5中使用slimdx sdk进行编码并在render循环上使用相同的方法时,也遇到了同样的问题,但请记住,您在函数调用中放置的毫秒数.这取决于处理器的功能.双核或以上的内核应该在8-12之间.
You can use Thread.Sleep(milliseconds) function inside your render loop. May be that can solve your problem. As I was also going through the same problem when coding in .net3.5 and with slimdx sdk and used the same method on the render loop but keep in mind the number of milliseconds that you place in the function call. It depends upon how powerful your processor is. Something between 8-12 should work for dual core or above.


这篇关于VMR9分配器-PresentImage()滞后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆