live
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
MPEG4GenericRTPSink Class Reference

#include <MPEG4GenericRTPSink.hh>

Inheritance diagram for MPEG4GenericRTPSink:
Inheritance graph
[legend]
Collaboration diagram for MPEG4GenericRTPSink:
Collaboration graph
[legend]

Public Types

typedef void( onSendErrorFunc )(void *clientData)
 
typedef void( afterPlayingFunc )(void *clientData)
 

Public Member Functions

void setPacketSizes (unsigned preferredPacketSize, unsigned maxPacketSize)
 
void setOnSendErrorFunc (onSendErrorFunc *onSendErrorFunc, void *onSendErrorFuncData)
 
virtual void stopPlaying ()
 
Groupsock const & groupsockBeingUsed () const
 
GroupsockgroupsockBeingUsed ()
 
unsigned char rtpPayloadType () const
 
unsigned rtpTimestampFrequency () const
 
void setRTPTimestampFrequency (unsigned freq)
 
char const * rtpPayloadFormatName () const
 
unsigned numChannels () const
 
virtual char * rtpmapLine () const
 
u_int16_t currentSeqNo () const
 
u_int32_t presetNextTimestamp ()
 
RTPTransmissionStatsDBtransmissionStatsDB () const
 
Boolean nextTimestampHasBeenPreset () const
 
BooleanenableRTCPReports ()
 
void getTotalBitrate (unsigned &outNumBytes, double &outElapsedTime)
 
struct timeval const & creationTime () const
 
struct timeval const & initialPresentationTime () const
 
struct timeval const & mostRecentPresentationTime () const
 
void resetPresentationTimes ()
 
void setStreamSocket (int sockNum, unsigned char streamChannelId)
 
void addStreamSocket (int sockNum, unsigned char streamChannelId)
 
void removeStreamSocket (int sockNum, unsigned char streamChannelId)
 
unsigned & estimatedBitrate ()
 
Boolean startPlaying (MediaSource &source, afterPlayingFunc *afterFunc, void *afterClientData)
 
FramedSourcesource () const
 
UsageEnvironmentenvir () const
 
char const * name () const
 
virtual Boolean isSource () 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 MPEG4GenericRTPSinkcreateNew (UsageEnvironment &env, Groupsock *RTPgs, u_int8_t rtpPayloadFormat, u_int32_t rtpTimestampFrequency, char const *sdpMediaTypeString, char const *mpeg4Mode, char const *configString, unsigned numChannels=1)
 
static Boolean lookupByName (UsageEnvironment &env, char const *sinkName, RTPSink *&resultSink)
 
static Boolean lookupByName (UsageEnvironment &env, char const *sinkName, MediaSink *&resultSink)
 
static Boolean lookupByName (UsageEnvironment &env, char const *mediumName, Medium *&resultMedium)
 
static void close (UsageEnvironment &env, char const *mediumName)
 
static void close (Medium *medium)
 

Protected Member Functions

 MPEG4GenericRTPSink (UsageEnvironment &env, Groupsock *RTPgs, u_int8_t rtpPayloadFormat, u_int32_t rtpTimestampFrequency, char const *sdpMediaTypeString, char const *mpeg4Mode, char const *configString, unsigned numChannels)
 
virtual ~MPEG4GenericRTPSink ()
 
virtual Boolean allowFragmentationAfterStart () const
 
virtual Boolean allowOtherFramesAfterLastFragment () const
 
virtual unsigned frameSpecificHeaderSize () const
 
virtual unsigned computeOverflowForNewFrame (unsigned newFrameSize) const
 
Boolean isFirstPacket () const
 
Boolean isFirstFrameInPacket () const
 
unsigned curFragmentationOffset () const
 
void setMarkerBit ()
 
void setTimestamp (struct timeval framePresentationTime)
 
void setSpecialHeaderWord (unsigned word, unsigned wordPosition=0)
 
void setSpecialHeaderBytes (unsigned char const *bytes, unsigned numBytes, unsigned bytePosition=0)
 
void setFrameSpecificHeaderWord (unsigned word, unsigned wordPosition=0)
 
