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 
11 #include "rtpdatapacket.h"
12 
17 {
18  public:
21  RTPTSDataPacket(uint64_t key) : RTPDataPacket(key) { }
22  RTPTSDataPacket(void) : RTPDataPacket(0ULL) { }
23 
24  const unsigned char *GetTSData(void) const
25  {
26  return reinterpret_cast<const unsigned char*>(m_data.data()) + GetTSOffset();
27  }
28 
29  unsigned int GetTSDataSize(void) const
30  {
31  return std::max(m_data.size() - (int)GetTSOffset() - (int)GetPaddingSize(), 0);
32  }
33 
34  private:
35  uint GetTSOffset(void) const { return m_off; }
36 };
37 
38 #endif // RTP_TS_DATA_PACKET_H
rtpdatapacket.h
RTPTSDataPacket
RTP Transport Stream Data Packet.
Definition: rtptsdatapacket.h:16
RTPTSDataPacket::GetTSDataSize
unsigned int GetTSDataSize(void) const
Definition: rtptsdatapacket.h:29
UDPPacket::m_data
QByteArray m_data
Definition: udppacket.h:42
RTPTSDataPacket::RTPTSDataPacket
RTPTSDataPacket(const UDPPacket &o)
Definition: rtptsdatapacket.h:20
RTPTSDataPacket::GetTSData
const unsigned char * GetTSData(void) const
Definition: rtptsdatapacket.h:24
uint
unsigned int uint
Definition: compat.h:140
RTPDataPacket::GetPaddingSize
uint GetPaddingSize(void) const
Definition: rtpdatapacket.h:119
RTPTSDataPacket::RTPTSDataPacket
RTPTSDataPacket(const RTPDataPacket &o)
Definition: rtptsdatapacket.h:19
RTPTSDataPacket::GetTSOffset
uint GetTSOffset(void) const
Definition: rtptsdatapacket.h:35
RTPDataPacket::m_off
uint m_off
Definition: rtpdatapacket.h:127
RTPDataPacket
RTP Data Packet.
Definition: rtpdatapacket.h:30
RTPTSDataPacket::RTPTSDataPacket
RTPTSDataPacket(uint64_t key)
Definition: rtptsdatapacket.h:21
RTPTSDataPacket::RTPTSDataPacket
RTPTSDataPacket(void)
Definition: rtptsdatapacket.h:22
UDPPacket
UDP Packet.
Definition: udppacket.h:20