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.
>
>