void setFrameSpecificHeaderBytes (unsigned char const *bytes, unsigned numBytes, unsigned bytePosition=0)
 
void setFramePadding (unsigned numPaddingBytes)
 
unsigned numFramesUsedSoFar () const
 
unsigned ourMaxPacketSize () const
 
virtual Boolean continuePlaying ()
 
u_int32_t SSRC () const
 
u_int32_t convertToRTPTimestamp (struct timeval tv)
 
unsigned packetCount () const
 
unsigned octetCount () const
 
virtual Boolean sourceIsCompatibleWithUs (MediaSource &source)
 
void onSourceClosure ()
 
TaskTokennextTask ()
 

Static Protected Member Functions

static void onSourceClosure (void *clientData)
 

Protected Attributes

RTPInterface fRTPInterface
 
unsigned char fRTPPayloadType
 
unsigned fPacketCount
 
unsigned fOctetCount
 
unsigned fTotalOctetCount
 
struct timeval
fTotalOctetCountStartTime
fInitialPresentationTime 
fMostRecentPresentationTime
 
u_int32_t fCurrentTimestamp
 
u_int16_t fSeqNo
 
FramedSourcefSource
 

Private Member Functions

virtual Boolean frameCanAppearAfterPacketStart (unsigned char const *frameStart, unsigned numBytesInFrame) const
 
virtual void doSpecialFrameHandling (unsigned fragmentationOffset, unsigned char *frameStart, unsigned numBytesInFrame, struct timeval framePresentationTime, unsigned numRemainingBytes)
 
virtual unsigned specialHeaderSize () const
 
virtual char const * sdpMediaType () const
 
virtual char const * auxSDPLine ()
 

Private Attributes

char const * fSDPMediaTypeString
 
char const * fMPEG4Mode
 
char const * fConfigString
 
char * fFmtpSDPLine
 

Detailed Description

Definition at line 28 of file MPEG4GenericRTPSink.hh.

Member Typedef Documentation

typedef void( MediaSink::afterPlayingFunc)(void *clientData)
inherited

Definition at line 33 of file MediaSink.hh.

typedef void( MultiFramedRTPSink::onSendErrorFunc)(void *clientData)
inherited

Definition at line 33 of file MultiFramedRTPSink.hh.

Constructor & Destructor Documentation

MPEG4GenericRTPSink::MPEG4GenericRTPSink ( UsageEnvironment env,
Groupsock RTPgs,
u_int8_t  rtpPayloadFormat,
u_int32_t  rtpTimestampFrequency,
char const *  sdpMediaTypeString,
char const *  mpeg4Mode,
char const *  configString,
unsigned  numChannels 
)
protected
virtual MPEG4GenericRTPSink::~MPEG4GenericRTPSink ( )
protectedvirtual

Member Function Documentation

void RTPSink::addStreamSocket ( int  sockNum,
unsigned char  streamChannelId 
)
inlineinherited

Definition at line 81 of file RTPSink.hh.

References RTPInterface::addStreamSocket(), and RTPSink::fRTPInterface.

81  {
82  fRTPInterface.addStreamSocket(sockNum, streamChannelId);
83  }
void addStreamSocket(int sockNum, unsigned char streamChannelId)
RTPInterface fRTPInterface
Definition: RTPSink.hh:109
virtual Boolean MultiFramedRTPSink::allowFragmentationAfterStart ( ) const
protectedvirtualinherited

Reimplemented in MPEG4ESVideoRTPSink, and MPEG1or2VideoRTPSink.

virtual Boolean MultiFramedRTPSink::allowOtherFramesAfterLastFragment ( ) const
protectedvirtualinherited
virtual char const* MPEG4GenericRTPSink::auxSDPLine ( )
privatevirtual

Reimplemented from RTPSink.

static void Medium::close ( UsageEnvironment env,
char const *  mediumName 
)
staticinherited
static void Medium::close ( Medium medium)
staticinherited
virtual unsigned MultiFramedRTPSink::computeOverflowForNewFrame ( unsigned  newFrameSize) const
protectedvirtualinherited

Reimplemented in DVVideoRTPSink.

virtual Boolean MultiFramedRTPSink::continuePlaying ( )
protectedvirtualinherited

