本文整理汇总了C++中MediaStreamTrack::kind方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaStreamTrack::kind方法的具体用法?C++ MediaStreamTrack::kind怎么用?C++ MediaStreamTrack::kind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaStreamTrack
的用法示例。
在下文中一共展示了MediaStreamTrack::kind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createOfferTask
void MediaEndpointPeerConnection::createOfferTask(RTCOfferOptions&, SessionDescriptionPromise& promise)
{
ASSERT(!m_dtlsFingerprint.isEmpty());
RefPtr<MediaEndpointSessionConfiguration> configurationSnapshot = MediaEndpointSessionConfiguration::create();
configurationSnapshot->setSessionVersion(m_sdpSessionVersion++);
RtpSenderVector senders = m_client->getSenders();
// Add media descriptions for senders.
for (auto& sender : senders) {
RefPtr<PeerMediaDescription> mediaDescription = PeerMediaDescription::create();
MediaStreamTrack* track = sender->track();
mediaDescription->setMediaStreamId(sender->mediaStreamIds()[0]);
mediaDescription->setMediaStreamTrackId(track->id());
mediaDescription->setType(track->kind());
mediaDescription->setPayloads(track->kind() == "audio" ? m_defaultAudioPayloads : m_defaultVideoPayloads);
mediaDescription->setDtlsFingerprintHashFunction(m_dtlsFingerprintFunction);
mediaDescription->setDtlsFingerprint(m_dtlsFingerprint);
mediaDescription->setCname(m_cname);
mediaDescription->addSsrc(cryptographicallyRandomNumber());
mediaDescription->setIceUfrag(m_iceUfrag);
mediaDescription->setIcePassword(m_icePassword);
configurationSnapshot->addMediaDescription(WTFMove(mediaDescription));
}
String sdpString;
SDPProcessor::Result result = m_sdpProcessor->generate(*configurationSnapshot, sdpString);
if (result != SDPProcessor::Result::Success) {
LOG_ERROR("SDPProcessor internal error");
return;
}
promise.resolve(RTCSessionDescription::create("offer", sdpString));
}