Log in

View Full Version : how to set DirectVobSub filter properties from external apps?


Kaiousama
21st July 2003, 22:50
I'm coding a VB subtitling application, i've created a picturebox where the videoclip is rendered by DirectShow
All goes well and i'm able to visualize the videoclip, now i have to implement DirectVobSub on it, i've added the DirectVobSub to my FilterGraph with this VB code:


Set m_objMediaControl = New FilgraphManager

' find DirectVobSub filter and add it to the graph
filtername$ = "DirectVobSub"
For Each Filter In m_objMediaControl.RegFilterCollection
'Check if it is the selected filter
If Filter.Name = filtername$ Then
MsgBox "Founded DirectVobSub!"
'Ok, add to the filter graph, return IFilterInfo foundFilter
Filter.Filter foundFilter
Exit For
End If
Next Filter

Call m_objMediaControl.RenderFile(FileName)


I've encountered a problem in rendering this new filtergraph:
The filtergraph is rendered, the videoclip is visualized and DirectVobSub is started (the tray icon is visualized and i can manually interact with it), but i don't know how to feed DirectVobSub with my subtitle file (the one i want to display on the video). How can i do it?
When i've rendered the new filtergraph, if i open DirectVobSub property page and manually select "open" and my subFileName, this is correctly displayed, the problem is that i don't know how can i automate the SubFileName loading process from my application.

I've tryied in many ways but i can't solve this problem by myself, i've also tried to find the respective method on vsfilter.dll sources in order to manually link my program to that dll but it seems the dll doesn't expose those properties in .def file, please help me.
Best Regards.

BlackSun
24th July 2003, 11:20
well, you can't from VB :(

DAvenger
24th July 2003, 12:35
That's right. Forget about VB and get Delphi or some C++ (VSNET or Borland). You won't regret ;)

Kaiousama
25th July 2003, 09:59
Thanks for your replies, i wasn't thinking VB cannot do it :confused:
I'll try to use C++ (i've only VisualStudio6sp5 and not VidualStudio.net, is it possible with my version or must i upgrade to .net?)
instead of VB and make a video handling .ocx control in order to use it from my main VB application.

But even in C++ i've only seen applications capable of displaying the filter's properties dialog box, not to set a specific property of that dialog box (wich is what i want to make), can you suggest me some papers or any GPL project to learn from? (i'm a totally n00b in DirectX C++ programming).
Many thanks, i would still be trying to make it work in VB without your good suggestions :p

[Toff]
25th July 2003, 21:35
Property pages in directshow use interfaces to get/set data of the filter. If you use the same interface you should be able to do the same things that is done in the property page.
Look at the file IDirectVobSub.h in vobsub's sources to have the complete interface description.

EDIT:
I finally found the file in CVS :D
IDirectVobSub.h (http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/guliverkli/guliverkli/src/filters/transform/vsfilter/IDirectVobSub.h?rev=1.2&content-type=text/vnd.viewcvs-markup)

So in more words (but not too much ;)) you need to :
1. find the dvobsub filter in the graph (by name (IFilterGraph::FindFilterByName), or better by CLSID (enumerating filers))
2. query dvobsub for the IDirectVobSub interface (MyDVobSubFilter->QueryInterface(....))
3. call the function you want on the interface :)

stax76
25th July 2003, 22:17
actually VB nowadays ain't limited as it used to be but only if you don't mind to use M$ DOTNET :devil:

BlackSun
29th July 2003, 18:59
Originally posted by [Toff]
Property pages in directshow use interfaces to get/set data of the filter. If you use the same interface you should be able to do the same things that is done in the property page.
Look at the file IDirectVobSub.h in vobsub's sources to have the complete interface description.

EDIT:
I finally found the file in CVS :D
IDirectVobSub.h (http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/guliverkli/guliverkli/src/filters/transform/vsfilter/IDirectVobSub.h?rev=1.2&content-type=text/vnd.viewcvs-markup)

So in more words (but not too much ;)) you need to :
1. find the dvobsub filter in the graph (by name (IFilterGraph::FindFilterByName), or better by CLSID (enumerating filers))
2. query dvobsub for the IDirectVobSub interface (MyDVobSubFilter->QueryInterface(....))
3. call the function you want on the interface :)

moo, I said we can't from VB (5/6)

[Toff]
29th July 2003, 21:19
Originally posted by BlackSun
moo, I said we can't from VB (5/6)

Who said i'm talking about VB :p
It's C++ :D

BlackSun
30th July 2003, 00:25
Originally posted by [Toff]
Who said i'm talking about VB :p
It's C++ :D

he was talking about VB :o

I won't give a Pims
:devil: