FreeWorship, free software using MediaKit

Apr 17, 2013 at 2:12 AM

Thank you very much for this library we have started using it in our application, FreeWorship. We are using the library to playback videos with alpha blending with text overlay. So far to the video player we have added video trimming, load capability checking and thumbnail generation. We are hoping to add in the webcam and dvd elements soon as well.

We were looking at the possibility of adding contrast and brightness controls. Would this be best done through a pixel renderer or by editing the DirectShow graph?

Thank you very much!
Apr 17, 2013 at 6:09 AM
IMO, a DirectShow transform filter works best and is the simplest. I believe Microsoft has a standard contrast/brightness sample filter in their DirectX SDK. The only thing you need to do is:
  • Build the filter (it is in C++)
  • Add your own COM interface into the filter, with some methods to get/set settings
  • In your graph, after you add the filter, query it for your control interface to change settings etc.
If you can't find that sample filter, I am pretty sure you can find stock ones on the Internet very easily. Actually writing one is quite simple.

I think this is heaps easier than fiddling with pixel shaders, but of course you may be an HLSL guru and think shaders are simpler... :-)
Sep 29, 2013 at 12:17 PM

I tried to my source filter (written in un-managed c++, tested and working perfectly in unmanaged application) to the WebCamPlayer sample instead of the web camera capture filter.

The filter is added correctly (it found it OK), it has a custom control of the following
public unsafe interface IID_ILvmSourceControl
    int GetAudioPort(IntPtr pAudioPort);

           int SetAudioPort([In, MarshalAs(UnmanagedType.U2)] UInt16 AudioPort);
i found the interface correctly and also called the GetAudioPort method but getting garbage result,
Furthermore if calling the SetAudioPort twice , the second one raises an exception of 'writing to protected memory'

Am i doing something wrong ??

Sep 30, 2013 at 10:34 AM

The Interface declaration must include ALL of the COM interface functions and in the exact same order