Skip to content

Commit e723afd

Browse files
authored
Merge pull request #11 from finger563/chore/ue5_5
Update to Unreal Engine 5.5
2 parents 6d0350d + 5acc9a1 commit e723afd

File tree

7 files changed

+242
-100
lines changed

7 files changed

+242
-100
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ Plugins/*/Intermediate/*
7373
# Cache files for the editor to use
7474
DerivedDataCache/*
7575
.DS_Store
76+
packaged/

Content/Maps/RtspDisplayMap.umap

7.64 KB
Binary file not shown.

RtspDisplay.uproject

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,27 @@
1717
"TargetAllowList": [
1818
"Editor"
1919
]
20+
},
21+
{
22+
"Name": "Fab",
23+
"Enabled": false,
24+
"SupportedTargetPlatforms": [
25+
"Win64",
26+
"Mac",
27+
"Linux"
28+
]
29+
},
30+
{
31+
"Name": "EditorTelemetry",
32+
"Enabled": false
33+
},
34+
{
35+
"Name": "EditorPerformance",
36+
"Enabled": false
37+
},
38+
{
39+
"Name": "StudioTelemetry",
40+
"Enabled": false
2041
}
2142
]
2243
}

Source/RtspDisplay.Target.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ public class RtspDisplayTarget : TargetRules
88
public RtspDisplayTarget( TargetInfo Target) : base(Target)
99
{
1010
Type = TargetType.Game;
11-
DefaultBuildSettings = BuildSettingsVersion.V2;
12-
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_1;
13-
ExtraModuleNames.Add("RtspDisplay");
11+
DefaultBuildSettings = BuildSettingsVersion.V5;
12+
// CppStandard = CppStandardVersion.Cpp20;
13+
// IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_5;
14+
15+
ExtraModuleNames.AddRange( new string[] { "RtspDisplay" } );
1416
}
1517
}

Source/RtspDisplay/rtp_packet.cpp

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#include "rtp_packet.hpp"
2+
3+
using namespace espp;
4+
5+
RtpPacket::RtpPacket() {
6+
// ensure that the packet_ vector is at least RTP_HEADER_SIZE bytes long
7+
packet_.resize(RTP_HEADER_SIZE);
8+
}
9+
10+
RtpPacket::RtpPacket(size_t payload_size)
11+
: payload_size_(payload_size) {
12+
// ensure that the packet_ vector is at least RTP_HEADER_SIZE + payload_size bytes long
13+
packet_.resize(RTP_HEADER_SIZE + payload_size);
14+
}
15+
16+
RtpPacket::RtpPacket(std::string_view data) {
17+
packet_.assign(data.begin(), data.end());
18+
payload_size_ = packet_.size() - RTP_HEADER_SIZE;
19+
if (packet_.size() >= RTP_HEADER_SIZE)
20+
parse_rtp_header();
21+
}
22+
23+
RtpPacket::~RtpPacket() {}
24+
25+
/// Getters for the RTP header fields.
26+
int RtpPacket::get_version() const { return version_; }
27+
bool RtpPacket::get_padding() const { return padding_; }
28+
bool RtpPacket::get_extension() const { return extension_; }
29+
int RtpPacket::get_csrc_count() const { return csrc_count_; }
30+
bool RtpPacket::get_marker() const { return marker_; }
31+
int RtpPacket::get_payload_type() const { return payload_type_; }
32+
int RtpPacket::get_sequence_number() const { return sequence_number_; }
33+
int RtpPacket::get_timestamp() const { return timestamp_; }
34+
int RtpPacket::get_ssrc() const { return ssrc_; }
35+
36+
/// Setters for the RTP header fields.
37+
void RtpPacket::set_version(int version) { version_ = version; }
38+
void RtpPacket::set_padding(bool padding) { padding_ = padding; }
39+
void RtpPacket::set_extension(bool extension) { extension_ = extension; }
40+
void RtpPacket::set_csrc_count(int csrc_count) { csrc_count_ = csrc_count; }
41+
void RtpPacket::set_marker(bool marker) { marker_ = marker; }
42+
void RtpPacket::set_payload_type(int payload_type) { payload_type_ = payload_type; }
43+
void RtpPacket::set_sequence_number(int sequence_number) { sequence_number_ = sequence_number; }
44+
void RtpPacket::set_timestamp(int timestamp) { timestamp_ = timestamp; }
45+
void RtpPacket::set_ssrc(int ssrc) { ssrc_ = ssrc; }
46+
47+
void RtpPacket::serialize() { serialize_rtp_header(); }
48+
49+
std::string_view RtpPacket::get_data() const {
50+
return std::string_view((char *)packet_.data(), packet_.size());
51+
}
52+
53+
size_t RtpPacket::get_rtp_header_size() const { return RTP_HEADER_SIZE; }
54+
55+
std::string_view RtpPacket::get_rpt_header() const {
56+
return std::string_view((char *)packet_.data(), RTP_HEADER_SIZE);
57+
}
58+
59+
std::vector<uint8_t> &RtpPacket::get_packet() { return packet_; }
60+
61+
std::string_view RtpPacket::get_payload() const {
62+
return std::string_view((char *)packet_.data() + RTP_HEADER_SIZE, payload_size_);
63+
}
64+
65+
void RtpPacket::set_payload(std::string_view payload) {
66+
packet_.resize(RTP_HEADER_SIZE + payload.size());
67+
std::copy(payload.begin(), payload.end(), packet_.begin() + RTP_HEADER_SIZE);
68+
payload_size_ = payload.size();
69+
}
70+
71+
void RtpPacket::parse_rtp_header() {
72+
version_ = (packet_[0] & 0xC0) >> 6;
73+
padding_ = (packet_[0] & 0x20) >> 5;
74+
extension_ = (packet_[0] & 0x10) >> 4;
75+
csrc_count_ = packet_[0] & 0x0F;
76+
marker_ = (packet_[1] & 0x80) >> 7;
77+
payload_type_ = packet_[1] & 0x7F;
78+
sequence_number_ = (packet_[2] << 8) | packet_[3];
79+
timestamp_ = (packet_[4] << 24) | (packet_[5] << 16) | (packet_[6] << 8) | packet_[7];
80+
ssrc_ = (packet_[8] << 24) | (packet_[9] << 16) | (packet_[10] << 8) | packet_[11];
81+
}
82+
83+
void RtpPacket::serialize_rtp_header() {
84+
packet_[0] = (version_ << 6) | (padding_ << 5) | (extension_ << 4) | csrc_count_;
85+
packet_[1] = (marker_ << 7) | payload_type_;
86+
packet_[2] = sequence_number_ >> 8;
87+
packet_[3] = sequence_number_ & 0xFF;
88+
packet_[4] = timestamp_ >> 24;
89+
packet_[5] = (timestamp_ >> 16) & 0xFF;
90+
packet_[6] = (timestamp_ >> 8) & 0xFF;
91+
packet_[7] = timestamp_ & 0xFF;
92+
packet_[8] = ssrc_ >> 24;
93+
packet_[9] = (ssrc_ >> 16) & 0xFF;
94+
packet_[10] = (ssrc_ >> 8) & 0xFF;
95+
packet_[11] = ssrc_ & 0xFF;
96+
}

0 commit comments

Comments
 (0)