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


Public Types | |
| typedef void( | afterGettingFunc )(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds) |
| typedef void( | onCloseFunc )(void *clientData) |
Public Member Functions | |
| Boolean | curPacketMarkerBit () const |
| unsigned char | rtpPayloadFormat () const |
| virtual Boolean | hasBeenSynchronizedUsingRTCP () |
| Groupsock * | RTPgs () const |
| u_int32_t | SSRC () const |
| unsigned | timestampFrequency () const |
| RTPReceptionStatsDB & | receptionStatsDB () const |
| u_int32_t | lastReceivedSSRC () const |
| void | setStreamSocket (int sockNum, unsigned char streamChannelId) |
| void | setAuxilliaryReadHandler (AuxHandlerFunc *handlerFunc, void *handlerClientData) |
| u_int16_t | curPacketRTPSeqNum () const |
| u_int32_t | curPacketRTPTimestamp () 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 | 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 JPEGVideoRTPSource * | createNew (UsageEnvironment &env, Groupsock *RTPgs, unsigned char rtpPayloadFormat=26, unsigned rtpPayloadFrequency=90000, unsigned defaultWidth=0, unsigned defaultHeight=0) |
| static Boolean | lookupByName (UsageEnvironment &env, char const *sourceName, RTPSource *&resultSource) |
| 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 | ~JPEGVideoRTPSource () |
| virtual Boolean | packetIsUsableInJitterCalculation (unsigned char *packet, unsigned packetSize) |
| virtual void | doStopGettingFrames () |
| TaskToken & | nextTask () |
Static Protected Member Functions | |
| static void | afterGetting (FramedSource *source) |
Protected Attributes | |
| Boolean | fCurrentPacketBeginsFrame |
| Boolean | fCurrentPacketCompletesFrame |
| RTPInterface | fRTPInterface |
| u_int16_t | fCurPacketRTPSeqNum |
| u_int32_t | fCurPacketRTPTimestamp |
| Boolean | fCurPacketMarkerBit |
| Boolean | fCurPacketHasBeenSynchronizedUsingRTCP |
| u_int32_t | fLastReceivedSSRC |
| unsigned char * | fTo |
| unsigned | fMaxSize |
| unsigned | fFrameSize |
| unsigned | fNumTruncatedBytes |
| timeval | fPresentationTime |
| unsigned | fDurationInMicroseconds |
Private Member Functions | |
| JPEGVideoRTPSource (UsageEnvironment &env, Groupsock *RTPgs, unsigned char rtpPayloadFormat, unsigned rtpTimestampFrequency, unsigned defaultWidth, unsigned defaultHeight) | |
| virtual Boolean | processSpecialHeader (BufferedPacket *packet, unsigned &resultSpecialHeaderSize) |
| virtual char const * | MIMEtype () const |
Private Attributes | |
| unsigned | fDefaultWidth |
| unsigned | fDefaultHeight |
Definition at line 30 of file JPEGVideoRTPSource.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.
| JPEGVideoRTPSource::~JPEGVideoRTPSource | ( | ) | [protected, virtual] |
| JPEGVideoRTPSource::JPEGVideoRTPSource | ( | UsageEnvironment & | env, | |
| Groupsock * | RTPgs, | |||
| unsigned char | rtpPayloadFormat, | |||
| unsigned | rtpTimestampFrequency, | |||
| unsigned | defaultWidth, | |||
| unsigned | defaultHeight | |||
| ) | [private] |
Definition at line 57 of file JPEGVideoRTPSource.cpp.
Referenced by createNew().
00062 : MultiFramedRTPSource(env, RTPgs, 00063 rtpPayloadFormat, rtpTimestampFrequency, 00064 new JPEGBufferedPacketFactory), 00065 fDefaultWidth(defaultWidth), fDefaultHeight(defaultHeight) { 00066 }
| JPEGVideoRTPSource * JPEGVideoRTPSource::createNew | ( | UsageEnvironment & | env, | |
| Groupsock * | RTPgs, | |||
| unsigned char | rtpPayloadFormat = 26, |
|||
| unsigned | rtpPayloadFrequency = 90000, |
|||
| unsigned | defaultWidth = 0, |
|||
| unsigned | defaultHeight = 0 | |||
| ) | [static] |
Definition at line 49 of file JPEGVideoRTPSource.cpp.
References env, JPEGVideoRTPSource(), and RTPSource::RTPgs().
Referenced by MediaSubsession::initiate().
00052 { 00053 return new JPEGVideoRTPSource(env, RTPgs, rtpPayloadFormat, 00054 rtpTimestampFrequency, defaultWidth, defaultHeight); 00055 }
| Boolean JPEGVideoRTPSource::processSpecialHeader | ( | BufferedPacket * | packet, | |
| unsigned & | resultSpecialHeaderSize | |||
| ) | [private, virtual] |
Reimplemented from MultiFramedRTPSource.
Definition at line 311 of file JPEGVideoRTPSource.cpp.
References computeJPEGHeaderSize(), createJPEGHeader(), DWORD, False, MultiFramedRTPSource::fCurrentPacketBeginsFrame, MultiFramedRTPSource::fCurrentPacketCompletesFrame, fDefaultHeight, fDefaultWidth, makeDefaultQtables(), NULL, True, and WORD.
00312 { 00313 unsigned char* headerStart = packet->data(); 00314 unsigned packetSize = packet->dataSize(); 00315 00316 unsigned char* qtables = NULL; 00317 unsigned qtlen = 0; 00318 unsigned dri = 0; 00319 00320 // There's at least 8-byte video-specific header 00321 /* 00322 0 1 2 3 00323 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 00324 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00325 | Type-specific | Fragment Offset | 00326 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00327 | Type | Q | Width | Height | 00328 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00329 */ 00330 if (packetSize < 8) return False; 00331 00332 resultSpecialHeaderSize = 8; 00333 00334 unsigned Offset = (unsigned)((DWORD)headerStart[1] << 16 | (DWORD)headerStart[2] << 8 | (DWORD)headerStart[3]); 00335 unsigned Type = (unsigned)headerStart[4]; 00336 unsigned type = Type & 1; 00337 unsigned Q = (unsigned)headerStart[5]; 00338 unsigned width = (unsigned)headerStart[6] * 8; 00339 unsigned height = (unsigned)headerStart[7] * 8; 00340 if ((width == 0 || height == 0) && fDefaultWidth != 0 && fDefaultHeight != 0) { 00341 // Use the default width and height parameters instead: 00342 width = fDefaultWidth; 00343 height = fDefaultHeight; 00344 } 00345 if (width == 0) width = 256*8; // special case 00346 if (height == 0) height = 256*8; // special case 00347 00348 if (Type > 63) { 00349 // Restart Marker header present 00350 /* 00351 0 1 2 3 00352 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 00353 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00354 | Restart Interval |F|L| Restart Count | 00355 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00356 */ 00357 if (packetSize < resultSpecialHeaderSize + 4) return False; 00358 00359 unsigned RestartInterval = (unsigned)((WORD)headerStart[resultSpecialHeaderSize] << 8 | (WORD)headerStart[resultSpecialHeaderSize + 1]); 00360 dri = RestartInterval; 00361 resultSpecialHeaderSize += 4; 00362 } 00363 00364 if (Offset == 0) { 00365 if (Q > 127) { 00366 // Quantization Table header present 00367 /* 00368 0 1 2 3 00369 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 00370 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00371 | MBZ | Precision | Length | 00372 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00373 | Quantization Table Data | 00374 | ... | 00375 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 00376 */ 00377 if (packetSize < resultSpecialHeaderSize + 4) return False; 00378 00379 unsigned MBZ = (unsigned)headerStart[resultSpecialHeaderSize]; 00380 if (MBZ == 0) { 00381 // unsigned Precision = (unsigned)headerStart[resultSpecialHeaderSize + 1]; 00382 unsigned Length = (unsigned)((WORD)headerStart[resultSpecialHeaderSize + 2] << 8 | (WORD)headerStart[resultSpecialHeaderSize + 3]); 00383 00384 //ASSERT(Length == 128); 00385 00386 resultSpecialHeaderSize += 4; 00387 00388 if (packetSize < resultSpecialHeaderSize + Length) return False; 00389 00390 qtlen = Length; 00391 qtables = &headerStart[resultSpecialHeaderSize]; 00392 00393 resultSpecialHeaderSize += Length; 00394 } 00395 } 00396 } 00397 00398 // If this is the first (or only) fragment of a JPEG frame, then we need 00399 // to synthesize a JPEG header, and prepend it to the incoming data. 00400 // Hack: We can do this because we allowed space for it in 00401 // our special "JPEGBufferedPacket" subclass. We also adjust 00402 // "resultSpecialHeaderSize" to compensate for this, by subtracting 00403 // the size of the synthesized header. Note that this will cause 00404 // "resultSpecialHeaderSize" to become negative, but the code that called 00405 // us (in "MultiFramedRTPSource") will handle this properly. 00406 if (Offset == 0) { 00407 unsigned char newQtables[128]; 00408 if (qtlen == 0) { 00409 // A quantization table was not present in the RTP JPEG header, 00410 // so use the default tables, scaled according to the "Q" factor: 00411 makeDefaultQtables(newQtables, Q); 00412 qtables = newQtables; 00413 qtlen = sizeof newQtables; 00414 } 00415 00416 unsigned hdrlen = computeJPEGHeaderSize(qtlen, dri); 00417 resultSpecialHeaderSize -= hdrlen; // goes negative 00418 headerStart += (int)resultSpecialHeaderSize; // goes backward 00419 createJPEGHeader(headerStart, type, width, height, qtables, qtlen, dri); 00420 } 00421 00422 fCurrentPacketBeginsFrame = (Offset == 0); 00423 00424 // The RTP "M" (marker) bit indicates the last fragment of a frame: 00425 ((JPEGBufferedPacket*)packet)->completesFrame 00426 = fCurrentPacketCompletesFrame = packet->rtpMarkerBit(); 00427 00428 return True; 00429 }
| char const * JPEGVideoRTPSource::MIMEtype | ( | ) | const [private, virtual] |
| Boolean MultiFramedRTPSource::packetIsUsableInJitterCalculation | ( | unsigned char * | packet, | |
| unsigned | packetSize | |||
| ) | [protected, virtual, inherited] |
Reimplemented in MPEG1or2VideoRTPSource.
Definition at line 98 of file MultiFramedRTPSource.cpp.
References True.
Referenced by MultiFramedRTPSource::networkReadHandler().
00099 { 00100 // Default implementation: 00101 return True; 00102 }
| void MultiFramedRTPSource::doStopGettingFrames | ( | ) | [protected, virtual, inherited] |
Reimplemented from FramedSource.
Definition at line 104 of file MultiFramedRTPSource.cpp.
References MultiFramedRTPSource::fReorderingBuffer, RTPSource::fRTPInterface, MultiFramedRTPSource::reset(), ReorderingPacketBuffer::reset(), and RTPInterface::stopNetworkReading().
00104 { 00105 fRTPInterface.stopNetworkReading(); 00106 fReorderingBuffer->reset(); 00107 reset(); 00108 }
| Boolean RTPSource::lookupByName | ( | UsageEnvironment & | env, | |
| char const * | sourceName, | |||
| RTPSource *& | resultSource | |||
| ) | [static, inherited] |
Definition at line 26 of file RTPSource.cpp.
References env, False, MediaSource::isRTPSource(), MediaSource::lookupByName(), NULL, and True.
00028 { 00029 resultSource = NULL; // unless we succeed 00030 00031 MediaSource* source; 00032 if (!MediaSource::lookupByName(env, sourceName, source)) return False; 00033 00034 if (!source->isRTPSource()) { 00035 env.setResultMsg(sourceName, " is not a RTP source"); 00036 return False; 00037 } 00038 00039 resultSource = (RTPSource*)source; 00040 return True; 00041 }
| 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 }
| Boolean RTPSource::curPacketMarkerBit | ( | ) | const [inline, inherited] |
Definition at line 38 of file RTPSource.hh.
References RTPSource::fCurPacketMarkerBit.
Referenced by SubsessionIOState::useFrameForHinting().
00038 { return fCurPacketMarkerBit; }
| unsigned char RTPSource::rtpPayloadFormat | ( | ) | const [inline, inherited] |
Definition at line 40 of file RTPSource.hh.
References RTPSource::fRTPPayloadFormat.
Referenced by QuickTimeFileSink::addAtom_hdlr2(), MultiFramedRTPSource::networkReadHandler(), and SubsessionIOState::useFrameForHinting().
00040 { return fRTPPayloadFormat; }
| Boolean RTPSource::hasBeenSynchronizedUsingRTCP | ( | ) | [virtual, inherited] |
Reimplemented in RawAMRRTPSource, and RawQCELPRTPSource.
Definition at line 43 of file RTPSource.cpp.
References RTPSource::fCurPacketHasBeenSynchronizedUsingRTCP.
Referenced by checkForPacketArrival(), RawQCELPRTPSource::processSpecialHeader(), RawAMRRTPSource::processSpecialHeader(), SubsessionIOState::syncOK(), and SubsessionIOState::useFrame().
00043 { 00044 return fCurPacketHasBeenSynchronizedUsingRTCP; 00045 }
| Groupsock* RTPSource::RTPgs | ( | ) | const [inline, inherited] |
Definition at line 44 of file RTPSource.hh.
References RTPSource::fRTPInterface, and RTPInterface::gs().
Referenced by SimpleRTPSource::createNew(), QuickTimeGenericRTPSource::createNew(), RawQCELPRTPSource::createNew(), MPEG4LATMAudioRTPSource::createNew(), MPEG4GenericRTPSource::createNew(), MPEG4ESVideoRTPSource::createNew(), MPEG1or2VideoRTPSource::createNew(), MPEG1or2AudioRTPSource::createNew(), MP3ADURTPSource::createNew(), createNew(), H264VideoRTPSource::createNew(), H263plusVideoRTPSource::createNew(), H261VideoRTPSource::createNew(), RawAMRRTPSource::createNew(), AC3AudioRTPSource::createNew(), and main().
00044 { return fRTPInterface.gs(); }
| u_int32_t RTPSource::SSRC | ( | ) | const [inline, inherited] |
Definition at line 49 of file RTPSource.hh.
References RTPSource::fSSRC.
Referenced by RTCPInstance::addBYE(), RTCPInstance::addRR(), and RTCPInstance::addSDES().
00049 { return fSSRC; }
| unsigned RTPSource::timestampFrequency | ( | ) | const [inline, inherited] |
Definition at line 53 of file RTPSource.hh.
References RTPSource::fTimestampFrequency.
Referenced by QuickTimeFileSink::addAtom_hdlr2(), MultiFramedRTPSource::networkReadHandler(), and RTPReceptionStats::noteIncomingPacket().
00053 {return fTimestampFrequency;}
| RTPReceptionStatsDB& RTPSource::receptionStatsDB | ( | ) | const [inline, inherited] |
Definition at line 55 of file RTPSource.hh.
References RTPSource::fReceptionStatsDB.
Referenced by checkForPacketArrival(), checkInterPacketGaps(), RTCPInstance::enqueueCommonReportSuffix(), RTCPInstance::incomingReportHandler1(), MultiFramedRTPSource::networkReadHandler(), printQOSData(), qosMeasurementRecord::qosMeasurementRecord(), and RTCPInstance::removeSSRC().
00055 { 00056 return *fReceptionStatsDB; 00057 }
| u_int32_t RTPSource::lastReceivedSSRC | ( | ) | const [inline, inherited] |
Definition at line 59 of file RTPSource.hh.
References RTPSource::fLastReceivedSSRC.
00059 { return fLastReceivedSSRC; }
| void RTPSource::setStreamSocket | ( | int | sockNum, | |
| unsigned char | streamChannelId | |||
| ) | [inline, inherited] |
Definition at line 62 of file RTPSource.hh.
References RTPSource::fRTPInterface, and RTPInterface::setStreamSocket().
Referenced by RTSPClient::setupMediaSubsession().
00062 { 00063 // hack to allow sending RTP over TCP (RFC 2236, section 10.12) 00064 fRTPInterface.setStreamSocket(sockNum, streamChannelId); 00065 }
| void RTPSource::setAuxilliaryReadHandler | ( | AuxHandlerFunc * | handlerFunc, | |
| void * | handlerClientData | |||
| ) | [inline, inherited] |
Definition at line 67 of file RTPSource.hh.
References RTPSource::fRTPInterface, and RTPInterface::setAuxilliaryReadHandler().
00068 { 00069 fRTPInterface.setAuxilliaryReadHandler(handlerFunc, 00070 handlerClientData); 00071 }
| u_int16_t RTPSource::curPacketRTPSeqNum | ( | ) | const [inline, inherited] |
Definition at line 76 of file RTPSource.hh.
References RTPSource::fCurPacketRTPSeqNum.
Referenced by SubsessionIOState::afterGettingFrame(), AVISubsessionIOState::afterGettingFrame(), QCELPDeinterleaver::afterGettingFrame1(), and AMRDeinterleavingBuffer::deliverIncomingFrame().
00076 { return fCurPacketRTPSeqNum; }
| u_int32_t RTPSource::curPacketRTPTimestamp | ( | ) | const [inline, inherited] |
Definition at line 77 of file RTPSource.hh.
References RTPSource::fCurPacketRTPTimestamp.
Referenced by MediaSubsession::getNormalPlayTime().
00077 { return fCurPacketRTPTimestamp; }
| 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(), 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::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 }