
- Forum
- Programming Talk
- C and C++
- circular buffer
circular buffer
This is a discussion on circular buffer within the C and C++ forums, part of the Programming Talk category; Hi, I have a program which reads the data from a webcam connected to a linux m/c and writes the ...
-
circular buffer
Hi,
I have a program which reads the data from a webcam connected to a linux m/c and writes the data to a file. The problem with this is the file size grows as i capture the data. Instead i want to this using a circular buffer. how can i do this?
plz kindly suggest me.
Thanks
Jagadish
-
07-15-2004, 05:11 PM #2dhee Guest
Re:circular buffer
my intuition would be to have a linked list of memory segments which are allocated as data
is being read from the webcam. (It should be a fixed buffer size if you are reading it
directly from the device.)
use successive nodes to read the data and keep freeing the nodes which have stale data.
If you MUST write the data to a file then you could extend the above to a file analogy as in
writing it to multiple files and deleting them as the need expires. OF course, this would be a rather lousy way to do things.
dhee

Reply With Quote





