#include <ADTSAudioFileSource.hh>
Inheritance diagram for ADTSAudioFileSource:


Public Types | |
| typedef void( | afterGettingFunc )(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds) |
| typedef void( | onCloseFunc )(void *clientData) |
Public Member Functions | |
| unsigned | samplingFrequency () const |
| unsigned | numChannels () const |
| char const * | configStr () 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 void | getAttributes () const |
| virtual char const * | MIMEtype () const |
| virtual Boolean | isRTPSource () const |
| virtual Boolean | isMPEG1or2VideoStreamFramer () const |
| virtual Boolean | isMPEG4VideoStreamFramer () const |
| virtual Boolean | isH264VideoStreamFramer () const |
| virtual Boolean | isJPEGVideoSource () const |
| virtual Boolean | isAMRAudioSource () const |
| UsageEnvironment & | envir () 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 ADTSAudioFileSource * | createNew (UsageEnvironment &env, char const *fileName) |
| 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 | |
| virtual void | doStopGettingFrames () |
| TaskToken & | nextTask () |
Static Protected Member Functions | |
| static void | afterGetting (FramedSource *source) |
Protected Attributes | |
| FILE * | fFid |
| unsigned char * | fTo |
| unsigned | fMaxSize |
| unsigned | fFrameSize |
| unsigned | fNumTruncatedBytes |
| timeval | fPresentationTime |
| unsigned | fDurationInMicroseconds |
Private Member Functions | |
| ADTSAudioFileSource (UsageEnvironment &env, FILE *fid, u_int8_t profile, u_int8_t samplingFrequencyIndex, u_int8_t channelConfiguration) | |
| virtual | ~ADTSAudioFileSource () |
| virtual void | doGetNextFrame () |
Private Attributes | |
| unsigned | fSamplingFrequency |
| unsigned | fNumChannels |
| unsigned | fuSecsPerFrame |
| char | fConfigStr [5] |
Definition at line 28 of file ADTSAudioFileSource.hh.
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.
| ADTSAudioFileSource::ADTSAudioFileSource | ( | UsageEnvironment & | env, | |
| FILE * | fid, | |||
| u_int8_t | profile, | |||
| u_int8_t | samplingFrequencyIndex, | |||
| u_int8_t | channelConfiguration | |||
| ) | [private] |
Definition at line 95 of file ADTSAudioFileSource.cpp.
References fConfigStr, fNumChannels, fSamplingFrequency, fuSecsPerFrame, and samplingFrequencyTable.
Referenced by createNew().
00097 : FramedFileSource(env, fid) { 00098 fSamplingFrequency = samplingFrequencyTable[samplingFrequencyIndex]; 00099 fNumChannels = channelConfiguration == 0 ? 2 : channelConfiguration; 00100 fuSecsPerFrame 00101 = (1024/*samples-per-frame*/*1000000) / fSamplingFrequency/*samples-per-second*/; 00102 00103 // Construct the 'AudioSpecificConfig', and from it, the corresponding ASCII string: 00104 unsigned char audioSpecificConfig[2]; 00105 u_int8_t const audioObjectType = profile + 1; 00106 audioSpecificConfig[0] = (audioObjectType<<3) | (samplingFrequencyIndex>>1); 00107 audioSpecificConfig[1] = (samplingFrequencyIndex<<7) | (channelConfiguration<<3); 00108 sprintf(fConfigStr, "%02X%02x", audioSpecificConfig[0], audioSpecificConfig[1]); 00109 }
| ADTSAudioFileSource::~ADTSAudioFileSource | ( | ) | [private, virtual] |
Definition at line 111 of file ADTSAudioFileSource.cpp.
References CloseInputFile(), and FramedFileSource::fFid.
00111 { 00112 CloseInputFile(fFid); 00113 }
| ADTSAudioFileSource * ADTSAudioFileSource::createNew | ( | UsageEnvironment & | env, | |
| char const * | fileName | |||
| ) | [static] |
Definition at line 35 of file ADTSAudioFileSource.cpp.
References ADTSAudioFileSource(), CloseInputFile(), env, NULL, OpenInputFile(), samplingFrequencyTable, and UsageEnvironment::setResultMsg().
Referenced by ADTSAudioFileServerMediaSubsession::createNewStreamSource().
00035 { 00036 FILE* fid = NULL; 00037 do { 00038 fid = OpenInputFile(env, fileName); 00039 if (fid == NULL) break; 00040 00041 // Now, having opened the input file, read the fixed header of the first frame, 00042 // to get the audio stream's parameters: 00043 unsigned char fixedHeader[4]; // it's actually 3.5 bytes long 00044 if (fread(fixedHeader, 1, sizeof fixedHeader, fid) < sizeof fixedHeader) break; 00045 00046 // Check the 'syncword': 00047 if (!(fixedHeader[0] == 0xFF && (fixedHeader[1]&0xF0) == 0xF0)) { 00048 env.setResultMsg("Bad 'syncword' at start of ADTS file"); 00049 break; 00050 } 00051 00052 // Get and check the 'profile': 00053 u_int8_t profile = (fixedHeader[2]&0xC0)>>6; // 2 bits 00054 if (profile == 3) { 00055 env.setResultMsg("Bad (reserved) 'profile': 3 in first frame of ADTS file"); 00056 break; 00057 } 00058 00059 // Get and check the 'sampling_frequency_index': 00060 u_int8_t sampling_frequency_index = (fixedHeader[2]&0x3C)>>2; // 4 bits 00061 if (samplingFrequencyTable[sampling_frequency_index] == 0) { 00062 env.setResultMsg("Bad 'sampling_frequency_index' in first frame of ADTS file"); 00063 break; 00064 } 00065 00066 // Get and check the 'channel_configuration': 00067 u_int8_t channel_configuration 00068 = ((fixedHeader[2]&0x01)<<2)|((fixedHeader[3]&0xC0)>>6); // 3 bits 00069 00070 // If we get here, the frame header was OK. 00071 // Reset the fid to the beginning of the file: 00072 #ifndef _WIN32_WCE 00073 rewind(fid); 00074 #else 00075 fseek(fid, SEEK_SET,0); 00076 #endif 00077 #ifdef DEBUG 00078 fprintf(stderr, "Read first frame: profile %d, " 00079 "sampling_frequency_index %d => samplingFrequency %d, " 00080 "channel_configuration %d\n", 00081 profile, 00082 sampling_frequency_index, samplingFrequencyTable[sampling_frequency_index], 00083 channel_configuration); 00084 #endif 00085 return new ADTSAudioFileSource(env, fid, profile, 00086 sampling_frequency_index, channel_configuration); 00087 } while (0); 00088 00089 // An error occurred: 00090 CloseInputFile(fid); 00091 return NULL; 00092 }
| unsigned ADTSAudioFileSource::samplingFrequency | ( | ) | const [inline] |
Definition at line 33 of file ADTSAudioFileSource.hh.
References fSamplingFrequency.
Referenced by ADTSAudioFileServerMediaSubsession::createNewRTPSink().
00033 { return fSamplingFrequency; }
| unsigned ADTSAudioFileSource::numChannels | ( | ) | const [inline] |
Definition at line 34 of file ADTSAudioFileSource.hh.
References fNumChannels.
Referenced by ADTSAudioFileServerMediaSubsession::createNewRTPSink().
00034 { return fNumChannels; }
| char const* ADTSAudioFileSource::configStr | ( | ) | const [inline] |
Definition at line 35 of file ADTSAudioFileSource.hh.
References fConfigStr.
Referenced by ADTSAudioFileServerMediaSubsession::createNewRTPSink().
00035 { return fConfigStr; }
| void ADTSAudioFileSource::doGetNextFrame | ( | ) | [private, virtual] |
Implements FramedSource.
Definition at line 117 of file ADTSAudioFileSource.cpp.
References FramedSource::afterGetting(), Medium::envir(), FramedSource::fDurationInMicroseconds, FramedFileSource::fFid, FramedSource::fFrameSize, FramedSource::fMaxSize, FramedSource::fNumTruncatedBytes, FramedSource::fPresentationTime, FramedSource::fTo, fuSecsPerFrame, FramedSource::handleClosure(), Medium::nextTask(), NULL, TaskScheduler::scheduleDelayedTask(), and UsageEnvironment::taskScheduler().
00117 { 00118 // Begin by reading the 7-byte fixed_variable headers: 00119 unsigned char headers[7]; 00120 if (fread(headers, 1, sizeof headers, fFid) < sizeof headers 00121 || feof(fFid) || ferror(fFid)) { 00122 // The input source has ended: 00123 handleClosure(this); 00124 return; 00125 } 00126 00127 // Extract important fields from the headers: 00128 Boolean protection_absent = headers[1]&0x01; 00129 u_int16_t frame_length 00130 = ((headers[3]&0x03)<<11) | (headers[4]<<3) | ((headers[5]&0xE0)>>5); 00131 #ifdef DEBUG 00132 u_int16_t syncword = (headers[0]<<4) | (headers[1]>>4); 00133 fprintf(stderr, "Read frame: syncword 0x%x, protection_absent %d, frame_length %d\n", syncword, protection_absent, frame_length); 00134 if (syncword != 0xFFF) fprintf(stderr, "WARNING: Bad syncword!\n"); 00135 #endif 00136 unsigned numBytesToRead 00137 = frame_length > sizeof headers ? frame_length - sizeof headers : 0; 00138 00139 // If there's a 'crc_check' field, skip it: 00140 if (!protection_absent) { 00141 fseek(fFid, 2, SEEK_CUR); 00142 numBytesToRead = numBytesToRead > 2 ? numBytesToRead - 2 : 0; 00143 } 00144 00145 // Next, read the raw frame data into the buffer provided: 00146 if (numBytesToRead > fMaxSize) { 00147 fNumTruncatedBytes = numBytesToRead - fMaxSize; 00148 numBytesToRead = fMaxSize; 00149 } 00150 int numBytesRead = fread(fTo, 1, numBytesToRead, fFid); 00151 if (numBytesRead < 0) numBytesRead = 0; 00152 fFrameSize = numBytesRead; 00153 fNumTruncatedBytes += numBytesToRead - numBytesRead; 00154 00155 // Set the 'presentation time': 00156 if (fPresentationTime.tv_sec == 0 && fPresentationTime.tv_usec == 0) { 00157 // This is the first frame, so use the current time: 00158 gettimeofday(&fPresentationTime, NULL); 00159 } else { 00160 // Increment by the play time of the previous frame: 00161 unsigned uSeconds = fPresentationTime.tv_usec + fuSecsPerFrame; 00162 fPresentationTime.tv_sec += uSeconds/1000000; 00163 fPresentationTime.tv_usec = uSeconds%1000000; 00164 } 00165 00166 fDurationInMicroseconds = fuSecsPerFrame; 00167 00168 // Switch to another task, and inform the reader that he has data: 00169 nextTask() = envir().taskScheduler().scheduleDelayedTask(0, 00170 (TaskFunc*)FramedSource::afterGetting, this); 00171 }
| 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(), 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().
| 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(), 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 }
| void FramedSource::doStopGettingFrames | ( | ) | [protected, virtual, inherited] |
Reimplemented in AMRDeinterleaver, BasicUDPSource, ByteStreamFileSource, FramedFilter, MPEG1or2DemuxedElementaryStream, MPEG2TransportStreamFramer, MPEG2TransportStreamFromESSource, MPEG2TransportStreamFromPESSource, MPEG2TransportStreamTrickModeFilter, and MultiFramedRTPSource.
Definition at line 110 of file FramedSource.cpp.
Referenced by FramedSource::stopGettingFrames().
00110 { 00111 // Default implementation: Do nothing 00112 // Subclasses may wish to specialize this so as to ensure that a 00113 // subsequent reader can pick up where this one left off. 00114 }
| void MediaSource::getAttributes | ( | ) | const [virtual, inherited] |
Reimplemented in FramedFilter, MP3ADUTranscoder, MP3FileSource, and RTPSource.
Definition at line 79 of file MediaSource.cpp.
References Medium::envir(), and UsageEnvironment::setResultMsg().
Referenced by MP3ADUTranscoder::getAttributes(), and FramedFilter::getAttributes().
00079 { 00080 // Default implementation 00081 envir().setResultMsg(""); 00082 }
| char const * MediaSource::MIMEtype | ( | ) | const [virtual, inherited] |
Reimplemented in RawAMRRTPSource, AC3AudioRTPSource, FramedFilter, H261VideoRTPSource, H263plusVideoRTPSource, H264VideoRTPSource, JPEGVideoRTPSource, ADUFromMP3Source, MP3FromADUSource, MP3ADURTPSource, MP3FileSource, MPEG1or2AudioRTPSource, MPEG1or2DemuxedElementaryStream, MPEG1or2VideoRTPSource, MPEG4ESVideoRTPSource, MPEG4GenericRTPSource, MPEG4LATMAudioRTPSource, QuickTimeGenericRTPSource, SimpleRTPSource, and RawQCELPRTPSource.
Definition at line 36 of file MediaSource.cpp.
Referenced by HTTPSink::continuePlaying(), MP3ADUTranscoder::createNew(), MP3FromADUSource::createNew(), ADUFromMP3Source::createNew(), MP3ADUinterleaverBase::getInputSource(), MediaSession::initiateByMediaType(), SimpleRTPSource::MIMEtype(), QuickTimeGenericRTPSource::MIMEtype(), FramedFilter::MIMEtype(), and MPEG1or2DemuxedElementaryStream::MPEG1or2DemuxedElementaryStream().
| 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::isMPEG4VideoStreamFramer | ( | ) | const [virtual, inherited] |
Reimplemented in MPEG4VideoStreamFramer.
Definition at line 49 of file MediaSource.cpp.
References False.
Referenced by MPEG4ESVideoRTPSink::sourceIsCompatibleWithUs().
00049 { 00050 return False; // default implementation 00051 }
| 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(), MPEG1or2Demux::~MPEG1or2Demux(), MPEG1or2FileServerDemux::~MPEG1or2FileServerDemux(), MPEG2TransportFileServerMediaSubsession::~MPEG2TransportFileServerMediaSubsession(), MPEG2TransportStreamFromPESSource::~MPEG2TransportStreamFromPESSource(), ServerMediaSession::~ServerMediaSession(), and ServerMediaSubsession::~ServerMediaSubsession().
00076 { 00077 MediaLookupTable::ourMedia(env)->remove(name); 00078 }
| void Medium::close | ( | Medium * | medium | ) | [static, inherited] |
Definition at line 80 of file Media.cpp.
References Medium::close(), Medium::envir(), Medium::name(), and NULL.
00080 { 00081 if (medium == NULL) return; 00082 00083 close(medium->envir(), medium->name()); 00084 }
| UsageEnvironment& Medium::envir | ( | ) | const [inline, inherited] |
Definition at line 59 of file Media.hh.
References Medium::fEnviron.
Referenced by QuickTimeFileSink::addArbitraryString(), FileSink::addData(), MPEG2IFrameIndexFromTransportStream::addToTail(), StreamParser::afterGettingBytes(), MultiFramedRTPSink::afterGettingFrame1(), InputESSourceRecord::afterGettingFrame1(), MPEG2TransportStreamFramer::afterGettingFrame1(), MPEG2IFrameIndexFromTransportStream::afterGettingFrame1(), HTTPSink::afterGettingFrame1(), BasicUDPSink::afterGettingFrame1(), MPEG4VideoFileServerMediaSubsession::afterPlayingDummy1(), MPEG4VideoStreamParser::analyzeVOLHeader(), RTSPClient::announceSDPDescription(), announceStream(), MPEG4VideoFileServerMediaSubsession::checkForAuxSDPLine1(), Medium::close(), MPEG2IFrameIndexFromTransportStream::compactParseBuffer(), QuickTimeFileSink::continuePlaying(), HTTPSink::continuePlaying(), H264VideoRTPSink::continuePlaying(), AVIFileSink::continuePlaying(), MPEG4VideoFileServerMediaSubsession::createNewRTPSink(), MPEG2TransportFileServerMediaSubsession::createNewRTPSink(), MPEG1or2VideoFileServerMediaSubsession::createNewRTPSink(), MPEG1or2DemuxedServerMediaSubsession::createNewRTPSink(), H263plusVideoFileServerMediaSubsession::createNewRTPSink(), AMRAudioFileServerMediaSubsession::createNewRTPSink(), ADTSAudioFileServerMediaSubsession::createNewRTPSink(), MPEG4VideoFileServerMediaSubsession::createNewStreamSource(), MPEG2TransportFileServerMediaSubsession::createNewStreamSource(), MPEG1or2VideoFileServerMediaSubsession::createNewStreamSource(), MPEG1or2DemuxedServerMediaSubsession::createNewStreamSource(), H263plusVideoFileServerMediaSubsession::createNewStreamSource(), AMRAudioFileServerMediaSubsession::createNewStreamSource(), ADTSAudioFileServerMediaSubsession::createNewStreamSource(), MPEG2IFrameIndexFromTransportStream::deliverIndexRecord(), SegmentQueue::dequeue(), RTSPClient::describeURL(), WAVAudioFileSource::doGetNextFrame(), MPEG2IFrameIndexFromTransportStream::doGetNextFrame(), MP3FileSource::doGetNextFrame(), H264FUAFragmenter::doGetNextFrame(), ByteStreamMultiFileSource::doGetNextFrame(), ByteStreamFileSource::doGetNextFrame(), BasicUDPSource::doGetNextFrame(), AMRAudioFileSource::doGetNextFrame(), doGetNextFrame(), MultiFramedRTPSource::doGetNextFrame1(), MP3FileSource::doGetNextFrame1(), ADUFromMP3Source::doGetNextFrame1(), SIPClient::doInviteStateMachine(), ByteStreamFileSource::doReadFromFile(), MPEG1or2VideoRTPSink::doSpecialFrameHandling(), MP3ADURTPSink::doSpecialFrameHandling(), H263plusVideoRTPSink::doSpecialFrameHandling(), ByteStreamFileSource::doStopGettingFrames(), BasicUDPSource::doStopGettingFrames(), SegmentQueue::enqueueNewSegment(), StreamParser::ensureValidBytes1(), MediaSubsession::env(), SubsessionIOState::envir(), RTSPServer::RTSPClientSession::envir(), RTSPOverHTTPServer::HTTPClientConnection::envir(), RTPInterface::envir(), AVISubsessionIOState::envir(), ServerMediaSession::generateSDPDescription(), RTPSource::getAttributes(), MP3FileSource::getAttributes(), MP3ADUTranscoder::getAttributes(), MediaSource::getAttributes(), MPEG4VideoFileServerMediaSubsession::getAuxSDPLine(), RTSPClient::getMediaSessionParameter(), getMPEG1or2TimeCode(), FramedSource::getNextFrame(), getOptionsResponse(), SIPClient::getResponse(), RTSPClient::getResponse(), RTSPClient::getResponse1(), SIPClient::getResponseCode(), getSDPDescriptionFromURL(), OnDemandServerMediaSubsession::getStreamParameters(), RTSPServer::incomingConnectionHandler1(), RTSPOverHTTPServer::incomingConnectionHandler1(), RTCPInstance::incomingReportHandler1(), RTSPClient::incomingRequestHandler1(), MP3FileSource::initializeStream(), MediaSession::initializeWithSDP(), MediaSession::initiateByMediaType(), SIPClient::invite1(), DynamicRTSPServer::lookupServerMediaSession(), MPEG4GenericRTPSource::MPEG4GenericRTPSource(), MPEG1or2FileServerDemux::newElementaryStream(), MPEG1or2Demux::newElementaryStream(), MPEG4GenericBufferedPacket::nextEnclosedFrameSize(), AMRBufferedPacket::nextEnclosedFrameSize(), RTSPClient::openConnectionFromURL(), MPEG2TransportStreamIndexFile::openFid(), MPEG2IFrameIndexFromTransportStream::parseFrame(), AC3AudioStreamParser::parseFrame(), RTSPClient::parseGetParameterHeader(), MPEGProgramStreamParser::parsePackHeader(), MPEGProgramStreamParser::parsePESPacket(), SIPClient::parseResponseCode(), RTSPClient::parseResponseCode(), MediaSession::parseSDPLine(), MPEG1or2VideoStreamParser::parseSlice(), MPEGProgramStreamParser::parseSystemHeader(), MPEG4VideoStreamParser::parseVideoObjectLayer(), MPEG4VideoStreamParser::parseVideoObjectPlane(), MPEG4VideoStreamParser::parseVisualObject(), RTSPClient::pauseMediaSession(), RTSPClient::pauseMediaSubsession(), RTSPClient::playMediaSession(), RTSPClient::playMediaSubsession(), AC3AudioRTPSource::processSpecialHeader(), SIPClient::processURL(), AC3AudioStreamParser::readAndSaveAFrame(), RTSPClient::recordMediaSubsession(), MPEG1or2Demux::registerReadInterest(), RTCPInstance::reschedule(), RTSPServer::rtspURLPrefix(), RTCPInstance::schedule(), OnDemandServerMediaSubsession::sdpLines(), SIPClie