SubsessionIOState Class Reference

Collaboration diagram for SubsessionIOState:

Collaboration graph
[legend]

Public Types

typedef unsigned(QuickTimeFileSink::*) atomCreationFunc ()

Public Member Functions

 SubsessionIOState (QuickTimeFileSink &sink, MediaSubsession &subsession)
virtual ~SubsessionIOState ()
Boolean setQTstate ()
void setFinalQTstate ()
void afterGettingFrame (unsigned packetDataSize, struct timeval presentationTime)
void onSourceClosure ()
Boolean syncOK (struct timeval presentationTime)
Boolean isHintTrack () const
Boolean hasHintTrack () const
UsageEnvironmentenvir () const

Static Public Member Functions

static void setHintTrack (SubsessionIOState *hintedTrack, SubsessionIOState *hintTrack)

Data Fields

unsigned fTrackID
SubsessionIOStatefHintTrackForUs
SubsessionIOStatefTrackHintedByUs
SubsessionBufferfBuffer
SubsessionBufferfPrevBuffer
QuickTimeFileSinkfOurSink
MediaSubsessionfOurSubsession
unsigned short fLastPacketRTPSeqNum
Boolean fOurSourceIsActive
Boolean fHaveBeenSynced
timeval fSyncTime
Boolean fQTEnableTrack
unsigned fQTcomponentSubtype
char const * fQTcomponentName
atomCreationFunc fQTMediaInformationAtomCreator
atomCreationFunc fQTMediaDataAtomCreator
char const * fQTAudioDataType
unsigned short fQTSoundSampleVersion
unsigned fQTTimeScale
unsigned fQTTimeUnitsPerSample
unsigned fQTBytesPerFrame
unsigned fQTSamplesPerFrame
unsigned fQTTotNumSamples
unsigned fQTDurationM
unsigned fQTDurationT
int64_t fTKHD_durationPosn
unsigned fQTInitialOffsetDuration
ChunkDescriptorfHeadChunk
ChunkDescriptorfTailChunk
unsigned fNumChunks
SyncFramefHeadSyncFrame
SyncFramefTailSyncFrame
SubsessionIOState::hinf fHINF
unsigned frameSize
timeval presentationTime
int64_t destFileOffset
unsigned startSampleNumber
unsigned short seqNum
unsigned rtpHeader
unsigned char numSpecialHeaders
unsigned specialHeaderBytesLength
unsigned char specialHeaderBytes [SPECIAL_HEADER_BUFFER_SIZE]
unsigned packetSizes [256]

Static Public Attributes

static unsigned fCurrentTrackNumber = 0

Private Member Functions

void useFrame (SubsessionBuffer &buffer)
void useFrameForHinting (unsigned frameSize, struct timeval presentationTime, unsigned startSampleNumber)
unsigned useFrame1 (unsigned sourceDataSize, struct timeval presentationTime, unsigned frameDuration, int64_t destFileOffset)

Private Attributes

