ChunkDescriptor Class Reference

Collaboration diagram for ChunkDescriptor:

Collaboration graph
[legend]

Public Member Functions

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

Data Fields

ChunkDescriptorfNextChunk
unsigned fOffsetInFile
unsigned fNumFrames
unsigned fFrameSize
unsigned fFrameDuration
timeval fPresentationTime

Detailed Description

Definition at line 37 of file QuickTimeFileSink.cpp.


Constructor & Destructor Documentation

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

Definition at line 1091 of file QuickTimeFileSink.cpp.

Referenced by extendChunk().

01094   : fNextChunk(NULL), fOffsetInFile(offsetInFile),
01095     fNumFrames(size/frameSize),
01096     fFrameSize(frameSize), fFrameDuration(frameDuration),
01097     fPresentationTime(presentationTime) {
01098 }

ChunkDescriptor::~ChunkDescriptor (  )  [virtual]

Definition at line 1100 of file QuickTimeFileSink.cpp.

References fNextChunk.

01100                                   {
01101   delete fNextChunk;
01102 }


Member Function Documentation

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

Definition at line 1105 of file QuickTimeFileSink.cpp.

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

Referenced by SubsessionIOState::useFrame1().

01107                                                   {
01108   // First, check whether the new space is just at the end of this
01109   // existing chunk:
01110   if (newOffsetInFile == fOffsetInFile + fNumFrames*fFrameSize) {
01111     // We can extend this existing chunk, provided that the frame size
01112     // and frame duration have not changed:
01113     if (newFrameSize == fFrameSize && newFrameDuration == fFrameDuration) {
01114       fNumFrames += newSize/fFrameSize;
01115       return this;
01116     }
01117   }
01118 
01119   // We'll allocate a new ChunkDescriptor, and link it to the end of us:
01120   ChunkDescriptor* newDescriptor
01121     = new ChunkDescriptor(newOffsetInFile, newSize,
01122                           newFrameSize, newFrameDuration,
01123                           newPresentationTime);
01124 
01125   fNextChunk = newDescriptor;
01126 
01127   return newDescriptor;
01128 }


Field Documentation

ChunkDescriptor* ChunkDescriptor::fNextChunk

Definition at line 50 of file QuickTimeFileSink.cpp.

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

unsigned ChunkDescriptor::fOffsetInFile

Definition at line 51 of file QuickTimeFileSink.cpp.

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

unsigned ChunkDescriptor::fNumFrames

Definition at line 52 of file QuickTimeFileSink.cpp.

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

unsigned ChunkDescriptor::fFrameSize

Definition at line 53 of file QuickTimeFileSink.cpp.

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

unsigned ChunkDescriptor::fFrameDuration

Definition at line 54 of file QuickTimeFileSink.cpp.

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

struct timeval ChunkDescriptor::fPresentationTime [read]

Definition at line 55 of file QuickTimeFileSink.cpp.

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


The documentation for this class was generated from the following file:
Generated on Tue Oct 7 15:39:37 2008 for live by  doxygen 1.5.2