[DirectShow]如何使用VMR-9将视频显示为“最近的邻居"? [英] [DirectShow] How to use VMR-9 to display video as "Nearest Neighbor"?

查看:90
本文介绍了[DirectShow]如何使用VMR-9将视频显示为“最近的邻居"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的专家,

我目前正在使用directShow在学校​​项目中编写视频播放器.我在无窗口模式下使用VMR-9作为渲染器过滤器.

一切正常,我的视频播放器可以播放视频!但是,当我调整应用程序的大小(在我的情况下是放大)(这意味着调整视频窗口的大小)时,由于使用双线性插值算法进行了渲染,因此视频的图像显得平滑.但是我想要的只是最近的邻居算法(图像看起来很差但是很真实).

我听说可以在VMR-9渲染器筛选器中进行配置,但是Google不会向我返回与此相关的任何结果.这里还有其他人知道该怎么做吗?我现在真的很困.

非常感谢您的关注.

Dear Experts,

I am currently using directShow to write a video player in school project. I use VMR-9 in windowless mode as my renderer filter.

Every thing work fine, my video player can play videos! But when I resize (in my case is enlarging) the application (which means resize the video window), the image of the video appeared smoothly as it has been render with Bilinear Interpolation Algorithm. But all I want is just the Nearest Neighbor Algorithm (the image look bad but real).

I''ve heard that this can be configured in VMR-9 renderer Filter, but Google doesn''t return me any result related to this. Does anyone else here know how to do it? I am really stucked now.

Thank you very much for your concern.

推荐答案

我看了 IVMRMixerControl9界面(Windows) [ ^ ]和尤其是 IVMRMixerControl9 :: SetMixingPrefs方法(Windows) [ ^ ]. 此处 [
I had a look at the Video Mixing Renderer Filter 9 (Win dows)[^] (I used it, but I didn''t change the settings you are talking about).
I think you can use the IVMRMixerControl9 Interface (Windows)[^] and especially the IVMRMixerControl9::SetMixingPrefs Method (Windows)[^]. Here[^] you find the possible settings that you can use.


感谢您的建议Sauro先生,

但是我真的不知道为什么IVMRMixerControl9::SetMixingPrefs方法(Windows)对我不起作用.

我将流的数量设置为1.
我将渲染模式设置为VMR9Mode_Windowless
我从MSDN复制了代码,并更改了一些代码以将其应用到我的应用程序中:

Thank for your advise Mr Sauro,

But i really don''t know why IVMRMixerControl9::SetMixingPrefs Method (Windows) doesn''t work with me.

I set number of streams to 1.
I set rendering mode to VMR9Mode_Windowless
I copy the code from MSDN and change a litter bit to apply it in my application:

    // Get the current mixing preferences.
DWORD dwPrefs;
m_p_mix_control_->GetMixingPrefs(&dwPrefs);

// Remove the current filtering flag.
dwPrefs &= ~MixerPref9_FilteringMask;

// Add the render target flag that we want.
dwPrefs |= MixerPref9_PointFiltering;

// Set the new flags.
hr= m_p_mix_control_->SetMixingPrefs(dwPrefs);



==>结果仍然是相同的.好像什么都没发生.

我该如何解决?



==> the result is still the same. Like nothing happened.

How can I solve this?


这篇关于[DirectShow]如何使用VMR-9将视频显示为“最近的邻居"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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