Capture Source Filter kudos & bug fix
- From: scotchfaster <scott.schafer@xxxxxxxxx>
- Date: Sun, 18 May 2008 13:51:57 -0700 (PDT)
First off, this completely saved my ass. I started, as many have done
before, going down the path of trying to modify AMCap in order to
create a virtual camera until someone took pity on me and directed me
to Vivek's invaluable sample.
So if you're reading this, Vivek, thanks a million.
However, I did find a small bug. The sample can crash with a division-
by-zero error when a client of the webcam sets the camera dimensions
to small values. I tracked down the problem to this initialization:
pvscc->OutputGranularityX = 0;
pvscc->OutputGranularityY = 0;
These are steps that are used to calculate the output dimensions under
certain conditions, and apparently DirectShow will try to divide
dimensions by these values even when they're zero. I was able to make
the crash go away completely by changing the code to:
pvscc->OutputGranularityX = 1;
pvscc->OutputGranularityY = 1;
- Scott
.
- Prev by Date: Creating a bitmap from a sample
- Next by Date: Re: ScopeGuard and CComPtr
- Previous by thread: Creating a bitmap from a sample
- Next by thread: Multicast Directshow Graph Bridging, COW Rustling, & the Use of Portable Holes in Cartoon Physics.
- Index(es):
Relevant Pages
|