C++/VB - Are there resources about implementing an IKsPropertySet or IKsControl on a PushSource Filter?
Asked By Thomas Franck
22-May-07 10:05 AM

Hi...
I've been roaming through so many 'net-pages and help files, maybe I'm
getting blind... I can't seem to find any examples..
I'm not a very proficient guy on this topic, so I need help.. :)
According to The March Hare's FAQ you will need some info to be able to
point me in the right direction:
I am using the DirectX 9.0 December 2004 SDK with VC8.0 and the Windows
Vista Platform SDK.
I started off with the PushSource example and ended up with a working
implementation of a OSD.. problem is: that OSD needs to be controllable.
So I added a method to which my app was supposed to talk to the filter to
say like "display text xyz"... of course that didn't work - The filter
stub doesn't know about the method.. so I looked for other ways.. SDK
says use IKsPropertySet or better (if I got that right) IKsControl.. very
little documentation on the first and almost none on the latter..
A few posts I found pointed to the Gargle Filter sample.. but that seems
to be over the top.. I don't need a PropertyPage - just means for my app
to influence the filter (programmatically).. besides, it doesn't use
IKsPropertySet..
Maybe I'm on the wrong track with that and should try to implement these
custom interfaces?
Is there a website or book I should read to help my grasp the idea of
implementing Interfaces?
Thanks for reading this far.. I appreciate that. :)
--
Thomas
IKsPropertySet
(1)
PushSource
(1)
IKsControl
(1)
OSD
(1)
DECLARE_INTERFACE_
(1)
IID_IBCC_OSD
(1)
M_pIBCC_OSD
(1)
M_pBCC_OSD
(1)
The March Hare [MVP] replied...
Look at the ezrgb sample. Besides having a property page, which you don't
need, it implements a simple custom interface.
Right.
The filter wizard on my site includes a skeleton custom interface.
However, it only works with VC7.1 since they changed the plug-in model for
VC8.
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
Thomas Franck replied...

