rtspstack
Class RtspMsg

Direct Known Subclasses:
RtspRequest, RtspResponse

class RtspMsg


Constructor Summary
RtspMsg()
           
RtspMsg(const RtspMsg & src)
           

Destructor Summary
 virtual ~RtspMsg()
           

Method Summary
 virtual Dataencode()
          not finished
 const const RtspMsgCompletionTypegetCompletionFlag()
           
 const Data &getContentBase()
          It parse Content-Base header for the first time and return a reference of the data
 const intgetContentLength()
          if it's the first time call, it will parse content-length header and set myContentLength, otherwise it directly return it
 const Data &getContentType()
          It parse Content-Type header and return a copy of the data Return the whole string of the header body for now Application just need to see if the returned Data has substring of "application/sdp" to know if it support sdp TODO: try parse the detail of Content-Type and Accept
 const Data &getCSeq()
          It parse Cseq header for the first time and assign myCSeq
 const boolgetFirstWordUnknown()
           
 const const Data &getHeaders()
           
 const const Data &getMsgBody()
           
 Sptr< RtspRangeHdr >getRange()
          It returns an object when parser found and understood the Range hdr, and it assigns myRange; otherwise return 0
 const Data &getSessionId()
          It parse Session header for the first time and assign mySessionId
 Data &getStartLine()
           
 const Sptr< RtspTcpBuffer >getTransConnPtr()
          transport connection
 Sptr< RtspTransportSpec >getTransport()
          It returns an object when parser found a suitable transport-spec in the transport hdr, and it assigns myTransportSpec; otherwise it returns 0
 const boolhasBody()
           
 virtual boolisRequest()
          It will look at the first word of the startLine if it is *not* RTSP, return true; otherwise false.
 virtual boolisResponse()
          It will look at the first word of the startLine if it *is* RTSP, return true; otherwise false.
 boolisValid()
          check if there is Cseq number
 RtspMsg &operator=(const RtspMsg & src)
           
 voidsetCompletionFlag(RtspMsgCompletionType flag)
           
 voidsetFirstWordUnknown(bool flag)
           
 voidsetHasBody(bool has)
           
 voidsetHeaders(const Data & hdr)
           
 voidsetHeadersMap(u_int32_t hdrType, const HeaderValueData & hvd)
           
 voidsetMsgBody(const Data & body)
           
 voidsetNumHeader(u_int32_t num)
           
 voidsetStartLine(const Data & stline)
           
 voidsetTransConnPtr(Sptr< RtspTcpBuffer > ptr)
           

Constructor Detail

RtspMsg

public RtspMsg()

RtspMsg

public RtspMsg(const RtspMsg & src)
Method Detail

~RtspMsg

public virtual ~RtspMsg()
Method Detail

encode

public virtual Data encode()
not finished

getCompletionFlag

public const const RtspMsgCompletionType getCompletionFlag()

getContentBase

public const Data & getContentBase()
It parse Content-Base header for the first time and return a reference of the data

getContentLength

public const int getContentLength()
if it's the first time call, it will parse content-length header and set myContentLength, otherwise it directly return it

getContentType

public const Data & getContentType()
It parse Content-Type header and return a copy of the data Return the whole string of the header body for now Application just need to see if the returned Data has substring of "application/sdp" to know if it support sdp TODO: try parse the detail of Content-Type and Accept

getCSeq

public const Data & getCSeq()
It parse Cseq header for the first time and assign myCSeq

getFirstWordUnknown

public const bool getFirstWordUnknown()

getHeaders

public const const Data & getHeaders()

getMsgBody

public const const Data & getMsgBody()

getRange

public Sptr< RtspRangeHdr > getRange()
It returns an object when parser found and understood the Range hdr, and it assigns myRange; otherwise return 0

getSessionId

public const Data & getSessionId()
It parse Session header for the first time and assign mySessionId

getStartLine

public Data & getStartLine()

getTransConnPtr

public const Sptr< RtspTcpBuffer > getTransConnPtr()
transport connection

getTransport

public Sptr< RtspTransportSpec > getTransport()
It returns an object when parser found a suitable transport-spec in the transport hdr, and it assigns myTransportSpec; otherwise it returns 0

hasBody

public const bool hasBody()

isRequest

public virtual bool isRequest()
It will look at the first word of the startLine if it is *not* RTSP, return true; otherwise false.

isResponse

public virtual bool isResponse()
It will look at the first word of the startLine if it *is* RTSP, return true; otherwise false.

isValid

public bool isValid()
check if there is Cseq number

operator=

public RtspMsg & operator=(const RtspMsg & src)

setCompletionFlag

public void setCompletionFlag(RtspMsgCompletionType flag)

setFirstWordUnknown

public void setFirstWordUnknown(bool flag)

setHasBody

public void setHasBody(bool has)

setHeaders

public void setHeaders(const Data & hdr)

setHeadersMap

public void setHeadersMap(u_int32_t hdrType, const HeaderValueData & hvd)

setMsgBody

public void setMsgBody(const Data & body)

setNumHeader

public void setNumHeader(u_int32_t num)

setStartLine

public void setStartLine(const Data & stline)

setTransConnPtr

public void setTransConnPtr(Sptr< RtspTcpBuffer > ptr)

Association Links

to Class RtspHeaderValueData_t

Holds all kind of the headers' body offset, and only to parse when needed. The offset points to the beginning of the first non-space after ":", each item initialzed with -1.