#include <MP3ADU.hh>
Inheritance diagram for MP3FromADUSource:


Public Types | |
| typedef void( | afterGettingFunc )(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds) |
| typedef void( | onCloseFunc )(void *clientData) |
Public Member Functions | |
| FramedSource * | inputSource () 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 | 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 MP3FromADUSource * | createNew (UsageEnvironment &env, FramedSource *inputSource, Boolean includeADUdescriptors=True) |
| 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 | |
| MP3FromADUSource (UsageEnvironment &env, FramedSource *inputSource, Boolean includeADUdescriptors) | |
| virtual | ~MP3FromADUSource () |
| virtual void | getAttributes () const |
| virtual void | doStopGettingFrames () |
| TaskToken & | nextTask () |
Static Protected Member Functions | |
| static void | afterGetting (FramedSource *source) |
Protected Attributes | |
| FramedSource * | fInputSource |
| unsigned char * | fTo |
| unsigned | fMaxSize |
| unsigned | fFrameSize |
| unsigned | fNumTruncatedBytes |
| timeval | fPresentationTime |
| unsigned | fDurationInMicroseconds |
Private Member Functions | |
| virtual void | doGetNextFrame () |
| virtual char const * | MIMEtype () const |
| Boolean | needToGetAnADU () |
| void | insertDummyADUsIfNecessary () |
| Boolean | generateFrameFromHeadADU () |
Private Attributes | |
| Boolean | fAreEnqueueingADU |
| SegmentQueue * | fSegments |
| Boolean | fIncludeADUdescriptors |
Definition at line 66 of file MP3ADU.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.
| MP3FromADUSource::MP3FromADUSource | ( | UsageEnvironment & | env, | |
| FramedSource * | inputSource, | |||
| Boolean | includeADUdescriptors | |||
| ) | [protected] |
Definition at line 274 of file MP3ADU.cpp.
Referenced by createNew().
00277 : FramedFilter(env, inputSource), 00278 fAreEnqueueingADU(False), 00279 fSegments(new SegmentQueue(False /* because we're ADU->MP3 */, 00280 includeADUdescriptors)), 00281 fIncludeADUdescriptors(includeADUdescriptors) { 00282 }
| MP3FromADUSource::~MP3FromADUSource | ( | ) | [protected, virtual] |
Definition at line 284 of file MP3ADU.cpp.
References fSegments.
00284 { 00285 delete fSegments; 00286 }
| MP3FromADUSource * MP3FromADUSource::createNew | ( | UsageEnvironment & | env, | |
| FramedSource * | inputSource, | |||
| Boolean | includeADUdescriptors = True | |||
| ) | [static] |
Definition at line 292 of file MP3ADU.cpp.
References env, FramedFilter::inputSource(), MediaSource::MIMEtype(), MP3FromADUSource(), Medium::name(), NULL, and UsageEnvironment::setResultMsg().
Referenced by MP3AudioFileServerMediaSubsession::createNewStreamSource(), MediaSubsession::initiate(), and main().
00294 { 00295 // The source must be an MP3 ADU source: 00296 if (strcmp(inputSource->MIMEtype(), "audio/MPA-ROBUST") != 0) { 00297 env.setResultMsg(inputSource->name(), " is not an MP3 ADU source"); 00298 return NULL; 00299 } 00300 00301 return new MP3FromADUSource(env, inputSource, includeADUdescriptors); 00302 }
| void MP3FromADUSource::doGetNextFrame | ( | ) | [private, virtual] |
Implements FramedSource.
Definition at line 305 of file MP3ADU.cpp.
References FramedSource::afterGetting(), Segment::buf, SegmentQueue::enqueueNewSegment(), False, fAreEnqueueingADU, FramedFilter::fInputSource, fSegments, generateFrameFromHeadADU(), insertDummyADUsIfNecessary(), needToGetAnADU(), our_random(), and True.
00305 { 00306 if (fAreEnqueueingADU) insertDummyADUsIfNecessary(); 00307 fAreEnqueueingADU = False; 00308 00309 if (needToGetAnADU()) { 00310 // Before returning a frame, we must enqueue at least one ADU: 00311 #ifdef TEST_LOSS 00312 NOTE: This code no longer works, because it uses synchronous reads, 00313 which are no longer supported. 00314 static unsigned const framesPerPacket = 10; 00315 static unsigned const frameCount = 0; 00316 static Boolean packetIsLost; 00317 while (1) { 00318 if ((frameCount++)%framesPerPacket == 0) { 00319 packetIsLost = (our_random()%10 == 0); // simulate 10% packet loss ##### 00320 } 00321 00322 if (packetIsLost) { 00323 // Read and discard the next input frame (that would be part of 00324 // a lost packet): 00325 Segment dummySegment; 00326 unsigned numBytesRead; 00327 struct timeval presentationTime; 00328 // (this works only if the source can be read synchronously) 00329 fInputSource->syncGetNextFrame(dummySegment.buf, 00330 sizeof dummySegment.buf, numBytesRead, 00331 presentationTime); 00332 } else { 00333 break; // from while (1) 00334 } 00335 } 00336 #endif 00337 00338 fAreEnqueueingADU = True; 00339 fSegments->enqueueNewSegment(fInputSource, this); 00340 } else { 00341 // Return a frame now: 00342 generateFrameFromHeadADU(); 00343 // sets fFrameSize, fPresentationTime, and fDurationInMicroseconds 00344 00345 // Call our own 'after getting' function. Because we're not a 'leaf' 00346 // source, we can call this directly, without risking infinite recursion. 00347 afterGetting(this); 00348 } 00349 }
| char const * MP3FromADUSource::MIMEtype | ( | ) | const [private, virtual] |
| Boolean MP3FromADUSource::needToGetAnADU | ( | ) | [private] |
Definition at line 351 of file MP3ADU.cpp.
References Segment::aduSize, Segment::backpointer, Segment::dataHere(), False, fSegments, SegmentQueue::headIndex(), SegmentQueue::headSegment(), SegmentQueue::isEmpty(), SegmentQueue::nextFreeIndex(), SegmentQueue::nextIndex(), SegmentQueue::s, and True.
Referenced by doGetNextFrame().
00351 { 00352 // Check whether we need to first enqueue a new ADU before we 00353 // can generate a frame for our head ADU. 00354 Boolean needToEnqueue = True; 00355 00356 if (!fSegments->isEmpty()) { 00357 unsigned index = fSegments->headIndex(); 00358 Segment* seg = &(fSegments->headSegment()); 00359 int const endOfHeadFrame = (int) seg->dataHere(); 00360 unsigned frameOffset = 0; 00361 00362 while (1) { 00363 int endOfData = frameOffset - seg->backpointer + seg->aduSize; 00364 if (endOfData >= endOfHeadFrame) { 00365 // We already have enough data to generate a frame 00366 needToEnqueue = False; 00367 break; 00368 } 00369 00370 frameOffset += seg->dataHere(); 00371 index = SegmentQueue::nextIndex(index); 00372 if (index == fSegments->nextFreeIndex()) break; 00373 seg = &(fSegments->s[index]); 00374 } 00375 } 00376 00377 return needToEnqueue; 00378 }
| void MP3FromADUSource::insertDummyADUsIfNecessary | ( | ) | [private] |
Definition at line 380 of file MP3ADU.cpp.
References Segment::aduSize, Segment::backpointer, Segment::dataHere(), fSegments, SegmentQueue::headIndex(), SegmentQueue::insertDummyBeforeTail(), SegmentQueue::isEmpty(), SegmentQueue::nextFreeIndex(), SegmentQueue::prevIndex(), and SegmentQueue::s.
Referenced by doGetNextFrame().
00380 { 00381 if (fSegments->isEmpty()) return; // shouldn't happen 00382 00383 // The tail segment (ADU) is assumed to have been recently 00384 // enqueued. If its backpointer would overlap the data 00385 // of the previous ADU, then we need to insert one or more 00386 // empty, 'dummy' ADUs ahead of it. (This situation should occur 00387 // only if an intermediate ADU was lost.) 00388 00389 unsigned tailIndex 00390 = SegmentQueue::prevIndex(fSegments->nextFreeIndex()); 00391 Segment* tailSeg = &(fSegments->s[tailIndex]); 00392 00393 while (1) { 00394 unsigned prevADUend; // relative to the start of the new ADU 00395 if (fSegments->headIndex() != tailIndex) { 00396 // there is a previous segment 00397 unsigned prevIndex = SegmentQueue::prevIndex(tailIndex); 00398 Segment& prevSegment = fSegments->s[prevIndex]; 00399 prevADUend = prevSegment.dataHere() + prevSegment.backpointer; 00400 if (prevSegment.aduSize > prevADUend) { 00401 // shouldn't happen if the previous ADU was well-formed 00402 prevADUend = 0; 00403 } else { 00404 prevADUend -= prevSegment.aduSize; 00405 } 00406 } else { 00407 prevADUend = 0; 00408 } 00409 00410 if (tailSeg->backpointer > prevADUend) { 00411 // We need to insert a dummy ADU in front of the tail 00412 #ifdef DEBUG 00413 fprintf(stderr, "a->m:need to insert a dummy ADU (%d, %d, %d) [%d, %d]\n", tailSeg->backpointer, prevADUend, tailSeg->dataHere(), fSegments->headIndex(), fSegments->nextFreeIndex()); 00414 #endif 00415 tailIndex = fSegments->nextFreeIndex(); 00416 if (!fSegments->insertDummyBeforeTail(prevADUend)) return; 00417 tailSeg = &(fSegments->s[tailIndex]); 00418 } else { 00419 break; // no more dummy ADUs need to be inserted 00420 } 00421 } 00422 }
| Boolean MP3FromADUSource::generateFrameFromHeadADU | ( | ) | [private] |
Definition at line 424 of file MP3ADU.cpp.
References Segment::aduSize, Segment::backpointer, Segment::dataHere(), Segment::dataStart(), SegmentQueue::dequeue(), Segment::descriptorSize, Segment::durationInMicroseconds, False, FramedSource::fDurationInMicroseconds, FramedSource::fFrameSize, FramedSource::fPresentationTime, Segment::frameSize, fSegments, FramedSource::fTo, Segment::headerSize, SegmentQueue::headIndex(), SegmentQueue::headSegment(), SegmentQueue::isEmpty(), SegmentQueue::nextFreeIndex(), SegmentQueue::nextIndex(), Segment::presentationTime, SegmentQueue::s, Segment::sideInfoSize, and True.
Referenced by doGetNextFrame().
00424 { 00425 // Output a frame for the head ADU: 00426 if (fSegments->isEmpty()) return False; 00427 unsigned index = fSegments->headIndex(); 00428 Segment* seg = &(fSegments->headSegment()); 00429 #ifdef DEBUG 00430 fprintf(stderr, "a->m:outputting frame for %d<-%d (fs %d, dh %d), (descriptorSize: %d)\n", seg->aduSize, seg->backpointer, seg->frameSize, seg->dataHere(), seg->descriptorSize); 00431 #endif 00432 unsigned char* toPtr = fTo; 00433 00434 // output header and side info: 00435 fFrameSize = seg->frameSize; 00436 fPresentationTime = seg->presentationTime; 00437 fDurationInMicroseconds = seg->durationInMicroseconds; 00438 memmove(toPtr, seg->dataStart(), seg->headerSize + seg->sideInfoSize); 00439 toPtr += seg->headerSize + seg->sideInfoSize; 00440 00441 // zero out the rest of the frame, in case ADU data doesn't fill it all in 00442 unsigned bytesToZero = seg->dataHere(); 00443 for (unsigned i = 0; i < bytesToZero; ++i) { 00444 toPtr[i] = '\0'; 00445 } 00446 00447 // Fill in the frame with appropriate ADU data from this and 00448 // subsequent ADUs: 00449 unsigned frameOffset = 0; 00450 unsigned toOffset = 0; 00451 unsigned const endOfHeadFrame = seg->dataHere(); 00452 00453 while (toOffset < endOfHeadFrame) { 00454 int startOfData = frameOffset - seg->backpointer; 00455 if (startOfData > (int)endOfHeadFrame) break; // no more ADUs needed 00456 00457 int endOfData = startOfData + seg->aduSize; 00458 if (endOfData > (int)endOfHeadFrame) { 00459 endOfData = endOfHeadFrame; 00460 } 00461 00462 unsigned fromOffset; 00463 if (startOfData <= (int)toOffset) { 00464 fromOffset = toOffset - startOfData; 00465 startOfData = toOffset; 00466 if (endOfData < startOfData) endOfData = startOfData; 00467 } else { 00468 fromOffset = 0; 00469 00470 // we may need some padding bytes beforehand 00471 unsigned bytesToZero = startOfData - toOffset; 00472 #ifdef DEBUG 00473 if (bytesToZero > 0) fprintf(stderr, "a->m:outputting %d zero bytes (%d, %d, %d, %d)\n", bytesToZero, startOfData, toOffset, frameOffset, seg->backpointer); 00474 #endif 00475 toOffset += bytesToZero; 00476 } 00477 00478 unsigned char* fromPtr 00479 = &seg->dataStart()[seg->headerSize + seg->sideInfoSize + fromOffset]; 00480 unsigned bytesUsedHere = endOfData - startOfData; 00481 #ifdef DEBUG 00482 if (bytesUsedHere > 0) fprintf(stderr, "a->m:outputting %d bytes from %d<-%d\n", bytesUsedHere, seg->aduSize, seg->backpointer); 00483 #endif 00484 memmove(toPtr + toOffset, fromPtr, bytesUsedHere); 00485 toOffset += bytesUsedHere; 00486 00487 frameOffset += seg->dataHere(); 00488 index = SegmentQueue::nextIndex(index); 00489 if (index == fSegments->nextFreeIndex()) break; 00490 seg = &(fSegments->s[index]); 00491 } 00492 00493 fSegments->dequeue(); 00494 00495 return True; 00496 }
| 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(), MPEG4VideoStreamFramer::createNew(), MPEG4VideoStreamDiscreteFramer::createNew(), MPEG2IFrameIndexFromTransportStream::createNew(), MPEG1or2VideoStreamFramer::createNew(), MPEG1or2VideoStreamDiscreteFramer::createNew(), MPEG1or2AudioStreamFramer::createNew(), MP3Transcoder::createNew(), MP3ADUTranscoder::createNew(), MP3ADUdeinterleaver::createNew(), MP3ADUinterleaver::createNew(), createNew(), ADUFromMP3Source::createNew(), H263plusVideoStreamFramer::createNew(), AC3AudioStreamFramer::createNew(), H264VideoRTPSink::doSpecialFrameHandling(), MP3ADUinterleaverBase::getInputSource(), H263plusVideoStreamFramer::H263plusVideoStreamFramer(), MPEG1or2VideoStreamFramer::MPEG1or2VideoStreamFramer(), MPEG4VideoStreamFramer::MPEG4VideoStreamFramer(), MP3AudioFileServerMediaSubsession::seekStreamSource(), ClientTrickPlayState::setSource(), and MP3AudioFileServerMediaSubsession::setStreamSourceScale().
00030 { return fInputSource; }
| 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().
| 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(), 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::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(