struct {
   unsigned   frameSize
   timeval   presentationTime
   int64_t   destFileOffset
   unsigned   startSampleNumber
   unsigned short   seqNum
   unsigned   rtpHeader
   unsigned char   numSpecialHeaders
   unsigned   specialHeaderBytesLength
   unsigned char   specialHeaderBytes [SPECIAL_HEADER_BUFFER_SIZE]
   unsigned   packetSizes [256]
fPrevFrameState

Data Structures

struct  hinf

Detailed Description

Definition at line 109 of file QuickTimeFileSink.cpp.


Member Typedef Documentation

typedef unsigned(QuickTimeFileSink::*) SubsessionIOState::atomCreationFunc()

Definition at line 149 of file QuickTimeFileSink.cpp.


Constructor & Destructor Documentation

SubsessionIOState::SubsessionIOState ( QuickTimeFileSink sink,
MediaSubsession subsession 
)

Definition at line 529 of file QuickTimeFileSink.cpp.

References fBuffer, QuickTimeFileSink::fBufferSize, fCurrentTrackNumber, fOurSink, fOurSourceIsActive, fPrevBuffer, fPrevFrameState, fTrackID, NULL, MediaSubsession::readSource(), sink, and subsession.

00531   : fHintTrackForUs(NULL), fTrackHintedByUs(NULL),
00532     fOurSink(sink), fOurSubsession(subsession),
00533     fLastPacketRTPSeqNum(0), fHaveBeenSynced(False), fQTTotNumSamples(0), 
00534     fHeadChunk(NULL), fTailChunk(NULL), fNumChunks(0),
00535     fHeadSyncFrame(NULL), fTailSyncFrame(NULL) {
00536   fTrackID = ++fCurrentTrackNumber;
00537 
00538   fBuffer = new SubsessionBuffer(fOurSink.fBufferSize);
00539   fPrevBuffer = sink.fPacketLossCompensate
00540     ? new SubsessionBuffer(fOurSink.fBufferSize) : NULL;
00541 
00542   FramedSource* subsessionSource = subsession.readSource();
00543   fOurSourceIsActive = subsessionSource != NULL;
00544 
00545   fPrevFrameState.presentationTime.tv_sec = 0;
00546   fPrevFrameState.presentationTime.tv_usec = 0;
00547   fPrevFrameState.seqNum = 0;
00548 }

SubsessionIOState::~SubsessionIOState (  )  [virtual]

Definition at line 550 of file QuickTimeFileSink.cpp.

References chunk, fBuffer, fHeadChunk, fHeadSyncFrame, ChunkDescriptor::fNextChunk, fPrevBuffer, SyncFrame::nextSyncFrame, and NULL.

00550                                       {
00551   delete fBuffer; delete fPrevBuffer;
00552 
00553   // Delete the list of chunk descriptors:
00554   ChunkDescriptor* chunk = fHeadChunk;
00555   while (chunk != NULL) {
00556     ChunkDescriptor* next = chunk->fNextChunk;
00557     delete chunk;
00558     chunk = next;
00559   }
00560 
00561   // Delete the list of sync frames:
00562   SyncFrame* syncFrame = fHeadSyncFrame;
00563   while (syncFrame != NULL) {
00564     SyncFrame* next = syncFrame->nextSyncFrame;
00565     delete syncFrame;
00566     syncFrame = next;
00567   }
00568 }


Member Function Documentation

Boolean SubsessionIOState::setQTstate (  ) 

Definition at line 570 of file QuickTimeFileSink.cpp.

References QuickTimeFileSink::addAtom_dummy(), QuickTimeFileSink::addAtom_genericMedia(), QuickTimeFileSink::addAtom_soundMediaGeneral(), MediaSubsession::codecName(), envir(), False, QuickTimeFileSink::fMovieFPS, MediaSubsession::fmtp_config(), fourChar, fOurSink, fOurSubsession, fQTAudioDataType, fQTBytesPerFrame, fQTcomponentName, fQTcomponentSubtype, fQTEnableTrack, fQTMediaDataAtomCreator, fQTMediaInformationAtomCreator, fQTSamplesPerFrame, fQTSoundSampleVersion, fQTTimeScale, fQTTimeUnitsPerSample, isHintTrack(), MediaSubsession::mediumName(), MediaSubsession::rtpTimestampFrequency(), samplingFrequencyFromAudioSpecificConfig(), and True.

Referenced by QuickTimeFileSink::QuickTimeFileSink().

00570                                       {
00571   char const* noCodecWarning1 = "Warning: We don't implement a QuickTime ";
00572   char const* noCodecWarning2 = " Media Data Type for the \"";
00573   char const* noCodecWarning3 = "\" track, so we'll insert a dummy \"????\" Media Data Atom instead.  A separate, codec-specific editing pass will be needed before this track can be played.\n";
00574 
00575   do {
00576     fQTEnableTrack = True; // enable this track in the movie by default
00577     fQTTimeScale = fOurSubsession.rtpTimestampFrequency(); // by default
00578     fQTTimeUnitsPerSample = 1; // by default
00579     fQTBytesPerFrame = 0;
00580         // by default - indicates that the whole packet data is a frame
00581     fQTSamplesPerFrame = 1; // by default
00582 
00583     // Make sure our subsession's medium is one that we know how to
00584     // represent in a QuickTime file:
00585     if (isHintTrack()) {
00586       // Hint tracks are treated specially
00587       fQTEnableTrack = False; // hint tracks are marked as inactive
00588       fQTcomponentSubtype = fourChar('h','i','n','t');
00589       fQTcomponentName = "hint media handler";
00590       fQTMediaInformationAtomCreator = &QuickTimeFileSink::addAtom_gmhd;
00591       fQTMediaDataAtomCreator = &QuickTimeFileSink::addAtom_rtp;
00592     } else if (strcmp(fOurSubsession.mediumName(), "audio") == 0) {
00593       fQTcomponentSubtype = fourChar('s','o','u','n');
00594       fQTcomponentName = "Apple Sound Media Handler";
00595       fQTMediaInformationAtomCreator = &QuickTimeFileSink::addAtom_smhd;
00596       fQTMediaDataAtomCreator
00597         = &QuickTimeFileSink::addAtom_soundMediaGeneral; // by default
00598       fQTSoundSampleVersion = 0; // by default
00599 
00600       // Make sure that our subsession's codec is one that we can handle:
00601       if (strcmp(fOurSubsession.codecName(), "X-QT") == 0 ||
00602           strcmp(fOurSubsession.codecName(), "X-QUICKTIME") == 0) {
00603         fQTMediaDataAtomCreator = &QuickTimeFileSink::addAtom_genericMedia;
00604       } else if (strcmp(fOurSubsession.codecName(), "PCMU") == 0) {
00605         fQTAudioDataType = "ulaw";
00606         fQTBytesPerFrame = 1;
00607       } else if (strcmp(fOurSubsession.codecName(), "GSM") == 0) {
00608         fQTAudioDataType = "agsm";
00609         fQTBytesPerFrame = 33;
00610         fQTSamplesPerFrame = 160;
00611       } else if (strcmp(fOurSubsession.codecName(), "PCMA") == 0) {
00612         fQTAudioDataType = "alaw";
00613         fQTBytesPerFrame = 1;
00614       } else if (strcmp(fOurSubsession.codecName(), "QCELP") == 0) {
00615         fQTMediaDataAtomCreator = &QuickTimeFileSink::addAtom_Qclp;
00616         fQTSamplesPerFrame = 160;
00617       } else if (strcmp(fOurSubsession.codecName(), "MPEG4-GENERIC") == 0 ||
00618                  strcmp(fOurSubsession.codecName(), "MP4A-LATM") == 0) {
00619         fQTMediaDataAtomCreator = &QuickTimeFileSink::addAtom_mp4a;
00620         fQTTimeUnitsPerSample = 1024; // QT considers each frame to be a 'sample'
00621         // The time scale (frequency) comes from the 'config' information.
00622         // It might be different from the RTP timestamp frequency (e.g., aacPlus).
00623         unsigned frequencyFromConfig
00624           = samplingFrequencyFromAudioSpecificConfig(fOurSubsession.fmtp_config());
00625         if (frequencyFromConfig != 0) fQTTimeScale = frequencyFromConfig;
00626       } else {
00627         envir() << noCodecWarning1 << "Audio" << noCodecWarning2
00628                 << fOurSubsession.codecName() << noCodecWarning3;
00629         fQTMediaDataAtomCreator = &QuickTimeFileSink::addAtom_dummy;
00630         fQTEnableTrack = False; // disable this track in the movie
00631       }
00632     } else if (strcmp(fOurSubsession.mediumName(), "video") == 0) {
00633       fQTcomponentSubtype = fourChar('v','i','d','e');
00634       fQTcomponentName = "Apple Video Media Handler";
00635       fQTMediaInformationAtomCreator = &QuickTimeFileSink::addAtom_vmhd;
00636 
00637       // Make sure that our subsession's codec is one that we can handle:
00638       if (strcmp(fOurSubsession.codecName(), "X-QT") == 0 ||
00639           strcmp(fOurSubsession.codecName(), "X-QUICKTIME") == 0) {
00640         fQTMediaDataAtomCreator = &QuickTimeFileSink::addAtom_genericMedia;
00641       } else if (strcmp(fOurSubsession.codecName(), "H263-1998") == 0 ||
00642                  strcmp(fOurSubsession.codecName(), "H263-2000") == 0) {
00643         fQTMediaDataAtomCreator = &QuickTimeFileSink::addAtom_h263;
00644         fQTTimeScale = 600;
00645         fQTTimeUnitsPerSample = fQTTimeScale/fOurSink.fMovieFPS;
00646       } else if (strcmp(fOurSubsession.codecName(), "H264") == 0) {
00647         fQTMediaDataAtomCreator = &QuickTimeFileSink::addAtom_avc1;
00648         fQTTimeScale = 600;
00649         fQTTimeUnitsPerSample = fQTTimeScale/fOurSink.fMovieFPS;
00650       } else if (strcmp(fOurSubsession.codecName(), "MP4V-ES") == 0) {
00651         fQTMediaDataAtomCreator = &QuickTimeFileSink::addAtom_mp4v;
00652         fQTTimeScale = 600;
00653         fQTTimeUnitsPerSample = fQTTimeScale/fOurSink.fMovieFPS;
00654       } else {
00655         envir() << noCodecWarning1 << "Video" << noCodecWarning2
00656                 << fOurSubsession.codecName() << noCodecWarning3;
00657         fQTMediaDataAtomCreator = &QuickTimeFileSink::addAtom_dummy;
00658         fQTEnableTrack = False; // disable this track in the movie
00659       }
00660     } else {
00661       envir() << "Warning: We don't implement a QuickTime Media Handler for media type \""
00662               << fOurSubsession.mediumName() << "\"";
00663       break;
00664     }
00665 
00666 #ifdef QT_SUPPORT_PARTIALLY_ONLY
00667     envir() << "Warning: We don't have sufficient codec-specific information (e.g., sample sizes) to fully generate the \""
00668             << fOurSubsession.mediumName() << "/" << fOurSubsession.codecName()
00669             << "\" track, so we'll disable this track in the movie.  A separate, codec-specific editing pass will be needed before this track can be played\n";
00670     fQTEnableTrack = False; // disable this track in the movie
00671 #endif
00672 
00673     return True;
00674   } while (0);
00675 
00676   envir() << ", so a track for the \"" << fOurSubsession.mediumName()
00677           << "/" << fOurSubsession.codecName()
00678           << "\" subsession will not be included in the output QuickTime file\n";
00679   return False;
00680 }

void SubsessionIOState::setFinalQTstate (  ) 

Definition at line 682 of file QuickTimeFileSink.cpp.

References chunk, ChunkDescriptor::fFrameDuration, fHeadChunk, QuickTimeFileSink::fMaxTrackDurationM, ChunkDescriptor::fNextChunk, ChunkDescriptor::fNumFrames, fOurSink, fQTDurationM, fQTDurationT, fQTTimeScale, QuickTimeFileSink::movieTimeScale(), and NULL.

Referenced by QuickTimeFileSink::completeOutputFile().

00682                                         {
00683   // Compute derived parameters, by running through the list of chunks:
00684   fQTDurationT = 0;
00685 
00686   ChunkDescriptor* chunk = fHeadChunk;
00687   while (chunk != NULL) {
00688     unsigned const numFrames = chunk->fNumFrames;
00689     unsigned const dur = numFrames*chunk->fFrameDuration;
00690     fQTDurationT += dur;
00691 
00692     chunk = chunk->fNextChunk;
00693   }
00694 
00695   // Convert this duration from track to movie time scale:
00696   double scaleFactor = fOurSink.movieTimeScale()/(double)fQTTimeScale;
00697   fQTDurationM = (unsigned)(fQTDurationT*scaleFactor);
00698 
00699   if (fQTDurationM > fOurSink.fMaxTrackDurationM) {
00700     fOurSink.fMaxTrackDurationM = fQTDurationM;
00701   }
00702 }

void SubsessionIOState::afterGettingFrame ( unsigned  packetDataSize,
struct timeval  presentationTime 
)

Definition at line 704 of file QuickTimeFileSink.cpp.

References QuickTimeFileSink::addAtom_genericMedia(), SubsessionBuffer::addBytes(), SubsessionBuffer::bytesInUse(), QuickTimeFileSink::continuePlaying(), RTPSource::curPacketRTPSeqNum(), fBuffer, fLastPacketRTPSeqNum, QuickTimeFileSink::fMovieFPS, QuickTimeFileSink::fMovieHeight, QuickTimeFileSink::fMovieWidth, fourChar, fOurSink, fOurSubsession, QuickTimeFileSink::fPacketLossCompensate, fPrevBuffer, fQTBytesPerFrame, fQTMediaDataAtomCreator, fQTSamplesPerFrame, fQTTimeScale, fQTTimeUnitsPerSample, QuickTimeGenericRTPSource::QTState::height, QuickTimeGenericRTPSource::qtState, SubsessionBuffer::reset(), MediaSubsession::rtpSource(), QuickTimeGenericRTPSource::QTState::sdAtom, QuickTimeGenericRTPSource::QTState::sdAtomSize, SubsessionBuffer::setPresentationTime(), QuickTimeGenericRTPSource::QTState::timescale, useFrame(), and QuickTimeGenericRTPSource::QTState::width.

Referenced by QuickTimeFileSink::afterGettingFrame().

00705                                                                            {
00706   // Begin by checking whether there was a gap in the RTP stream.
00707   // If so, try to compensate for this (if desired):
00708   unsigned short rtpSeqNum
00709     = fOurSubsession.rtpSource()->curPacketRTPSeqNum();
00710   if (fOurSink.fPacketLossCompensate && fPrevBuffer->bytesInUse() > 0) {
00711     short seqNumGap = rtpSeqNum - fLastPacketRTPSeqNum;
00712     for (short i = 1; i < seqNumGap; ++i) {
00713       // Insert a copy of the previous frame, to compensate for the loss:
00714       useFrame(*fPrevBuffer);
00715     }
00716   }
00717   fLastPacketRTPSeqNum = rtpSeqNum;
00718 
00719   // Now, continue working with the frame that we just got
00720   if (fBuffer->bytesInUse() == 0) {
00721     fBuffer->setPresentationTime(presentationTime);
00722   }
00723   fBuffer->addBytes(packetDataSize);
00724 
00725   // If our RTP source is a "QuickTimeGenericRTPSource", then
00726   // use its 'qtState' to set some parameters that we need:
00727   if (fQTMediaDataAtomCreator == &QuickTimeFileSink::addAtom_genericMedia){
00728     QuickTimeGenericRTPSource* rtpSource
00729       = (QuickTimeGenericRTPSource*)fOurSubsession.rtpSource();
00730     QuickTimeGenericRTPSource::QTState& qtState = rtpSource->qtState;
00731     fQTTimeScale = qtState.timescale;
00732     if (qtState.width != 0) {
00733       fOurSink.fMovieWidth = qtState.width;
00734     }
00735     if (qtState.height != 0) {
00736       fOurSink.fMovieHeight = qtState.height;
00737     }
00738 
00739     // Also, if the media type in the "sdAtom" is one that we recognize
00740     // to have a special parameters, then fix this here:
00741     if (qtState.sdAtomSize >= 8) {
00742       char const* atom = qtState.sdAtom;
00743       unsigned mediaType = fourChar(atom[4],atom[5],atom[6],atom[7]);
00744       switch (mediaType) {
00745       case fourChar('a','g','s','m'): {
00746         fQTBytesPerFrame = 33;
00747         fQTSamplesPerFrame = 160;
00748         break;
00749       }
00750       case fourChar('Q','c','l','p'): {
00751         fQTBytesPerFrame = 35;
00752         fQTSamplesPerFrame = 160;
00753         break;
00754       }
00755       case fourChar('H','c','l','p'): {
00756         fQTBytesPerFrame = 17;
00757         fQTSamplesPerFrame = 160;
00758         break;
00759       }
00760       case fourChar('h','2','6','3'): {
00761         fQTTimeUnitsPerSample = fQTTimeScale/fOurSink.fMovieFPS;
00762         break;
00763       }
00764       }
00765     }
00766   } else if (fQTMediaDataAtomCreator == &QuickTimeFileSink::addAtom_Qclp) {
00767     // For QCELP data, make a note of the frame size (even though it's the
00768     // same as the packet data size), because it varies depending on the
00769     // 'rate' of the stream, and this size gets used later when setting up
00770     // the 'Qclp' QuickTime atom:
00771     fQTBytesPerFrame = packetDataSize;
00772   }
00773 
00774   useFrame(*fBuffer);
00775   if (fOurSink.fPacketLossCompensate) {
00776     // Save this frame, in case we need it for recovery:
00777     SubsessionBuffer* tmp = fPrevBuffer; // assert: != NULL
00778     fPrevBuffer = fBuffer;
00779     fBuffer = tmp;
00780   }
00781   fBuffer->reset(); // for the next input
00782 
00783   // Now, try getting more frames:
00784   fOurSink.continuePlaying();
00785 }

void SubsessionIOState::onSourceClosure (  ) 

Definition at line 1090 of file QuickTimeFileSink.cpp.

References False, fOurSink, fOurSourceIsActive, and QuickTimeFileSink::onSourceClosure1().

Referenced by QuickTimeFileSink::onRTCPBye(), and QuickTimeFileSink::onSourceClosure().

01090                                         {
01091   fOurSourceIsActive = False;
01092   fOurSink.onSourceClosure1();
01093 }

Boolean SubsessionIOState::syncOK ( struct timeval  presentationTime  ) 

Definition at line 1095 of file QuickTimeFileSink.cpp.

References SubsessionBuffer::dataStart(), False, fBuffer, fHaveBeenSynced, QuickTimeFileSink::fNumSubsessions, QuickTimeFileSink::fNumSyncedSubsessions, fOurSink, fOurSubsession, fQTMediaDataAtomCreator, QuickTimeFileSink::fSyncStreams, fSyncTime, H264_IDR_FRAME, RTPSource::hasBeenSynchronizedUsingRTCP(), MediaSubsession::rtpSource(), timevalGE(), and True.

Referenced by QuickTimeFileSink::afterGettingFrame().

01095                                                                  {
01096   QuickTimeFileSink& s = fOurSink; // abbreviation
01097   if (!s.fSyncStreams) return True; // we don't care
01098 
01099   if (s.fNumSyncedSubsessions < s.fNumSubsessions) {
01100     // Not all subsessions have yet been synced.  Check whether ours was
01101     // one of the unsynced ones, and, if so, whether it is now synced:
01102     if (!fHaveBeenSynced) {
01103       // We weren't synchronized before
01104       if (fOurSubsession.rtpSource()->hasBeenSynchronizedUsingRTCP()) {
01105         // H264 ?
01106         if (fQTMediaDataAtomCreator == &QuickTimeFileSink::addAtom_avc1) {
01107           // special case: audio + H264 video: wait until audio is in sync
01108           if ((s.fNumSubsessions == 2) && (s.fNumSyncedSubsessions < (s.fNumSubsessions - 1))) return False;
01109 
01110           // if audio is in sync, wait for the next IDR frame to start
01111           unsigned char* const frameSource = fBuffer->dataStart();
01112           if (*frameSource != H264_IDR_FRAME) return False;
01113         }
01114         // But now we are
01115         fHaveBeenSynced = True;
01116         fSyncTime = presentationTime;
01117         ++s.fNumSyncedSubsessions;
01118 
01119         if (timevalGE(fSyncTime, s.fNewestSyncTime)) {
01120           s.fNewestSyncTime = fSyncTime;
01121         }
01122       }
01123     }
01124   }
01125 
01126   // Check again whether all subsessions have been synced:
01127   if (s.fNumSyncedSubsessions < s.fNumSubsessions) return False;
01128 
01129   // Allow this data if it is more recent than the newest sync time:
01130   return timevalGE(presentationTime, s.fNewestSyncTime);
01131 }

void SubsessionIOState::setHintTrack ( SubsessionIOState hintedTrack,
SubsessionIOState hintTrack 
) [static]

Definition at line 1133 of file QuickTimeFileSink.cpp.

References fHintTrackForUs, fTrackHintedByUs, hintedTrack, and NULL.

Referenced by QuickTimeFileSink::QuickTimeFileSink().

01134                                                                    {
01135   if (hintedTrack != NULL) hintedTrack->fHintTrackForUs = hintTrack;
01136   if (hintTrack != NULL) hintTrack->fTrackHintedByUs = hintedTrack;
01137 }

Boolean SubsessionIOState::isHintTrack (  )  const [inline]

Definition at line 126 of file QuickTimeFileSink.cpp.

References fTrackHintedByUs, and NULL.

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

00126 { return fTrackHintedByUs != NULL; }

Boolean SubsessionIOState::hasHintTrack (  )  const [inline]

Definition at line 127 of file QuickTimeFileSink.cpp.

References fHintTrackForUs, and NULL.

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

00127 { return fHintTrackForUs != NULL; }

UsageEnvironment& SubsessionIOState::envir (  )  const [inline]

Definition at line 129 of file QuickTimeFileSink.cpp.

References Medium::envir(), and fOurSink.

Referenced by QuickTimeFileSink::afterGettingFrame(), QuickTimeFileSink::onRTCPBye(), setQTstate(), and useFrameForHinting().

00129 { return fOurSink.envir(); }

void SubsessionIOState::useFrame ( SubsessionBuffer buffer  )  [private]

Definition at line 787 of file QuickTimeFileSink.cpp.

References QuickTimeFileSink::addWord(), SubsessionBuffer::bytesInUse(), SubsessionBuffer::dataStart(), destFileOffset, duration, fHaveBeenSynced, fHeadSyncFrame, fHintTrackForUs, fourChar, fOurSink, fOurSubsession, QuickTimeFileSink::fOutFid, fPrevFrameState, fQTcomponentSubtype, fQTMediaDataAtomCreator, fQTSamplesPerFrame, fQTTimeScale, fQTTimeUnitsPerSample, fQTTotNumSamples, frameSize, QuickTimeFileSink::fSyncStreams, fTailSyncFrame, H264_IDR_FRAME, RTPSource::hasBeenSynchronizedUsingRTCP(), hasHintTrack(), SyncFrame::nextSyncFrame, NULL, SubsessionBuffer::presentationTime(), presentationTime, MediaSubsession::rtpSource(), TellFile64(), useFrame1(), and useFrameForHinting().

Referenced by afterGettingFrame().

00787                                                          {
00788   unsigned char* const frameSource = buffer.dataStart();
00789   unsigned const frameSize = buffer.bytesInUse();
00790   struct timeval const& presentationTime = buffer.presentationTime();
00791   int64_t const destFileOffset = TellFile64(fOurSink.fOutFid);
00792   unsigned sampleNumberOfFrameStart = fQTTotNumSamples + 1;
00793   Boolean avcHack = fQTMediaDataAtomCreator == &QuickTimeFileSink::addAtom_avc1;
00794 
00795   // If we're not syncing streams, or this subsession is not video, then
00796   // just give this frame a fixed duration:
00797   if (!fOurSink.fSyncStreams
00798       || fQTcomponentSubtype != fourChar('v','i','d','e')) {
00799     unsigned const frameDuration = fQTTimeUnitsPerSample*fQTSamplesPerFrame;
00800     unsigned frameSizeToUse = frameSize;
00801     if (avcHack) frameSizeToUse += 4; // H.264/AVC gets the frame size prefix
00802 
00803     fQTTotNumSamples += useFrame1(frameSizeToUse, presentationTime, frameDuration, destFileOffset);
00804   } else {
00805     // For synced video streams, we use the difference between successive
00806     // frames' presentation times as the 'frame duration'.  So, record
00807     // information about the *previous* frame:
00808     struct timeval const& ppt = fPrevFrameState.presentationTime; //abbrev
00809     if (ppt.tv_sec != 0 || ppt.tv_usec != 0) {
00810       // There has been a previous frame.
00811       double duration = (presentationTime.tv_sec - ppt.tv_sec)
00812         + (presentationTime.tv_usec - ppt.tv_usec)/1000000.0;
00813       if (duration < 0.0) duration = 0.0;
00814       unsigned frameDuration
00815         = (unsigned)((2*duration*fQTTimeScale+1)/2); // round
00816       unsigned frameSizeToUse = fPrevFrameState.frameSize;
00817       if (avcHack) frameSizeToUse += 4; // H.264/AVC gets the frame size prefix
00818 
00819       unsigned numSamples
00820         = useFrame1(frameSizeToUse, ppt, frameDuration, fPrevFrameState.destFileOffset);
00821       fQTTotNumSamples += numSamples;
00822       sampleNumberOfFrameStart = fQTTotNumSamples + 1;
00823     }
00824 
00825     if (avcHack && (*frameSource == H264_IDR_FRAME)) {
00826       SyncFrame* newSyncFrame = new SyncFrame(fQTTotNumSamples + 1);
00827       if (fTailSyncFrame == NULL) {
00828         fHeadSyncFrame = newSyncFrame;
00829       } else {
00830         fTailSyncFrame->nextSyncFrame = newSyncFrame;
00831       }
00832       fTailSyncFrame = newSyncFrame;
00833     }
00834 
00835     // Remember the current frame for next time:
00836     fPrevFrameState.frameSize = frameSize;
00837     fPrevFrameState.presentationTime = presentationTime;
00838     fPrevFrameState.destFileOffset = destFileOffset;
00839   }
00840 
00841   if (avcHack) fOurSink.addWord(frameSize);
00842 
00843   // Write the data into the file:
00844   fwrite(frameSource, 1, frameSize, fOurSink.fOutFid);
00845 
00846   // If we have a hint track, then write to it also:
00847   if (hasHintTrack()) {
00848     // Because presentation times are used for RTP packet timestamps,
00849     // we don't starting writing to the hint track until we've been synced:
00850     if (!fHaveBeenSynced) {
00851       fHaveBeenSynced
00852         = fOurSubsession.rtpSource()->hasBeenSynchronizedUsingRTCP();
00853     }
00854     if (fHaveBeenSynced) {
00855       fHintTrackForUs->useFrameForHinting(frameSize, presentationTime,
00856                                           sampleNumberOfFrameStart);
00857     }
00858   }
00859 }

void SubsessionIOState::useFrameForHinting ( unsigned  frameSize,
struct timeval  presentationTime,
unsigned  startSampleNumber 
) [private]

Definition at line 861 of file QuickTimeFileSink.cpp.

References QuickTimeFileSink::addByte(), QuickTimeFileSink::addHalfWord(), QuickTimeFileSink::addWord(), MediaSubsession::attrVal_unsigned(), MediaSubsession::codecName(), RTPSource::curPacketMarkerBit(), SubsessionIOState::hinf::dimm, SubsessionIOState::hinf::dmax, SubsessionIOState::hinf::dmed, duration, envir(), fHINF, H263plusVideoRTPSource::fNumSpecialHeaders, fOurSink, fOurSubsession, QuickTimeFileSink::fOutFid, H263plusVideoRTPSource::fPacketSizes, fPrevFrameState, fQTBytesPerFrame, fQTSamplesPerFrame, fQTTimeScale, fQTTimeUnitsPerSample, fQTTotNumSamples, H263plusVideoRTPSource::fSpecialHeaderBytes, H263plusVideoRTPSource::fSpecialHeaderBytesLength, fTrackHintedByUs, if(), maxPacketSize, MediaSubsession::mediumName(), NULL, SubsessionIOState::hinf::nump, SubsessionIOState::hinf::pmax, rtpHeader, RTPSource::rtpPayloadFormat(), MediaSubsession::rtpSource(), MediaSubsession::rtpTimestampFrequency(), seqNum, TellFile64(), SubsessionIOState::hinf::tpyl, SubsessionIOState::hinf::trpy, and useFrame1().

Referenced by useFrame().

00863                                                                        {
00864   // At this point, we have a single, combined frame - not individual packets.
00865   // For the hint track, we need to split the frame back up into separate packets.
00866   // However, for some RTP sources, then we also need to reuse the special
00867   // header bytes that were at the start of each of the RTP packets.
00868   Boolean hack263 = strcmp(fOurSubsession.codecName(), "H263-1998") == 0;
00869   Boolean hackm4a_generic = strcmp(fOurSubsession.mediumName(), "audio") == 0
00870     && strcmp(fOurSubsession.codecName(), "MPEG4-GENERIC") == 0;
00871   Boolean hackm4a_latm = strcmp(fOurSubsession.mediumName(), "audio") == 0
00872     && strcmp(fOurSubsession.codecName(), "MP4A-LATM") == 0;
00873   Boolean hackm4a = hackm4a_generic || hackm4a_latm;
00874   Boolean haveSpecialHeaders = (hack263 || hackm4a_generic);
00875 
00876   // If there has been a previous frame, then output a 'hint sample' for it.
00877   // (We use the current frame's presentation time to compute the previous
00878   // hint sample's duration.)
00879   RTPSource* const rs = fOurSubsession.rtpSource(); // abbrev
00880   struct timeval const& ppt = fPrevFrameState.presentationTime; //abbrev
00881   if (ppt.tv_sec != 0 || ppt.tv_usec != 0) {
00882     double duration = (presentationTime.tv_sec - ppt.tv_sec)
00883       + (presentationTime.tv_usec - ppt.tv_usec)/1000000.0;
00884     if (duration < 0.0) duration = 0.0;
00885     unsigned msDuration = (unsigned)(duration*1000); // milliseconds
00886     if (msDuration > fHINF.dmax) fHINF.dmax = msDuration;
00887     unsigned hintSampleDuration
00888       = (unsigned)((2*duration*fQTTimeScale+1)/2); // round
00889     if (hackm4a) {
00890       // Because multiple AAC frames can appear in a RTP packet, the presentation
00891       // times of the second and subsequent frames will not be accurate.
00892       // So, use the known "hintSampleDuration" instead:
00893       hintSampleDuration = fTrackHintedByUs->fQTTimeUnitsPerSample;
00894 
00895       // Also, if the 'time scale' was different from the RTP timestamp frequency,
00896       // (as can happen with aacPlus), then we need to scale "hintSampleDuration"
00897       // accordingly:
00898       if (fTrackHintedByUs->fQTTimeScale != fOurSubsession.rtpTimestampFrequency()) {
00899         unsigned const scalingFactor
00900           = fOurSubsession.rtpTimestampFrequency()/fTrackHintedByUs->fQTTimeScale ;
00901         hintSampleDuration *= scalingFactor;
00902       }
00903     }
00904 
00905     int64_t const hintSampleDestFileOffset = TellFile64(fOurSink.fOutFid);
00906 
00907     unsigned const maxPacketSize = 1450;
00908     unsigned short numPTEntries
00909       = (fPrevFrameState.frameSize + (maxPacketSize-1))/maxPacketSize; // normal case
00910     unsigned char* immediateDataPtr = NULL;
00911     unsigned immediateDataBytesRemaining = 0;
00912     if (haveSpecialHeaders) { // special case
00913       numPTEntries = fPrevFrameState.numSpecialHeaders;
00914       immediateDataPtr = fPrevFrameState.specialHeaderBytes;
00915       immediateDataBytesRemaining
00916         = fPrevFrameState.specialHeaderBytesLength;
00917     }
00918     unsigned hintSampleSize
00919       = fOurSink.addHalfWord(numPTEntries);// Entry count
00920     hintSampleSize += fOurSink.addHalfWord(0x0000); // Reserved
00921 
00922     unsigned offsetWithinSample = 0;
00923     for (unsigned i = 0; i < numPTEntries; ++i) {
00924       // Output a Packet Table entry (representing a single RTP packet):
00925       unsigned short numDTEntries = 1;
00926       unsigned short seqNum = fPrevFrameState.seqNum++;
00927           // Note: This assumes that the input stream had no packets lost #####
00928       unsigned rtpHeader = fPrevFrameState.rtpHeader;
00929       if (i+1 < numPTEntries) {
00930         // This is not the last RTP packet, so clear the marker bit:
00931         rtpHeader &=~ (1<<23);
00932       }
00933       unsigned dataFrameSize = (i+1 < numPTEntries)
00934         ? maxPacketSize : fPrevFrameState.frameSize - i*maxPacketSize; // normal case
00935       unsigned sampleNumber = fPrevFrameState.startSampleNumber;
00936 
00937       unsigned char immediateDataLen = 0;
00938       if (haveSpecialHeaders) { // special case
00939         ++numDTEntries; // to include a Data Table entry for the special hdr
00940         if (immediateDataBytesRemaining > 0) {
00941           if (hack263) {
00942             immediateDataLen = *immediateDataPtr++;
00943             --immediateDataBytesRemaining;
00944             if (immediateDataLen > immediateDataBytesRemaining) {
00945               // shouldn't happen (length byte was bad)
00946               immediateDataLen = immediateDataBytesRemaining;
00947             }
00948           } else {
00949             immediateDataLen = fPrevFrameState.specialHeaderBytesLength;
00950           }
00951         }
00952         dataFrameSize = fPrevFrameState.packetSizes[i] - immediateDataLen;
00953 
00954         if (hack263) {
00955           Boolean PbitSet
00956             = immediateDataLen >= 1 && (immediateDataPtr[0]&0x4) != 0;
00957           if (PbitSet) {
00958             offsetWithinSample += 2; // to omit the two leading 0 bytes
00959           }
00960         }
00961       }
00962 
00963       // Output the Packet Table:
00964       hintSampleSize += fOurSink.addWord(0); // Relative transmission time
00965       hintSampleSize += fOurSink.addWord(rtpHeader|seqNum);
00966           // RTP header info + RTP sequence number
00967       hintSampleSize += fOurSink.addHalfWord(0x0000); // Flags
00968       hintSampleSize += fOurSink.addHalfWord(numDTEntries); // Entry count
00969       unsigned totalPacketSize = 0;
00970 
00971       // Output the Data Table:
00972       if (haveSpecialHeaders) {
00973         //   use the "Immediate Data" format (1):
00974         hintSampleSize += fOurSink.addByte(1); // Source
00975         unsigned char len = immediateDataLen > 14 ? 14 : immediateDataLen;
00976         hintSampleSize += fOurSink.addByte(len); // Length
00977         totalPacketSize += len; fHINF.dimm += len;
00978         unsigned char j;
00979         for (j = 0; j < len; ++j) {
00980           hintSampleSize += fOurSink.addByte(immediateDataPtr[j]); // Data
00981         }
00982         for (j = len; j < 14; ++j) {
00983           hintSampleSize += fOurSink.addByte(0); // Data (padding)
00984         }
00985 
00986         immediateDataPtr += immediateDataLen;
00987         immediateDataBytesRemaining -= immediateDataLen;
00988       }
00989       //   use the "Sample Data" format (2):
00990       hintSampleSize += fOurSink.addByte(2); // Source
00991       hintSampleSize += fOurSink.addByte(0); // Track ref index
00992       hintSampleSize += fOurSink.addHalfWord(dataFrameSize); // Length
00993       totalPacketSize += dataFrameSize; fHINF.dmed += dataFrameSize;
00994       hintSampleSize += fOurSink.addWord(sampleNumber); // Sample number
00995       hintSampleSize += fOurSink.addWord(offsetWithinSample); // Offset
00996       // Get "bytes|samples per compression block" from the hinted track:
00997       unsigned short const bytesPerCompressionBlock
00998         = fTrackHintedByUs->fQTBytesPerFrame;
00999       unsigned short const samplesPerCompressionBlock
01000         = fTrackHintedByUs->fQTSamplesPerFrame;
01001       hintSampleSize += fOurSink.addHalfWord(bytesPerCompressionBlock);
01002       hintSampleSize += fOurSink.addHalfWord(samplesPerCompressionBlock);
01003 
01004       offsetWithinSample += dataFrameSize;// for the next iteration (if any)
01005 
01006       // Tally statistics for this packet:
01007       fHINF.nump += 1;
01008       fHINF.tpyl += totalPacketSize;
01009       totalPacketSize += 12; // add in the size of the RTP header
01010       fHINF.trpy += totalPacketSize;
01011       if (totalPacketSize > fHINF.pmax) fHINF.pmax = totalPacketSize;
01012     }
01013 
01014     // Make note of this completed hint sample frame:
01015     fQTTotNumSamples += useFrame1(hintSampleSize, ppt, hintSampleDuration,
01016                                   hintSampleDestFileOffset);
01017   }
01018 
01019   // Remember this frame for next time:
01020   fPrevFrameState.frameSize = frameSize;
01021   fPrevFrameState.presentationTime = presentationTime;
01022   fPrevFrameState.startSampleNumber = startSampleNumber;
01023   fPrevFrameState.rtpHeader
01024     = rs->curPacketMarkerBit()<<23
01025     | (rs->rtpPayloadFormat()&0x7F)<<16;
01026   if (hack263) {
01027     H263plusVideoRTPSource* rs_263 = (H263plusVideoRTPSource*)rs;
01028     fPrevFrameState.numSpecialHeaders = rs_263->fNumSpecialHeaders;
01029     fPrevFrameState.specialHeaderBytesLength = rs_263->fSpecialHeaderBytesLength;
01030     unsigned i;
01031     for (i = 0; i < rs_263->fSpecialHeaderBytesLength; ++i) {
01032       fPrevFrameState.specialHeaderBytes[i] = rs_263->fSpecialHeaderBytes[i];
01033     }
01034     for (i = 0; i < rs_263->fNumSpecialHeaders; ++i) {
01035       fPrevFrameState.packetSizes[i] = rs_263->fPacketSizes[i];
01036     }
01037   } else if (hackm4a_generic) {
01038     // Synthesize a special header, so that this frame can be in its own RTP packet.
01039     unsigned const sizeLength = fOurSubsession.attrVal_unsigned("sizelength");
01040     unsigned const indexLength = fOurSubsession.attrVal_unsigned("indexlength");
01041     if (sizeLength + indexLength != 16) {
01042       envir() << "Warning: unexpected 'sizeLength' " << sizeLength
01043               << " and 'indexLength' " << indexLength
01044               << "seen when creating hint track\n";
01045     }
01046     fPrevFrameState.numSpecialHeaders = 1;
01047     fPrevFrameState.specialHeaderBytesLength = 4;
01048     fPrevFrameState.specialHeaderBytes[0] = 0; // AU_headers_length (high byte)
01049     fPrevFrameState.specialHeaderBytes[1] = 16; // AU_headers_length (low byte)
01050     fPrevFrameState.specialHeaderBytes[2] = ((frameSize<<indexLength)&0xFF00)>>8;
01051     fPrevFrameState.specialHeaderBytes[3] = (frameSize<<indexLength);
01052     fPrevFrameState.packetSizes[0]
01053       = fPrevFrameState.specialHeaderBytesLength + frameSize;
01054   }
01055 }

unsigned SubsessionIOState::useFrame1 ( unsigned  sourceDataSize,
struct timeval  presentationTime,
unsigned  frameDuration,
int64_t  destFileOffset 
) [private]

Definition at line 1057 of file QuickTimeFileSink.cpp.

References ChunkDescriptor::extendChunk(), fHeadChunk, fNumChunks, fQTBytesPerFrame, fQTSamplesPerFrame, frameSize, fTailChunk, and NULL.

Referenced by useFrame(), and useFrameForHinting().

01060                                                               {
01061   // Figure out the actual frame size for this data:
01062   unsigned frameSize = fQTBytesPerFrame;
01063   if (frameSize == 0) {
01064     // The entire packet data is assumed to be a frame:
01065     frameSize = sourceDataSize;
01066   }
01067   unsigned const numFrames = sourceDataSize/frameSize;
01068   unsigned const numSamples = numFrames*fQTSamplesPerFrame;
01069 
01070   // Record the information about which 'chunk' this data belongs to:
01071   ChunkDescriptor* newTailChunk;
01072   if (fTailChunk == NULL) {
01073     newTailChunk = fHeadChunk
01074       = new ChunkDescriptor(destFileOffset, sourceDataSize,
01075                             frameSize, frameDuration, presentationTime);
01076   } else {
01077     newTailChunk = fTailChunk->extendChunk(destFileOffset, sourceDataSize,
01078                                            frameSize, frameDuration,
01079                                            presentationTime);
01080   }
01081   if (newTailChunk != fTailChunk) {
01082    // This data created a new chunk, rather than extending the old one
01083     ++fNumChunks;
01084     fTailChunk = newTailChunk;
01085   }
01086 
01087   return numSamples;
01088 }


Field Documentation

unsigned SubsessionIOState::fCurrentTrackNumber = 0 [static]

Definition at line 132 of file QuickTimeFileSink.cpp.

Referenced by SubsessionIOState().

unsigned SubsessionIOState::fTrackID

Definition at line 133 of file QuickTimeFileSink.cpp.

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

SubsessionIOState* SubsessionIOState::fHintTrackForUs

Definition at line 134 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::completeOutputFile(), hasHintTrack(), setHintTrack(), useFrame(), while(), and QuickTimeFileSink::~QuickTimeFileSink().

SubsessionIOState* SubsessionIOState::fTrackHintedByUs

Definition at line 134 of file QuickTimeFileSink.cpp.

Referenced by isHintTrack(), setHintTrack(), and useFrameForHinting().

SubsessionBuffer* SubsessionIOState::fBuffer

Definition at line 136 of file QuickTimeFileSink.cpp.

Referenced by afterGettingFrame(), QuickTimeFileSink::continuePlaying(), SubsessionIOState(), syncOK(), and ~SubsessionIOState().

SubsessionBuffer * SubsessionIOState::fPrevBuffer

Definition at line 136 of file QuickTimeFileSink.cpp.

Referenced by afterGettingFrame(), SubsessionIOState(), and ~SubsessionIOState().

QuickTimeFileSink& SubsessionIOState::fOurSink

Definition at line 137 of file QuickTimeFileSink.cpp.

Referenced by afterGettingFrame(), QuickTimeFileSink::afterGettingFrame(), envir(), QuickTimeFileSink::onRTCPBye(), onSourceClosure(), setFinalQTstate(), setQTstate(), SubsessionIOState(), syncOK(), useFrame(), and useFrameForHinting().

MediaSubsession& SubsessionIOState::fOurSubsession

Definition at line 138 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), afterGettingFrame(), QuickTimeFileSink::onRTCPBye(), setQTstate(), syncOK(), useFrame(), useFrameForHinting(), and while().

