470,815 Members | 1,350 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

.net threads

Hi everybody,
I'm writing an application that receives video frame from a camera that
releases a GotFrame event carrying the image as event argument 25 times
per second.
I wrote an event handler FrameReceiver hooked to the GotFrame event
that has to process the frame.
The main problem is that the frame processing rate can be lower than
the camera frame rate (depending on the system load) and the camera
releases its events on different threads.
I would like:
1) That the differnet threads that process the frames do not overlap
each other and do mantain the order they are released from the camera
2) If the recevier is busy processing one frame it should dismiss
future GotFrame events or (better) enqueue them in a N position FIFO
queue to be processed later on.

I'm knew with multi thread programming and any help would be
appreciate.
Regards,
Marco

May 22 '06 #1
2 1017
Have you thought os using buffering? With buffering, you save the frames for
a period of time, and then begin displaying them at such a rate that the
client will never run out of frames to display. That way, the frames are
displayed at the rate they were created. If, for some reason, the client
catches up with the camera, you simply stop the client and re-buffer.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

The man who questions opinions is wise.
The man who quarrels with facts is a fool.

<nb*********@gmail.com> wrote in message
news:11*********************@y43g2000cwc.googlegro ups.com...
Hi everybody,
I'm writing an application that receives video frame from a camera that
releases a GotFrame event carrying the image as event argument 25 times
per second.
I wrote an event handler FrameReceiver hooked to the GotFrame event
that has to process the frame.
The main problem is that the frame processing rate can be lower than
the camera frame rate (depending on the system load) and the camera
releases its events on different threads.
I would like:
1) That the differnet threads that process the frames do not overlap
each other and do mantain the order they are released from the camera
2) If the recevier is busy processing one frame it should dismiss
future GotFrame events or (better) enqueue them in a N position FIFO
queue to be processed later on.

I'm knew with multi thread programming and any help would be
appreciate.
Regards,
Marco

May 22 '06 #2
hB
Follow the technique specified here by Kevin Spencer.
And Have two threads.

One Thread - MasterThread -> Receives the events
And put the data/images in the buffer.

Other Thread -> Checks the buffer for Input data/images to process.
Process them one by one in the order data/images put-in by master
thread.
And when processes remove them from buffer.

Use any thread safe buffer mechanism of DotNet.

---
hB

May 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ronan Viernes | last post: by
reply views Thread by Al Tobey | last post: by
34 posts views Thread by Kovan Akrei | last post: by
3 posts views Thread by bygandhi | last post: by
10 posts views Thread by [Yosi] | last post: by
6 posts views Thread by RahimAsif | last post: by
10 posts views Thread by Darian | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.