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