Implements MediaSink.

Reimplemented in T140TextRTPSink, and H264or5VideoRTPSink.

u_int32_t RTPSink::convertToRTPTimestamp ( struct timeval  tv)
protectedinherited
static MPEG4GenericRTPSink* MPEG4GenericRTPSink::createNew ( UsageEnvironment env,
Groupsock RTPgs,
u_int8_t  rtpPayloadFormat,
u_int32_t  rtpTimestampFrequency,
char const *  sdpMediaTypeString,
char const *  mpeg4Mode,
char const *  configString,
unsigned  numChannels = 1 
)
static
struct timeval const& RTPSink::creationTime ( ) const
inlineinherited

Definition at line 72 of file RTPSink.hh.

References RTPSink::fCreationTime.

72 { return fCreationTime; }
struct timeval fCreationTime
Definition: RTPSink.hh:127
unsigned MultiFramedRTPSink::curFragmentationOffset ( ) const
inlineprotectedinherited

Definition at line 79 of file MultiFramedRTPSink.hh.

References MultiFramedRTPSink::fCurFragmentationOffset.

79 { return fCurFragmentationOffset; }
u_int16_t RTPSink::currentSeqNo ( ) const
inlineinherited

Definition at line 56 of file RTPSink.hh.

References RTPSink::fSeqNo.

56 { return fSeqNo; }
u_int16_t fSeqNo
Definition: RTPSink.hh:114
virtual void MPEG4GenericRTPSink::doSpecialFrameHandling ( unsigned  fragmentationOffset,
unsigned char *  frameStart,
unsigned  numBytesInFrame,
struct timeval  framePresentationTime,
unsigned  numRemainingBytes 
)
privatevirtual

Reimplemented from MultiFramedRTPSink.

Boolean& RTPSink::enableRTCPReports ( )
inlineinherited

Definition at line 66 of file RTPSink.hh.

References RTPSink::fEnableRTCPReports.

66 { return fEnableRTCPReports; }
Boolean fEnableRTCPReports
Definition: RTPSink.hh:124
UsageEnvironment& Medium::envir ( ) const
inlineinherited

Definition at line 59 of file Media.hh.

References Medium::fEnviron.

Referenced by MediaSubsession::env(), RTPInterface::envir(), RTSPServer::RTSPClientConnection::envir(), and RTSPServer::RTSPClientSession::envir().

59 {return fEnviron;}
UsageEnvironment & fEnviron
Definition: Media.hh:83
unsigned& RTPSink::estimatedBitrate ( )
inlineinherited

Definition at line 87 of file RTPSink.hh.

References RTPSink::fEstimatedBitrate.

87 { return fEstimatedBitrate; } // kbps; usually 0 (i.e., unset)
unsigned fEstimatedBitrate
Definition: RTPSink.hh:128
virtual Boolean MPEG4GenericRTPSink::frameCanAppearAfterPacketStart ( unsigned char const *  frameStart,
unsigned  numBytesInFrame 
) const
privatevirtual

Reimplemented from MultiFramedRTPSink.

virtual unsigned MultiFramedRTPSink::frameSpecificHeaderSize ( ) const
protectedvirtualinherited

Reimplemented in VorbisAudioRTPSink.

void RTPSink::getTotalBitrate ( unsigned &  outNumBytes,
double &  outElapsedTime 
)
inherited
Groupsock const& RTPSink::groupsockBeingUsed ( ) const
inlineinherited

Definition at line 39 of file RTPSink.hh.

References RTPSink::fRTPInterface, and RTPInterface::gs().

39 { return *(fRTPInterface.gs()); }
RTPInterface fRTPInterface
Definition: RTPSink.hh:109
Groupsock * gs() const
Definition: RTPInterface.hh:60
Groupsock& RTPSink::groupsockBeingUsed ( )
inlineinherited

Definition at line 40 of file RTPSink.hh.

References RTPSink::fRTPInterface, and RTPInterface::gs().

40 { return *(fRTPInterface.gs()); }
RTPInterface fRTPInterface
Definition: RTPSink.hh:109
Groupsock * gs() const
Definition: RTPInterface.hh:60
struct timeval const& RTPSink::initialPresentationTime ( ) const
inlineinherited

