how to implement a virtual video driver base on testcap?

Hello everyone!

I’m an absolute newbie in windowx xp wdm driver development.
I need a virtual video capture driver that take an “jpg picture stream” as
input. Then the application(MSN) can use the data from the drive as same as
from a actual hardware driver.

So i started to study the testcap (ddk example) and i’d like to know:
which is the function that manages the input stream? Is the function
ImageSynth(in capxfer.c)?if so how does it works?
whic format of the output stream should i convert the jpg files to?
Do u have any ideas in which steps i can implement my virtual video driver?

thank u
kong(xxxxx@gmail.com)

kazi wrote:

I’m an absolute newbie in windowx xp wdm driver development.
I need a virtual video capture driver that take an “jpg
picture stream” as input. Then the application(MSN) can use the
data from the drive as same as from a actual hardware driver.

So i started to study the testcap (ddk example) and i’d like to know:
which is the function that manages the input stream? Is the
function ImageSynth(in capxfer.c)?if so how does it works?

There’s not much to it. VideoCaptureRoutine() gets fired by a timer,
and if it is time for a new frame, it calls ImageSynth() to create one.
The code in ImageSynth() is self-explanatory.

whic format of the output stream should i convert the jpg
files to?

Whatever you want. You just need to tell the system what it is you will
be supplying, by filling in the KS_DATARANGE_VIDEO structures (see
capstrm.h). You can deliver motion JPEG, if you want (fourcc MJPG);
most machines contain a decompressor for that. If you’d RATHER do the
decompression yourself, you can supply whichever RGB format is convenient.

Do u have any ideas in which steps i can implement my
virtual video driver?

Where will you be getting the images? I suspect that’s the trickier
part. If it is coming from a file, I’m not sure why you want to involve
the kernel at all. You should be able to do this with a user-mode
DirectShow source filter.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

hi Tim Roberts!

Thanks for your reply! It’s much helpful for me!
I still have some questions:

  1. If I use some API to decompress images data, is it means that my driver
    will switch state between kernel mode and user mode? Can it still have a
    good performance?
  2. For your suspect: My images getting from a handset camera, the data is
    transferd by bluetooth port. In the handset side, i can capture images as a
    JPEG format or BMP format. The bluetooth port is a low speed device so i
    think i have to choose the JPEG format.
    I want my project has the ablity to support all the other application which
    is “Video for Windows compatible”. So I think i have to provide a device
    driver for this idea. Am I right? Has there another way to realize my idea
    using the DirectShow? Which one is easier for me?
    my question may be too long or inexplicability, If need i can explain what
    you want. Thanks for your help again!
    kong(xxxxx@gmail.com)

On 16/11/05, Tim Roberts wrote:

> kazi wrote:
>
> >
> >
> > I’m an absolute newbie in windowx xp wdm driver development.
> > I need a virtual video capture driver that take an “jpg
> > picture stream” as input. Then the application(MSN) can use the
> > data from the drive as same as from a actual hardware driver.
> >
> > So i started to study the testcap (ddk example) and i’d like to know:
> > which is the function that manages the input stream? Is the
> > function ImageSynth(in capxfer.c)?if so how does it works?
> >
>
> There’s not much to it. VideoCaptureRoutine() gets fired by a timer,
> and if it is time for a new frame, it calls ImageSynth() to create one.
> The code in ImageSynth() is self-explanatory.
>
> > whic format of the output stream should i convert the jpg
> > files to?
> >
>
> Whatever you want. You just need to tell the system what it is you will
> be supplying, by filling in the KS_DATARANGE_VIDEO structures (see
> capstrm.h). You can deliver motion JPEG, if you want (fourcc MJPG);
> most machines contain a decompressor for that. If you’d RATHER do the
> decompression yourself, you can supply whichever RGB format is convenient.
>
> > Do u have any ideas in which steps i can implement my
> > virtual video driver?
> >
>
> Where will you be getting the images? I suspect that’s the trickier
> part. If it is coming from a file, I’m not sure why you want to involve
> the kernel at all. You should be able to do this with a user-mode
> DirectShow source filter.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>

I think that such things can be solved by using a user mode DLL, no kernel
mode development is necessary.

The legacy Video For Windows driver will suite, for instance.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “kazi”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, November 15, 2005 11:13 AM
Subject: [ntdev] how to implement a virtual video driver base on testcap?

Hello everyone!

