AVIFileSink Class Reference

#include <AVIFileSink.hh>

Inheritance diagram for AVIFileSink:

Inheritance graph
[legend]
Collaboration diagram for AVIFileSink:

Collaboration graph
[legend]

Public Types

typedef void( afterPlayingFunc )(void *clientData)

Public Member Functions

Boolean startPlaying (afterPlayingFunc *afterFunc, void *afterClientData)
unsigned numActiveSubsessions () const
UsageEnvironmentenvir () const
char const * name () const
virtual Boolean isSource () const
virtual Boolean isSink () const
virtual Boolean isRTCPInstance () const
virtual Boolean isRTSPClient () const
virtual Boolean isRTSPServer () const
virtual Boolean isMediaSession () const
virtual Boolean isServerMediaSession () const
virtual Boolean isDarwinInjector () const

Static Public Member Functions

static AVIFileSinkcreateNew (UsageEnvironment &env, MediaSession &inputSession, char const *outputFileName, unsigned bufferSize=20000, unsigned short movieWidth=240, unsigned short movieHeight=180, unsigned movieFPS=15, Boolean packetLossCompensate=False)
static Boolean lookupByName (UsageEnvironment &env, char const *mediumName, Medium *&resultMedium)
static void close (UsageEnvironment &env, char const *mediumName)
static void close (Medium *medium)

Protected Member Functions

TaskTokennextTask ()

Private Member Functions

 AVIFileSink (UsageEnvironment &env, MediaSession &inputSession, char const *outputFileName, unsigned bufferSize, unsigned short movieWidth, unsigned short movieHeight, unsigned movieFPS, Boolean packetLossCompensate)
virtual ~AVIFileSink ()
Boolean continuePlaying ()
void onSourceClosure1 ()
void addIndexRecord (class AVIIndexRecord *newIndexRecord)
void completeOutputFile ()
unsigned addWord (unsigned word)
unsigned addHalfWord (unsigned short halfWord)
unsigned addByte (unsigned char byte)
unsigned addZeroWords (unsigned numWords)
unsigned add4ByteString (char const *str)
void setWord (unsigned filePosn, unsigned size)
 _header (AVI)
 _header (hdrl)
 _header (avih)
 _header (strl)
 _header (strh)
 _header (strf)
 _header (JUNK)
 _header (movi)

Static Private Member Functions