Thanks.. I did that and it helped.. up to a point.
My Filter has a custom interface now and compiles just fine.
Problem I have now is that I can't Query the Filter for it in my app,
because it says "unresolved external symbol" for the IID..
The Interface header contains just this (plus the #if statements from the
ezrgb sample):
// {2F58AAAF-02D1-4dfa-AA27-04D71B65E9EF}
DEFINE_GUID(IID_IBCC_OSD,
0x2f58aaaf, 0x2d1, 0x4dfa, 0xaa, 0x27, 0x4, 0xd7, 0x1b, 0x65, 0xe9,
0xef);
DECLARE_INTERFACE_(IBCC_OSD, IUnknown)
{
STDMETHOD(set_BaseImage) (THIS_
LPCTSTR FileName // OSD Base Image Path
) PURE;
};
this is in the Graph header file:
CComPtr <IBaseFilter> m_pBCC_OSD; //The OSD PushSource
CComPtr <IBCC_OSD> m_pIBCC_OSD; //The OSD Interface
which compiles ok.. (include path is set right)
and the graph.cpp file has this:
[Instantiate the Filter and add it to the Filter]
hr = m_pBCC_OSD->QueryInterface(IID_IBCC_OSD,(void **) &m_pIBCC_OSD);
which doesn't compile, giving the "LNK2001: unresolved external symbol"
error for _IID_IBCC_OSD
Oh, right.. the lib file is in the Linker settings.
As I ran out of thoughts, I added the IID to the .def file.. the app
compiled then.. but of course couldn't load the dll...
Now back to the net.. Any guess on what I missed doing?
Okay.. your point is very clear on that... :)
cheers,
--
Thomas
Iain Downs replied...
just before the inlcude of the header file with the interface definition
Iain
The March Hare [MVP] replied...
This is covered in my FAQ and the dshow docs FAQ (and Iain pointed you to
it).
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
Thomas Franck replied...
40tude.net:
Bummer.... That one must have slipped my reading... :(
It compiles okay now...
Thanks again, and sorry for the noise..
--
Thomas
The March Hare [MVP] replied...
No problem. Thanks for following up.
--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution

Question on IKSPropertySet Interface parameters C++ / VB Hi, I'm a beginner to DirectShow and have some understanding problems with the IKsPropertySet. Can someone explain me the difference of the pInstanceData and pPropData in the IKsPropertySet::Set and IKsPropertySet::Get methodes? The SDK is 'from a beginners point of view' not very easy to code examples that can clearify this. Thanks for any help Christian Win32 DirectX Video Discussions IKSPropertySet (1) IKsControl (1) AVStream (1) DwPropID (1) CbInstanceData (1) PInstanceData (1) GuidPropSet (1) CbPropData (1) From: "Christian specific property <name> , the is empty {NULL, 0}, as shown in the sample code for IKsPropertySet::Get(). - - / / Alessandro Angeli / / MVP :: DirectShow / MediaFoundation / / mvpnews at riseoftheants dot com / / http: / / www.riseoftheants.com dot com / / http: / / www.riseoftheants.com / mmx / faq.htm In fact, if you look at IKsControl::KsProperty, which is the interface I usually use to talk to my AVStream filters, it
to a ts file without any problem. Below is what the graph that I built. PushSource Desktop -> Elecard MPEG2 Encoder -> Mainconcept MPEG Muxer -> File Writer(ts file) However, when I implemented the video is not good, it is flipping a lot. I tried to change the PushSource Desktop from 5 fps to 10fps, the result is same, only the video is faster Alessandro. I will try it out. Thanks again. Hi Alessandro, I tried to adjust the PushSource Desktop filter's frame rate, the higher frames rate I adjust, the faster the video I tried to write Desktop capture to AVI file, which the graph is shown below: PushSource Desktop filter -> AVI Mux -> File Writer Filter I believe this is the same as the case, does it mean all I need to change the frame rate is in DS PushSource Desktop Filter? And, you mentioned that the AVI Mux will use the VIDEOINFOHEADE::AvgTimePerFrame value, and I found the PushSource Desktop filter is using VIDEOINFO, does it matter? I did changed all the VIDEOINFO to the avi video will flipping / flashing, no matter what frame rate I changed in the PushSource Desktop filter. Here is the problem, my application suppose to run 60fps all the time problem in the video since the my application frame rate doesn't match with the PushSource Desktop Filter. Can you please tell me how to solve this problem? In the PushSource
Source to AVI file C++ / VB Hi, I created a graph by using the DS PushSource Desktop filter and AVI Mux to capture desktop screen to avi video file, such as below: PushSource Desktop Filter -> AVI Mux -> File Writer I can create an avi video file, and the default frame rate for the PushSource is 5 fps, but when I play the avi video, it is slow. So, I increase the frame rate in PushSource to 30 fps, and the avi video play fast, just like a fast forward. The will play. I am trying to create a frame rate with 60 fps for the PushSource filter in order to match with my application's frame rate. Can anyone tell me in advance. Joseph. Win32 DirectX Video Discussions AVIMux (1) PushSourceDesktop (1) FillBuffer (1) DirectShow (1) PushSource (1) Writer (1) VIDEOINFOHEADER (1) Riseoftheants (1) From: "joseph" I would like to point out Push, Source, to, AVI, file description: Hi, I created a graph by using the DS PushSource Desktop filter and AVI Mux to capture desktop screen to avi video file, such as below: PushSource Desk
strFolderName) Set oWMIService = GetObject("winmgmts:") Set secsettings = _ oWMIService.Get("Win32_LogicalFileSecuritySetting = '" & strFolderName & "'") ret = secsettings.GetSecurityDescriptor(oSD) If ret = 0 Then get_owner = oSD.Owner.Name Else 'could not read security descriptor End If End Function This runs fine Select * From Win32_LogicalFileSecuritySetting " _ & "where path = " & strFolderName) For Each oItem In cSettings iRet = oItem.GetSecurityDescriptor(oSD) If iRet = 0 Then get_owner = oSD.Owner.Name Else get_owner = "Not found" End If Next End Function Note also this peculiarity Win32_LogicalFileSecuritySetting " _ & "where path = 3D '" & strFolderName & "'") For Each oItem In cSettings iRet = 3D oItem.GetSecurityDescriptor(oSD) If iRet = 3D 0 Then get_owner = 3D oSD.Owner.Name Else get_owner = 3D "Not found" End If Next End Function At least, that From" _ & Win32_LogicalFileSecuritySetting " _ & "where path = '" & strFolderName & "'") For Each oItem In cSettings iRet = oItem.GetSecurityDescriptor(oSD) If iRet = 0 Then get_owner = oSD.Owner.Name Else get_owner = "Not found" End If Next End Function At least, that is
additional information? Thanks. Win32 DirectX Video Discussions IAMStreamConfig (1) IAMStramConfig (1) CSNBaseFilter (1) ICaptureGraphBuilder2 (1) IKsPropertySet (1) IBaseFilter (1) IBaseFilte (1) PropID (1) From the documentation, you need to support IKsPropertySet on your capture pin and return PIN_CATEGORY_CAPTURE for Get(AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, . . .). See the SDK docs approach I outlined already by implementing the IAMStreamConfig on each of the pins and supporting IKsPropertySet on them. Why do you think implementing IAMStreamConfig the filter instead of the pins will B11 $B;~ (B50 $BJ, (B, "The March Hare [MVP]" Sure. I have implemented IAMStreamConfig and IKsPropertySet on my created IPin. But it never come into my IPin to QI IAMStreamConfig. And on IKsPropertySet, I saw it query AMPROPSETID_Pin and PropID = 0. And I return PIN_CATEGORY_CAPTURE. It looks nothing