mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-09 13:25:00 +00:00
Bug 874306 - Add PC identifier to ICE logging r=ekr
This commit is contained in:
parent
216dcc61f4
commit
5b7705a03b
@ -2668,7 +2668,7 @@ vcmCreateTransportFlow(sipcc::PeerConnectionImpl *pc, int level, bool rtcp,
|
|||||||
|
|
||||||
|
|
||||||
ScopedDeletePtr<TransportLayerIce> ice(
|
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),
|
pc->media()->ice_media_stream(level-1),
|
||||||
rtcp ? 2 : 1));
|
rtcp ? 2 : 1));
|
||||||
|
|
||||||
|
@ -56,6 +56,11 @@ namespace mozilla {
|
|||||||
|
|
||||||
static char kDTLSExporterLabel[] = "EXTRACTOR-dtls_srtp";
|
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() {
|
nsresult MediaPipeline::Init() {
|
||||||
ASSERT_ON_THREAD(main_thread_);
|
ASSERT_ON_THREAD(main_thread_);
|
||||||
|
|
||||||
|
@ -97,9 +97,7 @@ class MediaPipeline : public sigslot::has_slots<> {
|
|||||||
description_() {
|
description_() {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~MediaPipeline() {
|
virtual ~MediaPipeline();
|
||||||
MOZ_ASSERT(!stream_); // Check that we have shut down already.
|
|
||||||
}
|
|
||||||
|
|
||||||
// Must be called on the STS thread. Must be called after ShutdownMedia_m().
|
// Must be called on the STS thread. Must be called after ShutdownMedia_m().
|
||||||
void ShutdownTransport_s();
|
void ShutdownTransport_s();
|
||||||
|
@ -465,6 +465,27 @@ PeerConnectionImpl::Initialize(IPeerConnectionObserver* aObserver,
|
|||||||
{
|
{
|
||||||
nsresult res;
|
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
|
#ifdef MOZILLA_INTERNAL_API
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
#endif
|
#endif
|
||||||
@ -524,23 +545,6 @@ PeerConnectionImpl::Initialize(IPeerConnectionObserver* aObserver,
|
|||||||
return res;
|
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
|
// Store under mHandle
|
||||||
mCall->setPeerConnection(mHandle);
|
mCall->setPeerConnection(mHandle);
|
||||||
PeerConnectionCtx::GetInstance()->mPeerConnections[mHandle] = this;
|
PeerConnectionCtx::GetInstance()->mPeerConnections[mHandle] = this;
|
||||||
|
@ -179,9 +179,12 @@ nsresult PeerConnectionMedia::Init(const std::vector<NrIceStunServer>& stun_serv
|
|||||||
// Create three streams to start with.
|
// Create three streams to start with.
|
||||||
// One each for audio, video and DataChannel
|
// One each for audio, video and DataChannel
|
||||||
// TODO: this will be re-visited
|
// TODO: this will be re-visited
|
||||||
RefPtr<NrIceMediaStream> audioStream = mIceCtx->CreateStream("stream1", 2);
|
RefPtr<NrIceMediaStream> audioStream =
|
||||||
RefPtr<NrIceMediaStream> videoStream = mIceCtx->CreateStream("stream2", 2);
|
mIceCtx->CreateStream((mParent->GetHandle()+"/stream1/audio").c_str(), 2);
|
||||||
RefPtr<NrIceMediaStream> dcStream = mIceCtx->CreateStream("stream3", 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) {
|
if (!audioStream) {
|
||||||
CSFLogError(logTag, "%s: audio stream is NULL", __FUNCTION__);
|
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));
|
sstrncpy(dcb->peerconnection, msg->data.pc.pc_handle, sizeof(dcb->peerconnection));
|
||||||
dcb->peerconnection_set = TRUE;
|
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);
|
return (SM_RC_END);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user