mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 874306 - Add PC identifier to ICE logging r=ekr
This commit is contained in:
parent
4e52e9bcaa
commit
5395bf6afe
@ -2668,7 +2668,7 @@ vcmCreateTransportFlow(sipcc::PeerConnectionImpl *pc, int level, bool rtcp,
|
||||
|
||||
|
||||
ScopedDeletePtr<TransportLayerIce> ice(
|
||||
new TransportLayerIce("flow", pc->media()->ice_ctx(),
|
||||
new TransportLayerIce(pc->GetHandle(), pc->media()->ice_ctx(),
|
||||
pc->media()->ice_media_stream(level-1),
|
||||
rtcp ? 2 : 1));
|
||||
|
||||
|
@ -56,6 +56,11 @@ namespace mozilla {
|
||||
|
||||
static char kDTLSExporterLabel[] = "EXTRACTOR-dtls_srtp";
|
||||
|
||||
MediaPipeline::~MediaPipeline() {
|
||||
MOZ_ASSERT(!stream_); // Check that we have shut down already.
|
||||
MOZ_MTLOG(PR_LOG_DEBUG, "Destroying MediaPipeline: " << description_);
|
||||
}
|
||||
|
||||
nsresult MediaPipeline::Init() {
|
||||
ASSERT_ON_THREAD(main_thread_);
|
||||
|
||||
|
@ -97,9 +97,7 @@ class MediaPipeline : public sigslot::has_slots<> {
|
||||
description_() {
|
||||
}
|
||||
|
||||
virtual ~MediaPipeline() {
|
||||
MOZ_ASSERT(!stream_); // Check that we have shut down already.
|
||||
}
|
||||
virtual ~MediaPipeline();
|
||||
|
||||
// Must be called on the STS thread. Must be called after ShutdownMedia_m().
|
||||
void ShutdownTransport_s();
|
||||
|
@ -465,6 +465,27 @@ PeerConnectionImpl::Initialize(IPeerConnectionObserver* aObserver,
|
||||
{
|
||||
nsresult res;
|
||||
|
||||
// Generate a random handle
|
||||
unsigned char handle_bin[8];
|
||||
SECStatus rv;
|
||||
rv = PK11_GenerateRandom(handle_bin, sizeof(handle_bin));
|
||||
if (rv != SECSuccess) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
char hex[17];
|
||||
PR_snprintf(hex,sizeof(hex),"%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x",
|
||||
handle_bin[0],
|
||||
handle_bin[1],
|
||||
handle_bin[2],
|
||||
handle_bin[3],
|
||||
handle_bin[4],
|
||||
handle_bin[5],
|
||||
handle_bin[6],
|
||||
handle_bin[7]);
|
||||
|
||||
mHandle = hex;
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
#endif
|
||||
@ -524,23 +545,6 @@ PeerConnectionImpl::Initialize(IPeerConnectionObserver* aObserver,
|
||||
return res;
|
||||
}
|
||||
|
||||
// Generate a random handle
|
||||
unsigned char handle_bin[8];
|
||||
PK11_GenerateRandom(handle_bin, sizeof(handle_bin));
|
||||
|
||||
char hex[17];
|
||||
PR_snprintf(hex,sizeof(hex),"%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x",
|
||||
handle_bin[0],
|
||||
handle_bin[1],
|
||||
handle_bin[2],
|
||||
handle_bin[3],
|
||||
handle_bin[4],
|
||||
handle_bin[5],
|
||||
handle_bin[6],
|
||||
handle_bin[7]);
|
||||
|
||||
mHandle += hex;
|
||||
|
||||
// Store under mHandle
|
||||
mCall->setPeerConnection(mHandle);
|
||||
PeerConnectionCtx::GetInstance()->mPeerConnections[mHandle] = this;
|
||||
|
@ -179,9 +179,12 @@ nsresult PeerConnectionMedia::Init(const std::vector<NrIceStunServer>& stun_serv
|
||||
// Create three streams to start with.
|
||||
// One each for audio, video and DataChannel
|
||||
// TODO: this will be re-visited
|
||||
RefPtr<NrIceMediaStream> audioStream = mIceCtx->CreateStream("stream1", 2);
|
||||
RefPtr<NrIceMediaStream> videoStream = mIceCtx->CreateStream("stream2", 2);
|
||||
RefPtr<NrIceMediaStream> dcStream = mIceCtx->CreateStream("stream3", 2);
|
||||
RefPtr<NrIceMediaStream> audioStream =
|
||||
mIceCtx->CreateStream((mParent->GetHandle()+"/stream1/audio").c_str(), 2);
|
||||
RefPtr<NrIceMediaStream> videoStream =
|
||||
mIceCtx->CreateStream((mParent->GetHandle()+"/stream2/video").c_str(), 2);
|
||||
RefPtr<NrIceMediaStream> dcStream =
|
||||
mIceCtx->CreateStream((mParent->GetHandle()+"/stream3/data").c_str(), 2);
|
||||
|
||||
if (!audioStream) {
|
||||
CSFLogError(logTag, "%s: audio stream is NULL", __FUNCTION__);
|
||||
|
@ -3516,6 +3516,10 @@ fsmdef_ev_setpeerconnection(sm_event_t *event) {
|
||||
sstrncpy(dcb->peerconnection, msg->data.pc.pc_handle, sizeof(dcb->peerconnection));
|
||||
dcb->peerconnection_set = TRUE;
|
||||
|
||||
FSM_DEBUG_SM(DEB_F_PREFIX"Setting peerconnection handle for (%d/%d) to %s",
|
||||
DEB_F_PREFIX_ARGS(FSM, __FUNCTION__),
|
||||
line, call_id, dcb->peerconnection);
|
||||
|
||||
return (SM_RC_END);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user