Bug 1002831 - Display remote and local SDP on about:webrtc. r=smaug, r=jib

This commit is contained in:
Byron Campen [:bwc] 2014-05-05 11:13:24 -07:00
parent a0a82f96e2
commit ed80aecb7c
3 changed files with 30 additions and 0 deletions

View File

@ -141,6 +141,8 @@ dictionary RTCStatsReportInternal {
sequence<RTCIceCandidatePairStats> iceCandidatePairStats;
sequence<RTCIceCandidateStats> iceCandidateStats;
sequence<RTCCodecStats> codecStats;
DOMString localSdp;
DOMString remoteSdp;
DOMHighResTimeStamp timestamp;
boolean closed; // Is the PC now closed
};

View File

@ -2124,6 +2124,14 @@ PeerConnectionImpl::BuildStatsQuery_m(
NS_ConvertASCIItoUTF16(mName.c_str()),
query->now);
// Populate SDP on main
if (query->internalStats) {
query->report.mLocalSdp.Construct(
NS_ConvertASCIItoUTF16(mLocalSDP.c_str()));
query->report.mRemoteSdp.Construct(
NS_ConvertASCIItoUTF16(mRemoteSDP.c_str()));
}
// Gather up pipelines from mMedia so they may be inspected on STS
TrackID trackId = aSelector ? aSelector->GetTrackID() : 0;

View File

@ -248,6 +248,26 @@ function buildPcDiv(stats, pcDivHeading) {
// end of ICE stats
// Now, SDP
var localSdpHeading = document.createElement('h4');
localSdpHeading.appendChild(document.createTextNode("Local SDP"));
newPcDiv.appendChild(localSdpHeading);
var localSdpDiv = document.createElement('pre');
localSdpDiv.appendChild(document.createTextNode(stats.localSdp));
newPcDiv.appendChild(localSdpDiv);
var remoteSdpHeading = document.createElement('h4');
remoteSdpHeading.appendChild(document.createTextNode("Remote SDP"));
newPcDiv.appendChild(remoteSdpHeading);
var remoteSdpDiv = document.createElement('pre');
remoteSdpDiv.appendChild(document.createTextNode(stats.remoteSdp));
newPcDiv.appendChild(remoteSdpDiv);
// End of SDP
// Now, RTP stats
var rtpHeading = document.createElement('h4');
rtpHeading.appendChild(document.createTextNode("RTP statistics"));