libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libcvd-members] libcvd cvd/videofilebuffer.h cvd/videofilebuffe...


From: Ethan Eade
Subject: Re: [Libcvd-members] libcvd cvd/videofilebuffer.h cvd/videofilebuffe...
Date: Tue, 23 May 2006 20:51:26 +0100
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050716)

Edward Rosten wrote:

        RawVideoFileBuffer is now a templated class. This allows the
VideoFileBuffer to correctly return frames of type Rgb<byte>.


As fas as I knew, the previous system worked with Rgb<byte> frames. Was this not the case?

I would prefer it if the code (of which there is a large amount) is kept in the .cc file, since RawVideoFileBuffer contains almost no type dependent code.

Essentially, at some point a cast has to happen between ffmpeg's data (uint_8) and the compile time CVD image type. In the new version, this happens on line 433 (videofilebuffer.h, version 1.12). The only other piece of type dependent code is in the allocation of a memory buffer (must be 3x bigger for Rgb). This could be allocated in VideoFileBiffer and the data passed as a void pointer, or simply 3x the memory could be allocated (the old version).
My understanding of the problem, from briefly looking at the code with Colin, is that an image constructed as Image<byte> was being destructed as Image<Rgb<byte> >, which is bad (and aborts because of how aligned_mem registers buffers). I suspect the type dependent code can be factored out while still choosing the right destructor; I think the problem is that no one was using this code in whatever configure settings Colin is currently using, so the bug wasn't discovered until now, and Colin needed it to work.

Since we are already linking against a library, I agree that it's best to keep as much as possible in the library instead of headers. If it were a mostly-header library, on the other hand... well, I've been known to embrace 45 second compiles.

- Ethan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]