unsigned short SubsessionIOState::fLastPacketRTPSeqNum

Definition at line 140 of file QuickTimeFileSink.cpp.

Referenced by afterGettingFrame().

Boolean SubsessionIOState::fOurSourceIsActive

Definition at line 141 of file QuickTimeFileSink.cpp.

Referenced by onSourceClosure(), QuickTimeFileSink::onSourceClosure1(), and SubsessionIOState().

Boolean SubsessionIOState::fHaveBeenSynced

Definition at line 143 of file QuickTimeFileSink.cpp.

Referenced by syncOK(), and useFrame().

struct timeval SubsessionIOState::fSyncTime [read]

Definition at line 144 of file QuickTimeFileSink.cpp.

Referenced by syncOK().

Boolean SubsessionIOState::fQTEnableTrack

Definition at line 146 of file QuickTimeFileSink.cpp.

Referenced by setQTstate().

unsigned SubsessionIOState::fQTcomponentSubtype

Definition at line 147 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), setQTstate(), and useFrame().

char const* SubsessionIOState::fQTcomponentName

Definition at line 148 of file QuickTimeFileSink.cpp.

Referenced by setQTstate().

atomCreationFunc SubsessionIOState::fQTMediaInformationAtomCreator

Definition at line 150 of file QuickTimeFileSink.cpp.