Definition at line 73 of file RTPSink.hh.

73 { return fInitialPresentationTime; }
virtual Boolean Medium::isDarwinInjector ( ) const
virtualinherited

Reimplemented in DarwinInjector.

Boolean MultiFramedRTPSink::isFirstFrameInPacket ( ) const
inlineprotectedinherited

Definition at line 78 of file MultiFramedRTPSink.hh.

References MultiFramedRTPSink::fNumFramesUsedSoFar.

78 { return fNumFramesUsedSoFar == 0; }
Boolean MultiFramedRTPSink::isFirstPacket ( ) const
inlineprotectedinherited

Definition at line 77 of file MultiFramedRTPSink.hh.

References MultiFramedRTPSink::fIsFirstPacket.

77 { return fIsFirstPacket; }
virtual Boolean Medium::isMediaSession ( ) const
virtualinherited

Reimplemented in MediaSession.

virtual Boolean Medium::isRTCPInstance ( ) const
virtualinherited

Reimplemented in RTCPInstance.

virtual Boolean Medium::isRTSPClient ( ) const
virtualinherited

Reimplemented in RTSPClient.

virtual Boolean Medium::isRTSPServer ( ) const
virtualinherited

Reimplemented in RTSPServer.

virtual Boolean Medium::isServerMediaSession ( ) const
virtualinherited

Reimplemented in ServerMediaSession.

virtual Boolean Medium::isSource ( ) const
virtualinherited

Reimplemented in MediaSource.

static Boolean MediaSink::lookupByName ( UsageEnvironment env,
char const *  sinkName,
MediaSink *&  resultSink 
)
staticinherited
static Boolean RTPSink::lookupByName ( UsageEnvironment env,
char const *  sinkName,
RTPSink *&  resultSink 
)
staticinherited
static Boolean Medium::lookupByName ( UsageEnvironment env,
char const *  mediumName,
Medium *&  resultMedium 
)
staticinherited
struct timeval const& RTPSink::mostRecentPresentationTime ( ) const
inlineinherited

Definition at line 74 of file RTPSink.hh.

References RTPSink::fMostRecentPresentationTime.

struct timeval fTotalOctetCountStartTime fInitialPresentationTime fMostRecentPresentationTime
Definition: RTPSink.hh:112
char const* Medium::name ( ) const
inlineinherited

Definition at line 61 of file Media.hh.

References Medium::fMediumName.

61 {return fMediumName;}
char fMediumName[mediumNameMaxLen]
Definition: Media.hh:84
TaskToken& Medium::nextTask ( )
inlineprotectedinherited

Definition at line 78 of file Media.hh.

References Medium::fNextTask.

78  {
79  return fNextTask;
80  }
TaskToken fNextTask
Definition: Media.hh:85
Boolean RTPSink::nextTimestampHasBeenPreset ( ) const
inlineinherited

Definition at line 65 of file RTPSink.hh.

References RTPSink::fNextTimestampHasBeenPreset.

Boolean fNextTimestampHasBeenPreset
Definition: RTPSink.hh:123
unsigned RTPSink::numChannels ( ) const
inlineinherited

Definition at line 49 of file RTPSink.hh.

References RTPSink::fNumChannels.

49 { return fNumChannels; }
unsigned fNumChannels
Definition: RTPSink.hh:126
unsigned MultiFramedRTPSink::numFramesUsedSoFar ( ) const
inlineprotectedinherited

Definition at line 91 of file MultiFramedRTPSink.hh.

References MultiFramedRTPSink::fNumFramesUsedSoFar.

91 { return fNumFramesUsedSoFar; }
unsigned RTPSink::octetCount ( ) const
inlineprotectedinherited

Definition at line 106 of file RTPSink.hh.

References RTPSink::fOctetCount.

106 {return fOctetCount;}
unsigned fOctetCount
Definition: RTPSink.hh:111
static void MediaSink::onSourceClosure ( void *  clientData)
staticprotectedinherited
void MediaSink::onSourceClosure ( )
protectedinherited
unsigned MultiFramedRTPSink::ourMaxPacketSize ( ) const
inlineprotectedinherited