static void afterGettingFrame (void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
static void onSourceClosure (void *clientData)
static void onRTCPBye (void *clientData)

Private Attributes

MediaSessionfInputSession
FILE * fOutFid
AVIIndexRecordfIndexRecordsHead
AVIIndexRecordfIndexRecordsTail
unsigned fNumIndexRecords
unsigned fBufferSize
Boolean fPacketLossCompensate
Boolean fAreCurrentlyBeingPlayed
afterPlayingFuncfAfterFunc
void * fAfterClientData
unsigned fNumSubsessions
unsigned fNumBytesWritten
timeval fStartTime
Boolean fHaveCompletedOutputFile
unsigned short fMovieWidth
unsigned short fMovieHeight
unsigned fMovieFPS
unsigned fRIFFSizePosition
unsigned fRIFFSizeValue
unsigned fAVIHMaxBytesPerSecondPosition
unsigned fAVIHFrameCountPosition
unsigned fMoviSizePosition
unsigned fMoviSizeValue
AVISubsessionIOStatefCurrentIOState
unsigned fJunkNumber

Friends

class AVISubsessionIOState
class MediaLookupTable

Detailed Description

Definition at line 28 of file AVIFileSink.hh.


Member Typedef Documentation

typedef void( AVIFileSink::afterPlayingFunc)(void *clientData)

Definition at line 39 of file AVIFileSink.hh.


Constructor & Destructor Documentation

AVIFileSink::AVIFileSink ( UsageEnvironment env,
MediaSession inputSession,
char const *  outputFileName,
unsigned  bufferSize,
unsigned short  movieWidth,
unsigned short  movieHeight,
unsigned  movieFPS,
Boolean  packetLossCompensate 
) [private]

Definition at line 123 of file AVIFileSink.cpp.

References AVISubsessionIOState, env, fInputSession, fMovieFPS, fMovieHeight, fMovieWidth, fNumSubsessions, fOutFid, iter, MediaSubsession::miscPtr, MediaSubsessionIterator::next(), NULL, onRTCPBye(), OpenOutputFile(), MediaSubsession::readSource(), MediaSubsession::rtcpInstance(), RTCPInstance::setByeHandler(), subsession, MediaSubsession::videoFPS(), MediaSubsession::videoHeight(), and MediaSubsession::videoWidth().

Referenced by createNew().

00129   : Medium(env), fInputSession(inputSession),
00130     fIndexRecordsHead(NULL), fIndexRecordsTail(NULL), fNumIndexRecords(0),
00131     fBufferSize(bufferSize), fPacketLossCompensate(packetLossCompensate),
00132     fAreCurrentlyBeingPlayed(False), fNumSubsessions(0), fNumBytesWritten(0),
00133     fHaveCompletedOutputFile(False),
00134     fMovieWidth(movieWidth), fMovieHeight(movieHeight), fMovieFPS(movieFPS) {
00135   fOutFid = OpenOutputFile(env, outputFileName);
00136   if (fOutFid == NULL) return;
00137 
00138   // Set up I/O state for each input subsession:
00139   MediaSubsessionIterator iter(fInputSession);
00140   MediaSubsession* subsession;
00141   while ((subsession = iter.next()) != NULL) {
00142     // Ignore subsessions without a data source:
00143     FramedSource* subsessionSource = subsession->readSource();
00144     if (subsessionSource == NULL) continue;
00145 
00146     // If "subsession's" SDP description specified screen dimension
00147     // or frame rate parameters, then use these.
00148     if (subsession->videoWidth() != 0) {
00149       fMovieWidth = subsession->videoWidth();
00150     }
00151     if (subsession->videoHeight() != 0) {
00152       fMovieHeight = subsession->videoHeight();
00153     }
00154     if (subsession->videoFPS() != 0) {
00155       fMovieFPS = subsession->videoFPS();
00156     }
00157 
00158     AVISubsessionIOState* ioState
00159       = new AVISubsessionIOState(*this, *subsession);
00160     subsession->miscPtr = (void*)ioState;
00161 
00162     // Also set a 'BYE' handler for this subsession's RTCP instance:
00163     if (subsession->rtcpInstance() != NULL) {
00164       subsession->rtcpInstance()->setByeHandler(onRTCPBye, ioState);
00165     }
00166 
00167     ++fNumSubsessions;
00168   }
00169 
00170   // Begin by writing an AVI header:
00171   addFileHeader_AVI();
00172 }

AVIFileSink::~AVIFileSink (  )  [private, virtual]

Definition at line 174 of file AVIFileSink.cpp.

References CloseOutputFile(), completeOutputFile(), fIndexRecordsHead, fInputSession, fOutFid, iter, MediaSubsession::miscPtr, AVIIndexRecord::next(), MediaSubsessionIterator::next(), NULL, MediaSubsession::readSource(), FramedSource::stopGettingFrames(), and subsession.

00174                           {
00175   completeOutputFile();
00176 
00177   // Then, stop streaming and delete each active "AVISubsessionIOState":
00178   MediaSubsessionIterator iter(fInputSession);
00179   MediaSubsession* subsession;
00180   while ((subsession = iter.next()) != NULL) {
00181     if (subsession->readSource() != NULL) subsession->readSource()->stopGettingFrames();
00182 
00183     AVISubsessionIOState* ioState
00184       = (AVISubsessionIOState*)(subsession->miscPtr);
00185     if (ioState == NULL) continue;
00186 
00187     delete ioState;
00188   }
00189 
00190   // Then, delete the index records:
00191   AVIIndexRecord* cur = fIndexRecordsHead;
00192   while (cur != NULL) {
00193     AVIIndexRecord* next = cur->next();
00194     delete cur;
00195     cur = next;
00196   }
00197 
00198   // Finally, close our output file:
00199   CloseOutputFile(fOutFid);
00200 }


Member Function Documentation

AVIFileSink * AVIFileSink::createNew ( UsageEnvironment env,
MediaSession inputSession,
char const *  outputFileName,
unsigned  bufferSize = 20000,
unsigned short  movieWidth = 240,
unsigned short  movieHeight = 180,
unsigned  movieFPS = 15,
Boolean  packetLossCompensate = False 
) [static]

Definition at line 203 of file AVIFileSink.cpp.

References AVIFileSink(), Medium::close(), env, fOutFid, and NULL.

Referenced by createOutputFiles().

00207                                                              {
00208   AVIFileSink* newSink =
00209     new AVIFileSink(env, inputSession, outputFileName, bufferSize,
00210                     movieWidth, movieHeight, movieFPS, packetLossCompensate);
00211   if (newSink == NULL || newSink->fOutFid == NULL) {
00212     Medium::close(newSink);
00213     return NULL;
00214   }
00215 
00216   return newSink;
00217 }

Boolean AVIFileSink::startPlaying ( afterPlayingFunc afterFunc,
void *  afterClientData 
)

Definition at line 219 of file AVIFileSink.cpp.

References continuePlaying(), Medium::envir(), fAfterClientData, fAfterFunc, False, fAreCurrentlyBeingPlayed, UsageEnvironment::setResultMsg(), and True.

Referenced by createOutputFiles().

00220                                                          {
00221   // Make sure we're not already being played:
00222   if (fAreCurrentlyBeingPlayed) {
00223     envir().setResultMsg("This sink has already been played");
00224     return False;
00225   }
00226 
00227   fAreCurrentlyBeingPlayed = True;
00228   fAfterFunc = afterFunc;
00229   fAfterClientData = afterClientData;
00230 
00231   return continuePlaying();
00232 }

unsigned AVIFileSink::numActiveSubsessions (  )  const [inline]

Definition at line 43 of file AVIFileSink.hh.

References fNumSubsessions.

Referenced by checkForPacketArrival().

00043 { return fNumSubsessions; }

Boolean AVIFileSink::continuePlaying (  )  [private]

Definition at line 234 of file AVIFileSink.cpp.

References afterGettingFrame(), SubsessionBuffer::bytesAvailable(), SubsessionBuffer::dataEnd(), Medium::envir(), False, AVISubsessionIOState::fBuffer, fInputSession, FramedSource::getNextFrame(), FramedSource::isCurrentlyAwaitingData(), iter, MediaSubsession::miscPtr, MediaSubsessionIterator::next(), NULL, onSourceClosure(), MediaSubsession::readSource(), UsageEnvironment::setResultMsg(), subsession, and True.

Referenced by AVISubsessionIOState::afterGettingFrame(), and startPlaying().

00234                                      {
00235   // Run through each of our input session's 'subsessions',
00236   // asking for a frame from each one:
00237   Boolean haveActiveSubsessions = False;
00238   MediaSubsessionIterator iter(fInputSession);
00239   MediaSubsession* subsession;
00240   while ((subsession = iter.next()) != NULL) {
00241     FramedSource* subsessionSource = subsession->readSource();
00242     if (subsessionSource == NULL) continue;
00243 
00244     if (subsessionSource->isCurrentlyAwaitingData()) continue;
00245 
00246     AVISubsessionIOState* ioState
00247       = (AVISubsessionIOState*)(subsession->miscPtr);
00248     if (ioState == NULL) continue;
00249 
00250     haveActiveSubsessions = True;
00251     unsigned char* toPtr = ioState->fBuffer->dataEnd();
00252     unsigned toSize = ioState->fBuffer->bytesAvailable();
00253     subsessionSource->getNextFrame(toPtr, toSize,
00254                                    afterGettingFrame, ioState,
00255                                    onSourceClosure, ioState);
00256   }
00257   if (!haveActiveSubsessions) {
00258     envir().setResultMsg("No subsessions are currently active");
00259     return False;
00260   }
00261 
00262   return True;
00263 }

void AVIFileSink::afterGettingFrame ( void *  clientData,
unsigned  frameSize,
unsigned  numTruncatedBytes,
struct timeval  presentationTime,
unsigned  durationInMicroseconds 
) [static, private]

Definition at line 266 of file AVIFileSink.cpp.

References AVISubsessionIOState::afterGettingFrame(), and AVISubsessionIOState::envir().

Referenced by continuePlaying().

00269                                                          {
00270   AVISubsessionIOState* ioState = (AVISubsessionIOState*)clientData;
00271   if (numTruncatedBytes > 0) {
00272     ioState->envir() << "AVIFileSink::afterGettingFrame(): The input frame data was too large for our buffer.  "
00273                      << numTruncatedBytes
00274                      << " bytes of trailing data was dropped!  Correct this by increasing the \"bufferSize\" parameter in the \"createNew()\" call.\n";
00275   }
00276   ioState->afterGettingFrame(packetDataSize, presentationTime);
00277 }

void AVIFileSink::onSourceClosure ( void *  clientData  )  [static, private]

Definition at line 279 of file AVIFileSink.cpp.

References AVISubsessionIOState::onSourceClosure().

Referenced by continuePlaying().

00279                                                   {
00280   AVISubsessionIOState* ioState = (AVISubsessionIOState*)clientData;
00281   ioState->onSourceClosure();
00282 }

void AVIFileSink::onSourceClosure1 (  )  [private]

Definition at line 284 of file AVIFileSink.cpp.

References completeOutputFile(), fAfterClientData, fAfterFunc, fInputSession, AVISubsessionIOState::fOurSourceIsActive, iter, MediaSubsession::miscPtr, MediaSubsessionIterator::next(), NULL, and subsession.

Referenced by AVISubsessionIOState::onSourceClosure().

00284                                    {
00285   // Check whether *all* of the subsession sources have closed.
00286   // If not, do nothing for now:
00287   MediaSubsessionIterator iter(fInputSession);
00288   MediaSubsession* subsession;
00289   while ((subsession = iter.next()) != NULL) {
00290     AVISubsessionIOState* ioState
00291       = (AVISubsessionIOState*)(subsession->miscPtr);
00292     if (ioState == NULL) continue;
00293 
00294     if (ioState->fOurSourceIsActive) return; // this source hasn't closed
00295   }
00296 
00297   completeOutputFile();
00298 
00299   // Call our specified 'after' function:
00300   if (fAfterFunc != NULL) {
00301     (*fAfterFunc)(fAfterClientData);
00302   }
00303 }

void AVIFileSink::onRTCPBye ( void *  clientData  )  [static, private]

Definition at line 305 of file AVIFileSink.cpp.

References MediaSubsession::codecName(), AVISubsessionIOState::envir(), AVISubsessionIOState::fOurSink, AVISubsessionIOState::fOurSubsession, fStartTime, MediaSubsession::mediumName(), NULL, AVISubsessionIOState::onSourceClosure(), and subsession.

Referenced by AVIFileSink().

00305                                             {
00306   AVISubsessionIOState* ioState = (AVISubsessionIOState*)clientData;
00307 
00308   struct timeval timeNow;
00309   gettimeofday(&timeNow, NULL);
00310   unsigned secsDiff
00311     = timeNow.tv_sec - ioState->fOurSink.fStartTime.tv_sec;
00312 
00313   MediaSubsession& subsession = ioState->fOurSubsession;
00314   ioState->envir() << "Received RTCP \"BYE\" on \""
00315                    << subsession.mediumName()
00316                    << "/" << subsession.codecName()
00317                    << "\" subsession (after "
00318                    << secsDiff << " seconds)\n";
00319 
00320   // Handle the reception of a RTCP "BYE" as if the source had closed:
00321   ioState->onSourceClosure();
00322 }

void AVIFileSink::addIndexRecord ( class AVIIndexRecord newIndexRecord  )  [private]

Definition at line 324 of file AVIFileSink.cpp.

References fIndexRecordsHead, fIndexRecordsTail, fNumIndexRecords, AVIIndexRecord::next(), and NULL.

Referenced by AVISubsessionIOState::useFrame().

00324                                                                {
00325   if (fIndexRecordsHead == NULL) {
00326     fIndexRecordsHead = newIndexRecord;
00327   } else {
00328     fIndexRecordsTail->next() = newIndexRecord;
00329   }
00330   fIndexRecordsTail = newIndexRecord;
00331   ++fNumIndexRecords;
00332 }

void AVIFileSink::completeOutputFile (  )  [private]

Definition at line 334 of file AVIFileSink.cpp.

References add4ByteString(), addWord(), fAVIHFrameCountPosition, fAVIHMaxBytesPerSecondPosition, fHaveCompletedOutputFile, fIndexRecordsHead, fInputSession, AVISubsessionIOState::fIsAudio, AVISubsessionIOState::fIsVideo, AVISubsessionIOState::fMaxBytesPerSecond, fMoviSizePosition, fMoviSizeValue, fNumBytesWritten, AVISubsessionIOState::fNumFrames, fNumIndexRecords, fOutFid, fRIFFSizePosition, fRIFFSizeValue, AVISubsessionIOState::fSTRHFrameCountPosition, iter, MediaSubsession::miscPtr, MediaSubsessionIterator::next(), NULL, setWord(), subsession, and True.

Referenced by onSourceClosure1(), and ~AVIFileSink().

00334                                      {
00335   if (fHaveCompletedOutputFile || fOutFid == NULL) return;
00336 
00337   // Update various AVI 'size' fields to take account of the codec data that
00338   // we've now written to the file:
00339   unsigned maxBytesPerSecond = 0;
00340   unsigned numVideoFrames = 0;
00341   unsigned numAudioFrames = 0;
00342 
00344   MediaSubsessionIterator iter(fInputSession);
00345   MediaSubsession* subsession;
00346   while ((subsession = iter.next()) != NULL) {
00347     AVISubsessionIOState* ioState
00348       = (AVISubsessionIOState*)(subsession->miscPtr);
00349     if (ioState == NULL) continue;
00350 
00351     maxBytesPerSecond += ioState->fMaxBytesPerSecond;
00352 
00353     setWord(ioState->fSTRHFrameCountPosition, ioState->fNumFrames);
00354     if (ioState->fIsVideo) numVideoFrames = ioState->fNumFrames;
00355     else if (ioState->fIsAudio) numAudioFrames = ioState->fNumFrames;
00356   }
00357 
00359   add4ByteString("idx1");
00360   addWord(fNumIndexRecords*4*4); // the size of all of the index records, which come next:
00361   for (AVIIndexRecord* indexRecord = fIndexRecordsHead; indexRecord != NULL; indexRecord = indexRecord->next()) {
00362     addWord(indexRecord->chunkId());
00363     addWord(indexRecord->flags());
00364     addWord(indexRecord->offset());
00365     addWord(indexRecord->size());
00366   }
00367 
00368   fRIFFSizeValue += fNumBytesWritten;
00369   setWord(fRIFFSizePosition, fRIFFSizeValue);
00370 
00371   setWord(fAVIHMaxBytesPerSecondPosition, maxBytesPerSecond);
00372   setWord(fAVIHFrameCountPosition,
00373           numVideoFrames > 0 ? numVideoFrames : numAudioFrames);
00374 
00375   fMoviSizeValue += fNumBytesWritten;
00376   setWord(fMoviSizePosition, fMoviSizeValue);
00377 
00378   // We're done:
00379   fHaveCompletedOutputFile = True;
00380 }

unsigned AVIFileSink::addWord ( unsigned  word  )  [private]

Definition at line 564 of file AVIFileSink.cpp.

References addByte().

Referenced by addZeroWords(), completeOutputFile(), if(), setWord(), and AVISubsessionIOState::useFrame().

00564                                            {
00565   // Add "word" to the file in little-endian order:
00566   addByte(word); addByte(word>>8);
00567   addByte(word>>16); addByte(word>>24);
00568 
00569   return 4;
00570 }

unsigned AVIFileSink::addHalfWord ( unsigned short  halfWord  )  [private]

Definition at line 572 of file AVIFileSink.cpp.

References addByte().

Referenced by if().

00572                                                          {
00573   // Add "halfWord" to the file in little-endian order:
00574   addByte((unsigned char)halfWord); addByte((unsigned char)(halfWord>>8));
00575 
00576   return 2;
00577 }

unsigned AVIFileSink::addByte ( unsigned char  byte  )  [inline, private]

Definition at line 85 of file AVIFileSink.hh.

References fOutFid.

Referenced by add4ByteString(), addHalfWord(), addWord(), and AVISubsessionIOState::useFrame().

00085                                        {
00086     putc(byte, fOutFid);
00087     return 1;
00088   }

unsigned AVIFileSink::addZeroWords ( unsigned  numWords  )  [private]

Definition at line 579 of file AVIFileSink.cpp.

References addWord().

Referenced by if().

00579                                                     {
00580   for (unsigned i = 0; i < numWords; ++i) {
00581     addWord(0);
00582   }
00583 
00584   return numWords*4;
00585 }

unsigned AVIFileSink::add4ByteString ( char const *  str  )  [private]

Definition at line 587 of file AVIFileSink.cpp.

References addByte().

Referenced by completeOutputFile().

00587                                                     {
00588   addByte(str[0]); addByte(str[1]); addByte(str[2]);
00589   addByte(str[3] == '\0' ? ' ' : str[3]); // e.g., for "AVI "
00590 
00591   return 4;
00592 }

void AVIFileSink::setWord ( unsigned  filePosn,
unsigned  size 
) [private]

Definition at line 594 of file AVIFileSink.cpp.

References addWord(), Medium::envir(), fOutFid, UsageEnvironment::getErrno(), and SeekFile64().

Referenced by completeOutputFile().

00594                                                           {
00595   do {
00596     if (SeekFile64(fOutFid, filePosn, SEEK_SET) < 0) break;
00597     addWord(size);
00598     if (SeekFile64(fOutFid, 0, SEEK_END) < 0) break; // go back to where we were
00599 
00600     return;
00601   } while (0);
00602 
00603   // One of the SeekFile64()s failed, probable because we're not a seekable file
00604   envir() << "AVIFileSink::setWord(): SeekFile64 failed (err "
00605           << envir().getErrno() << ")\n";
00606 }

AVIFileSink::_header ( AVI   )  [private]

AVIFileSink::_header ( hdrl   )  [private]

AVIFileSink::_header ( avih   )  [private]

AVIFileSink::_header ( strl   )  [private]

AVIFileSink::_header ( strh   )  [private]

AVIFileSink::_header ( strf   )  [private]

AVIFileSink::_header ( JUNK   )  [private]

AVIFileSink::_header ( movi   )  [private]

Boolean Medium::lookupByName ( UsageEnvironment env,
char const *  mediumName,
Medium *&  resultMedium 
) [static, inherited]

Definition at line 41 of file Media.cpp.

References env, False, MediaLookupTable::lookup(), NULL, MediaLookupTable::ourMedia(), UsageEnvironment::setResultMsg(), and True.

Referenced by ServerMediaSession::lookupByName(), RTSPServer::lookupByName(), RTSPClient::lookupByName(), RTCPInstance::lookupByName(), MediaSource::lookupByName(), MediaSink::lookupByName(), MediaSession::lookupByName(), and DarwinInjector::lookupByName().

00042                                                          {
00043   resultMedium = MediaLookupTable::ourMedia(env)->lookup(mediumName);
00044   if (resultMedium == NULL) {
00045     env.setResultMsg("Medium ", mediumName, " does not exist");
00046     return False;
00047   }
00048 
00049   return True;
00050 }

void Medium::close ( UsageEnvironment env,
char const *  mediumName 
) [static, inherited]

Definition at line 52 of file Media.cpp.

References env, MediaLookupTable::ourMedia(), and MediaLookupTable::remove().

Referenced by afterPlaying(), Medium::close(), closeMediaSinks(), OnDemandServerMediaSubsession::closeStreamSource(), continueAfterClientCreation0(), continueAfterTEARDOWN(), WAVAudioFileSource::createNew(), QuickTimeFileSink::createNew(), QCELPAudioRTPSource::createNew(), MP3FileSource::createNew(), createNew(), AMRAudioRTPSource::createNew(), WAVAudioFileServerMediaSubsession::createNewStreamSource(), MPEG1or2DemuxedServerMediaSubsession::createNewStreamSource(), MediaSubsession::deInitiate(), ServerMediaSession::deleteAllSubsessions(), RTSPServerSupportingHTTPStreaming::RTSPClientConnectionSupportingHTTPStreaming::handleHTTPCmd_StreamingGET(), MPEG1or2ProgramStreamFileDuration(), MPEG1or2Demux::noteElementaryStreamDeletion(), ByteStreamMultiFileSource::onSourceClosure1(), StreamState::reclaim(), registerResponseHandler(), RTSPServer::removeServerMediaSession(), ProxyServerMediaSession::resetDESCRIBEState(), OnDemandServerMediaSubsession::sdpLines(), shutdownStream(), subsessionAfterPlaying(), ClientTrickPlayState::updateStateOnScaleChange(), AMRDeinterleaver::~AMRDeinterleaver(), ByteStreamMultiFileSource::~ByteStreamMultiFileSource(), DarwinInjector::~DarwinInjector(), FramedFilter::~FramedFilter(), H264or5VideoRTPSink::~H264or5VideoRTPSink(), InputESSourceRecord::~InputESSourceRecord(), MatroskaFileParser::~MatroskaFileParser(), MatroskaFileServerDemux::~MatroskaFileServerDemux(), MPEG1or2Demux::~MPEG1or2Demux(), MPEG1or2FileServerDemux::~MPEG1or2FileServerDemux(), MPEG2TransportFileServerMediaSubsession::~MPEG2TransportFileServerMediaSubsession(), MPEG2TransportStreamFromPESSource::~MPEG2TransportStreamFromPESSource(), OggFileParser::~OggFileParser(), OggFileServerDemux::~OggFileServerDemux(), ProxyServerMediaSession::~ProxyServerMediaSession(), RTSPServerSupportingHTTPStreaming::RTSPClientConnectionSupportingHTTPStreaming::~RTSPClientConnectionSupportingHTTPStreaming(), ServerMediaSubsession::~ServerMediaSubsession(), StreamClientState::~StreamClientState(), StreamReplicator::~StreamReplicator(), and T140TextRTPSink::~T140TextRTPSink().

00052                                                           {
00053   MediaLookupTable::ourMedia(env)->remove(name);
00054 }

void Medium::close ( Medium medium  )  [static, inherited]

Definition at line 56 of file Media.cpp.

References Medium::close(), Medium::envir(), Medium::name(), and NULL.

00056                                  {
00057   if (medium == NULL) return;
00058 
00059   close(medium->envir(), medium->name());
00060 }

UsageEnvironment& Medium::envir (  )  const [inline, inherited]

Definition at line 59 of file Media.hh.

References Medium::fEnviron.

Referenced by QuickTimeFileSink::addArbitraryString(), FileSink::addData(), RTCPInstance::addStreamSocket(), MPEG2IFrameIndexFromTransportStream::addToTail(), StreamParser::afterGettingBytes1(), DummySink::afterGettingFrame(), TCPStreamSink::afterGettingFrame(), T140IdleFilter::afterGettingFrame(), FileSink::afterGettingFrame(), MultiFramedRTPSink::afterGettingFrame1(), InputESSourceRecord::afterGettingFrame1(), MPEG2TransportStreamFramer::afterGettingFrame1(), MPEG2IFrameIndexFromTransportStream::afterGettingFrame1(), H264or5VideoStreamDiscreteFramer::afterGettingFrame1(), BasicUDPSink::afterGettingFrame1(), MPEG4VideoFileServerMediaSubsession::afterPlayingDummy1(), H265VideoFileServerMediaSubsession::afterPlayingDummy1(), H264VideoFileServerMediaSubsession::afterPlayingDummy1(), MPEG4VideoStreamParser::analyzeVOLHeader(), announceStream(), RTSPServer::RTSPClientConnection::changeClientInputSocket(), MPEG4VideoFileServerMediaSubsession::checkForAuxSDPLine1(), H265VideoFileServerMediaSubsession::checkForAuxSDPLine1(), H264VideoFileServerMediaSubsession::checkForAuxSDPLine1(), Medium::close(), ProxyServerMediaSubsession::closeStreamSource(), MPEG2IFrameIndexFromTransportStream::compactParseBuffer(), RTSPClient::connectionHandler1(), RTSPClient::connectToServer(), ProxyServerMediaSession::continueAfterDESCRIBE(), ProxyRTSPClient::continueAfterLivenessCommand(), ProxyRTSPClient::continueAfterSETUP(), T140TextRTPSink::continuePlaying(), QuickTimeFileSink::continuePlaying(), H264or5VideoRTPSink::continuePlaying(), continuePlaying(), ProxyServerMediaSubsession::createNewRTPSink(), MPEG4VideoFileServerMediaSubsession::createNewRTPSink(), MPEG2TransportUDPServerMediaSubsession::createNewRTPSink(), MPEG2TransportFileServerMediaSubsession::createNewRTPSink(), MPEG1or2VideoFileServerMediaSubsession::createNewRTPSink(), MPEG1or2DemuxedServerMediaSubsession::createNewRTPSink(), MP3AudioFileServerMediaSubsession::createNewRTPSink(), H265VideoFileServerMediaSubsession::createNewRTPSink(), H264VideoFileServerMediaSubsession::createNewRTPSink(), H263plusVideoFileServerMediaSubsession::createNewRTPSink(), DVVideoFileServerMediaSubsession::createNewRTPSink(), AMRAudioFileServerMediaSubsession::createNewRTPSink(), ADTSAudioFileServerMediaSubsession::createNewRTPSink(), AC3AudioFileServerMediaSubsession::createNewRTPSink(), HandlerServerForREGISTERCommand::createNewRTSPClient(), ProxyServerMediaSubsession::createNewStreamSource(), MPEG4VideoFileServerMediaSubsession::createNewStreamSource(), MPEG2TransportUDPServerMediaSubsession::createNewStreamSource(), MPEG2TransportFileServerMediaSubsession::createNewStreamSource(), MPEG1or2VideoFileServerMediaSubsession::createNewStreamSource(), MPEG1or2DemuxedServerMediaSubsession::createNewStreamSource(), MP3AudioFileServerMediaSubsession::createNewStreamSource(), H265VideoFileServerMediaSubsession::createNewStreamSource(), H264VideoFileServerMediaSubsession::createNewStreamSource(), H263plusVideoFileServerMediaSubsession::createNewStreamSource(), DVVideoFileServerMediaSubsession::createNewStreamSource(), AMRAudioFileServerMediaSubsession::createNewStreamSource(), ADTSAudioFileServerMediaSubsession::createNewStreamSource(), AC3AudioFileServerMediaSubsession::createNewStreamSource(), OggFile::createRTPSinkForTrackNumber(), MatroskaFile::createRTPSinkForTrackNumber(), MatroskaFile::createSourceForStreaming(), AMRDeinterleavingBuffer::deliverIncomingFrame(), MPEG2IFrameIndexFromTransportStream::deliverIndexRecord(), SegmentQueue::dequeue(), DeviceSource::DeviceSource(), WAVAudioFileSource::doGetNextFrame(), T140IdleFilter::doGetNextFrame(), MPEG2TransportStreamMultiplexor::doGetNextFrame(), MPEG2IFrameIndexFromTransportStream::doGetNextFrame(), MP3FileSource::doGetNextFrame(), H264or5Fragmenter::doGetNextFrame(), ByteStreamMultiFileSource::doGetNextFrame(), ByteStreamFileSource::doGetNextFrame(), BasicUDPSource::doGetNextFrame(), AMRAudioFileSource::doGetNextFrame(), ADTSAudioFileSource::doGetNextFrame(), MultiFramedRTPSource::doGetNextFrame1(), MP3FileSource::doGetNextFrame1(), ADUFromMP3Source::doGetNextFrame1(), SIPClient::doInviteStateMachine(), WAVAudioFileSource::doReadFromFile(), ByteStreamFileSource::doReadFromFile(), MPEG1or2VideoRTPSink::doSpecialFrameHandling(), MP3ADURTPSink::doSpecialFrameHandling(), H263plusVideoRTPSink::doSpecialFrameHandling(), WAVAudioFileSource::doStopGettingFrames(), T140IdleFilter::doStopGettingFrames(), MultiFramedRTPSource::doStopGettingFrames(), FramedSource::doStopGettingFrames(), ByteStreamFileSource::doStopGettingFrames(), BasicUDPSource::doStopGettingFrames(), SegmentQueue::enqueueNewSegment(), StreamParser::ensureValidBytes1(), MediaSubsession::env(), SubsessionIOState::envir(), RTSPServer::RTSPClientSession::envir(), RTSPServer::RTSPClientConnection::envir(), RTPInterface::envir(), AVISubsessionIOState::envir(), ServerMediaSession::generateSDPDescription(), RTPSource::getAttributes(), MP3FileSource::getAttributes(), MP3ADUTranscoder::getAttributes(), MediaSource::getAttributes(), MPEG4VideoFileServerMediaSubsession::getAuxSDPLine(), H265VideoFileServerMediaSubsession::getAuxSDPLine(), H264VideoFileServerMediaSubsession::getAuxSDPLine(), getMPEG1or2TimeCode(), FramedSource::getNextFrame(), getOptions(), DVVideoStreamFramer::getProfile(), SIPClient::getResponse(), SIPClient::getResponseCode(), getSDPDescription(), OnDemandServerMediaSubsession::getStreamParameters(), RTSPClient::handleAlternativeRequestByte1(), RTSPServer::RTSPClientConnection::handleCmd_REGISTER(), RTSPClient::handleGET_PARAMETERResponse(), RTSPServerSupportingHTTPStreaming::RTSPClientConnectionSupportingHTTPStreaming::handleHTTPCmd_StreamingGET(), RTSPClient::handleIncomingRequest(), RTSPClient::handlePLAYResponse(), RTSPClient::handleRequestError(), RTSPClient::handleResponseBytes(), RTSPClient::handleSETUPResponse(), RTSPServerWithREGISTERProxying::implementCmd_REGISTER(), RTSPServer::incomingConnectionHandler(), RTSPClient::incomingDataHandler1(), RTCPInstance::incomingReportHandler1(), MP3FileSource::initializeStream(), MediaSession::initializeWithSDP(), MediaSession::initiateByMediaType(), SIPClient::invite1(), DynamicRTSPServer::lookupServerMediaSession(), MatroskaDemux::MatroskaDemux(), MatroskaFile::MatroskaFile(), MPEG4GenericRTPSource::MPEG4GenericRTPSource(), MultiFramedRTPSource::networkReadHandler1(), OggDemux::newDemuxedTrack(), OggDemux::newDemuxedTrackByTrackNumber(), MatroskaDemux::newDemuxedTrackByTrackNumber(), MPEG1or2FileServerDemux::newElementaryStream(), MPEG1or2Demux::newElementaryStream(), MPEG4GenericBufferedPacket::nextEnclosedFrameSize(), AMRBufferedPacket::nextEnclosedFrameSize(), OggDemux::OggDemux(), OggFile::OggFile(), T140IdleFilter::onSourceClosure(), MediaSink::onSourceClosure(), RTSPClient::openConnection(), MPEG2TransportStreamIndexFile::openFid(), MPEG2IFrameIndexFromTransportStream::parseFrame(), AC3AudioStreamParser::parseFrame(), MPEGProgramStreamParser::parsePackHeader(), MPEGProgramStreamParser::parsePESPacket(), SIPClient::parseResponseCode(), MediaSession::parseSDPLine(), MPEG1or2VideoStreamParser::parseSlice(), MatroskaFileParser::parseStartOfFile(), MPEGProgramStreamParser::parseSystemHeader(), MPEG4VideoStreamParser::parseVideoObjectLayer(), MPEG4VideoStreamParser::parseVideoObjectPlane(), MPEG4VideoStreamParser::parseVisualObject(), TCPStreamSink::processBuffer(), SIPClient::processURL(), AC3AudioStreamParser::readAndSaveAFrame(), MPEG1or2Demux::registerReadInterest(), RTCPInstance::reschedule(), RTSPClient::resendCommand(), ProxyRTSPClient::reset(), RTSPClient::resetTCPSockets(), RTSPClient::responseHandlerForHTTP_GET1(), RTSPClient::RTSPClient(), RTSPServer::rtspURLPrefix(), RTCPInstance::schedule(), ProxyRTSPClient::scheduleDESCRIBECommand(), ProxyRTSPClient::scheduleLivenessCommand(), OnDemandServerMediaSubsession::sdpLines(), SIPClient::sendACK(), SIPClient::sendBYE(), RTSPClient::sendDummyUDPPackets(), SIPClient::sendINVITE(), MultiFramedRTPSink::sendPacketIfNecessary(), SIPClient::sendRequest(), RTSPClient::sendRequest(), DarwinInjector::setDestination(), RTSPClient::setRequestFields(), RTSPClient::setupHTTPTunneling1(), setupNextSubsession(), RTSPServer::setUpTunnelingOverHTTP(), QuickTimeFileSink::setWord(), setWord(), QuickTimeFileSink::setWord64(), shutdownStream(), SIPClient::SIPClient(), TCPStreamSink::socketWritableHandler1(), AMRAudioRTPSink::sourceIsCompatibleWithUs(), QuickTimeFileSink::startPlaying(), StreamState::startPlaying(), MediaSink::startPlaying(), startPlaying(), startPlayingSession(), PassiveServerMediaSubsession::startStream(), MediaSink::stopPlaying(), ProxyServerMediaSubsession::subsessionByeHandler(), tearDownSession(), SIPClient::timerAHandler(), SIPClient::timerBHandler(), SIPClient::timerDHandler(), ClientTrickPlayState::updateStateOnScaleChange(), MPEG2TransportStreamFramer::updateTSPacketDurationEstimate(), BasicUDPSource::~BasicUDPSource(), ByteStreamFileSource::~ByteStreamFileSource(), DeviceSource::~DeviceSource(), ProxyServerMediaSession::~ProxyServerMediaSession(), ProxyServerMediaSubsession::~ProxyServerMediaSubsession(), RTSPClient::~RTSPClient(), RTSPServer::~RTSPServer(), StreamClientState::~StreamClientState(), T140IdleFilter::~T140IdleFilter(), TCPStreamSink::~TCPStreamSink(), and WAVAudioFileSource::~WAVAudioFileSource().

00059 {return fEnviron;}

char const* Medium::name (  )  const [inline, inherited]

Definition at line 61 of file Media.hh.

References Medium::fMediumName.

Referenced by QuickTimeFileSink::addAtom_hdlr2(), Medium::close(), MP3ADUTranscoder::createNew(), MP3FromADUSource::createNew(), ADUFromMP3Source::createNew(), and MP3FileSource::initializeStream().

00061 {return fMediumName;}

Boolean Medium::isSource (  )  const [virtual, inherited]

Reimplemented in MediaSource.

Definition at line 62 of file Media.cpp.

References False.

Referenced by MediaSource::lookupByName().

00062                                {
00063   return False; // default implementation
00064 }

Boolean Medium::isSink (  )  const [virtual, inherited]

Reimplemented in MediaSink.

Definition at line 66 of file Media.cpp.

References False.

Referenced by MediaSink::lookupByName().

00066                              {
00067   return False; // default implementation
00068 }

Boolean Medium::isRTCPInstance (  )  const [virtual, inherited]

Reimplemented in RTCPInstance.

Definition at line 70 of file Media.cpp.

References False.

Referenced by RTCPInstance::lookupByName().

00070                                      {
00071   return False; // default implementation
00072 }

Boolean Medium::isRTSPClient (  )  const [virtual, inherited]

Reimplemented in RTSPClient.

Definition at line 74 of file Media.cpp.

References False.

Referenced by RTSPClient::lookupByName().

00074                                    {
00075   return False; // default implementation
00076 }

Boolean Medium::isRTSPServer (  )  const [virtual, inherited]

Reimplemented in RTSPServer.

Definition at line 78 of file Media.cpp.

References False.

Referenced by RTSPServer::lookupByName().

00078                                    {
00079   return False; // default implementation
00080 }

Boolean Medium::isMediaSession (  )  const [virtual, inherited]

Reimplemented in MediaSession.

Definition at line 82 of file Media.cpp.

References False.

Referenced by MediaSession::lookupByName().

00082                                      {
00083   return False; // default implementation
00084 }

Boolean Medium::isServerMediaSession (  )  const [virtual, inherited]

Reimplemented in ServerMediaSession.

Definition at line 86 of file Media.cpp.

References False.

Referenced by ServerMediaSession::lookupByName().

00086                                            {
00087   return False; // default implementation
00088 }

Boolean Medium::isDarwinInjector (  )  const [virtual, inherited]

Reimplemented in DarwinInjector.

Definition at line 90 of file Media.cpp.

References False.

Referenced by DarwinInjector::lookupByName().

00090                                        {
00091   return False; // default implementation
00092 }

TaskToken& Medium::nextTask (  )  [inline, protected, inherited]

Definition at line 78 of file Media.hh.

References Medium::fNextTask.

Referenced by BasicUDPSink::afterGettingFrame1(), MPEG4VideoFileServerMediaSubsession::afterPlayingDummy1(), H265VideoFileServerMediaSubsession::afterPlayingDummy1(), H264VideoFileServerMediaSubsession::afterPlayingDummy1(), MPEG4VideoFileServerMediaSubsession::checkForAuxSDPLine1(), H265VideoFileServerMediaSubsession::checkForAuxSDPLine1(), H264VideoFileServerMediaSubsession::checkForAuxSDPLine1(), MP3FileSource::doGetNextFrame(), AMRAudioFileSource::doGetNextFrame(), ADTSAudioFileSource::doGetNextFrame(), MultiFramedRTPSource::doGetNextFrame1(), WAVAudioFileSource::doReadFromFile(), ByteStreamFileSource::doReadFromFile(), WAVAudioFileSource::doStopGettingFrames(), MultiFramedRTPSource::doStopGettingFrames(), FramedSource::doStopGettingFrames(), ByteStreamFileSource::doStopGettingFrames(), MediaSink::onSourceClosure(), RTCPInstance::reschedule(), RTCPInstance::schedule(), MultiFramedRTPSink::sendPacketIfNecessary(), and MediaSink::stopPlaying().

00078                         {
00079         return fNextTask;
00080   }


Friends And Related Function Documentation

friend class AVISubsessionIOState [friend]

Definition at line 65 of file AVIFileSink.hh.

Referenced by AVIFileSink().

friend class MediaLookupTable [friend, inherited]

Definition at line 74 of file Media.hh.


Field Documentation

MediaSession& AVIFileSink::fInputSession [private]

Definition at line 66 of file AVIFileSink.hh.

Referenced by AVIFileSink(), completeOutputFile(), continuePlaying(), onSourceClosure1(), and ~AVIFileSink().

FILE* AVIFileSink::fOutFid [private]

Definition at line 67 of file AVIFileSink.hh.

Referenced by addByte(), AVIFileSink(), completeOutputFile(), createNew(), setWord(), AVISubsessionIOState::useFrame(), and ~AVIFileSink().

class AVIIndexRecord* AVIFileSink::fIndexRecordsHead [private]

Definition at line 68 of file AVIFileSink.hh.

Referenced by addIndexRecord(), completeOutputFile(), and ~AVIFileSink().

class AVIIndexRecord * AVIFileSink::fIndexRecordsTail [private]

Definition at line 68 of file AVIFileSink.hh.

Referenced by addIndexRecord().

unsigned AVIFileSink::fNumIndexRecords [private]

Definition at line 69 of file AVIFileSink.hh.

Referenced by addIndexRecord(), and completeOutputFile().

unsigned AVIFileSink::fBufferSize [private]

Definition at line 70 of file AVIFileSink.hh.

Referenced by AVISubsessionIOState::AVISubsessionIOState().

Boolean AVIFileSink::fPacketLossCompensate [private]

Definition at line 71 of file AVIFileSink.hh.

Referenced by AVISubsessionIOState::afterGettingFrame().

Boolean AVIFileSink::fAreCurrentlyBeingPlayed [private]

Definition at line 72 of file AVIFileSink.hh.

Referenced by startPlaying().

afterPlayingFunc* AVIFileSink::fAfterFunc [private]

Definition at line 73 of file AVIFileSink.hh.

Referenced by onSourceClosure1(), and startPlaying().

void* AVIFileSink::fAfterClientData [private]

Definition at line 74 of file AVIFileSink.hh.

Referenced by onSourceClosure1(), and startPlaying().

unsigned AVIFileSink::fNumSubsessions [private]

Definition at line 75 of file AVIFileSink.hh.

Referenced by AVIFileSink(), and numActiveSubsessions().

unsigned AVIFileSink::fNumBytesWritten [private]

Definition at line 76 of file AVIFileSink.hh.

Referenced by completeOutputFile(), and AVISubsessionIOState::useFrame().

struct timeval AVIFileSink::fStartTime [read, private]

Definition at line 77 of file AVIFileSink.hh.

Referenced by onRTCPBye().

Boolean AVIFileSink::fHaveCompletedOutputFile [private]

Definition at line 78 of file AVIFileSink.hh.

Referenced by completeOutputFile().

unsigned short AVIFileSink::fMovieWidth [private]

Definition at line 105 of file AVIFileSink.hh.

Referenced by AVIFileSink(), if(), and AVISubsessionIOState::setAVIstate().

unsigned short AVIFileSink::fMovieHeight [private]

Definition at line 105 of file AVIFileSink.hh.

Referenced by AVIFileSink(), if(), and AVISubsessionIOState::setAVIstate().

unsigned AVIFileSink::fMovieFPS [private]

Definition at line 106 of file AVIFileSink.hh.

Referenced by AVIFileSink(), and AVISubsessionIOState::setAVIstate().

unsigned AVIFileSink::fRIFFSizePosition [private]

Definition at line 107 of file AVIFileSink.hh.

Referenced by completeOutputFile().

unsigned AVIFileSink::fRIFFSizeValue [private]

Definition at line 107 of file AVIFileSink.hh.

Referenced by completeOutputFile().

unsigned AVIFileSink::fAVIHMaxBytesPerSecondPosition [private]

Definition at line 108 of file AVIFileSink.hh.

Referenced by completeOutputFile().

unsigned AVIFileSink::fAVIHFrameCountPosition [private]

Definition at line 109 of file AVIFileSink.hh.

Referenced by completeOutputFile().

unsigned AVIFileSink::fMoviSizePosition [private]

Definition at line 110 of file AVIFileSink.hh.

Referenced by completeOutputFile(), and AVISubsessionIOState::useFrame().

unsigned AVIFileSink::fMoviSizeValue [private]

Definition at line 110 of file AVIFileSink.hh.

Referenced by completeOutputFile().

class AVISubsessionIOState* AVIFileSink::fCurrentIOState [private]

Definition at line 111 of file AVIFileSink.hh.

Referenced by if(), and while().

unsigned AVIFileSink::fJunkNumber [private]

Definition at line 112 of file AVIFileSink.hh.


The documentation for this class was generated from the following files:
Generated on Tue Mar 25 14:39:12 2014 for live by  doxygen 1.5.2