Click here to Skip to main content
15,851,242 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Updated 26-Oct-10 23:14pm

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.
Share this answer
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;

// 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?
Share this answer
Sauro Viti 28-Oct-10 15:41pm    
It's very strange: the code seems to be right! Have you tested the HRESULT returned by GetMixingPrefs and SetMixingPrefs? They both should be S_OK if there are not been errors.

PS: Don't post comments as new answers...
phongvm90 28-Oct-10 22:39pm    
I tested it and both gave me S_OK under debug build. I found it very strange when I build the application under Release build: the compilator auto ignore those code!. (I use VS 2008)

The WORD value after GetMixingPrefs is 4117, and when i use SetMixingPrefs, it has been changed to 4133.

I still can not understand this thing. It all like a messed up of everything.

P/S: Thanks you MR Sauro, now I noticed it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900