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)
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 1150 of file QuickTimeFileSink.cpp.

01153   : fNextChunk(NULL), fOffsetInFile(offsetInFile),
01154     fNumFrames(size/frameSize),
01155     fFrameSize(frameSize), fFrameDuration(frameDuration),
01156     fPresentationTime(presentationTime) {
01157 }


Member Function Documentation

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

Definition at line 1160 of file QuickTimeFileSink.cpp.

Referenced by SubsessionIOState::useFrame1().

01162                                                   {
01163   // First, check whether the new space is just at the end of this
01164   // existing chunk:
01165   if (newOffsetInFile == fOffsetInFile + fNumFrames*fFrameSize) {
01166     // We can extend this existing chunk, provided that the frame size
01167     // and frame duration have not changed:
01168     if (newFrameSize == fFrameSize && newFrameDuration == fFrameDuration) {
01169       fNumFrames += newSize/fFrameSize;
01170       return this;
01171     }
01172   }
01173 
01174   // We'll allocate a new ChunkDescriptor, and link it to the end of us:
01175   ChunkDescriptor* newDescriptor
01176     = new ChunkDescriptor(newOffsetInFile, newSize,
01177                           newFrameSize, newFrameDuration,
01178                           newPresentationTime);
01179 
01180   fNextChunk = newDescriptor;
01181 
01182   return newDescriptor;
01183 }


Field Documentation

ChunkDescriptor* ChunkDescriptor::fNextChunk

Definition at line 52 of file QuickTimeFileSink.cpp.

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

int64_t ChunkDescriptor::fOffsetInFile

Definition at line 53 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2().

unsigned ChunkDescriptor::fNumFrames

Definition at line 54 of file QuickTimeFileSink.cpp.

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

unsigned ChunkDescriptor::fFrameSize

Definition at line 55 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2().

unsigned ChunkDescriptor::fFrameDuration

Definition at line 56 of file QuickTimeFileSink.cpp.

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

struct timeval ChunkDescriptor::fPresentationTime [read]

Definition at line 57 of file QuickTimeFileSink.cpp.

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


The documentation for this class was generated from the following file:
Generated on Mon Apr 29 13:31:23 2013 for live by  doxygen 1.5.2