ChunkDescriptor Class Reference

Collaboration diagram for ChunkDescriptor:

Collaboration graph
[legend]

Public Member Functions

 ChunkDescriptor (int64_t offsetInFile, unsigned size, unsigned frameSize, unsigned frameDuration, struct timeval presentationTime)
virtual ~ChunkDescriptor ()
ChunkDescriptorextendChunk (int64_t newOffsetInFile, unsigned newSize, unsigned newFrameSize, unsigned newFrameDuration, struct timeval newPresentationTime)

Data Fields

ChunkDescriptorfNextChunk
int64_t fOffsetInFile
unsigned fNumFrames
unsigned fFrameSize
unsigned fFrameDuration
timeval fPresentationTime

Detailed Description

Definition at line 40 of file QuickTimeFileSink.cpp.


Constructor & Destructor Documentation

ChunkDescriptor::ChunkDescriptor ( int64_t  offsetInFile,
unsigned  size,
unsigned  frameSize,
unsigned  frameDuration,
struct timeval  presentationTime 
)

Definition at line 1136 of file QuickTimeFileSink.cpp.

Referenced by extendChunk().

01139   : fNextChunk(NULL), fOffsetInFile(offsetInFile),
01140     fNumFrames(size/frameSize),
01141     fFrameSize(frameSize), fFrameDuration(frameDuration),
01142     fPresentationTime(presentationTime) {
01143 }

ChunkDescriptor::~ChunkDescriptor (  )  [virtual]

Definition at line 1145 of file QuickTimeFileSink.cpp.

References fNextChunk.

01145                                   {
01146   delete fNextChunk;
01147 }


Member Function Documentation

ChunkDescriptor * ChunkDescriptor::extendChunk ( int64_t  newOffsetInFile,
unsigned  newSize,
unsigned  newFrameSize,
unsigned  newFrameDuration,
struct timeval  newPresentationTime 
)

Definition at line 1150 of file QuickTimeFileSink.cpp.

References ChunkDescriptor(), fFrameDuration, fFrameSize, fNextChunk, fNumFrames, and fOffsetInFile.

Referenced by SubsessionIOState::useFrame1().

01152                                                   {
01153   // First, check whether the new space is just at the end of this
01154   // existing chunk:
01155   if (newOffsetInFile == fOffsetInFile + fNumFrames*fFrameSize) {
01156     // We can extend this existing chunk, provided that the frame size
01157     // and frame duration have not changed:
01158     if (newFrameSize == fFrameSize && newFrameDuration == fFrameDuration) {
01159       fNumFrames += newSize/fFrameSize;
01160       return this;
01161     }
01162   }
01163 
01164   // We'll allocate a new ChunkDescriptor, and link it to the end of us:
01165   ChunkDescriptor* newDescriptor
01166     = new ChunkDescriptor(newOffsetInFile, newSize,
01167                           newFrameSize, newFrameDuration,
01168                           newPresentationTime);
01169 
01170   fNextChunk = newDescriptor;
01171 
01172   return newDescriptor;
01173 }


Field Documentation

ChunkDescriptor* ChunkDescriptor::fNextChunk

Definition at line 53 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), extendChunk(), SubsessionIOState::setFinalQTstate(), while(), and ~ChunkDescriptor().

int64_t ChunkDescriptor::fOffsetInFile

Definition at line 54 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), and extendChunk().

unsigned ChunkDescriptor::fNumFrames

Definition at line 55 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), extendChunk(), SubsessionIOState::setFinalQTstate(), and while().

unsigned ChunkDescriptor::fFrameSize

Definition at line 56 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), and extendChunk().

unsigned ChunkDescriptor::fFrameDuration

Definition at line 57 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), extendChunk(), SubsessionIOState::setFinalQTstate(), and while().

struct timeval ChunkDescriptor::fPresentationTime [read]

Definition at line 58 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::completeOutputFile(), and while().


The documentation for this class was generated from the following file:
Generated on Thu Feb 2 23:54:45 2012 for live by  doxygen 1.5.2