Definition at line 92 of file MultiFramedRTPSink.hh.

References MultiFramedRTPSink::fOurMaxPacketSize.

92 { return fOurMaxPacketSize; }
unsigned RTPSink::packetCount ( ) const
inlineprotectedinherited

Definition at line 105 of file RTPSink.hh.

References RTPSink::fPacketCount.

105 {return fPacketCount;}
unsigned fPacketCount
Definition: RTPSink.hh:111
u_int32_t RTPSink::presetNextTimestamp ( )
inherited
void RTPSink::removeStreamSocket ( int  sockNum,
unsigned char  streamChannelId 
)
inlineinherited

Definition at line 84 of file RTPSink.hh.

References RTPSink::fRTPInterface, and RTPInterface::removeStreamSocket().

84  {
85  fRTPInterface.removeStreamSocket(sockNum, streamChannelId);
86  }
void removeStreamSocket(int sockNum, unsigned char streamChannelId)
RTPInterface fRTPInterface
Definition: RTPSink.hh:109
void RTPSink::resetPresentationTimes ( )
inherited
virtual char* RTPSink::rtpmapLine ( ) const
virtualinherited
char const* RTPSink::rtpPayloadFormatName ( ) const
inlineinherited

Definition at line 47 of file RTPSink.hh.

References RTPSink::fRTPPayloadFormatName.

47 {return fRTPPayloadFormatName;}
char const * fRTPPayloadFormatName
Definition: RTPSink.hh:125
unsigned char RTPSink::rtpPayloadType ( ) const
inlineinherited

Definition at line 42 of file RTPSink.hh.

References RTPSink::fRTPPayloadType.

42 { return fRTPPayloadType; }
unsigned char fRTPPayloadType
Definition: RTPSink.hh:110
unsigned RTPSink::rtpTimestampFrequency ( ) const
inlineinherited

Definition at line 43 of file RTPSink.hh.

References RTPSink::fTimestampFrequency.

43 { return fTimestampFrequency; }
unsigned fTimestampFrequency
Definition: RTPSink.hh:122
virtual char const* MPEG4GenericRTPSink::sdpMediaType ( ) const
privatevirtual

Reimplemented from RTPSink.

void MultiFramedRTPSink::setFramePadding ( unsigned  numPaddingBytes)
protectedinherited
void MultiFramedRTPSink::setFrameSpecificHeaderBytes ( unsigned char const *  bytes,
unsigned  numBytes,
unsigned  bytePosition = 0 
)
protectedinherited
void MultiFramedRTPSink::setFrameSpecificHeaderWord ( unsigned  word,
unsigned  wordPosition = 0 
)
protectedinherited
void MultiFramedRTPSink::setMarkerBit ( )
protectedinherited
void MultiFramedRTPSink::setOnSendErrorFunc ( onSendErrorFunc onSendErrorFunc,
void *  onSendErrorFuncData 
)
inlineinherited

Definition at line 34 of file MultiFramedRTPSink.hh.

References MultiFramedRTPSink::fOnSendErrorData, and MultiFramedRTPSink::fOnSendErrorFunc.

34  {
35  // Can be used to set a callback function to be called if there's an error sending RTP packets on our socket.
37  fOnSendErrorData = onSendErrorFuncData;
38  }
void( onSendErrorFunc)(void *clientData)
onSendErrorFunc * fOnSendErrorFunc
void MultiFramedRTPSink::setPacketSizes ( unsigned  preferredPacketSize,
unsigned  maxPacketSize 
)
inherited
void RTPSink::setRTPTimestampFrequency ( unsigned  freq)
inlineinherited

Definition at line 44 of file RTPSink.hh.

References RTPSink::fTimestampFrequency.

44  {
45  fTimestampFrequency = freq;
46  }
unsigned fTimestampFrequency
Definition: RTPSink.hh:122
void MultiFramedRTPSink::setSpecialHeaderBytes ( unsigned char const *  bytes,
unsigned  numBytes,
unsigned  bytePosition = 0 
)
protectedinherited
void MultiFramedRTPSink::setSpecialHeaderWord ( unsigned  word,
unsigned  wordPosition = 0 
)
protectedinherited
void RTPSink::setStreamSocket ( int  sockNum,
unsigned char  streamChannelId 
)
inlineinherited