I’m an absolute newbie in windowx xp wdm driver development.
I need a virtual video capture driver that take an “jpg picture stream” as
input. Then the application(MSN) can use the data from the drive as same as
from a actual hardware driver.

So i started to study the testcap (ddk example) and i’d like to know:
which is the function that manages the input stream? Is the function
ImageSynth(in capxfer.c)?if so how does it works?
whic format of the output stream should i convert the jpg files to?
Do u have any ideas in which steps i can implement my virtual video driver?

thank u
kong(xxxxx@gmail.com)


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

kazi wrote:

I still have some questions:

  1. If I use some API to decompress images data, is it means that
    my driver will switch state between kernel mode and user mode? Can
    it still have a good performance?

If you have a kernel streaming driver which needs to decompress the
image data, you will have to do it in kernel mode. You can’t call
APIs. If you need to use an API to decompress, then you need to write a
separate decompressor filter. And if it’s really just JPEG, you might
as well let the stock codecs handle it.

  1. For your suspect: My images getting from a handset camera, the
    data is transferd by bluetooth port. In the handset side, i can
    capture images as a JPEG format or BMP format. The bluetooth port
    is a low speed device so i think i have to choose the JPEG format.

And is this fast enough for streaming data?

I want my project has the ablity to support all the other
application which is “Video for Windows compatible”. So I think i
have to provide a device driver for this idea. Am I right? Has
there another way to realize my idea using the DirectShow?

Well, there are a couple of approachs. If your data is coming from
user-mode, it might be that the simplest solution is to write a Video
for Windows driver. This can be done entirely in user-mode. There is a
wrapper which will make such a driver available as a capture source in
DirectShow. I’m not sure there are any good examples of this, although
you may be able to find one with Google. Maxim has advocated this
approach in several cases; perhaps he has a good pointer to a sample.

There is a wrapper which makes WDM capture drivers available in VFW, but
I do not think there is one for user-mode DirectShow source filters.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

> user-mode, it might be that the simplest solution is to write a Video

for Windows driver. This can be done entirely in user-mode. There is a
wrapper which will make such a driver available as a capture source in
DirectShow.

QCAP.DLL is the wrapper, it automatically wraps all VfW capture devices.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Tim Roberts:
Thanks for your great help!
I think if i can descript my task clearly you can understand it clearly
too.
purpose: treat an handset camera as a webcam work with msn.
structure:
handset side personal computer side
[my phone app]
/ \ |
[camera] [bluetooth] ----|----> [bluetooth] –> [aDriver] –> [ MSN
]
|
completed work:

  1. All the phone side task:
    Capture the images from the camera. The image format is jpg or bmp.Here I
    choose the jpg format because of the narrow bandwidth of bluetooth.
    Send the images as a stream to the pc via bluetooth.
    2.PC side
    Receive the images from the bluetooth.
    Next work:
    Develop a virtual driver to support all the applications that has the
    ability to use webcam. f.e. msn.
    I think only a device driver can accomplish this task. I can select my
    device in msn’s option.
    If i devote to develop a driver(regardless kernel or user mode), i should
    receive the data from bluetooth, convert the data or directly transfer the
    jpg images data to any applicaton request.
    So

Well, there are a couple of approachs. If your data is coming from
user-mode, it might be that the simplest solution is to write a Video
for Windows driver. This can be done entirely in user-mode.

you mean i can wirte a vfw driver to accomplish this task. But after i
search the vfw driver relative information by google, i got few useful
stuffs. I can’t find the “Microsoft Video for Windows Development Kit”. Does
it contains in any other sdk or ddk? If i write this user-mode driver, does
it can choose as a device by msn?

There is a wrapper which will make such a driver available as a capture

source in
DirectShow. I’m not sure there are any good examples of this, although
you may be able to find one with Google. Maxim has advocated this
approach in several cases; perhaps he has a good pointer to a sample.

Do you mean after i write a vfw driver to receive the data from bluetooth,
then i can decompress the data by DirectShow in user-mode by a filter?

Hi Maxim Shatskih!
Thanks a lot for your advice!

I think that such things can be solved by using a user mode DLL, no kernel
mode development is necessary.

The legacy Video For Windows driver will suite, for instance.

Can you tell me where should i start? Can you list some documents help me to
understand how to do it? I have no experience in driver develop field.
Thank you again for your time and consideration!


kong(xxxxx@gmail.com)