MPEG4VideoStreamFramer Class Reference

#include <MPEG4VideoStreamFramer.hh>

Inheritance diagram for MPEG4VideoStreamFramer:

Inheritance graph
[legend]
Collaboration diagram for MPEG4VideoStreamFramer:

Collaboration graph
[legend]

Public Types

typedef void( afterGettingFunc )(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
typedef void( onCloseFunc )(void *clientData)

Public Member Functions

u_int8_t profile_and_level_indication () const
unsigned char * getConfigBytes (unsigned &numBytes) const
BooleanpictureEndMarker ()
void flushInput ()
FramedSourceinputSource () const
void getNextFrame (unsigned char *to, unsigned maxSize, afterGettingFunc *afterGettingFunc, void *afterGettingClientData, onCloseFunc *onCloseFunc, void *onCloseClientData)
void stopGettingFrames ()
virtual unsigned maxFrameSize () const
Boolean isCurrentlyAwaitingData () const
virtual Boolean isRTPSource () const
virtual Boolean isMPEG1or2VideoStreamFramer () const
virtual Boolean isH264VideoStreamFramer () const
virtual Boolean isJPEGVideoSource () const
virtual Boolean isAMRAudioSource () const
UsageEnvironmentenvir () const
char const * name () 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 MPEG4VideoStreamFramercreateNew (UsageEnvironment &env, FramedSource *inputSource)
static Boolean lookupByName (UsageEnvironment &env, char const *sourceName, FramedSource *&resultSource)
static Boolean lookupByName (UsageEnvironment &env, char const *sourceName, MediaSource *&resultSource)
static Boolean lookupByName (UsageEnvironment &env, char const *mediumName, Medium *&resultMedium)
static void handleClosure (void *clientData)
static void close (UsageEnvironment &env, char const *mediumName)
static void close (Medium *medium)

Protected Member Functions

 MPEG4VideoStreamFramer (UsageEnvironment &env, FramedSource *inputSource, Boolean createParser=True)
virtual ~MPEG4VideoStreamFramer ()
void startNewConfig ()
void appendToNewConfig (unsigned char *newConfigBytes, unsigned numNewBytes)
void completeNewConfig ()
void computePresentationTime (unsigned numAdditionalPictures)
void setTimeCode (unsigned hours, unsigned minutes, unsigned seconds, unsigned pictures, unsigned picturesSinceLastGOP)
virtual char const * MIMEtype () const
virtual void getAttributes () const
virtual void doStopGettingFrames ()
TaskTokennextTask ()

Static Protected Member Functions

static void afterGetting (FramedSource *source)

Protected Attributes

u_int8_t fProfileAndLevelIndication
unsigned char * fConfigBytes
unsigned fNumConfigBytes
double fFrameRate
unsigned fPictureCount
Boolean fPictureEndMarker
MPEGVideoStreamParserfParser
FramedSourcefInputSource
unsigned char * fTo
unsigned fMaxSize
unsigned fFrameSize
unsigned fNumTruncatedBytes
timeval fPresentationTime
unsigned fDurationInMicroseconds

Private Member Functions

virtual Boolean isMPEG4VideoStreamFramer () const

Private Attributes

unsigned char * fNewConfigBytes
unsigned fNumNewConfigBytes

Friends

class MPEG4VideoStreamParser
class MPEGVideoStreamParser

Detailed Description

Definition at line 33 of file MPEG4VideoStreamFramer.hh.


Member Typedef Documentation

typedef void( FramedSource::afterGettingFunc)(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds) [inherited]

Definition at line 36 of file FramedSource.hh.

typedef void( FramedSource::onCloseFunc)(void *clientData) [inherited]

Definition at line 40 of file FramedSource.hh.


Constructor & Destructor Documentation

MPEG4VideoStreamFramer::MPEG4VideoStreamFramer ( UsageEnvironment env,
FramedSource inputSource,
Boolean  createParser = True 
) [protected]

Definition at line 102 of file MPEG4VideoStreamFramer.cpp.

References MPEGVideoStreamFramer::fParser, FramedFilter::inputSource(), MPEG4VideoStreamParser, and NULL.

Referenced by createNew().

00105   : MPEGVideoStreamFramer(env, inputSource),
00106     fProfileAndLevelIndication(0),
00107     fConfigBytes(NULL), fNumConfigBytes(0),
00108     fNewConfigBytes(NULL), fNumNewConfigBytes(0) {
00109   fParser = createParser
00110     ? new MPEG4VideoStreamParser(this, inputSource)
00111     : NULL;
00112 }

MPEG4VideoStreamFramer::~MPEG4VideoStreamFramer (  )  [protected, virtual]

Definition at line 114 of file MPEG4VideoStreamFramer.cpp.

References fConfigBytes, and fNewConfigBytes.

00114                                                 {
00115   delete[] fConfigBytes; delete[] fNewConfigBytes;
00116 }


Member Function Documentation

MPEG4VideoStreamFramer * MPEG4VideoStreamFramer::createNew ( UsageEnvironment env,
FramedSource inputSource 
) [static]

Reimplemented in MPEG4VideoStreamDiscreteFramer.

Definition at line 90 of file MPEG4VideoStreamFramer.cpp.

References env, FramedFilter::inputSource(), and MPEG4VideoStreamFramer().

Referenced by MPEG4VideoFileServerMediaSubsession::createNewStreamSource().

00091                                                              {
00092   // Need to add source type checking here???  #####
00093   return new MPEG4VideoStreamFramer(env, inputSource);
00094 }

u_int8_t MPEG4VideoStreamFramer::profile_and_level_indication (  )  const [inline]

Definition at line 38 of file MPEG4VideoStreamFramer.hh.

References fProfileAndLevelIndication.

Referenced by MPEG4ESVideoRTPSink::auxSDPLine().

00038                                                 {
00039     return fProfileAndLevelIndication;
00040   }

unsigned char * MPEG4VideoStreamFramer::getConfigBytes ( unsigned &  numBytes  )  const

Definition at line 97 of file MPEG4VideoStreamFramer.cpp.

References fConfigBytes, and fNumConfigBytes.

Referenced by MPEG4ESVideoRTPSink::auxSDPLine().

00097                                          {
00098   numBytes = fNumConfigBytes;
00099   return fConfigBytes;
00100 }

void MPEG4VideoStreamFramer::startNewConfig (  )  [protected]

Definition at line 118 of file MPEG4VideoStreamFramer.cpp.

References fNewConfigBytes, fNumNewConfigBytes, and NULL.

Referenced by MPEG4VideoStreamParser::parseVisualObjectSequence().

00118                                             {
00119   delete[] fNewConfigBytes; fNewConfigBytes = NULL;
00120   fNumNewConfigBytes = 0;
00121 }

void MPEG4VideoStreamFramer::appendToNewConfig ( unsigned char *  newConfigBytes,
unsigned  numNewBytes 
) [protected]

Definition at line 124 of file MPEG4VideoStreamFramer.cpp.

References fNewConfigBytes, and fNumNewConfigBytes.

Referenced by MPEG4VideoStreamParser::parseVideoObjectLayer(), MPEG4VideoStreamParser::parseVisualObject(), and MPEG4VideoStreamParser::parseVisualObjectSequence().

00124                                                                        {
00125   // Allocate a new block of memory for the new config bytes:
00126   unsigned char* configNew
00127     = new unsigned char[fNumNewConfigBytes + numNewBytes];
00128 
00129   // Copy the old, then the new, config bytes there:
00130   memmove(configNew, fNewConfigBytes, fNumNewConfigBytes);
00131   memmove(&configNew[fNumNewConfigBytes], newConfigBytes, numNewBytes);
00132 
00133   delete[] fNewConfigBytes; fNewConfigBytes = configNew;
00134   fNumNewConfigBytes += numNewBytes;
00135 }

void MPEG4VideoStreamFramer::completeNewConfig (  )  [protected]

Definition at line 137 of file MPEG4VideoStreamFramer.cpp.

References fConfigBytes, fNewConfigBytes, fNumConfigBytes, fNumNewConfigBytes, and NULL.

Referenced by MPEG4VideoStreamParser::parseVideoObjectLayer().

Boolean MPEG4VideoStreamFramer::isMPEG4VideoStreamFramer (  )  const [private, virtual]

Reimplemented from MediaSource.

Definition at line 144 of file MPEG4VideoStreamFramer.cpp.

References True.

00144                                                                {
00145   return True;
00146 }

Boolean& MPEGVideoStreamFramer::pictureEndMarker (  )  [inline, inherited]

Definition at line 40 of file MPEGVideoStreamFramer.hh.

References MPEGVideoStreamFramer::fPictureEndMarker.

Referenced by MPEG4ESVideoRTPSink::doSpecialFrameHandling(), and MPEG1or2VideoRTPSink::doSpecialFrameHandling().

00040 { return fPictureEndMarker; }

void MPEGVideoStreamFramer::flushInput (  )  [inherited]

Definition at line 53 of file MPEGVideoStreamFramer.cpp.

References StreamParser::flushInput(), MPEGVideoStreamFramer::fParser, NULL, and MPEGVideoStreamFramer::reset().

Referenced by MPEG1or2DemuxedServerMediaSubsession::seekStreamSource().

00053                                        {
00054   reset();
00055   if (fParser != NULL) fParser->flushInput();
00056 }

void MPEGVideoStreamFramer::computePresentationTime ( unsigned  numAdditionalPictures  )  [protected, inherited]

Definition at line 74 of file MPEGVideoStreamFramer.cpp.

References TimeCode::days, MPEGVideoStreamFramer::fCurGOPTimeCode, MPEGVideoStreamFramer::fFrameRate, MPEGVideoStreamFramer::fPicturesAdjustment, MPEGVideoStreamFramer::fPictureTimeBase, FramedSource::fPresentationTime, MPEGVideoStreamFramer::fPresentationTimeBase, MPEGVideoStreamFramer::fTcSecsBase, TimeCode::hours, TimeCode::minutes, TimeCode::pictures, and TimeCode::seconds.

Referenced by MPEG1or2VideoStreamParser::parseGOPHeader(), MPEG4VideoStreamParser::parseGroupOfVideoObjectPlane(), MPEG1or2VideoStreamParser::parsePictureHeader(), MPEG1or2VideoStreamParser::parseSlice(), MPEG4VideoStreamParser::parseVideoObjectLayer(), MPEG4VideoStreamParser::parseVideoObjectPlane(), MPEG1or2VideoStreamParser::parseVideoSequenceHeader(), MPEG4VideoStreamParser::parseVisualObject(), and MPEG4VideoStreamParser::parseVisualObjectSequence().

00074                                                         {
00075   // Computes "fPresentationTime" from the most recent GOP's
00076   // time_code, along with the "numAdditionalPictures" parameter:
00077   TimeCode& tc = fCurGOPTimeCode;
00078 
00079   unsigned tcSecs
00080     = (((tc.days*24)+tc.hours)*60+tc.minutes)*60+tc.seconds - fTcSecsBase;
00081   double pictureTime = fFrameRate == 0.0 ? 0.0
00082     : (tc.pictures + fPicturesAdjustment + numAdditionalPictures)/fFrameRate;
00083   while (pictureTime < fPictureTimeBase) { // "if" should be enough, but just in case
00084     if (tcSecs > 0) tcSecs -= 1;
00085     pictureTime += 1.0;
00086   }
00087   pictureTime -= fPictureTimeBase;
00088   if (pictureTime < 0.0) pictureTime = 0.0; // sanity check
00089   unsigned pictureSeconds = (unsigned)pictureTime;
00090   double pictureFractionOfSecond = pictureTime - (double)pictureSeconds;
00091 
00092   fPresentationTime = fPresentationTimeBase;
00093   fPresentationTime.tv_sec += tcSecs + pictureSeconds;
00094   fPresentationTime.tv_usec += (long)(pictureFractionOfSecond*1000000.0);
00095   if (fPresentationTime.tv_usec >= 1000000) {
00096     fPresentationTime.tv_usec -= 1000000;
00097     ++fPresentationTime.tv_sec;
00098   }
00099 #ifdef DEBUG
00100   if (firstPT.tv_sec == 0 && firstPT.tv_usec == 0) firstPT = fPresentationTime;
00101   struct timeval diffPT;
00102   diffPT.tv_sec = fPresentationTime.tv_sec - firstPT.tv_sec;
00103   diffPT.tv_usec = fPresentationTime.tv_usec - firstPT.tv_usec;
00104   if (fPresentationTime.tv_usec < firstPT.tv_usec) {
00105     --diffPT.tv_sec;
00106     diffPT.tv_usec += 1000000;
00107   }
00108   fprintf(stderr, "MPEGVideoStreamFramer::computePresentationTime(%d) -> %lu.%06ld [%lu.%06ld]\n", numAdditionalPictures, fPresentationTime.tv_sec, fPresentationTime.tv_usec, diffPT.tv_sec, diffPT.tv_usec);
00109 #endif
00110 }

void MPEGVideoStreamFramer::setTimeCode ( unsigned  hours,
unsigned  minutes,
unsigned  seconds,
unsigned  pictures,
unsigned  picturesSinceLastGOP 
) [protected, inherited]

Definition at line 113 of file MPEGVideoStreamFramer.cpp.

References TimeCode::days, MPEGVideoStreamFramer::fCurGOPTimeCode, MPEGVideoStreamFramer::fFrameRate, MPEGVideoStreamFramer::fHaveSeenFirstTimeCode, MPEGVideoStreamFramer::fPicturesAdjustment, MPEGVideoStreamFramer::fPictureTimeBase, MPEGVideoStreamFramer::fPrevGOPTimeCode, MPEGVideoStreamFramer::fTcSecsBase, TimeCode::hours, TimeCode::minutes, TimeCode::pictures, TimeCode::seconds, and True.

Referenced by MPEG1or2VideoStreamParser::parseGOPHeader(), and MPEG4VideoStreamParser::parseGroupOfVideoObjectPlane().

00114                                                                 {
00115   TimeCode& tc = fCurGOPTimeCode; // abbrev
00116   unsigned days = tc.days;
00117   if (hours < tc.hours) {
00118     // Assume that the 'day' has wrapped around:
00119     ++days;
00120   }
00121   tc.days = days;
00122   tc.hours = hours;
00123   tc.minutes = minutes;
00124   tc.seconds = seconds;
00125   tc.pictures = pictures;
00126   if (!fHaveSeenFirstTimeCode) {
00127     fPictureTimeBase = fFrameRate == 0.0 ? 0.0 : tc.pictures/fFrameRate;
00128     fTcSecsBase = (((tc.days*24)+tc.hours)*60+tc.minutes)*60+tc.seconds;
00129     fHaveSeenFirstTimeCode = True;
00130   } else if (fCurGOPTimeCode == fPrevGOPTimeCode) {
00131     // The time code has not changed since last time.  Adjust for this:
00132     fPicturesAdjustment += picturesSinceLastGOP;
00133   } else {
00134     // Normal case: The time code changed since last time.
00135     fPrevGOPTimeCode = tc;
00136     fPicturesAdjustment = 0;
00137   }
00138 }

FramedSource* FramedFilter::inputSource (  )  const [inline, inherited]

Definition at line 30 of file FramedFilter.hh.

References FramedFilter::fInputSource.

Referenced by AC3AudioStreamFramer::AC3AudioStreamFramer(), EndianSwap16::createNew(), HostFromNetworkOrder16::createNew(), NetworkFromHostOrder16::createNew(), PCMFromuLawAudioSource::createNew(), QCELPDeinterleaver::createNew(), createNew(), MPEG4VideoStreamDiscreteFramer::createNew(), MPEG2IFrameIndexFromTransportStream::createNew(), MPEG1or2VideoStreamFramer::createNew(), MPEG1or2VideoStreamDiscreteFramer::createNew(), MPEG1or2AudioStreamFramer::createNew(), MP3Transcoder::createNew(), MP3ADUTranscoder::createNew(), MP3ADUdeinterleaver::createNew(), MP3ADUinterleaver::createNew(), MP3FromADUSource::createNew(), ADUFromMP3Source::createNew(), H263plusVideoStreamFramer::createNew(), AC3AudioStreamFramer::createNew(), H264VideoRTPSink::doSpecialFrameHandling(), MP3ADUinterleaverBase::getInputSource(), H263plusVideoStreamFramer::H263plusVideoStreamFramer(), MPEG1or2VideoStreamFramer::MPEG1or2VideoStreamFramer(), MPEG4VideoStreamFramer(), MP3AudioFileServerMediaSubsession::seekStreamSource(), ClientTrickPlayState::setSource(), and MP3AudioFileServerMediaSubsession::setStreamSourceScale().

00030 { return fInputSource; }

char const * FramedFilter::MIMEtype (  )  const [protected, virtual, inherited]

Reimplemented from MediaSource.

Reimplemented in ADUFromMP3Source, and MP3FromADUSource.

Definition at line 39 of file FramedFilter.cpp.

References FramedFilter::fInputSource, MediaSource::MIMEtype(), and NULL.

00039                                          {
00040   if (fInputSource == NULL) return "";
00041 
00042   return fInputSource->MIMEtype();
00043 }

void FramedFilter::getAttributes (  )  const [protected, virtual, inherited]

Reimplemented from MediaSource.

Reimplemented in MP3ADUTranscoder.

Definition at line 45 of file FramedFilter.cpp.

References FramedFilter::fInputSource, MediaSource::getAttributes(), and NULL.

00045                                        {
00046   if (fInputSource != NULL) fInputSource->getAttributes();
00047 }

void FramedFilter::doStopGettingFrames (  )  [protected, virtual, inherited]

Reimplemented from FramedSource.

Reimplemented in MPEG2TransportStreamFramer, and MPEG2TransportStreamTrickModeFilter.

Definition at line 49 of file FramedFilter.cpp.

References FramedFilter::fInputSource, NULL, and FramedSource::stopGettingFrames().

Referenced by MPEG2TransportStreamTrickModeFilter::doStopGettingFrames(), and MPEG2TransportStreamFramer::doStopGettingFrames().

00049                                        {
00050   if (fInputSource != NULL) fInputSource->stopGettingFrames();
00051 }

Boolean FramedSource::lookupByName ( UsageEnvironment env,
char const *  sourceName,
FramedSource *&  resultSource 
) [static, inherited]

Definition at line 41 of file FramedSource.cpp.

References env, False, MediaSource::isFramedSource(), MediaSource::lookupByName(), NULL, and True.

Referenced by MP3ADUinterleaverBase::getInputSource().

00042                                                                 {
00043   resultSource = NULL; // unless we succeed
00044 
00045   MediaSource* source;
00046   if (!MediaSource::lookupByName(env, sourceName, source)) return False;
00047 
00048   if (!source->isFramedSource()) {
00049     env.setResultMsg(sourceName, " is not a framed source");
00050     return False;
00051   }
00052 
00053   resultSource = (FramedSource*)source;
00054   return True;
00055 }

Boolean MediaSource::lookupByName ( UsageEnvironment env,
char const *  sourceName,
MediaSource *&  resultSource 
) [static, inherited]

Definition at line 62 of file MediaSource.cpp.

References env, False, Medium::isSource(), Medium::lookupByName(), NULL, and True.

Referenced by RTPSource::lookupByName(), and FramedSource::lookupByName().

00064                                                               {
00065   resultSource = NULL; // unless we succeed
00066 
00067   Medium* medium;
00068   if (!Medium::lookupByName(env, sourceName, medium)) return False;
00069 
00070   if (!medium->isSource()) {
00071     env.setResultMsg(sourceName, " is not a media source");
00072     return False;
00073   }
00074 
00075   resultSource = (MediaSource*)medium;
00076   return True;
00077 }

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

Definition at line 65 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().

00066                                                          {
00067   resultMedium = MediaLookupTable::ourMedia(env)->lookup(mediumName);
00068   if (resultMedium == NULL) {
00069     env.setResultMsg("Medium ", mediumName, " does not exist");
00070     return False;
00071   }
00072 
00073   return True;
00074 }

void FramedSource::getNextFrame ( unsigned char *  to,
unsigned  maxSize,
afterGettingFunc afterGettingFunc,
void *  afterGettingClientData,
onCloseFunc onCloseFunc,
void *  onCloseClientData 
) [inherited]

Definition at line 57 of file FramedSource.cpp.

References FramedSource::doGetNextFrame(), Medium::envir(), FramedSource::fAfterGettingClientData, FramedSource::fAfterGettingFunc, FramedSource::fDurationInMicroseconds, FramedSource::fIsCurrentlyAwaitingData, FramedSource::fMaxSize, FramedSource::fNumTruncatedBytes, FramedSource::fOnCloseClientData, FramedSource::fOnCloseFunc, FramedSource::fTo, and True.

Referenced by MPEG2TransportStreamFramer::afterGettingFrame1(), InputESSourceRecord::askForNewData(), MPEG2TransportStreamFromPESSource::awaitNewBuffer(), QuickTimeFileSink::continuePlaying(), DummySink::continuePlaying(), HTTPSink::continuePlaying(), FileSink::continuePlaying(), AVIFileSink::continuePlaying(), BasicUDPSink::continuePlaying1(), EndianSwap16::doGetNextFrame(), HostFromNetworkOrder16::doGetNextFrame(), NetworkFromHostOrder16::doGetNextFrame(), PCMFromuLawAudioSource::doGetNextFrame(), uLawFromPCMAudioSource::doGetNextFrame(), QCELPDeinterleaver::doGetNextFrame(), MPEG4VideoStreamDiscreteFramer::doGetNextFrame(), MPEG2TransportStreamFramer::doGetNextFrame(), MPEG2IFrameIndexFromTransportStream::doGetNextFrame(), MPEG1or2VideoStreamDiscreteFramer::doGetNextFrame(), MP3ADUTranscoder::doGetNextFrame(), MP3ADUdeinterleaver::doGetNextFrame(), MP3ADUinterleaver::doGetNextFrame(), H264FUAFragmenter::doGetNextFrame(), ByteStreamMultiFileSource::doGetNextFrame(), AMRDeinterleaver::doGetNextFrame(), SegmentQueue::enqueueNewSegment(), StreamParser::ensureValidBytes1(), MultiFramedRTPSink::packFrame(), AC3AudioStreamParser::readAndSaveAFrame(), and MPEG2TransportStreamTrickModeFilter::readTransportPacket().

00061                                                          {
00062   // Make sure we're not already being read:
00063   if (fIsCurrentlyAwaitingData) {
00064     envir() << "FramedSource[" << this << "]::getNextFrame(): attempting to read more than once at the same time!\n";
00065     exit(1);
00066   }
00067 
00068   fTo = to;
00069   fMaxSize = maxSize;
00070   fNumTruncatedBytes = 0; // by default; could be changed by doGetNextFrame()
00071   fDurationInMicroseconds = 0; // by default; could be changed by doGetNextFrame()
00072   fAfterGettingFunc = afterGettingFunc;
00073   fAfterGettingClientData = afterGettingClientData;
00074   fOnCloseFunc = onCloseFunc;
00075   fOnCloseClientData = onCloseClientData;
00076   fIsCurrentlyAwaitingData = True;
00077 
00078   doGetNextFrame();
00079 }

void FramedSource::handleClosure ( void *  clientData  )  [static, inherited]

Definition at line 95 of file FramedSource.cpp.

References False, FramedSource::fIsCurrentlyAwaitingData, FramedSource::fOnCloseClientData, FramedSource::fOnCloseFunc, and NULL.

Referenced by MPEG2TransportStreamFramer::afterGettingFrame1(), MP3ADUTranscoder::afterGettingFrame1(), InputESSourceRecord::askForNewData(), MPEG2TransportStreamFromPESSource::awaitNewBuffer(), WAVAudioFileSource::doGetNextFrame(), EndianSwap16::doGetNextFrame(), HostFromNetworkOrder16::doGetNextFrame(), NetworkFromHostOrder16::doGetNextFrame(), PCMFromuLawAudioSource::doGetNextFrame(), uLawFromPCMAudioSource::doGetNextFrame(), QCELPDeinterleaver::doGetNextFrame(), MPEG4VideoStreamDiscreteFramer::doGetNextFrame(), MPEG2TransportStreamFramer::doGetNextFrame(), MPEG1or2VideoStreamDiscreteFramer::doGetNextFrame(), MPEG1or2DemuxedElementaryStream::doGetNextFrame(), MP3FileSource::doGetNextFrame(), MP3ADUTranscoder::doGetNextFrame(), MP3ADUdeinterleaver::doGetNextFrame(), MP3ADUinterleaver::doGetNextFrame(), ADUFromMP3Source::doGetNextFrame(), H264FUAFragmenter::doGetNextFrame(), DeviceSource::doGetNextFrame(), ByteStreamMultiFileSource::doGetNextFrame(), ByteStreamFileSource::doGetNextFrame(), AMRDeinterleaver::doGetNextFrame(), AMRAudioFileSource::doGetNextFrame(), ADTSAudioFileSource::doGetNextFrame(), ByteStreamFileSource::doReadFromFile(), SegmentQueue::enqueueNewSegment(), MPEG2IFrameIndexFromTransportStream::handleInputClosure1(), and MPEG2TransportStreamTrickModeFilter::onSourceClosure1().

00095                                                  {
00096   FramedSource* source = (FramedSource*)clientData;
00097   source->fIsCurrentlyAwaitingData = False; // because we got a close instead
00098   if (source->fOnCloseFunc != NULL) {
00099     (*(source->fOnCloseFunc))(source->fOnCloseClientData);
00100   }
00101 }

void FramedSource::stopGettingFrames (  )  [inherited]

Definition at line 103 of file FramedSource.cpp.

References FramedSource::doStopGettingFrames(), False, and FramedSource::fIsCurrentlyAwaitingData.

Referenced by MPEG2TransportStreamFromPESSource::doStopGettingFrames(), FramedFilter::doStopGettingFrames(), AMRDeinterleaver::doStopGettingFrames(), and MediaSink::stopPlaying().

00103                                      {
00104   fIsCurrentlyAwaitingData = False; // indicates that we can be read again
00105 
00106   // Perform any specialized action now:
00107   doStopGettingFrames();
00108 }

unsigned FramedSource::maxFrameSize (  )  const [virtual, inherited]

Reimplemented in MPEG1or2DemuxedElementaryStream.

Definition at line 116 of file FramedSource.cpp.

Referenced by StreamParser::ensureValidBytes1().

00116                                           {
00117   // By default, this source has no maximum frame size.
00118   return 0;
00119 }

Boolean FramedSource::isCurrentlyAwaitingData (  )  const [inline, inherited]

Definition at line 60 of file FramedSource.hh.

References FramedSource::fIsCurrentlyAwaitingData.

Referenced by afterPlaying(), InputESSourceRecord::askForNewData(), MPEG2TransportStreamFromESSource::awaitNewBuffer(), QuickTimeFileSink::continuePlaying(), AVIFileSink::continuePlaying(), DeviceSource::deliverFrame(), QCELPDeinterleaver::doGetNextFrame(), AMRDeinterleaver::doGetNextFrame(), ByteStreamFileSource::fileReadableHandler(), and BasicUDPSource::incomingPacketHandler1().

00060 {return fIsCurrentlyAwaitingData;}

void FramedSource::afterGetting ( FramedSource source  )  [static, protected, inherited]

Definition at line 81 of file FramedSource.cpp.

References FramedSource::fAfterGettingClientData, FramedSource::fAfterGettingFunc, False, FramedSource::fDurationInMicroseconds, FramedSource::fFrameSize, FramedSource::fIsCurrentlyAwaitingData, FramedSource::fNumTruncatedBytes, FramedSource::fPresentationTime, and NULL.

Referenced by ByteStreamMultiFileSource::afterGettingFrame(), EndianSwap16::afterGettingFrame1(), HostFromNetworkOrder16::afterGettingFrame1(), NetworkFromHostOrder16::afterGettingFrame1(), PCMFromuLawAudioSource::afterGettingFrame1(), uLawFromPCMAudioSource::afterGettingFrame1(), MPEG2TransportStreamFramer::afterGettingFrame1(), MPEG1or2DemuxedElementaryStream::afterGettingFrame1(), MP3ADUTranscoder::afterGettingFrame1(), MPEG2TransportStreamTrickModeFilter::attemptDeliveryToClient(), MPEGVideoStreamFramer::continueReadProcessing(), MPEG1or2AudioStreamFramer::continueReadProcessing(), H263plusVideoStreamFramer::continueReadProcessing(), DeviceSource::deliverFrame(), MPEG2IFrameIndexFromTransportStream::deliverIndexRecord(), WAVAudioFileSource::doGetNextFrame(), QCELPDeinterleaver::doGetNextFrame(), MPEG2TransportStreamTrickModeFilter::doGetNextFrame(), MPEG2TransportStreamMultiplexor::doGetNextFrame(), MP3FileSource::doGetNextFrame(), MP3ADUdeinterleaver::doGetNextFrame(), MP3ADUinterleaver::doGetNextFrame(), MP3FromADUSource::doGetNextFrame(), H264FUAFragmenter::doGetNextFrame(), AMRDeinterleaver::doGetNextFrame(), AMRAudioFileSource::doGetNextFrame(), ADTSAudioFileSource::doGetNextFrame(), MultiFramedRTPSource::doGetNextFrame1(), ADUFromMP3Source::doGetNextFrame1(), ByteStreamFileSource::doReadFromFile(), BasicUDPSource::incomingPacketHandler1(), and AC3AudioStreamFramer::parseNextFrame().

00081                                                     {
00082   source->fIsCurrentlyAwaitingData = False;
00083       // indicates that we can be read again
00084       // Note that this needs to be done here, in case the "fAfterFunc"
00085       // called below tries to read another frame (which it usually will)
00086 
00087   if (source->fAfterGettingFunc != NULL) {
00088     (*(source->fAfterGettingFunc))(source->fAfterGettingClientData,
00089                                    source->fFrameSize, source->fNumTruncatedBytes,
00090                                    source->fPresentationTime,
00091                                    source->fDurationInMicroseconds);
00092   }
00093 }

Boolean MediaSource::isRTPSource (  )  const [virtual, inherited]

Reimplemented in RTPSource.

Definition at line 43 of file MediaSource.cpp.

References False.

Referenced by RTPSource::lookupByName().

00043                                        {
00044   return False; // default implementation
00045 }

Boolean MediaSource::isMPEG1or2VideoStreamFramer (  )  const [virtual, inherited]

Reimplemented in MPEG1or2VideoStreamFramer.

Definition at line 46 of file MediaSource.cpp.

References False.

Referenced by MPEG1or2VideoRTPSink::sourceIsCompatibleWithUs().

00046                                                        {
00047   return False; // default implementation
00048 }

Boolean MediaSource::isH264VideoStreamFramer (  )  const [virtual, inherited]

Reimplemented in H264VideoStreamFramer.

Definition at line 52 of file MediaSource.cpp.

References False.

Referenced by H264VideoRTPSink::sourceIsCompatibleWithUs().

00052                                                    {
00053   return False; // default implementation
00054 }

Boolean MediaSource::isJPEGVideoSource (  )  const [virtual, inherited]

Reimplemented in JPEGVideoSource.

Definition at line 55 of file MediaSource.cpp.

References False.

Referenced by JPEGVideoRTPSink::sourceIsCompatibleWithUs().

00055                                              {
00056   return False; // default implementation
00057 }

Boolean MediaSource::isAMRAudioSource (  )  const [virtual, inherited]

Reimplemented in AMRAudioSource.

Definition at line 58 of file MediaSource.cpp.

References False.

Referenced by AMRAudioRTPSink::sourceIsCompatibleWithUs(), and AMRAudioFileSink::sourceIsCompatibleWithUs().

00058                                             {
00059   return False; // default implementation
00060 }

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

Definition at line 76 of file Media.cpp.

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

Referenced by afterPlaying(), Medium::close(), closeMediaSinks(), OnDemandServerMediaSubsession::closeStreamSource(), WAVAudioFileSource::createNew(), QuickTimeFileSink::createNew(), QCELPAudioRTPSource::createNew(), MP3HTTPSource::createNew(), MP3FileSource::createNew(), AVIFileSink::createNew(), AMRAudioRTPSource::createNew(), WAVAudioFileServerMediaSubsession::createNewStreamSource(), MPEG1or2DemuxedServerMediaSubsession::createNewStreamSource(), MediaSubsession::deInitiate(), MediaSubsession::initiate(), MPEG1or2ProgramStreamFileDuration(), MPEG1or2Demux::noteElementaryStreamDeletion(), ByteStreamMultiFileSource::onSourceClosure1(), StreamState::reclaim(), RTSPServer::removeServerMediaSession(), OnDemandServerMediaSubsession::sdpLines(), shutdown(), H264VideoRTPSink::stopPlaying(), subsessionAfterPlaying(), ClientTrickPlayState::updateStateOnScaleChange(), AMRDeinterleaver::~AMRDeinterleaver(), ByteStreamMultiFileSource::~ByteStreamMultiFileSource(), DarwinInjector::~DarwinInjector(), FramedFilter::~FramedFilter(), H264VideoRTPSink::~H264VideoRTPSink(), InputESSourceRecord::~InputESSourceRecord(),