How to use Createfile Function to Open the WDM video capture source filter
associated with the camera?
How to use Createfile Function to Open the still pin on the filter?

rainwin Huang

Re: Createfile by Max

Max
Wed Jan 12 01:40:19 CST 2005

You don't normally use CreateFile for that. Check out AmCap sample from DX
SDK (or old Platform SDK). It shows how to uses System Device Enumerator to
look up a device from a particular category.
Also you don't normally want to open pin by calling CreateFile. What you
usually do is to connect a pin to an input pin of another filter and process
data when it comes to that pin.

-- Max.



"Zhuang" <ZHuang@cogentsystems.com> wrote in message
news:uQrMfXF%23EHA.4004@tk2msftngp13.phx.gbl...
> How to use Createfile Function to Open the WDM video capture source filter
> associated with the camera?
> How to use Createfile Function to Open the still pin on the filter?
>
> rainwin Huang
>
>



Re: Createfile by Zhuang

Zhuang
Wed Jan 12 19:38:59 CST 2005

Sir:
I read the flow section in DDK:

2.3.3 Using Bulk Pipes to Retrieve Still Frames from the Camera

An STI USB minidriver can retrieve still frames from the camera using
USBCAMD bulk services. The following steps outline how to retrieve still
frames from cameras that use bulk pipes for still image transfer.

1.. Open the WDM video capture source filter associated with the camera.

2.. Open the still pin on the filter handle obtained in step 1.

3.. Send a ReadFile on that pin with maximum-sized buffer.

4.. Set the stream state from Pause to Run.

5.. Get the interface pointer to PROPSETID_VIDCAP_VIDEOCONTROL property

set.
6.. Set the KS_VideoControlFlag_Trigger flag associated with property ID
KSPROPERTY_VIDEOCONTROL_MODE.

7.. Once the video control handler of the camera minidriver receives the
trigger request, it should call USBCAMD_BulkReadWrite with a NULL buffer
pointer.

8.. USBCAMD will dequeue a data SRB from the still pin and call the
minidriver's CamNewVideoFrameEx entry point before it starts the bulk
transfer. The camera minidriver can reduce the requested size of the bulk
transfer if it determines the actual still frame is smaller than the
maximum size allocated by DirectShow.

9.. Upon completion of the bulk transfer, USBCAMD will call the
CamProcessRawVideoFrameEx entry point for further processing. Afterward,
USBCAMD will finish the stream class read request on the still pin.

A user application can cancel a requested bulk read or write by sending a
CancelIO to the still pin. If there is a need to load tables to the camera
through a bulk out pipe, the USBD driver can send a WriteFile to the still
pin.

Still data flow is intended for use in a pull model. A pull occurs when an
application requests a still. Still data flow will also work in a push
model where it functions as a pull. A push occurs when the user pushes the
button on the camera, triggering the device event. USBCAMD will send a
KSEVENTSETID_VIDCAPTOSTI event which can be propagated all the way to the
imaging application.

please tell me how to do?




"Max Paklin" <mpaklin@hotmail.com> wrote in message
news:OKp#1nH#EHA.3596@TK2MSFTNGP12.phx.gbl...
> You don't normally use CreateFile for that. Check out AmCap sample from DX
> SDK (or old Platform SDK). It shows how to uses System Device Enumerator
to
> look up a device from a particular category.
> Also you don't normally want to open pin by calling CreateFile. What you
> usually do is to connect a pin to an input pin of another filter and
process
> data when it comes to that pin.
>
> -- Max.
>
>
>
> "Zhuang" <ZHuang@cogentsystems.com> wrote in message
> news:uQrMfXF%23EHA.4004@tk2msftngp13.phx.gbl...
> > How to use Createfile Function to Open the WDM video capture source
filter
> > associated with the camera?
> > How to use Createfile Function to Open the still pin on the filter?
> >
> > rainwin Huang
> >
> >
>
>



Re: Createfile by Max

Max
Fri Jan 14 03:35:42 CST 2005

Wow, I didn't know they had a architecture for still frame aquisition in
usbcamd.
Anyways, I can't really tell you what to do as I've never done this myself.
However what you read in DDK does seem to make sense.

See my comments inline.


"Zhuang" <ZHuang@cogentsystems.com> wrote in message
news:OgD%23oBR%23EHA.4072@TK2MSFTNGP10.phx.gbl...
> Sir:
> I read the flow section in DDK:
>
> 2.3.3 Using Bulk Pipes to Retrieve Still Frames from the Camera
>
> An STI USB minidriver can retrieve still frames from the camera using
> USBCAMD bulk services. The following steps outline how to retrieve still
> frames from cameras that use bulk pipes for still image transfer.
>
> 1.. Open the WDM video capture source filter associated with the camera.

