LeviLamina
Loading...
Searching...
No Matches
webrtc.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/external/absl/AnyInvocable.h"
7#include "mc/external/cricket/MediaType.h"
8#include "mc/external/webrtc/AV1Profile.h"
9#include "mc/external/webrtc/IceCandidateType.h"
10#include "mc/external/webrtc/PeerConnectionInterface.h"
11#include "mc/external/webrtc/Priority.h"
12#include "mc/external/webrtc/RTCErrorDetailType.h"
13#include "mc/external/webrtc/RTCErrorType.h"
14#include "mc/external/webrtc/RtpTransceiverDirection.h"
15#include "mc/external/webrtc/ScalabilityMode.h"
16#include "mc/external/webrtc/SdpType.h"
17#include "mc/external/webrtc/VP9Profile.h"
18#include "mc/external/webrtc/VideoCodecType.h"
19#include "mc/external/webrtc/scoped_refptr.h"
20
21// auto generated forward declare list
22// clang-format off
23namespace cricket { class Candidate; }
24namespace cricket { class ContentInfo; }
25namespace cricket { class FeedbackParam; }
26namespace cricket { class MediaContentDescription; }
27namespace cricket { class SessionDescription; }
28namespace cricket { struct Codec; }
29namespace cricket { struct RelayServerConfig; }
30namespace cricket { struct RidDescription; }
31namespace cricket { struct StreamParams; }
32namespace rtc { class CopyOnWriteBuffer; }
33namespace rtc { class IPAddress; }
34namespace rtc { class SocketAddress; }
35namespace rtc { class StringBuilder; }
36namespace webrtc { class DataRate; }
37namespace webrtc { class DataSize; }
38namespace webrtc { class FieldTrialParameterInterface; }
39namespace webrtc { class FieldTrialsView; }
40namespace webrtc { class IceCandidateInterface; }
41namespace webrtc { class JsepIceCandidate; }
42namespace webrtc { class JsepSessionDescription; }
43namespace webrtc { class PendingTaskSafetyFlag; }
44namespace webrtc { class RTCError; }
45namespace webrtc { class RTCStats; }
46namespace webrtc { class RTCStatsReport; }
47namespace webrtc { class RtpHeaderExtensionMap; }
48namespace webrtc { class SessionDescriptionInterface; }
49namespace webrtc { class TaskQueueFactory; }
50namespace webrtc { class TimeDelta; }
51namespace webrtc { class Timestamp; }
52namespace webrtc { class TransceiverList; }
53namespace webrtc { struct DataChannelInit; }
54namespace webrtc { struct FrameDependencyStructure; }
55namespace webrtc { struct H264ProfileLevelId; }
56namespace webrtc { struct RTPVideoHeader; }
57namespace webrtc { struct RtcpFeedback; }
58namespace webrtc { struct RtpCapabilities; }
59namespace webrtc { struct RtpCodecCapability; }
60namespace webrtc { struct RtpExtension; }
61namespace webrtc { struct RtpExtensionSize; }
62namespace webrtc { struct RtpParameters; }
63namespace webrtc { struct SdpParseError; }
64namespace webrtc { struct SsrcInfo; }
65// clang-format on
66
67namespace webrtc {
68// inner types
69enum : int {
70 KMaxEncoderBuffers = 8,
71};
72
73enum : int {
74 KMaxPreferredPixelFormats = 5,
75};
76
77enum : int {
78 KMaxSimulcastStreams = 3,
79};
80
81enum : int {
82 KMaxSpatialLayers = 5,
83};
84
85enum : int {
86 KMaxTemporalStreams = 4,
87};
88
89enum : int {
90 KRtpCsrcSize = 15,
91};
92
93// functions
94// NOLINTBEGIN
95MCNAPI bool AV1IsSameProfile(
96 ::std::map<::std::string, ::std::string> const& params1,
97 ::std::map<::std::string, ::std::string> const& params2
98);
99
100MCNAPI void
101AddAudioAttribute(::std::string const& name, ::std::string_view value, ::cricket::MediaContentDescription* desc);
102
103MCNAPI void AddFmtpLine(::cricket::Codec const& codec, ::std::string* message);
104
105MCNAPI void AddOrReplaceCodec(::cricket::MediaContentDescription* content_desc, ::cricket::Codec const& codec);
106
107MCNAPI void AddPacketizationLine(::cricket::Codec const& codec, ::std::string* message);
108
109MCNAPI void AddRtcpFbLines(::cricket::Codec const& codec, ::std::string* message);
110
111MCNAPI void AlignedFree(void* mem_block);
112
113MCNAPI void* AlignedMalloc(uint64 size, uint64 alignment);
114
115MCNAPI char const* CodecTypeToPayloadString(::webrtc::VideoCodecType type);
116
117MCNAPI ::webrtc::TimeDelta CompactNtpRttToTimeDelta(uint compact_ntp_interval);
118
119MCNAPI ::std::unique_ptr<::webrtc::TaskQueueFactory>
120CreateDefaultTaskQueueFactory(::webrtc::FieldTrialsView const* field_trials);
121
122MCNAPI ::webrtc::IceCandidateInterface* CreateIceCandidate(
123 ::std::string const& sdp_mid,
124 int sdp_mline_index,
125 ::std::string const& sdp,
126 ::webrtc::SdpParseError* error
127);
128
129MCNAPI ::std::unique_ptr<::webrtc::SessionDescriptionInterface>
130CreateSessionDescription(::webrtc::SdpType type, ::std::string const& sdp);
131
132MCNAPI ::std::unique_ptr<::webrtc::SessionDescriptionInterface>
133CreateSessionDescription(::webrtc::SdpType type, ::std::string const& sdp, ::webrtc::SdpParseError* error_out);
134
135MCNAPI ::std::unique_ptr<::webrtc::TaskQueueFactory> CreateTaskQueueStdlibFactory();
136
137MCNAPI void CreateTrackWithNoSsrcs(
138 ::std::vector<::std::string> const& msid_stream_ids,
139 ::std::string_view msid_track_id,
140 ::std::vector<::cricket::RidDescription> const& rids,
141 ::std::vector<::cricket::StreamParams>* tracks
142);
143
144MCNAPI void CreateTracksFromSsrcInfos(
145 ::std::vector<::webrtc::SsrcInfo> const& ssrc_infos,
146 ::std::vector<::std::string> const& msid_stream_ids,
147 ::std::string_view msid_track_id,
148 ::std::vector<::cricket::StreamParams>* tracks,
149 int msid_signaling
150);
151
152MCNAPI ::cricket::Codec
153GetCodecWithPayloadType(::cricket::MediaType type, ::std::vector<::cricket::Codec> const& codecs, int payload_type);
154
155MCNAPI void GetMediaStreamIds(::cricket::ContentInfo const* content, ::std::set<::std::string>* labels);
156
157MCNAPI bool GetParameter(::std::string const& name, ::std::map<::std::string, ::std::string> const& params, int* value);
158
159MCNAPI ::std::vector<::std::string const*> GetStatsReferencedIds(::webrtc::RTCStats const& stats);
160
161MCNAPI void H264GenerateProfileLevelIdForAnswer(
162 ::std::map<::std::string, ::std::string> const& local_supported_params,
163 ::std::map<::std::string, ::std::string> const& remote_offered_params,
164 ::std::map<::std::string, ::std::string>* answer_params
165);
166
167MCNAPI bool H264IsSameProfile(
168 ::std::map<::std::string, ::std::string> const& params1,
169 ::std::map<::std::string, ::std::string> const& params2
170);
171
172MCNAPI ::std::optional<::std::string> H264ProfileLevelIdToString(::webrtc::H264ProfileLevelId const& profile_level_id);
173
174MCNAPI bool HasDuplicateMsidLines(::cricket::SessionDescription* desc);
175
176MCNAPI ::std::string_view IceCandidateTypeToString(::webrtc::IceCandidateType type);
177
178MCNAPI ::webrtc::RTCError
179InvokeSetParametersCallback(::absl::AnyInvocable<void(::webrtc::RTCError) &&>& callback, ::webrtc::RTCError error);
180
181MCNAPI bool IsLegalRsidName(::std::string_view name);
182
183MCNAPI bool IsNewerSequenceNumber(ushort sequence_number, ushort prev_sequence_number);
184
185MCNAPI bool IsOpenMessage(::rtc::CopyOnWriteBuffer const& payload);
186
187MCNAPI bool IsRtcpPacket(::rtc::ArrayView<uchar const> packet);
188
189MCNAPI bool IsRtpPacket(::rtc::ArrayView<uchar const> packet);
190
191MCNAPI int Leb128Size(uint64 value);
192
193MCNAPI void
194MaybeCreateStaticPayloadAudioCodecs(::std::vector<int> const& fmts, ::cricket::MediaContentDescription* media_desc);
195
196MCNAPI bool ParseCandidate(
197 ::std::string_view message,
198 ::cricket::Candidate* candidate,
199 ::webrtc::SdpParseError* error,
200 bool is_raw
201);
202
203MCNAPI bool ParseConnectionData(::std::string_view line, ::rtc::SocketAddress* addr, ::webrtc::SdpParseError* error);
204
205MCNAPI bool ParseDataChannelOpenAckMessage(::rtc::CopyOnWriteBuffer const& payload);
206
207MCNAPI bool ParseDataChannelOpenMessage(
208 ::rtc::CopyOnWriteBuffer const& payload,
209 ::std::string* label,
210 ::webrtc::DataChannelInit* config
211);
212
213MCNAPI void ParseFieldTrial(
214 ::std::initializer_list<::webrtc::FieldTrialParameterInterface*> fields,
215 ::std::string_view trial_string
216);
217
218MCNAPI ::webrtc::RTCError ParseIceServersOrError(
219 ::std::vector<::webrtc::PeerConnectionInterface::IceServer> const& servers,
220 ::std::set<::rtc::SocketAddress>* stun_servers,
221 ::std::vector<::cricket::RelayServerConfig>* turn_servers
222);
223
224MCNAPI ushort ParseRtpSequenceNumber(::rtc::ArrayView<uchar const> rtp_packet);
225
226MCNAPI uint ParseRtpSsrc(::rtc::ArrayView<uchar const> rtp_packet);
227
228MCNAPI bool ParseSctpMaxMessageSize(::std::string_view line, int* max_message_size, ::webrtc::SdpParseError* error);
229
230MCNAPI bool ParseSctpPort(::std::string_view line, int* sctp_port, ::webrtc::SdpParseError* error);
231
232MCNAPI ::std::optional<::webrtc::AV1Profile>
233ParseSdpForAV1Profile(::std::map<::std::string, ::std::string> const& params);
234
235MCNAPI ::std::optional<::webrtc::H264ProfileLevelId>
236ParseSdpForH264ProfileLevelId(::std::map<::std::string, ::std::string> const& params);
237
238MCNAPI ::std::optional<::webrtc::VP9Profile>
239ParseSdpForVP9Profile(::std::map<::std::string, ::std::string> const& params);
240
241MCNAPI ::webrtc::VideoCodecType PayloadStringToCodecType(::std::string const& name);
242
243MCNAPI int ResolveHostname(::std::string_view hostname, int family, ::std::vector<::rtc::IPAddress>& addresses);
244
245MCNAPI ::std::vector<uchar> RtpDescriptorAuthentication(::webrtc::RTPVideoHeader const& rtp_video_header);
246
247MCNAPI int RtpHeaderExtensionSize(
248 ::rtc::ArrayView<::webrtc::RtpExtensionSize const> extensions,
249 ::webrtc::RtpHeaderExtensionMap const& registered_extensions
250);
251
252MCNAPI ::webrtc::RtpTransceiverDirection RtpTransceiverDirectionFromSendRecv(bool send, bool recv);
253
254MCNAPI bool RtpTransceiverDirectionHasRecv(::webrtc::RtpTransceiverDirection direction);
255
256MCNAPI bool RtpTransceiverDirectionHasSend(::webrtc::RtpTransceiverDirection direction);
257
258MCNAPI ::webrtc::RtpTransceiverDirection
259RtpTransceiverDirectionIntersection(::webrtc::RtpTransceiverDirection lhs, ::webrtc::RtpTransceiverDirection rhs);
260
261MCNAPI ::webrtc::RtpTransceiverDirection RtpTransceiverDirectionReversed(::webrtc::RtpTransceiverDirection direction);
262
263MCNAPI char const* RtpTransceiverDirectionToString(::webrtc::RtpTransceiverDirection direction);
264
265MCNAPI ::webrtc::RtpTransceiverDirection
266RtpTransceiverDirectionWithRecvSet(::webrtc::RtpTransceiverDirection direction, bool recv);
267
268MCNAPI ::absl::AnyInvocable<void() &&>
269SafeTask(::webrtc::scoped_refptr<::webrtc::PendingTaskSafetyFlag> flag, ::absl::AnyInvocable<void() &&> task);
270
271MCNAPI ::std::string_view ScalabilityModeToString(::webrtc::ScalabilityMode scalability_mode);
272
273MCNAPI bool
274SdpDeserialize(::std::string_view message, ::webrtc::JsepSessionDescription* jdesc, ::webrtc::SdpParseError* error);
275
276MCNAPI bool SdpDeserializeCandidate(
277 ::std::string_view message,
278 ::webrtc::JsepIceCandidate* jcandidate,
279 ::webrtc::SdpParseError* error
280);
281
282MCNAPI ::std::string SdpSerialize(::webrtc::JsepSessionDescription const& jdesc);
283
284MCNAPI ::std::string SdpSerializeCandidate(::cricket::Candidate const& candidate);
285
286MCNAPI ::std::string SdpSerializeCandidate(::webrtc::IceCandidateInterface const& candidate);
287
288MCNAPI ::std::optional<::webrtc::SdpType> SdpTypeFromString(::std::string const& type_str);
289
290MCNAPI char const* SdpTypeToString(::webrtc::SdpType type);
291
292MCNAPI ::webrtc::scoped_refptr<::webrtc::RTCStatsReport>
293TakeReferencedStats(::webrtc::scoped_refptr<::webrtc::RTCStatsReport> report, ::std::vector<::std::string> const& ids);
294
295MCNAPI ::std::optional<::webrtc::RtcpFeedback> ToRtcpFeedback(::cricket::FeedbackParam const& cricket_feedback);
296
297MCNAPI ::webrtc::RtpCapabilities ToRtpCapabilities(
298 ::std::vector<::cricket::Codec> const& cricket_codecs,
299 ::std::vector<::webrtc::RtpExtension> const& cricket_extensions
300);
301
302MCNAPI ::webrtc::RtpCodecCapability ToRtpCodecCapability(::cricket::Codec const& cricket_codec);
303
304MCNAPI ::std::string ToString(::webrtc::DataRate value);
305
306MCNAPI ::std::string ToString(::webrtc::DataSize value);
307
308MCNAPI ::std::string ToString(::webrtc::TimeDelta value);
309
310MCNAPI ::std::string ToString(::webrtc::Timestamp value);
311
312MCNAPI ::std::string_view ToString(::webrtc::RTCErrorDetailType error);
313
314MCNAPI ::std::string_view ToString(::webrtc::RTCErrorType error);
315
316MCNAPI bool UnimplementedRtpParameterHasValue(::webrtc::RtpParameters const& parameters);
317
318MCNAPI void UpdateFromWildcardCodecs(::cricket::MediaContentDescription* desc);
319
320MCNAPI void UpdateRtpHeaderExtensionPreferencesFromSdpMunging(
321 ::cricket::SessionDescription const* description,
322 ::webrtc::TransceiverList* transceivers
323);
324
325MCNAPI bool VP9IsSameProfile(
326 ::std::map<::std::string, ::std::string> const& params1,
327 ::std::map<::std::string, ::std::string> const& params2
328);
329
330MCNAPI void WriteDataChannelOpenAckMessage(::rtc::CopyOnWriteBuffer* payload);
331
332MCNAPI bool WriteDataChannelOpenMessage(
333 ::std::string const& label,
334 ::std::string const& protocol,
335 ::std::optional<::webrtc::Priority> opt_priority,
336 bool ordered,
337 ::std::optional<int> max_retransmits,
338 ::std::optional<int> max_retransmit_time,
339 ::rtc::CopyOnWriteBuffer* payload
340);
341
342MCNAPI bool WriteFmtpParameters(::std::map<::std::string, ::std::string> const& parameters, ::rtc::StringBuilder* os);
343
344MCNAPI int WriteLeb128(uint64 value, uchar* buffer);
345
346MCNAPI bool operator==(::webrtc::FrameDependencyStructure const& lhs, ::webrtc::FrameDependencyStructure const& rhs);
347// NOLINTEND
348
349// static variables
350// NOLINTBEGIN
351MCNAPI ::std::add_lvalue_reference_t<char const[]> kBweTypeHistogram();
352
353MCNAPI double const& kDefaultBitratePriority();
354
355MCNAPI ::std::add_lvalue_reference_t<char const[]> kVP9FmtpProfileId();
356// NOLINTEND
357
358} // namespace webrtc
Definition Candidate.h:15
Definition ContentInfo.h:12
Definition FeedbackParam.h:7
Definition MediaContentDescription.h:19
Definition SessionDescription.h:18
Definition CopyOnWriteBuffer.h:11
Definition IPAddress.h:7
Definition SocketAddress.h:12
Definition StringBuilder.h:7
Definition DataRate.h:10
Definition DataSize.h:10
Definition FieldTrialParameterInterface.h:7
Definition FieldTrialsView.h:7
Definition IceCandidateInterface.h:12
Definition JsepIceCandidate.h:15
Definition JsepSessionDescription.h:19
Definition PendingTaskSafetyFlag.h:16
Definition RTCError.h:10
Definition RTCStatsReport.h:17
Definition RTCStats.h:12
Definition RtpHeaderExtensionMap.h:15
Definition SessionDescriptionInterface.h:18
Definition TaskQueueFactory.h:13
Definition TimeDelta.h:10
Definition Timestamp.h:15
Definition TransceiverList.h:18
Definition Codec.h:14
Definition RelayServerConfig.h:15
Definition RidDescription.h:10
Definition StreamParams.h:12
Definition DataChannelInit.h:7
Definition FrameDependencyStructure.h:7
Definition H264ProfileLevelId.h:7
Definition RTPVideoHeader.h:12
Definition RtcpFeedback.h:11
Definition RtpCapabilities.h:7
Definition RtpCodecCapability.h:10
Definition RtpExtensionSize.h:7
Definition RtpExtension.h:7
Definition RtpParameters.h:7
Definition SdpParseError.h:7
Definition SsrcInfo.h:7