Major refactor to the cache object (again)! It now uses bytes to determine how many frames to keep.

This commit is contained in:
Jonathan Thomas
2012-10-11 17:30:32 -05:00
parent cebf9728c8
commit 217c54a5ae
7 changed files with 78 additions and 130 deletions

View File

@@ -358,6 +358,19 @@ int Frame::GetAudioSamplesRate()
return sample_rate;
}
// Get the size in bytes of this frame (rough estimate)
int64 Frame::GetBytes()
{
int64 total_bytes = 0;
if (image)
total_bytes += image->fileSize();
if (audio)
total_bytes += (audio->getNumSamples() * audio->getNumChannels() * sizeof(float));
// return size of this frame
return total_bytes;
}
// Get pixel data (as packets)
const Magick::PixelPacket* Frame::GetPixels()
{