Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DirectShow finding TV feed

Status
Not open for further replies.

Horrid

Programmer
May 20, 1999
373
0
0
I am writing an app in VB that needs to be able to scan through the available filters and find any TV or direct video feeds. Unforunatly all the DirectShow documentation is in C++ so I'm finding it rather difficult. As a result my varialbe names are a bit out of wack as many I have changed the type of as I went.

But here is what I am trying so far
Private m_objMediaControl As IMediaControl 'MediaControl Object
Private filterinfo2 As IRegFilterInfo
Private filterinfo As IFilterInfo
Private filtercollection As IAMCollection
Private pins As IPinInfo
Private unknown As IUnknownVB 'external typelib defines this
Private voidobject As VOID ' for use with iunknown


Private Sub Form_Load()
Set m_objMediaControl = New FilgraphManager
Set filtercollection = m_objMediaControl.RegFilterCollection
Dim i As Integer
For i = 0 To filtercollection.Count

' problem seems to start here

' how do I get info from the collection?
filtercollection.Item i, unknown
unknown.queryinterface IID?< where from, voidobject
Next i
End Sub

what I am trying to do is go through all the filters in the registy, find the TV type ones and add the required filters to the fileter graph. Now I could be doing this totally wrong and maybe I should be doing something with pins. One of my problems is that I have no idea how Iunknown functions, how do I know the IID for the queryinterface?

Any help appreciated, even if you just tell me I'm on the wrong track and try something new.
 
Hello
in VB for Video Rendering code is:

Private m_objRegFilterInfo As Object ' IFilterInfo interface represents all registered filters on the system
Private m_objMediaControl As IMediaControl 'IMediaControl interface provided by IFilgraphManager

' create a new IMediaControl object
Set m_objMediaControl = New FilgraphManager

' refresh the display for registered filters
If ObjPtr(m_objMediaControl) > 0 Then
If ObjPtr(m_objMediaControl.RegFilterCollection) > 0 Then
Set m_objRegFilterInfo = m_objMediaControl.RegFilterCollection
End If
End If

Dim objRegFilter As IRegFilterInfo

For Each objRegFilter In m_objRegFilterInfo ' listRegFilters
If LCase(objRegFilter.Name) = &quot;Logitech USB Video Camera&quot; Then 'LCase(listRegFilters.Text) Then
objRegFilter.Filter pSourceFilter 'objFilter
Exit For
End If
Next

'find put each pininfo and appendfileter then run filter graph using m_objMediaControl.Run
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top