sipxmedialib  Version 3.3
RTPHeader.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006-2013 SIPez LLC. All rights reserved.
3 //
4 // Copyright (C) 2004-2006 SIPfoundry Inc.
5 // Licensed by SIPfoundry under the LGPL license.
6 //
7 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
8 // Licensed to SIPfoundry under a Contributor Agreement.
9 //
10 // $$
12 
13 
14 
15 // Border Guard
16 #ifndef _RTPHeader_h
17 #define _RTPHeader_h
18 
19 #include "rtcp/RtcpConfig.h"
20 
21 // Includes
22 #include "IRTPHeader.h"
23 
24 // Defines
25 #define MAX_CSRCS 64
26 
27 
46 class CRTPHeader: public IRTPHeader // RTP Header Interface
47  {
48 
49 // Public Methods
50 public:
51 
72  CRTPHeader(ssrc_t ulSSRC = 0,
73  unsigned char *puchHeaderData=NULL,
74  unsigned long ulPacketLength=0);
75 
76 
77 
96  ~CRTPHeader(void);
97 
98 
99 
121  unsigned long ParseRTPHeader(unsigned char *puchRTPBuffer,
122  unsigned long ulPacketLength=0);
123 
145  unsigned long FormatRTPHeader(unsigned char *puchRTPBuffer,
146  unsigned long ulPacketLength=0);
147 
165  unsigned long GetHeaderLength(void);
166 
167 
185  unsigned long GetVersion(void);
186 
187 
205  unsigned long GetPadding(void);
206 
224  unsigned long GetExtension(void);
225 
226 
244  unsigned long GetMarker(void);
245 
246 
264  unsigned long GetPayload(void);
265 
266 
284  unsigned long GetSequenceNo(void);
285 
303  void GetRTPTimestamp(rtpts_t *pulTimestamp);
304 
322  void GetRecvTimestamp(rtpts_t *pulTimestamp);
323 
324 
342  ssrc_t GetSSRC(void);
343 
344 
363  unsigned long GetCSRC(ssrc_t *paulCSRC, bool bNBO=FALSE);
364 
382  void SetPayload(unsigned long ulPayload);
383 
384 
402  void SetSequenceNo(unsigned long ulSequenceNo);
403 
421  void SetRecvTimestamp(rtpts_t ulTimestamp);
422 
423 
424 private: // Private Methods
425 
426 
446  void ResetContents(void);
447 
448 
449 private: // Protected Data Members
450 
451 
452 
462  unsigned long m_ulVersion;
463 
473  unsigned long m_ulPadding;
474 
475 
486  unsigned long m_ulMarker;
487 
498  unsigned long m_ulExtension;
499 
500 
510  unsigned long m_ulPayload;
511 
512 
522  unsigned long m_ulSequenceNo;
523 
524 
536 
548 
549 
561 
571  unsigned long m_ulCSRCCount;
572 
583 
584 };
585 
586 
587 #endif
unsigned long m_ulCSRCCount
Definition: RTPHeader.h:571
unsigned long GetHeaderLength(void)
void GetRecvTimestamp(rtpts_t *pulTimestamp)
rtpts_t m_ulRecvTimestamp
Definition: RTPHeader.h:547
unsigned long GetPadding(void)
unsigned long GetPayload(void)
uint32_t rtpts_t
Definition: RtcpConfig.h:63
void GetRTPTimestamp(rtpts_t *pulTimestamp)
ssrc_t GetSSRC(void)
~CRTPHeader(void)
void SetRecvTimestamp(rtpts_t ulTimestamp)
unsigned long m_ulVersion
Definition: RTPHeader.h:462
unsigned long GetCSRC(ssrc_t *paulCSRC, bool bNBO=FALSE)
CRTPHeader(ssrc_t ulSSRC=0, unsigned char *puchHeaderData=NULL, unsigned long ulPacketLength=0)
unsigned long GetVersion(void)
unsigned long m_ulPayload
Definition: RTPHeader.h:510
void ResetContents(void)
ssrc_t m_ulSSRC
Definition: RTPHeader.h:560
unsigned long FormatRTPHeader(unsigned char *puchRTPBuffer, unsigned long ulPacketLength=0)
unsigned long GetExtension(void)
rtpts_t m_ulRTPTimestamp
Definition: RTPHeader.h:535
unsigned long m_ulExtension
Definition: RTPHeader.h:498
uint32_t ssrc_t
Definition: RtcpConfig.h:62
void SetSequenceNo(unsigned long ulSequenceNo)
void SetPayload(unsigned long ulPayload)
unsigned long GetMarker(void)
unsigned long m_ulPadding
Definition: RTPHeader.h:473
unsigned long GetSequenceNo(void)
#define FALSE
Definition: PlgDefsV1.h:37
unsigned long m_ulSequenceNo
Definition: RTPHeader.h:522
unsigned long ParseRTPHeader(unsigned char *puchRTPBuffer, unsigned long ulPacketLength=0)
ssrc_t m_aulCSRC[MAX_CSRCS]
Definition: RTPHeader.h:582
#define MAX_CSRCS
Definition: RTPHeader.h:25
Definition: RTPHeader.h:46
unsigned long m_ulMarker
Definition: RTPHeader.h:486