Hello, All.

I'm working on AVStream minidriver. And I want to create minidriver
that will provides DirectShow filter to the user mode application all
time while device is connected to the system and another one filter type
that will be seen by system only then my device is switched in special state
(looking at hardware state). And another one requirement is that these
filers have different category (I mean category like "Video Capture
source").

In AVStream documentation I have found two ways to implement additional
filter type from same device. The first one is to implement two filter
factories
in one minidriver and to create filters of each type separately from driver.
Does system notifies appications about new filters arrival in this case?
Does there is possibility to point system that these filters have different
categories (capture and decode, for example).

The second way is to create AVStream child device. But it is not clear for
me
what driver will serves this child device.

Please help me to clear these questions.

Andrey

Re: Two filters in one AVStream driver by Tim

Tim
Mon Jun 19 23:32:44 CDT 2006

"Andrey" <andrej@telemed.lt> wrote:
>
>I'm working on AVStream minidriver. And I want to create minidriver
>that will provides DirectShow filter to the user mode application all
>time while device is connected to the system and another one filter type
>that will be seen by system only then my device is switched in special state
>(looking at hardware state).

How are you going to know when this state transition occurs? If this is
just some bit in a register, the operating system is never going to notice
it.

If you get an interrupt, then you can certainly have your ISR fire off a
DPC to create another filter.

>And another one requirement is that these
>filers have different category (I mean category like "Video Capture
>source").

Doesn't matter. Your filters can be in whatever categories you need.

>Does system notifies appications about new filters arrival in this case?

Notify how? There is no particular notification scheme for new filters.

>Does there is possibility to point system that these filters have different
>categories (capture and decode, for example).

An application may search through whatever categories it wishes. Capture
applications looks through the video capture and audio capture categories.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: Two filters in one AVStream driver by Andrey

Andrey
Tue Jun 20 07:37:49 CDT 2006

Hello.
Thank you for an answer.

>>I'm working on AVStream minidriver. And I want to create minidriver
>>that will provides DirectShow filter to the user mode application all
>>time while device is connected to the system and another one filter type
>>that will be seen by system only then my device is switched in special
>>state
>>(looking at hardware state).
>
> How are you going to know when this state transition occurs? If this is
> just some bit in a register, the operating system is never going to notice
> it.
>
> If you get an interrupt, then you can certainly have your ISR fire off a
> DPC to create another filter.

It is not problem. I'll use interrupt.

>>And another one requirement is that these
>>filers have different category (I mean category like "Video Capture
>>source").
>
> Doesn't matter. Your filters can be in whatever categories you need.

I can't to find there to specify GUID of filter's category. Please point me
how to do it.

>>Does system notifies appications about new filters arrival in this case?
>
> Notify how? There is no particular notification scheme for new filters.

Sorry. I have in my mind notification of device change in Windows API.
Registering to by notified on device of particular category I have
possibility
to know when my device is arrival in the system. But of course it is device
notification
but not filter. And I though that something similar can be realized for
additional
filter types.

>
>>Does there is possibility to point system that these filters have
>>different
>>categories (capture and decode, for example).
>
> An application may search through whatever categories it wishes. Capture
> applications looks through the video capture and audio capture categories.

I want to register for notification messages for two categories to know
exactly
what filter becomes available in the system.

Andrey



Re: Two filters in one AVStream driver by Tim

Tim
Wed Jun 21 22:02:59 CDT 2006

"Andrey" <andrej@telemed.lt> wrote:
>
>>>And another one requirement is that these
>>>filers have different category (I mean category like "Video Capture
>>>source").
>>
>> Doesn't matter. Your filters can be in whatever categories you need.
>
>I can't to find there to specify GUID of filter's category. Please point me
>how to do it.

Really? I'd expected you to find it by now. In the KSFILTER_DESCRIPTOR,
the Categories member points to an array of GUIDs. The
DEFINE_KSFILTER_CATEGORIES macro is used to create them in a static data
structure.

>Sorry. I have in my mind notification of device change in Windows API.
>Registering to by notified on device of particular category I have
>possibility to know when my device is arrival in the system. But of
>course it is device notification but not filter. And I though that
>something similar can be realized for additional filter types.

No. Filters are not expected to be dynamic. You create a graph, you use a
graph.

>I want to register for notification messages for two categories to know
>exactly what filter becomes available in the system.

I'm not aware of any way to do tha.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: Two filters in one AVStream driver by Andrey

Andrey
Thu Jun 22 04:43:55 CDT 2006

Hello,

Thank you, Tim.
I have found Category GUID in filter descriptor few days ago. So I know
now how to declare filter's category. And taked a lot of time to understand
how to use reference GUID with category GUID to make filter
visible in DirectShow under correct category.

About notifications. It seems that thare is not way to use standard
Windows notifications to know when my filter will arrive.
So I plan to declare KSEVENT in the main filter and use fire it
every time when number of filters will change. I'll implement this
KSEVENT in the 'main' filter, that will be accessible all time while
device is accessible in the system.

"Tim Roberts" <timr@probo.com> wrote in message
news:bh1k92160d71oguktvpp2gqaf90p8n2hfu@4ax.com...
> "Andrey" <andrej@telemed.lt> wrote:
>>
>>>>And another one requirement is that these
>>>>filers have different category (I mean category like "Video Capture
>>>>source").
>>>
>>> Doesn't matter. Your filters can be in whatever categories you need.
>>
>>I can't to find there to specify GUID of filter's category. Please point
>>me
>>how to do it.
>
> Really? I'd expected you to find it by now. In the KSFILTER_DESCRIPTOR,
> the Categories member points to an array of GUIDs. The
> DEFINE_KSFILTER_CATEGORIES macro is used to create them in a static data
> structure.
>
>>Sorry. I have in my mind notification of device change in Windows API.
>>Registering to by notified on device of particular category I have
>>possibility to know when my device is arrival in the system. But of
>>course it is device notification but not filter. And I though that
>>something similar can be realized for additional filter types.
>
> No. Filters are not expected to be dynamic. You create a graph, you use
> a
> graph.
>
>>I want to register for notification messages for two categories to know
>>exactly what filter becomes available in the system.
>
> I'm not aware of any way to do tha.
> --
> - Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.



Re: Two filters in one AVStream driver by Tim

Tim
Fri Jun 23 22:30:03 CDT 2006

"Andrey" <andrej@telemed.lt> wrote:
>
>I have found Category GUID in filter descriptor few days ago. So I know
>now how to declare filter's category. And taked a lot of time to understand
>how to use reference GUID with category GUID to make filter
>visible in DirectShow under correct category.

Be sure to notice that this is a LIST of GUIDs. A filter can (and often
does) register in many categories.

>About notifications. It seems that thare is not way to use standard
>Windows notifications to know when my filter will arrive.
>So I plan to declare KSEVENT in the main filter and use fire it
>every time when number of filters will change. I'll implement this
>KSEVENT in the 'main' filter, that will be accessible all time while
>device is accessible in the system.

And then what? I'm not clear how you intend to use this. Is your app
going to tear down the graph and rebuild it with different components?
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: Two filters in one AVStream driver by Max

Max
Mon Jun 26 06:58:39 CDT 2006

Your scheme is fundamentally flawed.
You don't create filters, applications do. Your driver advertises itself as
capable of serving requests to create filters and then it is up to the
application to use that capability of the driver.

If you want to add another filter to the list of filters that your driver
advertises you can't do it on the fly easily.
Typically AVStream drivers create the list of filter factories statically
(or dynamically on startup) and use the same thing throughout the lifetime
of the driver. If you want to dynamically change that list you'd have to do
some work, but why?

IMO it is much easier to always advertise all filters and fail to create
some. If you control the application you can make it in such a way that it
can gracefully deal with the failure and assume the right thing, e.g. that
your filter isn't available and it should try later. Or you can succeed in
creating the filter and fail pin connection or fail state transition or
whatever. You can use some sort of event scheme between your app and your
driver to signal new state when the filter can be meaningfully used.

-- Max.




"Andrey" <andrej@telemed.lt> wrote in message
news:ejJMkBelGHA.676@TK2MSFTNGP05.phx.gbl...
> Hello,
>
> Thank you, Tim.
> I have found Category GUID in filter descriptor few days ago. So I know
> now how to declare filter's category. And taked a lot of time to
> understand
> how to use reference GUID with category GUID to make filter
> visible in DirectShow under correct category.
>
> About notifications. It seems that thare is not way to use standard
> Windows notifications to know when my filter will arrive.
> So I plan to declare KSEVENT in the main filter and use fire it
> every time when number of filters will change. I'll implement this
> KSEVENT in the 'main' filter, that will be accessible all time while
> device is accessible in the system.
>
> "Tim Roberts" <timr@probo.com> wrote in message
> news:bh1k92160d71oguktvpp2gqaf90p8n2hfu@4ax.com...
>> "Andrey" <andrej@telemed.lt> wrote:
>>>
>>>>>And another one requirement is that these
>>>>>filers have different category (I mean category like "Video Capture
>>>>>source").
>>>>
>>>> Doesn't matter. Your filters can be in whatever categories you need.
>>>
>>>I can't to find there to specify GUID of filter's category. Please point
>>>me
>>>how to do it.
>>
>> Really? I'd expected you to find it by now. In the KSFILTER_DESCRIPTOR,
>> the Categories member points to an array of GUIDs. The
>> DEFINE_KSFILTER_CATEGORIES macro is used to create them in a static data
>> structure.
>>
>>>Sorry. I have in my mind notification of device change in Windows API.
>>>Registering to by notified on device of particular category I have
>>>possibility to know when my device is arrival in the system. But of
>>>course it is device notification but not filter. And I though that
>>>something similar can be realized for additional filter types.
>>
>> No. Filters are not expected to be dynamic. You create a graph, you use
>> a
>> graph.
>>
>>>I want to register for notification messages for two categories to know
>>>exactly what filter becomes available in the system.
>>
>> I'm not aware of any way to do tha.
>> --
>> - Tim Roberts, timr@probo.com
>> Providenza & Boekelheide, Inc.
>
>



Re: Two filters in one AVStream driver by Andrey

Andrey
Tue Jun 27 03:09:40 CDT 2006

Gentlemen,
Thank you both for suggestions.

Max, probably I have used wrong terms.
I'll not create filters in the driver, but add and remove
additional filter factories in the driver. And it will
be a main filter that will always present when driver is
loaded. And this 'static' filter will signals application
about changes in the filter factory scheme. I think that
it is similar to the way you have offered.

The problem is that we already have application that
use these additional filters. But in previous implementation
they was implementes as separate drivers. So application's
code is developed to use existing filters from custom
category. And I want to minimize application's code
changing. I'll just add into application code event handler
that will calls existing code of enumeration of filters of
my category.
But if it will be a really hard to implement
filter's factory changing I'll follow your suggestion

Andrey.