Definition at line 78 of file RTPSink.hh.

References RTPSink::fRTPInterface, and RTPInterface::setStreamSocket().

78  {
79  fRTPInterface.setStreamSocket(sockNum, streamChannelId);
80  }
void setStreamSocket(int sockNum, unsigned char streamChannelId)
RTPInterface fRTPInterface
Definition: RTPSink.hh:109
void MultiFramedRTPSink::setTimestamp ( struct timeval  framePresentationTime)
protectedinherited
FramedSource* MediaSink::source ( ) const
inlineinherited

Definition at line 42 of file MediaSink.hh.

References MediaSink::fSource.

42 {return fSource;}
FramedSource * fSource
Definition: MediaSink.hh:58
virtual Boolean MediaSink::sourceIsCompatibleWithUs ( MediaSource source)
protectedvirtualinherited
virtual unsigned MPEG4GenericRTPSink::specialHeaderSize ( ) const
privatevirtual

Reimplemented from MultiFramedRTPSink.

u_int32_t RTPSink::SSRC ( ) const
inlineprotectedinherited

Definition at line 102 of file RTPSink.hh.

References RTPSink::fSSRC.

102 {return fSSRC;}
u_int32_t fSSRC
Definition: RTPSink.hh:121
Boolean MediaSink::startPlaying ( MediaSource source,
afterPlayingFunc afterFunc,
void *  afterClientData 
)
inherited
virtual void MultiFramedRTPSink::stopPlaying ( )
virtualinherited

Reimplemented from MediaSink.

RTPTransmissionStatsDB& RTPSink::transmissionStatsDB ( ) const
inlineinherited

Definition at line 61 of file RTPSink.hh.

References RTPSink::fTransmissionStatsDB.

61  {
62  return *fTransmissionStatsDB;
63  }
RTPTransmissionStatsDB * fTransmissionStatsDB
Definition: RTPSink.hh:130

Field Documentation

char const* MPEG4GenericRTPSink::fConfigString
private

Definition at line 66 of file MPEG4GenericRTPSink.hh.

u_int32_t RTPSink::fCurrentTimestamp
protectedinherited

Definition at line 113 of file RTPSink.hh.

char* MPEG4GenericRTPSink::fFmtpSDPLine
private

Definition at line 67 of file MPEG4GenericRTPSink.hh.

struct timeval fTotalOctetCountStartTime fInitialPresentationTime RTPSink::fMostRecentPresentationTime
protectedinherited

Definition at line 112 of file RTPSink.hh.

Referenced by RTPSink::mostRecentPresentationTime().

char const* MPEG4GenericRTPSink::fMPEG4Mode
private

Definition at line 65 of file MPEG4GenericRTPSink.hh.

unsigned RTPSink::fOctetCount
protectedinherited

Definition at line 111 of file RTPSink.hh.

Referenced by RTPSink::octetCount().

unsigned RTPSink::fPacketCount
protectedinherited

Definition at line 111 of file RTPSink.hh.

Referenced by RTPSink::packetCount().

RTPInterface RTPSink::fRTPInterface
protectedinherited
unsigned char RTPSink::fRTPPayloadType
protectedinherited

Definition at line 110 of file RTPSink.hh.

Referenced by RTPSink::rtpPayloadType().

char const* MPEG4GenericRTPSink::fSDPMediaTypeString
private

Definition at line 64 of file MPEG4GenericRTPSink.hh.

u_int16_t RTPSink::fSeqNo
protectedinherited

Definition at line 114 of file RTPSink.hh.

Referenced by RTPSink::currentSeqNo().

FramedSource* MediaSink::fSource
protectedinherited

Definition at line 58 of file MediaSink.hh.

Referenced by MediaSink::source().

unsigned RTPSink::fTotalOctetCount
protectedinherited

Definition at line 111 of file RTPSink.hh.


The documentation for this class was generated from the following file: