Click here to Skip to main content
15,913,055 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem on examing a String (token from a file) Pin
Immunity1830-May-07 3:41
Immunity1830-May-07 3:41 
QuestionChange MFC Dialog name (when running) Pin
Johpoke29-May-07 9:26
Johpoke29-May-07 9:26 
AnswerRe: Change MFC Dialog name (when running) Pin
shiraztk29-May-07 9:52
shiraztk29-May-07 9:52 
AnswerRe: Change MFC Dialog name (when running) (solved) Pin
Johpoke29-May-07 20:06
Johpoke29-May-07 20:06 
QuestionQuestion about Creating Directshow Filter with a callback Pin
godspeed12329-May-07 8:29
godspeed12329-May-07 8:29 
AnswerRe: Question about Creating Directshow Filter with a callback Pin
Mark Salsbery29-May-07 9:03
Mark Salsbery29-May-07 9:03 
GeneralRe: Question about Creating Directshow Filter with a callback Pin
godspeed12329-May-07 10:42
godspeed12329-May-07 10:42 
GeneralRe: Question about Creating Directshow Filter with a callback Pin
Mark Salsbery29-May-07 13:27
Mark Salsbery29-May-07 13:27 
The source pin is derived from CSourceStream so it has its own thread that is looping calling
FillBuffer().

The easiest solution based on the code you have would be to keep a copy of the current frame from
the camera (given to the filter through the callback) and every time your FillBuffer override
is called, copy the newest frame into the passed sample buffer and set the sample time.

The only real problem with this solution is 2 threads doing the job of one - a bit innefficient
especially with resources for the extra thread. The plus side to this solution is it's easiest
to code.

A more robust solution would be to do something closer to a capture filter. Using the existing
CSource/CSourceStream classes it's relatively easy to override a few methods to not use the
CAMThread base of CSourceStream. The CSourceStream::Active/CSourceStream::Inactive overrides
are where the thread creation/destruction occurs. CSourceStream::ThreadProc and
CSourceStream::DoBufferProcessingLoop are the methods relevant to the FillBuffer call so there
you'll find the necessary calls for obtaining/releasing sample buffers and making the delivery
calls. Those you'd want to do in your callback.

Mark




"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

GeneralRe: Question about Creating Directshow Filter with a callback Pin
godspeed12330-May-07 7:13
godspeed12330-May-07 7:13 
GeneralRe: Question about Creating Directshow Filter with a callback Pin
Mark Salsbery30-May-07 7:27
Mark Salsbery30-May-07 7:27 
GeneralRe: Question about Creating Directshow Filter with a callback Pin
godspeed12330-May-07 7:35
godspeed12330-May-07 7:35 
QuestionC++ basic question - parametrized and default constructors Pin
Vaclav_29-May-07 8:23
Vaclav_29-May-07 8:23 
AnswerRe: C++ basic question - parametrized and default constructors Pin
Mark Salsbery29-May-07 9:17
Mark Salsbery29-May-07 9:17 
AnswerRe: C++ basic question - parametrized and default constructors Pin
shiraztk29-May-07 10:05
shiraztk29-May-07 10:05 
GeneralRe: C++ basic question - parametrized and default constructors Pin
Vaclav_30-May-07 9:07
Vaclav_30-May-07 9:07 
QuestionHow to use a camera? Pin
smzhaq29-May-07 8:05
smzhaq29-May-07 8:05 
AnswerRe: How to use a camera? Pin
Vaclav_29-May-07 8:40
Vaclav_29-May-07 8:40 
AnswerRe: How to use a camera? Pin
Mark Salsbery29-May-07 9:11
Mark Salsbery29-May-07 9:11 
QuestionElegant way to read data from text file Pin
ldsdbomber29-May-07 7:31
ldsdbomber29-May-07 7:31 
AnswerRe: Elegant way to read data from text file Pin
David Crow29-May-07 8:03
David Crow29-May-07 8:03 
QuestionHow to use Create instead of LoadFrame Pin
prithaa29-May-07 7:11
prithaa29-May-07 7:11 
AnswerRe: How to use Create instead of LoadFrame Pin
Nibu babu thomas29-May-07 17:32
Nibu babu thomas29-May-07 17:32 
GeneralRe: How to use Create instead of LoadFrame Pin
prithaa29-May-07 18:03
prithaa29-May-07 18:03 
JokeHelp! [modified] Pin
Mark Salsbery29-May-07 6:55
Mark Salsbery29-May-07 6:55 
AnswerRe: Help! Pin
krmed29-May-07 7:02
krmed29-May-07 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.