本文整理汇总了C++中scheduleDispatchEvent函数的典型用法代码示例。如果您正苦于以下问题:C++ scheduleDispatchEvent函数的具体用法?C++ scheduleDispatchEvent怎么用?C++ scheduleDispatchEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了scheduleDispatchEvent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scheduleDispatchEvent
void MediaStream::setStreamIsActive(bool streamActive)
{
if (streamActive)
scheduleDispatchEvent(Event::create(eventNames().activeEvent, false, false));
else
scheduleDispatchEvent(Event::create(eventNames().inactiveEvent, false, false));
}
示例2: ASSERT
void RTCPeerConnection::didGenerateICECandidate(const blink::WebRTCICECandidate& webCandidate)
{
ASSERT(executionContext()->isContextThread());
if (webCandidate.isNull())
scheduleDispatchEvent(RTCIceCandidateEvent::create(false, false, nullptr));
else {
RefPtr<RTCIceCandidate> iceCandidate = RTCIceCandidate::create(webCandidate);
scheduleDispatchEvent(RTCIceCandidateEvent::create(false, false, iceCandidate.release()));
}
}
示例3: scheduleDispatchEvent
void MediaStream::streamEnded()
{
if (m_stopped || m_descriptor->ended())
return;
if (active()) {
m_descriptor->setActive(false);
scheduleDispatchEvent(Event::create(EventTypeNames::inactive));
}
m_descriptor->setEnded();
scheduleDispatchEvent(Event::create(EventTypeNames::ended));
}
示例4: bufferedAmount
void RTCDataChannel::didDecreaseBufferedAmount(unsigned previousAmount)
{
if (previousAmount > m_bufferedAmountLowThreshold
&& bufferedAmount() <= m_bufferedAmountLowThreshold) {
scheduleDispatchEvent(Event::create(EventTypeNames::bufferedamountlow));
}
}
示例5: ASSERT
void MediaStream::addRemoteTrack(MediaStreamTrackPrivate* privateTrack)
{
ASSERT(privateTrack);
if (!active())
return;
RefPtr<MediaStreamTrack> track;
switch (privateTrack->type()) {
case RealtimeMediaSource::Audio:
track = AudioStreamTrack::create(*scriptExecutionContext(), *privateTrack);
break;
case RealtimeMediaSource::Video:
track = VideoStreamTrack::create(*scriptExecutionContext(), *privateTrack);
break;
case RealtimeMediaSource::None:
ASSERT_NOT_REACHED();
break;
}
if (!track)
return;
if (addTrack(track))
scheduleDispatchEvent(MediaStreamTrackEvent::create(eventNames().addtrackEvent, false, false, track));
}
示例6: switch
void MediaStream::removeRemoteSource(MediaStreamSource* source)
{
if (ended())
return;
MediaStreamTrackVector* tracks = 0;
switch (source->type()) {
case MediaStreamSource::Audio:
tracks = &m_audioTracks;
break;
case MediaStreamSource::Video:
tracks = &m_videoTracks;
break;
}
size_t index = notFound;
for (size_t i = 0; i < tracks->size(); ++i) {
if ((*tracks)[i]->source() == source) {
index = i;
break;
}
}
if (index == notFound)
return;
m_descriptor->removeSource(source);
RefPtr<MediaStreamTrack> track = (*tracks)[index];
tracks->remove(index);
scheduleDispatchEvent(MediaStreamTrackEvent::create(eventNames().removetrackEvent, false, false, track));
}
示例7: scheduleDispatchEvent
void RTCPeerConnection::changeSignalingState(SignalingState signalingState)
{
if (m_signalingState != SignalingStateClosed && m_signalingState != signalingState) {
m_signalingState = signalingState;
scheduleDispatchEvent(Event::create(EventTypeNames::signalingstatechange));
}
}
示例8: scheduleDispatchEvent
void RTCDataChannel::didReceiveStringData(const String& text)
{
if (m_stopped)
return;
scheduleDispatchEvent(MessageEvent::create(text));
}
示例9: scheduleDispatchEvent
void RTCPeerConnection::changeIceGatheringState(IceGatheringState iceGatheringState)
{
if (m_iceGatheringState != iceGatheringState) {
m_iceGatheringState = iceGatheringState;
scheduleDispatchEvent(Event::create(eventNames().gatheringchangeEvent, false, false));
}
}
示例10: scheduleDispatchEvent
void RTCDataChannel::didDetectError()
{
if (m_stopped)
return;
scheduleDispatchEvent(Event::create(EventTypeNames::error));
}
示例11: switch
void MediaStream::removeRemoteTrack(MediaStreamComponent* component)
{
if (ended())
return;
MediaStreamTrackVector* tracks = 0;
switch (component->source()->type()) {
case MediaStreamSource::TypeAudio:
tracks = &m_audioTracks;
break;
case MediaStreamSource::TypeVideo:
tracks = &m_videoTracks;
break;
}
size_t index = notFound;
for (size_t i = 0; i < tracks->size(); ++i) {
if ((*tracks)[i]->component() == component) {
index = i;
break;
}
}
if (index == notFound)
return;
RefPtr<MediaStreamTrack> track = (*tracks)[index];
tracks->remove(index);
scheduleDispatchEvent(MediaStreamTrackEvent::create(eventNames().removetrackEvent, false, false, track));
}
示例12: scheduleDispatchEvent
void MediaStream::streamDidEnd()
{
if (ended())
return;
scheduleDispatchEvent(Event::create(eventNames().endedEvent, false, false));
}
示例13: scheduleDispatchEvent
void MediaRecorder::writeData(const char* data,
size_t length,
bool lastInSlice) {
if (m_stopped && !lastInSlice) {
m_stopped = false;
scheduleDispatchEvent(Event::create(EventTypeNames::start));
}
if (m_stream && m_streamAmountOfTracks != m_stream->getTracks().size()) {
m_streamAmountOfTracks = m_stream->getTracks().size();
onError("Amount of tracks in MediaStream has changed.");
}
// TODO(mcasas): Act as |m_ignoredMutedMedia| instructs if |m_stream| track(s)
// is in muted() state.
if (!m_blobData) {
m_blobData = BlobData::create();
m_blobData->setContentType(m_mimeType);
}
if (data)
m_blobData->appendBytes(data, length);
if (!lastInSlice)
return;
// Cache |m_blobData->length()| before release()ng it.
const long long blobDataLength = m_blobData->length();
createBlobEvent(Blob::create(
BlobDataHandle::create(std::move(m_blobData), blobDataLength)));
}
示例14: scheduleDispatchEvent
void MediaStream::streamEnded()
{
if (ended())
return;
m_descriptor->setEnded();
scheduleDispatchEvent(Event::create(eventNames().endedEvent, false, false));
}
示例15: scheduleDispatchEvent
void MediaStream::streamEnded()
{
if (ended())
return;
m_descriptor->setEnded();
scheduleDispatchEvent(Event::create(EventTypeNames::ended));
}