As I said earlier refer to amcap sample on how to locate and create an
instance of the filter that you are interested in.



> 2.. Open the still pin on the filter handle obtained in step 1.

This is a sort of mystery to me.
How is one supposed to "open" a pin?
What I've done in the past to capture a still frame was the following. I
wrote a simple sink filter that was taking a command from the app (via
trivial COM interface) and upon reception of the command it was submitting a
sample upstream to the connected Still pin. On the Still pin I was making a
copy of the current frame and sending it out. Plain and simple. Worked fine.


> 3.. Send a ReadFile on that pin with maximum-sized buffer.

I've never use classic ReadFile on KS pins.
Just like I said above I used KS/DShow infrastucture to submit a buffer to
Still pin.

This model looks way overcomplicated and I wouldn't do it the way it is
described. Just too much trouble, but maybe I miss something.

Sorry for not being of much help.

-- Max.




> 4.. Set the stream state from Pause to Run.
>
> 5.. Get the interface pointer to PROPSETID_VIDCAP_VIDEOCONTROL property
>
> set.
> 6.. Set the KS_VideoControlFlag_Trigger flag associated with property ID
> KSPROPERTY_VIDEOCONTROL_MODE.
>
> 7.. Once the video control handler of the camera minidriver receives the
> trigger request, it should call USBCAMD_BulkReadWrite with a NULL buffer
> pointer.
>
> 8.. USBCAMD will dequeue a data SRB from the still pin and call the
> minidriver's CamNewVideoFrameEx entry point before it starts the bulk
> transfer. The camera minidriver can reduce the requested size of the bulk
> transfer if it determines the actual still frame is smaller than the
> maximum size allocated by DirectShow.
>
> 9.. Upon completion of the bulk transfer, USBCAMD will call the
> CamProcessRawVideoFrameEx entry point for further processing. Afterward,
> USBCAMD will finish the stream class read request on the still pin.
>
> A user application can cancel a requested bulk read or write by sending a
> CancelIO to the still pin. If there is a need to load tables to the camera
> through a bulk out pipe, the USBD driver can send a WriteFile to the still
> pin.
>
> Still data flow is intended for use in a pull model. A pull occurs when an
> application requests a still. Still data flow will also work in a push
> model where it functions as a pull. A push occurs when the user pushes the
> button on the camera, triggering the device event. USBCAMD will send a
> KSEVENTSETID_VIDCAPTOSTI event which can be propagated all the way to the
> imaging application.
>
> please tell me how to do?
>
>
>
>
> "Max Paklin" <mpaklin@hotmail.com> wrote in message
> news:OKp#1nH#EHA.3596@TK2MSFTNGP12.phx.gbl...
>> You don't normally use CreateFile for that. Check out AmCap sample from
>> DX
>> SDK (or old Platform SDK). It shows how to uses System Device Enumerator
> to
>> look up a device from a particular category.
>> Also you don't normally want to open pin by calling CreateFile. What you
>> usually do is to connect a pin to an input pin of another filter and
> process
>> data when it comes to that pin.
>>
>> -- Max.
>>
>>
>>
>> "Zhuang" <ZHuang@cogentsystems.com> wrote in message
>> news:uQrMfXF%23EHA.4004@tk2msftngp13.phx.gbl...
>> > How to use Createfile Function to Open the WDM video capture source
> filter
>> > associated with the camera?
>> > How to use Createfile Function to Open the still pin on the filter?
>> >
>> > rainwin Huang
>> >
>> >
>>
>>
>
>



Re: Createfile by Zhuang

Zhuang
Mon Jan 17 19:09:33 CST 2005

Max Paklin:
I can get the WDM video capture source filter handle by using
setupapi function.
But i can not get wdm video capture pin handle.
in ddk ,there is a tool.It is in \ddk directory\tools\wdmaudio .


Thanks !





