Here's a patch to fix the block of code in NuppelVideoRecorder.cpp that
has the comment "count free buffers -- FIXME this can be done with less
CPU time!!" It just adds a member variable to the class that keeps
track of the free buffers, instead of counting them in the loop every
time in the function.
Also, in what case(s) is it necessary to have the thread for writing
data to the disk (ThreadedFileWriter)? The implementation is a ring
buffer that has data added when Write() is called, then sending that
data to the disk in another thread. Doesn't the write() system call
just dump the data to kernel buffers, where it is written when it can
be? The extra thread and memcpy's to implement the ring buffer stuff
may not be necessary. I didn't notice any difference in performance
when I removed all of the ThreadedFileWriter code and just had system
write() calls.
has the comment "count free buffers -- FIXME this can be done with less
CPU time!!" It just adds a member variable to the class that keeps
track of the free buffers, instead of counting them in the loop every
time in the function.
Also, in what case(s) is it necessary to have the thread for writing
data to the disk (ThreadedFileWriter)? The implementation is a ring
buffer that has data added when Write() is called, then sending that
data to the disk in another thread. Doesn't the write() system call
just dump the data to kernel buffers, where it is written when it can
be? The extra thread and memcpy's to implement the ring buffer stuff
may not be necessary. I didn't notice any difference in performance
when I removed all of the ThreadedFileWriter code and just had system
write() calls.