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/rtc/AdapterType.h"
9#include "mc/external/webrtc/AV1Profile.h"
10#include "mc/external/webrtc/IceCandidateType.h"
11#include "mc/external/webrtc/PeerConnectionInterface.h"
12#include "mc/external/webrtc/Priority.h"
13#include "mc/external/webrtc/RTCErrorDetailType.h"
14#include "mc/external/webrtc/RTCErrorType.h"
15#include "mc/external/webrtc/RtpReceiverProxyWithInternal.h"
16#include "mc/external/webrtc/RtpSenderProxyWithInternal.h"
17#include "mc/external/webrtc/RtpTransceiverDirection.h"
18#include "mc/external/webrtc/RtpTransceiverProxyWithInternal.h"
19#include "mc/external/webrtc/ScalabilityMode.h"
20#include "mc/external/webrtc/SdpType.h"
21#include "mc/external/webrtc/VP9Profile.h"
22#include "mc/external/webrtc/VideoCodecType.h"
23#include "mc/external/webrtc/scoped_refptr.h"
24
25// auto generated forward declare list
26// clang-format off
27namespace cricket { class Candidate; }
28namespace cricket { class ContentInfo; }
29namespace cricket { class FeedbackParam; }
30namespace cricket { class FeedbackParams; }
31namespace cricket { class MediaContentDescription; }
32namespace cricket { class SessionDescription; }
33namespace cricket { struct Codec; }
34namespace cricket { struct RelayServerConfig; }
35namespace cricket { struct RidDescription; }
36namespace cricket { struct StreamParams; }
37namespace rtc { class CopyOnWriteBuffer; }
38namespace rtc { class IPAddress; }
39namespace rtc { class RTCCertificate; }
40namespace rtc { class SocketAddress; }
41namespace rtc { class StringBuilder; }
42namespace webrtc { class DataRate; }
43namespace webrtc { class DataSize; }
44namespace webrtc { class FieldTrialParameterInterface; }
45namespace webrtc { class FieldTrialsView; }
46namespace webrtc { class IceCandidateInterface; }
47namespace webrtc { class JsepIceCandidate; }
48namespace webrtc { class JsepSessionDescription; }
49namespace webrtc { class MediaStreamTrackInterface; }
50namespace webrtc { class PendingTaskSafetyFlag; }
51namespace webrtc { class RTCError; }
52namespace webrtc { class RTCStats; }
53namespace webrtc { class RTCStatsReport; }
54namespace webrtc { class RtpHeaderExtensionMap; }
55namespace webrtc { class RtpReceiverInterface; }
56namespace webrtc { class RtpReceiverInternal; }
57namespace webrtc { class RtpSenderInterface; }
58namespace webrtc { class RtpSenderInternal; }
59namespace webrtc { class RtpTransceiver; }
60namespace webrtc { class SessionDescriptionInterface; }
61namespace webrtc { class TaskQueueFactory; }
62namespace webrtc { class TimeDelta; }
63namespace webrtc { class Timestamp; }
64namespace webrtc { class TransceiverList; }
65namespace webrtc { class VideoFrameBuffer; }
66namespace webrtc { struct DataChannelInit; }
67namespace webrtc { struct H264ProfileLevelId; }
68namespace webrtc { struct RTPVideoHeader; }
69namespace webrtc { struct RtcpFeedback; }
70namespace webrtc { struct RtpCapabilities; }
71namespace webrtc { struct RtpCodecCapability; }
72namespace webrtc { struct RtpExtension; }
73namespace webrtc { struct RtpExtensionSize; }
74namespace webrtc { struct RtpParameters; }
75namespace webrtc { struct SdpParseError; }
76namespace webrtc { struct SsrcInfo; }
77// clang-format on
78
79namespace webrtc {
80// inner types
81enum : int {
82 // bitfield representation
83 KMaxEncoderBuffers = 1 << 3,
84};
85
86enum : int {
87 KMaxPreferredPixelFormats = 5,
88};
89
90enum : int {
91 KMaxSimulcastStreams = 3,
92};
93
94enum : int {
95 KMaxSpatialLayers = 5,
96};
97
98enum : int {
99 // bitfield representation
100 KMaxTemporalStreams = 1 << 2,
101};
102
103enum : int {
104 KRtpCsrcSize = 15,
105};
106
107// functions
108// NOLINTBEGIN
109MCNAPI bool AV1IsSameProfile(
110 ::std::map<::std::string, ::std::string> const& params1,
111 ::std::map<::std::string, ::std::string> const& params2
112);
113
114MCNAPI char const* AdapterTypeToStatsType(::rtc::AdapterType type);
115
116MCNAPI void
117AddAudioAttribute(::std::string const& name, ::std::string_view value, ::cricket::MediaContentDescription* desc);
118
119MCNAPI void AddFeedbackParameter(::cricket::FeedbackParam const& feedback_param, ::cricket::Codec* codec);
120
121MCNAPI void AddFeedbackParameters(::cricket::FeedbackParams const& feedback_params, ::cricket::Codec* codec);
122
123MCNAPI void AddFmtpLine(::cricket::Codec const& codec, ::std::string* message);
124
125MCNAPI void AddOrReplaceCodec(::cricket::MediaContentDescription* content_desc, ::cricket::Codec const& codec);
126
127MCNAPI void AddPacketizationLine(::cricket::Codec const& codec, ::std::string* message);
128
129MCNAPI void AddParameters(::std::map<::std::string, ::std::string> const& parameters, ::cricket::Codec* codec);
130
131MCNAPI void AddRtcpFbLines(::cricket::Codec const& codec, ::std::string* message);
132
133MCNAPI void AlignedFree(void* mem_block);
134
135MCNAPI void* AlignedMalloc(uint64 size, uint64 alignment);
136
137MCNAPI char const* CodecTypeToPayloadString(::webrtc::VideoCodecType type);
138
139MCNAPI ::webrtc::TimeDelta CompactNtpRttToTimeDelta(uint compact_ntp_interval);
140
141MCNAPI ::std::unique_ptr<::webrtc::TaskQueueFactory>
142CreateDefaultTaskQueueFactory(::webrtc::FieldTrialsView const* field_trials);
143
144MCNAPI ::webrtc::IceCandidateInterface* CreateIceCandidate(
145 ::std::string const& sdp_mid,
146 int sdp_mline_index,
147 ::std::string const& sdp,
149);
150
151MCNAPI ::std::unique_ptr<::webrtc::SessionDescriptionInterface>
152CreateSessionDescription(::webrtc::SdpType type, ::std::string const& sdp);
153
154MCNAPI ::std::unique_ptr<::webrtc::SessionDescriptionInterface>
155CreateSessionDescription(::webrtc::SdpType type, ::std::string const& sdp, ::webrtc::SdpParseError* error_out);
156
157MCNAPI ::std::unique_ptr<::webrtc::SessionDescriptionInterface> CreateSessionDescription(
158 ::webrtc::SdpType type,
159 ::std::string const& session_id,
160 ::std::string const& session_version,
161 ::std::unique_ptr<::cricket::SessionDescription> description
162);
163
164MCNAPI ::std::unique_ptr<::webrtc::TaskQueueFactory> CreateTaskQueueStdlibFactory();
165
166MCNAPI void CreateTrackWithNoSsrcs(
167 ::std::vector<::std::string> const& msid_stream_ids,
168 ::std::string_view msid_track_id,
169 ::std::vector<::cricket::RidDescription> const& rids,
170 ::std::vector<::cricket::StreamParams>* tracks
171);
172
173MCNAPI void CreateTracksFromSsrcInfos(
174 ::std::vector<::webrtc::SsrcInfo> const& ssrc_infos,
175 ::std::vector<::std::string> const& msid_stream_ids,
176 ::std::string_view msid_track_id,
177 ::std::vector<::cricket::StreamParams>* tracks,
178 int msid_signaling
179);
180
181MCNAPI ::cricket::Codec
182GetCodecWithPayloadType(::cricket::MediaType type, ::std::vector<::cricket::Codec> const& codecs, int payload_type);
183
184MCNAPI bool GetDtmfCode(char tone, int* code);
185
186MCNAPI ::std::string GetLegacyCandidateTypeName(::cricket::Candidate const& c);
187
188MCNAPI void GetMediaStreamIds(::cricket::ContentInfo const* content, ::std::set<::std::string>* labels);
189
190MCNAPI bool GetMinValue(::std::vector<int> const& values, int* value);
191
192MCNAPI bool GetParameter(::std::string const& name, ::std::map<::std::string, ::std::string> const& params, int* value);
193
194MCNAPI uint64 GetRightAlign(uint64 start_pos, uint64 alignment);
195
196MCNAPI ::std::vector<::std::string const*> GetStatsReferencedIds(::webrtc::RTCStats const& stats);
197
198MCNAPI void H264GenerateProfileLevelIdForAnswer(
199 ::std::map<::std::string, ::std::string> const& local_supported_params,
200 ::std::map<::std::string, ::std::string> const& remote_offered_params,
201 ::std::map<::std::string, ::std::string>* answer_params
202);
203
204MCNAPI bool H264IsSameProfile(
205 ::std::map<::std::string, ::std::string> const& params1,
206 ::std::map<::std::string, ::std::string> const& params2
207);
208
209MCNAPI ::std::optional<::std::string> H264ProfileLevelIdToString(::webrtc::H264ProfileLevelId const& profile_level_id);
210
211MCNAPI bool HasDuplicateMsidLines(::cricket::SessionDescription* desc);
212
213MCNAPI char const* IceCandidateTypeToStatsType(::cricket::Candidate const& candidate);
214
215MCNAPI ::std::string_view IceCandidateTypeToString(::webrtc::IceCandidateType type);
216
217MCNAPI ::webrtc::RTCError
218InvokeSetParametersCallback(::absl::AnyInvocable<void(::webrtc::RTCError) &&>& callback, ::webrtc::RTCError error);
219
220MCNAPI bool IsFmtpParam(::std::string_view name);
221
222MCNAPI bool IsLegalRsidName(::std::string_view name);
223
224MCNAPI bool IsMandatoryHeaderExtension(::std::string const& uri);
225
226MCNAPI bool IsNewerSequenceNumber(ushort sequence_number, ushort prev_sequence_number);
227
228MCNAPI bool IsOpenMessage(::rtc::CopyOnWriteBuffer const& payload);
229
230MCNAPI bool IsRtcpPacket(::rtc::ArrayView<uchar const> packet);
231
232MCNAPI bool IsRtpPacket(::rtc::ArrayView<uchar const> packet);
233
234MCNAPI bool IsTokenChar(char ch);
235
236MCNAPI int Leb128Size(uint64 value);
237
238MCNAPI void
239MaybeCreateStaticPayloadAudioCodecs(::std::vector<int> const& fmts, ::cricket::MediaContentDescription* media_desc);
240
241MCNAPI bool ParseCandidate(
242 ::std::string_view message,
243 ::cricket::Candidate* candidate,
245 bool is_raw
246);
247
248MCNAPI bool ParseConnectionData(::std::string_view line, ::rtc::SocketAddress* addr, ::webrtc::SdpParseError* error);
249
250MCNAPI bool ParseDataChannelOpenAckMessage(::rtc::CopyOnWriteBuffer const& payload);
251
252MCNAPI bool ParseDataChannelOpenMessage(
253 ::rtc::CopyOnWriteBuffer const& payload,
254 ::std::string* label,
256);
257
258MCNAPI void ParseFieldTrial(
259 ::std::initializer_list<::webrtc::FieldTrialParameterInterface*> fields,
260 ::std::string_view trial_string
261);
262
263MCNAPI ::std::optional<::webrtc::H264ProfileLevelId> ParseH264ProfileLevelId(char const* str);
264
265MCNAPI ::webrtc::RTCError ParseIceServersOrError(
266 ::std::vector<::webrtc::PeerConnectionInterface::IceServer> const& servers,
267 ::std::set<::rtc::SocketAddress>* stun_servers,
268 ::std::vector<::cricket::RelayServerConfig>* turn_servers
269);
270
271MCNAPI ushort ParseRtpSequenceNumber(::rtc::ArrayView<uchar const> rtp_packet);
272
273MCNAPI uint ParseRtpSsrc(::rtc::ArrayView<uchar const> rtp_packet);
274
275MCNAPI bool ParseSctpMaxMessageSize(::std::string_view line, int* max_message_size, ::webrtc::SdpParseError* error);
276
277MCNAPI bool ParseSctpPort(::std::string_view line, int* sctp_port, ::webrtc::SdpParseError* error);
278
279MCNAPI ::std::optional<::webrtc::AV1Profile>
280ParseSdpForAV1Profile(::std::map<::std::string, ::std::string> const& params);
281
282MCNAPI ::std::optional<::webrtc::H264ProfileLevelId>
283ParseSdpForH264ProfileLevelId(::std::map<::std::string, ::std::string> const& params);
284
285MCNAPI ::std::optional<::webrtc::VP9Profile>
286ParseSdpForVP9Profile(::std::map<::std::string, ::std::string> const& params);
287
288MCNAPI ::webrtc::VideoCodecType PayloadStringToCodecType(::std::string const& name);
289
290MCNAPI ::std::optional<::cricket::Codec> PopWildcardCodec(::std::vector<::cricket::Codec>* codecs);
291
292MCNAPI int ResolveHostname(::std::string_view hostname, int family, ::std::vector<::rtc::IPAddress>& addresses);
293
294MCNAPI ::std::vector<uchar> RtpDescriptorAuthentication(::webrtc::RTPVideoHeader const& rtp_video_header);
295
296MCNAPI int RtpHeaderExtensionSize(
298 ::webrtc::RtpHeaderExtensionMap const& registered_extensions
299);
300
301MCNAPI ::webrtc::RtpTransceiverDirection RtpTransceiverDirectionFromSendRecv(bool send, bool recv);
302
303MCNAPI bool RtpTransceiverDirectionHasRecv(::webrtc::RtpTransceiverDirection direction);
304
305MCNAPI bool RtpTransceiverDirectionHasSend(::webrtc::RtpTransceiverDirection direction);
306
307MCNAPI ::webrtc::RtpTransceiverDirection
308RtpTransceiverDirectionIntersection(::webrtc::RtpTransceiverDirection lhs, ::webrtc::RtpTransceiverDirection rhs);
309
310MCNAPI ::webrtc::RtpTransceiverDirection RtpTransceiverDirectionReversed(::webrtc::RtpTransceiverDirection direction);
311
312MCNAPI char const* RtpTransceiverDirectionToString(::webrtc::RtpTransceiverDirection direction);
313
314MCNAPI ::webrtc::RtpTransceiverDirection
315RtpTransceiverDirectionWithRecvSet(::webrtc::RtpTransceiverDirection direction, bool recv);
316
317MCNAPI ::absl::AnyInvocable<void() &&>
319
320MCNAPI ::std::string_view ScalabilityModeToString(::webrtc::ScalabilityMode scalability_mode);
321
322MCNAPI bool
323SdpDeserialize(::std::string_view message, ::webrtc::JsepSessionDescription* jdesc, ::webrtc::SdpParseError* error);
324
325MCNAPI bool SdpDeserializeCandidate(
326 ::std::string_view message,
327 ::webrtc::JsepIceCandidate* jcandidate,
329);
330
331MCNAPI ::std::string SdpSerialize(::webrtc::JsepSessionDescription const& jdesc);
332
333MCNAPI ::std::string SdpSerializeCandidate(::cricket::Candidate const& candidate);
334
335MCNAPI ::std::string SdpSerializeCandidate(::webrtc::IceCandidateInterface const& candidate);
336
337MCNAPI ::std::optional<::webrtc::SdpType> SdpTypeFromString(::std::string const& type_str);
338
339MCNAPI char const* SdpTypeToString(::webrtc::SdpType type);
340
341MCNAPI ::std::optional<::webrtc::AV1Profile> StringToAV1Profile(::std::string_view str);
342
343MCNAPI ::std::optional<::webrtc::VP9Profile> StringToVP9Profile(::std::string const& str);
344
345MCNAPI ::webrtc::scoped_refptr<::webrtc::RTCStatsReport>
346TakeReferencedStats(::webrtc::scoped_refptr<::webrtc::RTCStatsReport> report, ::std::vector<::std::string> const& ids);
347
348MCNAPI ::std::optional<::webrtc::RtcpFeedback> ToRtcpFeedback(::cricket::FeedbackParam const& cricket_feedback);
349
350MCNAPI ::webrtc::RtpCapabilities ToRtpCapabilities(
351 ::std::vector<::cricket::Codec> const& cricket_codecs,
352 ::std::vector<::webrtc::RtpExtension> const& cricket_extensions
353);
354
355MCNAPI ::webrtc::RtpCodecCapability ToRtpCodecCapability(::cricket::Codec const& cricket_codec);
356
357MCNAPI ::std::string_view ToString(::webrtc::RTCErrorType error);
358
359MCNAPI ::std::string_view ToString(::webrtc::RTCErrorDetailType error);
360
361MCNAPI ::std::string ToString(::webrtc::DataRate value);
362
363MCNAPI ::std::string ToString(::webrtc::TimeDelta value);
364
365MCNAPI ::std::string ToString(::webrtc::DataSize value);
366
367MCNAPI ::std::string ToString(::webrtc::Timestamp);
368
369MCNAPI bool UnimplementedRtpParameterHasValue(::webrtc::RtpParameters const& parameters);
370
371MCNAPI void UpdateCodec(
373 int payload_type,
374 ::cricket::FeedbackParam const& feedback_param
375);
376
377MCNAPI void UpdateCodec(
379 int payload_type,
380 ::std::map<::std::string, ::std::string> const& parameters
381);
382
383MCNAPI void UpdateCodec(int payload_type, ::std::string_view name, ::cricket::MediaContentDescription* desc);
384
385MCNAPI void UpdateCodec(
386 int payload_type,
387 ::std::string_view name,
388 int clockrate,
389 int bitrate,
390 uint64 channels,
392);
393
394MCNAPI void UpdateFromWildcardCodecs(::cricket::MediaContentDescription* desc);
395
396MCNAPI void UpdateRtpHeaderExtensionPreferencesFromSdpMunging(
397 ::cricket::SessionDescription const* description,
398 ::webrtc::TransceiverList* transceivers
399);
400
401MCNAPI void UpdateVideoCodecPacketization(
403 int payload_type,
404 ::std::string_view packetization
405);
406
407MCNAPI bool VP9IsSameProfile(
408 ::std::map<::std::string, ::std::string> const& params1,
409 ::std::map<::std::string, ::std::string> const& params2
410);
411
412MCNAPI bool ValidAlignment(uint64 alignment);
413
414MCNAPI void WriteDataChannelOpenAckMessage(::rtc::CopyOnWriteBuffer* payload);
415
416MCNAPI bool WriteDataChannelOpenMessage(
417 ::std::string const& label,
418 ::std::string const& protocol,
419 ::std::optional<::webrtc::Priority> opt_priority,
420 bool ordered,
421 ::std::optional<int> max_retransmits,
422 ::std::optional<int> max_retransmit_time,
424);
425
426MCNAPI void WriteFmtpHeader(int payload_type, ::rtc::StringBuilder* os);
427
428MCNAPI void
429WriteFmtpParameter(::std::string_view parameter_name, ::std::string_view parameter_value, ::rtc::StringBuilder* os);
430
431MCNAPI bool WriteFmtpParameters(::std::map<::std::string, ::std::string> const& parameters, ::rtc::StringBuilder* os);
432
433MCNAPI int WriteLeb128(uint64 value, uchar* buffer);
434
435MCNAPI void WritePacketizationHeader(int payload_type, ::rtc::StringBuilder* os);
436
437MCNAPI void WriteRtcpFbHeader(int payload_type, ::rtc::StringBuilder* os);
438
439MCNAPI bool operator!=(::webrtc::scoped_refptr<::webrtc::VideoFrameBuffer> const& a, nullptr_t);
440
441MCNAPI bool operator!=(::webrtc::scoped_refptr<::rtc::RTCCertificate> const& a, nullptr_t);
442
443MCNAPI bool operator!=(::webrtc::scoped_refptr<::webrtc::PendingTaskSafetyFlag> const& a, nullptr_t);
444
445MCNAPI bool operator<(
448);
449
450MCNAPI bool operator==(::webrtc::scoped_refptr<::webrtc::VideoFrameBuffer> const& a, nullptr_t);
451
452MCNAPI bool operator==(::webrtc::scoped_refptr<::rtc::RTCCertificate> const& a, nullptr_t);
453
454MCNAPI bool operator==(::webrtc::scoped_refptr<::webrtc::PendingTaskSafetyFlag> const& a, nullptr_t);
455
456MCNAPI bool operator==(
459);
460
461MCNAPI bool operator==(
464);
465
466MCNAPI bool operator==(
469);
470
471MCNAPI bool operator==(
474);
475
476MCNAPI bool operator==(
479);
480
481MCNAPI bool operator==(
484);
485
486MCNAPI bool operator==(
489);
490
491MCNAPI bool operator==(
494);
495// NOLINTEND
496
497// static variables
498// NOLINTBEGIN
499MCNAPI ::std::add_lvalue_reference_t<char const[]> kBweTypeHistogram();
500
501MCNAPI ::webrtc::DataRate const& kCongestionControllerMinBitrate();
502
503MCNAPI double const& kDefaultBitratePriority();
504
505MCNAPI ::std::add_lvalue_reference_t<char const[]> kVP9FmtpProfileId();
506// NOLINTEND
507
508} // namespace webrtc
Definition AnyInvocable.h:8
Definition Candidate.h:15
Definition ContentInfo.h:12
Definition FeedbackParam.h:7
Definition FeedbackParams.h:12
Definition MediaContentDescription.h:23
Definition SessionDescription.h:18
Definition _HeaderOutputPredefine.h:264
Definition CopyOnWriteBuffer.h:11
Definition SocketAddress.h:12
Definition StringBuilder.h:7
Definition DataRate.h:10
Definition DataSize.h:10
Definition FieldTrialsView.h:7
Definition IceCandidateInterface.h:12
Definition JsepIceCandidate.h:16
Definition JsepSessionDescription.h:19
Definition MediaStreamTrackInterface.h:11
Definition RTCError.h:10
Definition RTCStats.h:12
Definition RtpHeaderExtensionMap.h:15
Definition RtpReceiverInterface.h:24
Definition RtpReceiverProxyWithInternal.h:8
Definition RtpSenderInterface.h:26
Definition RtpSenderProxyWithInternal.h:8
Definition RtpTransceiverProxyWithInternal.h:8
Definition TimeDelta.h:10
Definition Timestamp.h:10
Definition TransceiverList.h:18
Definition scoped_refptr.h:8
Definition buffer.h:5
Definition code.h:5
Definition Codec.h:14
Definition DataChannelInit.h:7
Definition H264ProfileLevelId.h:7
Definition RTPVideoHeader.h:12
Definition RtpParameters.h:7
Definition SdpParseError.h:7