Skip to content

Commit dbf985a

Browse files
authored
New RTP Packet: Round 3 (#1688)
- Move `RTC/Codecs` classes to `RTC/RTP/Codecs` and add `RTP` namespace into them. - _NOTE:_ Actually previous `RTC/Codecs` classes still exist. They will be removed later when the old `RtpPacket` class is completely gone. - This PR doesn't change any code in "production", this is, the new `RTP::Packet` class is not yet used.
1 parent 67db09e commit dbf985a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+5403
-918
lines changed

npm-scripts.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ function getPython() {
248248
if (!python) {
249249
try {
250250
execSync('python3 --version', { stdio: ['ignore', 'ignore', 'ignore'] });
251+
251252
python = 'python3';
252253
} catch (error) {
253254
python = 'python';

worker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM ubuntu:24.04
1+
FROM ubuntu:25.10
22

33
# Install dependencies.
44
RUN set -x \
55
&& apt-get update \
66
&& apt-get install --yes \
77
clang make pkg-config bash-completion wget curl screen python3-pip python3-yaml \
8-
zlib1g-dev libgss-dev libssl-dev libxml2-dev gdb
8+
zlib1g-dev libgss-dev libssl-dev libxml2-dev gdb clang-format-21
99

1010
# Install node 24.
1111
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#ifndef MS_FUZZER_RTC_RTP_CODECS_AV1_HPP
2+
#define MS_FUZZER_RTC_RTP_CODECS_AV1_HPP
3+
4+
#include "common.hpp"
5+
6+
namespace Fuzzer
7+
{
8+
namespace RTC
9+
{
10+
namespace RTP
11+
{
12+
namespace Codecs
13+
{
14+
namespace AV1
15+
{
16+
void Fuzz(const uint8_t* data, size_t len);
17+
} // namespace AV1
18+
} // namespace Codecs
19+
} // namespace RTP
20+
} // namespace RTC
21+
} // namespace Fuzzer
22+
23+
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#ifndef MS_FUZZER_RTC_RTP_CODECS_DEPENDENCY_DESCRIPTOR_HPP
2+
#define MS_FUZZER_RTC_RTP_CODECS_DEPENDENCY_DESCRIPTOR_HPP
3+
4+
#include "common.hpp"
5+
6+
namespace Fuzzer
7+
{
8+
namespace RTC
9+
{
10+
namespace RTP
11+
{
12+
namespace Codecs
13+
{
14+
namespace DependencyDescriptor
15+
{
16+
void Fuzz(const uint8_t* data, size_t len);
17+
} // namespace DependencyDescriptor
18+
} // namespace Codecs
19+
} // namespace RTP
20+
} // namespace RTC
21+
} // namespace Fuzzer
22+
23+
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#ifndef MS_FUZZER_RTC_RTP_CODECS_H264_HPP
2+
#define MS_FUZZER_RTC_RTP_CODECS_H264_HPP
3+
4+
#include "common.hpp"
5+
6+
namespace Fuzzer
7+
{
8+
namespace RTC
9+
{
10+
namespace RTP
11+
{
12+
namespace Codecs
13+
{
14+
namespace H264
15+
{
16+
void Fuzz(const uint8_t* data, size_t len);
17+
}
18+
} // namespace Codecs
19+
} // namespace RTP
20+
} // namespace RTC
21+
} // namespace Fuzzer
22+
23+
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#ifndef MS_FUZZER_RTC_RTP_CODECS_OPUS_HPP
2+
#define MS_FUZZER_RTC_RTP_CODECS_OPUS_HPP
3+
4+
#include "common.hpp"
5+
6+
namespace Fuzzer
7+
{
8+
namespace RTC
9+
{
10+
namespace RTP
11+
{
12+
namespace Codecs
13+
{
14+
namespace Opus
15+
{
16+
void Fuzz(const uint8_t* data, size_t len);
17+
}
18+
} // namespace Codecs
19+
} // namespace RTP
20+
} // namespace RTC
21+
} // namespace Fuzzer
22+
23+
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#ifndef MS_FUZZER_RTC_RTP_CODECS_VP8_HPP
2+
#define MS_FUZZER_RTC_RTP_CODECS_VP8_HPP
3+
4+
#include "common.hpp"
5+
6+
namespace Fuzzer
7+
{
8+
namespace RTC
9+
{
10+
namespace RTP
11+
{
12+
namespace Codecs
13+
{
14+
namespace VP8
15+
{
16+
void Fuzz(const uint8_t* data, size_t len);
17+
}
18+
} // namespace Codecs
19+
} // namespace RTP
20+
} // namespace RTC
21+
} // namespace Fuzzer
22+
23+
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#ifndef MS_FUZZER_RTC_RTP_CODECS_VP9_HPP
2+
#define MS_FUZZER_RTC_RTP_CODECS_VP9_HPP
3+
4+
#include "common.hpp"
5+
6+
namespace Fuzzer
7+
{
8+
namespace RTC
9+
{
10+
namespace RTP
11+
{
12+
namespace Codecs
13+
{
14+
namespace VP9
15+
{
16+
void Fuzz(const uint8_t* data, size_t len);
17+
}
18+
} // namespace Codecs
19+
} // namespace RTP
20+
} // namespace RTC
21+
} // namespace Fuzzer
22+
23+
#endif
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include "RTC/RTP/Codecs/FuzzerAV1.hpp"
2+
#include "RTC/RTP/Codecs/AV1.hpp"
3+
4+
class Listener : public ::RTC::RTP::Codecs::DependencyDescriptor::Listener
5+
{
6+
public:
7+
void OnDependencyDescriptorUpdated(const uint8_t* data, size_t len) override
8+
{
9+
}
10+
};
11+
12+
void Fuzzer::RTC::RTP::Codecs::AV1::Fuzz(const uint8_t* data, size_t len)
13+
{
14+
Listener listener;
15+
std::unique_ptr<::RTC::RTP::Codecs::DependencyDescriptor::TemplateDependencyStructure>
16+
templateDependencyStructure;
17+
18+
auto dependencyDescriptor = std::unique_ptr<::RTC::RTP::Codecs::DependencyDescriptor>(
19+
::RTC::RTP::Codecs::DependencyDescriptor::Parse(
20+
data, len, std::addressof(listener), templateDependencyStructure));
21+
22+
auto* descriptor = ::RTC::RTP::Codecs::AV1::Parse(dependencyDescriptor);
23+
24+
if (!descriptor)
25+
{
26+
return;
27+
}
28+
29+
delete descriptor;
30+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include "RTC/RTP/Codecs/FuzzerDependencyDescriptor.hpp"
2+
#include "RTC/RTP/Codecs/DependencyDescriptor.hpp"
3+
4+
class Listener : public ::RTC::RTP::Codecs::DependencyDescriptor::Listener
5+
{
6+
public:
7+
void OnDependencyDescriptorUpdated(const uint8_t* data, size_t len) override
8+
{
9+
}
10+
};
11+
12+
void Fuzzer::RTC::RTP::Codecs::DependencyDescriptor::Fuzz(const uint8_t* data, size_t len)
13+
{
14+
std::unique_ptr<::RTC::RTP::Codecs::DependencyDescriptor::TemplateDependencyStructure>
15+
templateDependencyStructure;
16+
17+
Listener listener;
18+
19+
auto* descriptor = ::RTC::RTP::Codecs::DependencyDescriptor::Parse(
20+
data, len, std::addressof(listener), templateDependencyStructure);
21+
22+
if (!descriptor)
23+
{
24+
return;
25+
}
26+
27+
delete descriptor;
28+
}

0 commit comments

Comments
 (0)