"Max Paklin" <mpaklin@hotmail.com> wrote in message
news:uGQsrxh#EHA.1264@TK2MSFTNGP12.phx.gbl...
> Wow, I didn't know they had a architecture for still frame aquisition in
> usbcamd.
> Anyways, I can't really tell you what to do as I've never done this
myself.
> However what you read in DDK does seem to make sense.
>
> See my comments inline.
>
>
> "Zhuang" <ZHuang@cogentsystems.com> wrote in message
> news:OgD%23oBR%23EHA.4072@TK2MSFTNGP10.phx.gbl...
> > Sir:
> > I read the flow section in DDK:
> >
> > 2.3.3 Using Bulk Pipes to Retrieve Still Frames from the Camera
> >
> > An STI USB minidriver can retrieve still frames from the camera using
> > USBCAMD bulk services. The following steps outline how to retrieve still
> > frames from cameras that use bulk pipes for still image transfer.
> >
> > 1.. Open the WDM video capture source filter associated with the
camera.
>
> As I said earlier refer to amcap sample on how to locate and create an
> instance of the filter that you are interested in.
>
>
>
> > 2.. Open the still pin on the filter handle obtained in step 1.
>
> This is a sort of mystery to me.
> How is one supposed to "open" a pin?
> What I've done in the past to capture a still frame was the following. I
> wrote a simple sink filter that was taking a command from the app (via
> trivial COM interface) and upon reception of the command it was submitting
a
> sample upstream to the connected Still pin. On the Still pin I was making
a
> copy of the current frame and sending it out. Plain and simple. Worked
fine.
>
>
> > 3.. Send a ReadFile on that pin with maximum-sized buffer.
>
> I've never use classic ReadFile on KS pins.
> Just like I said above I used KS/DShow infrastucture to submit a buffer to
> Still pin.
>
> This model looks way overcomplicated and I wouldn't do it the way it is
> described. Just too much trouble, but maybe I miss something.
>
> Sorry for not being of much help.
>
> -- Max.
>
>
>
>
> > 4.. Set the stream state from Pause to Run.
> >
> > 5.. Get the interface pointer to PROPSETID_VIDCAP_VIDEOCONTROL property
> >
> > set.
> > 6.. Set the KS_VideoControlFlag_Trigger flag associated with property
ID
> > KSPROPERTY_VIDEOCONTROL_MODE.
> >
> > 7.. Once the video control handler of the camera minidriver receives
the
> > trigger request, it should call USBCAMD_BulkReadWrite with a NULL buffer
> > pointer.
> >
> > 8.. USBCAMD will dequeue a data SRB from the still pin and call the
> > minidriver's CamNewVideoFrameEx entry point before it starts the bulk
> > transfer. The camera minidriver can reduce the requested size of the
bulk
> > transfer if it determines the actual still frame is smaller than the
> > maximum size allocated by DirectShow.
> >
> > 9.. Upon completion of the bulk transfer, USBCAMD will call the
> > CamProcessRawVideoFrameEx entry point for further processing. Afterward,
> > USBCAMD will finish the stream class read request on the still pin.
> >
> > A user application can cancel a requested bulk read or write by sending
a
> > CancelIO to the still pin. If there is a need to load tables to the
camera
> > through a bulk out pipe, the USBD driver can send a WriteFile to the
still
> > pin.
> >
> > Still data flow is intended for use in a pull model. A pull occurs when
an
> > application requests a still. Still data flow will also work in a push
> > model where it functions as a pull. A push occurs when the user pushes
the
> > button on the camera, triggering the device event. USBCAMD will send a
> > KSEVENTSETID_VIDCAPTOSTI event which can be propagated all the way to
the
> > imaging application.
> >
> > please tell me how to do?
> >
> >
> >
> >
> > "Max Paklin" <mpaklin@hotmail.com> wrote in message
> > news:OKp#1nH#EHA.3596@TK2MSFTNGP12.phx.gbl...
> >> You don't normally use CreateFile for that. Check out AmCap sample from
> >> DX
> >> SDK (or old Platform SDK). It shows how to uses System Device
Enumerator
> > to
> >> look up a device from a particular category.
> >> Also you don't normally want to open pin by calling CreateFile. What
you
> >> usually do is to connect a pin to an input pin of another filter and
> > process
> >> data when it comes to that pin.
> >>
> >> -- Max.
> >>
> >>
> >>
> >> "Zhuang" <ZHuang@cogentsystems.com> wrote in message
> >> news:uQrMfXF%23EHA.4004@tk2msftngp13.phx.gbl...
> >> > How to use Createfile Function to Open the WDM video capture source
> > filter
> >> > associated with the camera?
> >> > How to use Createfile Function to Open the still pin on the filter?
> >> >
> >> > rainwin Huang
> >> >
> >> >
> >>
> >>
> >
> >
>
>