From: Alexander Prado on
Maxim,

thanks for your response.
Would VFW driver be seen as a WEBCAM? If so, it would be an interesting
solution.
BTW: I would like to receive your recommendation. Please send them to
marteletto(a)hotmail.com

Best regards,


Alex




"Maxim S. Shatskih" <maxim(a)storagecraft.com> wrote in message
news:#KdzqtoGFHA.3484(a)TK2MSFTNGP12.phx.gbl...
> The best way of solving this is to forget WDM and use the old VfW
driver.
> User-mode-only DLL, exposed to DirectShow by standard MS's QCAP.DLL
wrapper.
>
> I can recommend a Russian company who already has this solution
debugged
> and working.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim(a)storagecraft.com
> http://www.storagecraft.com
>
> "Alexander Prado" <marteletto(a)hotmail.com> wrote in message
> news:OzQVf0PGFHA.3792(a)TK2MSFTNGP10.phx.gbl...
> > Hi There!
> >
> > I am a newbie in Driver Development, so I think my doubt is simple.
> > What I need is a virtual driver for capturing desktop window
(applications
> > must see it as a webcam).
> >
> > I have installed DDK and realized that TESTCAP (DDK ýs sample) has all I
> > need - except that this driver doesn't capture anything (it only shows
color
> > bars). So, I have thought that all I would have to do was to change the
core
> > function "ImageSynth" (in capxfer.c), including a screen capture method
and
> > to make some simple changes...
> >
> > I have been trying to use GDI for capturing the screen, and likely
that's
> > the problem. In order to debug, I have commented all the code in
> > "ImageSynth", except the following commands, but I have no success (the
> > driver is successfully compiled and installed, but Windows shows a
message
> > "Windows cannot load the device driver for this hardware. The driver may
be
> > corrupted or missing. (Code 39)".
> >
> > void ImageSynth (
> > IN OUT PHW_STREAM_REQUEST_BLOCK pSrb,
> > IN ImageXferCommands Command,
> > IN BOOL FlipHorizontal
> > )
> > {
> > // IF THE FOLLOWING COMMANDS ARE COMMENTED, DRIVER WORKS FINE!
> > HDC hdcScreen;
> > hdcScreen = CreateDC("DISPLAY", NULL, NULL, NULL);
> > DeleteDC(hdcScreen);
> > }
> >
> >
> > Does anybody could help me to do this job? I would prefer starting from
> > either a DDK sample or another source code available.
> >
> > Thanks in advance.
> >
> >
> > Alex
> >
> >
> >
> >
> >
>
>


From: Alexander Prado on
Eugene,

thanks for your (very detailed) explanation. I got the role picture.
The big problem is I need a solution that creates a virtual driver, which
would be listed as a WEBCAM on videoconferencing solutions (for instance) -
thats the only reason I though WDM driver was the solution.

As I am not a driver developer, I start thinking that I actually have a huge
problem to be solved! I hope that I find someone who has already developed
something like that...

Best regards,


Alex





"Eugene Sukhodolin" <mirrdrv(a)demoforge.com> wrote in message
news:uwczb0vGFHA.2924(a)TK2MSFTNGP15.phx.gbl...
> Alexander,
>
> > I am a newbie in Driver Development, so I think my doubt is simple.
> > What I need is a virtual driver for capturing desktop window
(applications
> > must see it as a webcam).
>
> First of all, to capture/stream the screen you need a sort of video
driver.
> Windows (NT) graphics drivers are not WDM ones. By far not.
> NT video drivers enjoy their own bicomponent portclass-based model
> which is unlike to anything else in Windows drivers world.
>
> It is not possible to turn video driver into KS streaming one directly due
> to a number of reasons. Video port class and streaming port class drivers
> can not service a single device at the same time. Video devices are
created
> only by video port class and are exclusive ones. And so on.
>
> Meanwhile it is possible to create a WDM screen streaming solution based
> on a tandem of drivers - video mirroring and the streaming one. It is a
> tough task for an experienced developer. Moreover, I believe this solution
is
> inefficient and unnatural. Desktop stream is not a framewise video by its
> nature. Usually the updates do not come periodically at a constant rate.
> Updates normally come in a quite small portions in average compared to
> a wholescreen size. There are even periods of no screen activity at all.
> But in WDM video streaming model you're compelled to produce
> a full-screen constant (or near constant) bitrate video all the time.
> At a rough estimation, it is some 100 times and more higher than
> the required traffic should be. Drastic difference, isn't it?
>
> Of course, it is possible to decrease a frame rate. But then you'll loose
> the smoothness and dynamics.
>
> My advice is to forget WDM streaming in a scope of this task and use
> an important property that a mirror driver in itself has. This kind of
driver
> offers the ability to track the exact area of update since it intercepts
> all rendering requests and is able to examine their bounding regions.
>
> You may share the screen surface memory with a client application/service
> and provide some messaging to tell the application that there is a change
on
> the screen.
>
> Regarding samples. DDK mirror sample is just a skeleton of a driver.
> It performs no rendering, offers no efficient method of mirror surface
> access and no messaging services. Of course, to be functional, this driver
> have to implement some sort of rendering for required DDIs.
> And a reliable mechanism of communication to the program that mediates
> the screen image to its real consumers.
>
> Video capture ddk sample driver may be used as a skeleton for a WDM
> capture part. The only way to make it read the image of the desktop
> from the mirror is a direct backdoor communication with mirror's miniport
> driver. This is very tricky, indeed. At least because streaming driver
can't
> even open the mirror's device as far as it is exclusivly opened by GDI
> all the time. Maybe the reverse scheme would work: video mirror's
> miniport opens a special device on a KS driver and manipulates the
> driver through it on a behalf of an active instance of a mirror device.
> Screen memory should be allocated and mapped in a special way for this
approach
> to work.
>
> Hope my comments were of some help to you.
>
> --
> Sincerely,
> Eugene Sukhodolin
> www.demoforge.com
>