3#include "../Video/IVideoDecoder.h"
7#include "Foundation/Network/Address.h"
8#include "Foundation/Network/Connection.h"
10#include <unordered_map>
18 namespace Core{
class Context; };
23 uint32_t clock_rate = 90000,
24 uint16_t client_port = 0,
34 void setUserData(intptr_t data) { userData = data; }
35 void setConnectTimeout(int64_t milliseconds) { tcpConnection.setConnectTimeout(milliseconds); }
37 uint16_t GetRTPPort()
const {
return rtp_port; }
38 uint16_t GetRTCPPort()
const {
return rtcp_port; }
39 intptr_t getUserData()
const {
return userData; }
41 void AddDestination(
const uint8_t ip[4], uint16_t server_port);
42 void JoinMulticastGroup(
const uint8_t ip[4], uint16_t server_port);
44 void SendPacket(
const uint8_t *buffer,
size_t size);
46 void AddSSRC(uint32_t ssrc, Cogs::Core::Codec codec, ResourceId textureId);
49 void WriteData(
Dest &dest);
51 Dest *GetLatestStream();
56 bool use_pool_thread =
false;
59 uint32_t clock_rate = 0;
60 uint16_t client_port = 0;
61 uint16_t server_port = 0;
64 uint16_t rtp_port = 0;
65 uint16_t rtcp_port = 0;
66 jrtplib::RTPSession *session =
nullptr;
68 Cogs::Core::Codec codec = Cogs::Core::Codec::None;
70 bool rtp_one_byte_header_extension =
true;
71 bool rtp_two_byte_header_extension =
false;
73 uint16_t rfc6051_ext_id = 1;
75 uint32_t stream_number = 0;
78 Cogs::Core::Codec codec;
81 uint64_t receive_time = 0, prev_receive_time = 0;
82 uint64_t timestamp = 0, prev_timestamp = 0;
84 uint32_t eseq = 0, prev_eseq = 0;
85 uint32_t dropped_packages = 0, last_dropped = 0;
87 uint32_t size_akk = 0;
89 uint64_t rate_time = 0;
92 char *buffer =
nullptr;
93 size_t buffer_use = 0;
94 size_t buffer_size = 0;
95 uint64_t buffer_timestamp = 0;
96 bool buffer_first =
false;
97 bool buffer_last =
false;
98 bool buffer_discontinuity =
false;
106 std::unordered_map<uint32_t, Dest> dest;
112 void processH264NALU(
Dest& dest, uint32_t rtpType,
const void* data,
size_t size);
113 void processH265NALU(
Dest& dest, uint32_t rtpType,
const void* data,
size_t size);
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Contains all Cogs related functionality.