Referenced by setQTstate().

atomCreationFunc SubsessionIOState::fQTMediaDataAtomCreator

Definition at line 151 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), afterGettingFrame(), setQTstate(), syncOK(), and useFrame().

char const* SubsessionIOState::fQTAudioDataType

Definition at line 152 of file QuickTimeFileSink.cpp.

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

unsigned short SubsessionIOState::fQTSoundSampleVersion

Definition at line 153 of file QuickTimeFileSink.cpp.

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

unsigned SubsessionIOState::fQTTimeScale

Definition at line 154 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), afterGettingFrame(), if(), setFinalQTstate(), setQTstate(), useFrame(), useFrameForHinting(), and while().

unsigned SubsessionIOState::fQTTimeUnitsPerSample

Definition at line 155 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), afterGettingFrame(), setQTstate(), useFrame(), and useFrameForHinting().

unsigned SubsessionIOState::fQTBytesPerFrame

Definition at line 156 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), afterGettingFrame(), setQTstate(), useFrame1(), and useFrameForHinting().

unsigned SubsessionIOState::fQTSamplesPerFrame

Definition at line 157 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), afterGettingFrame(), setQTstate(), useFrame(), useFrame1(), and useFrameForHinting().

unsigned SubsessionIOState::fQTTotNumSamples

