Hello, All.
I am working on DirectShow application, which works with stream devices.
Application have a list of these devices to provide to user
possibility to choose device he(she) wants. The probem is the follow:
the device can be connected to the system when application is
executed and I need to add new device into the list. I have hooked
WM_DEVICECHANGE message and then enumerate all devices I need via
ICreateDevEnum and IEnumMoniker interfaces. But I need to know which
devices are already in the my list and which of them are new.
The questions are:
1.There is any documented way to understand that two IBaseFilter interfaces
points to the same device?
2. Do I can use string returned by the IMoniker::GetDisplayName method for
this
purpose?

--
Andrey

Re: Stream devices identification` by The

The
Thu Jul 03 12:03:48 CDT 2003

Nice crosspost! I replied in the appropriate newsgroup.



Re: Stream devices identification` by Max

Max
Thu Jul 03 17:45:38 CDT 2003

QI returned IBaseFilter on IUnknown. IUnknown is known as an object
ideantity and should be equal for the same object no matter what interface
was used to get IUknown from.

Display friendly name may not work. What if you have two identical devices?
Why don't you use moniker name instead? It contains unique device ID and
that's all you need.

-- Max.



"Andrey" <andrej_no@spam_telemed.lt> wrote in message
news:OBbQD4XQDHA.1024@TK2MSFTNGP12.phx.gbl...
> Hello, All.
> I am working on DirectShow application, which works with stream devices.
> Application have a list of these devices to provide to user
> possibility to choose device he(she) wants. The probem is the follow:
> the device can be connected to the system when application is
> executed and I need to add new device into the list. I have hooked
> WM_DEVICECHANGE message and then enumerate all devices I need via
> ICreateDevEnum and IEnumMoniker interfaces. But I need to know which
> devices are already in the my list and which of them are new.
> The questions are:
> 1.There is any documented way to understand that two IBaseFilter
interfaces
> points to the same device?
> 2. Do I can use string returned by the IMoniker::GetDisplayName method for
> this
> purpose?
>
> --
> Andrey
>
>



Re: Stream devices identification` by Andrey

Andrey
Fri Jul 04 03:29:06 CDT 2003

Hello, Max.
Thank you for replay.
IMoniker::GetDisplayName returned for example the follow string:

{"@device:pnp:\\?\pci#ven_8086&dev_24c5&subsys_a0021458&rev_02#3&13c0b0c5&0&
fd#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\wave"}

It is that are you talking about? Or I need to use another moniker method?
Or I need to parse this string to get unique identificator?

It seems that IUnknown interfaces created by different enumerations for
the same device are not identical.
--
Andrey

"Max Paklin" <mpaklin@hotmail.com> wrote in message
news:eJ9TXTbQDHA.1988@TK2MSFTNGP12.phx.gbl...
> QI returned IBaseFilter on IUnknown. IUnknown is known as an object
> ideantity and should be equal for the same object no matter what interface
> was used to get IUknown from.
>
> Display friendly name may not work. What if you have two identical
devices?
> Why don't you use moniker name instead? It contains unique device ID and
> that's all you need.
>



Re: Stream devices identification` by Max

Max
Mon Jul 07 17:59:54 CDT 2003

Objects created by different instances of enumerator are different objects,
so their IUnknown's are different. This is expected behavior. Their "display
names" should be identical though. And yes, the display name I am referring
to is returned by IMoniker::GetDisplayName.

Why do you use different enumerators anyway?
When you receive the "device changed" message, tear down all the graphs,
reinumerate the devices and rebuild the whole thing from scratch. Sure, it
takes some time, but it does not happen every minute, does it? I don't know
if it is practical for your case or not, but it is worth considering. If
not, use IMoniker::GetDisplayName. It should be sufficient for your needs.

-- Max.


"Andrey" <andrej_no@spam_telemed.lt> wrote in message
news:eEbUy3fQDHA.1072@TK2MSFTNGP10.phx.gbl...
> Hello, Max.
> Thank you for replay.
> IMoniker::GetDisplayName returned for example the follow string:
>
>
{"@device:pnp:\\?\pci#ven_8086&dev_24c5&subsys_a0021458&rev_02#3&13c0b0c5&0&
> fd#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\wave"}
>
> It is that are you talking about? Or I need to use another moniker method?
> Or I need to parse this string to get unique identificator?
>
> It seems that IUnknown interfaces created by different enumerations for
> the same device are not identical.
> --
> Andrey
>
> "Max Paklin" <mpaklin@hotmail.com> wrote in message
> news:eJ9TXTbQDHA.1988@TK2MSFTNGP12.phx.gbl...
> > QI returned IBaseFilter on IUnknown. IUnknown is known as an object
> > ideantity and should be equal for the same object no matter what
interface
> > was used to get IUknown from.
> >
> > Display friendly name may not work. What if you have two identical
> devices?
> > Why don't you use moniker name instead? It contains unique device ID and
> > that's all you need.
> >
>
>



Re: Stream devices identification` by Andrey

Andrey
Tue Jul 08 02:32:12 CDT 2003


> Objects created by different instances of enumerator are different
objects,
> so their IUnknown's are different. This is expected behavior. Their
"display
> names" should be identical though. And yes, the display name I am
referring
> to is returned by IMoniker::GetDisplayName.
>
> Why do you use different enumerators anyway?
> When you receive the "device changed" message, tear down all the graphs,
> reinumerate the devices and rebuild the whole thing from scratch. Sure, it
> takes some time, but it does not happen every minute, does it? I don't
know
> if it is practical for your case or not, but it is worth considering. If
> not, use IMoniker::GetDisplayName. It should be sufficient for your needs.
>

Because I'll must to build graph from the same capture device after
reenumerating.
So I need unique indentifier to find source device after reenumerating in
any case.
Furthermore I don't want to make the user confused with hold up preview.

Andrey