MythTV  master
rtptsdatapacket.h
Go to the documentation of this file.
1 /* -*- Mode: c++ -*-
2  * Copyright (c) 2012 Digital Nirvana, Inc.
3  * Distributed as part of MythTV under GPL v2 and later.
4  */
5 
6 #ifndef _RTP_TS_DATA_PACKET_H_
7 #define _RTP_TS_DATA_PACKET_H_
8 
9 #include <algorithm>
10 using namespace std;
11 
12 #include "rtpdatapacket.h"
13 
18 {
19  public:
22  RTPTSDataPacket(uint64_t key) : RTPDataPacket(key) { }
23  RTPTSDataPacket(void) : RTPDataPacket(0ULL) { }
24 
25  const unsigned char *GetTSData(void) const
26  {
27  return reinterpret_cast<const unsigned char*>(m_data.data()) + GetTSOffset();
28  }
29 
30  unsigned int GetTSDataSize(void) const
31  {
32  return max(m_data.size() - (int)GetTSOffset() - (int)GetPaddingSize(), 0);
33  }
34 
35  private:
36  uint GetTSOffset(void) const { return m_off; }
37 };
38 
39 #endif // _RTP_TS_DATA_PACKET_H_
uint GetTSOffset(void) const
UDP Packet.
Definition: udppacket.h:20
RTPTSDataPacket(uint64_t key)
RTP Transport Stream Data Packet.
RTP Data Packet.
Definition: rtpdatapacket.h:30
RTPTSDataPacket(const RTPDataPacket &o)
unsigned int uint
Definition: compat.h:140
const unsigned char * GetTSData(void) const
unsigned int GetTSDataSize(void) const
RTPTSDataPacket(const UDPPacket &o)