Definition at line 160 of file QuickTimeFileSink.cpp.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), useFrame(), and useFrameForHinting().

unsigned SubsessionIOState::fQTDurationM

Definition at line 161 of file QuickTimeFileSink.cpp.

Referenced by if(), and setFinalQTstate().

unsigned SubsessionIOState::fQTDurationT

Definition at line 162 of file QuickTimeFileSink.cpp.

Referenced by if(), and setFinalQTstate().

int64_t SubsessionIOState::fTKHD_durationPosn

Definition at line 163 of file QuickTimeFileSink.cpp.

Referenced by if().

unsigned SubsessionIOState::fQTInitialOffsetDuration

Definition at line 165 of file QuickTimeFileSink.cpp.

ChunkDescriptor* SubsessionIOState::fHeadChunk

Definition at line 168 of file QuickTimeFileSink.cpp.

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

ChunkDescriptor * SubsessionIOState::fTailChunk

Definition at line 168 of file QuickTimeFileSink.cpp.

Referenced by useFrame1().

unsigned SubsessionIOState::fNumChunks

Definition at line 169 of file QuickTimeFileSink.cpp.

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

SyncFrame* SubsessionIOState::fHeadSyncFrame

Definition at line 170 of file QuickTimeFileSink.cpp.

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

SyncFrame * SubsessionIOState::fTailSyncFrame

