1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-23 00:18:37 -05:00
sdrangel/qrtplib/rtpstructs.h

129 lines
2.9 KiB
C
Raw Normal View History

2018-02-26 19:35:16 -05:00
/*
2018-02-27 17:05:46 -05:00
This file is a part of JRTPLIB
Copyright (c) 1999-2017 Jori Liesenborgs
Contact: jori.liesenborgs@gmail.com
This library was developed at the Expertise Centre for Digital Media
(http://www.edm.uhasselt.be), a research center of the Hasselt University
(http://www.uhasselt.be). The library is based upon work done for
my thesis at the School for Knowledge Technology (Belgium/The Netherlands).
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
2018-02-26 19:35:16 -05:00
2018-02-27 17:05:46 -05:00
*/
2018-02-26 19:35:16 -05:00
/**
* \file rtpstructs.h
*/
#ifndef RTPSTRUCTS_H
#define RTPSTRUCTS_H
#include "rtpconfig.h"
#include "rtptypes.h"
namespace qrtplib
{
struct RTPHeader
{
#ifdef RTP_BIG_ENDIAN
2018-02-27 17:05:46 -05:00
uint8_t version:2;
uint8_t padding:1;
uint8_t extension:1;
uint8_t csrccount:4;
2018-02-26 19:35:16 -05:00
2018-02-27 17:05:46 -05:00
uint8_t marker:1;
uint8_t payloadtype:7;
2018-02-26 19:35:16 -05:00
#else // little endian
2018-02-27 17:05:46 -05:00
uint8_t csrccount :4;
uint8_t extension :1;
uint8_t padding :1;
uint8_t version :2;
2018-02-26 19:35:16 -05:00
2018-02-27 17:05:46 -05:00
uint8_t payloadtype :7;
uint8_t marker :1;
2018-02-26 19:35:16 -05:00
#endif // RTP_BIG_ENDIAN
2018-02-27 17:05:46 -05:00
uint16_t sequencenumber;
uint32_t timestamp;
uint32_t ssrc;
2018-02-26 19:35:16 -05:00
};
struct RTPExtensionHeader
{
2018-02-27 17:05:46 -05:00
uint16_t extid;
uint16_t length;
2018-02-26 19:35:16 -05:00
};
struct RTPSourceIdentifier
{
2018-02-27 17:05:46 -05:00
uint32_t ssrc;
2018-02-26 19:35:16 -05:00
};
struct RTCPCommonHeader
{
#ifdef RTP_BIG_ENDIAN
2018-02-27 17:05:46 -05:00
uint8_t version:2;
uint8_t padding:1;
uint8_t count:5;
2018-02-26 19:35:16 -05:00
#else // little endian
2018-02-27 17:05:46 -05:00
uint8_t count :5;
uint8_t padding :1;
uint8_t version :2;
2018-02-26 19:35:16 -05:00
#endif // RTP_BIG_ENDIAN
2018-02-27 17:05:46 -05:00
uint8_t packettype;
uint16_t length;
2018-02-26 19:35:16 -05:00
};
struct RTCPSenderReport
{
2018-02-27 17:05:46 -05:00
uint32_t ntptime_msw;
uint32_t ntptime_lsw;
uint32_t rtptimestamp;
uint32_t packetcount;
uint32_t octetcount;
2018-02-26 19:35:16 -05:00
};
struct RTCPReceiverReport
{
2018-02-27 17:05:46 -05:00
uint32_t ssrc; // Identifies about which SSRC's data this report is...
uint8_t fractionlost;
uint8_t packetslost[3];
uint32_t exthighseqnr;
uint32_t jitter;
uint32_t lsr;
uint32_t dlsr;
2018-02-26 19:35:16 -05:00
};
struct RTCPSDESHeader
{
2018-02-27 17:05:46 -05:00
uint8_t sdesid;
uint8_t length;
2018-02-26 19:35:16 -05:00
};
} // end namespace
#endif // RTPSTRUCTS