本文整理汇总了C++中NrIceCtx::FindStream方法的典型用法代码示例。如果您正苦于以下问题:C++ NrIceCtx::FindStream方法的具体用法?C++ NrIceCtx::FindStream怎么用?C++ NrIceCtx::FindStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NrIceCtx
的用法示例。
在下文中一共展示了NrIceCtx::FindStream方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: trickle_cb
void NrIceCtx::trickle_cb(void *arg, nr_ice_ctx *ice_ctx,
nr_ice_media_stream *stream,
int component_id,
nr_ice_candidate *candidate) {
// Get the ICE ctx
NrIceCtx *ctx = static_cast<NrIceCtx *>(arg);
RefPtr<NrIceMediaStream> s = ctx->FindStream(stream);
if (!s) {
// This stream has been removed because it is inactive
return;
}
// Format the candidate.
char candidate_str[NR_ICE_MAX_ATTRIBUTE_SIZE];
int r = nr_ice_format_candidate_attribute(candidate, candidate_str,
sizeof(candidate_str));
MOZ_ASSERT(!r);
if (r)
return;
MOZ_MTLOG(ML_INFO, "NrIceCtx(" << ctx->name_ << "): trickling candidate "
<< candidate_str);
s->SignalCandidate(s, candidate_str);
}
示例2: msg_recvd
int NrIceCtx::msg_recvd(void *obj, nr_ice_peer_ctx *pctx,
nr_ice_media_stream *stream, int component_id,
UCHAR *msg, int len) {
// Get the ICE ctx
NrIceCtx *ctx = static_cast<NrIceCtx *>(obj);
RefPtr<NrIceMediaStream> s = ctx->FindStream(stream);
// Streams which do not exist should never have packets.
MOZ_ASSERT(s);
s->SignalPacketReceived(s, component_id, msg, len);
return 0;
}
示例3: stream_failed
int NrIceCtx::stream_failed(void *obj, nr_ice_media_stream *stream) {
MOZ_MTLOG(PR_LOG_DEBUG, "stream_failed called");
// Get the ICE ctx
NrIceCtx *ctx = static_cast<NrIceCtx *>(obj);
RefPtr<NrIceMediaStream> s = ctx->FindStream(stream);
// Streams which do not exist should never fail.
MOZ_ASSERT(s);
ctx->SetState(ICE_CTX_FAILED);
s -> SignalFailed(s);
return 0;
}
示例4: stream_ready
int NrIceCtx::stream_ready(void *obj, nr_ice_media_stream *stream) {
MOZ_MTLOG(PR_LOG_DEBUG, "stream_ready called");
// Get the ICE ctx
NrIceCtx *ctx = static_cast<NrIceCtx *>(obj);
RefPtr<NrIceMediaStream> s = ctx->FindStream(stream);
// Streams which do not exist should never be ready.
MOZ_ASSERT(s);
s->Ready();
return 0;
}
示例5: trickle_cb
void NrIceCtx::trickle_cb(void *arg, nr_ice_ctx *ice_ctx,
nr_ice_media_stream *stream,
int component_id,
nr_ice_candidate *candidate) {
// Get the ICE ctx
NrIceCtx *ctx = static_cast<NrIceCtx *>(arg);
RefPtr<NrIceMediaStream> s = ctx->FindStream(stream);
// Streams which do not exist shouldn't have candidates.
MOZ_ASSERT(s);
// Format the candidate.
char candidate_str[NR_ICE_MAX_ATTRIBUTE_SIZE];
int r = nr_ice_format_candidate_attribute(candidate, candidate_str,
sizeof(candidate_str));
MOZ_ASSERT(!r);
if (r)
return;
MOZ_MTLOG(ML_INFO, "NrIceCtx(" << ctx->name_ << "): trickling candidate "
<< candidate_str);
s->SignalCandidate(s, candidate_str);
}