Definition at line 170 of file QuickTimeFileSink.cpp.

Referenced by useFrame().

struct SubsessionIOState::hinf SubsessionIOState::fHINF

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

unsigned SubsessionIOState::frameSize

Definition at line 201 of file QuickTimeFileSink.cpp.

Referenced by useFrame(), and useFrame1().

struct timeval SubsessionIOState::presentationTime [read]

Definition at line 202 of file QuickTimeFileSink.cpp.

Referenced by useFrame().

int64_t SubsessionIOState::destFileOffset

Definition at line 203 of file QuickTimeFileSink.cpp.

Referenced by useFrame().

unsigned SubsessionIOState::startSampleNumber

Definition at line 206 of file QuickTimeFileSink.cpp.

unsigned short SubsessionIOState::seqNum

Definition at line 207 of file QuickTimeFileSink.cpp.

Referenced by useFrameForHinting().

unsigned SubsessionIOState::rtpHeader

Definition at line 208 of file QuickTimeFileSink.cpp.

Referenced by useFrameForHinting().

unsigned char SubsessionIOState::numSpecialHeaders

Definition at line 209 of file QuickTimeFileSink.cpp.

unsigned SubsessionIOState::specialHeaderBytesLength

Definition at line 210 of file QuickTimeFileSink.cpp.

unsigned char SubsessionIOState::specialHeaderBytes[SPECIAL_HEADER_BUFFER_SIZE]

Definition at line 211 of file QuickTimeFileSink.cpp.

unsigned SubsessionIOState::packetSizes[256]

Definition at line 212 of file QuickTimeFileSink.cpp.

struct { ... } SubsessionIOState::fPrevFrameState [private]

Referenced by SubsessionIOState(), useFrame(), and useFrameForHinting().


The documentation for this class was generated from the following file:
Generated on Tue Mar 25 14:40:57 2014 for live by  doxygen 1.5.2