-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
558 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
node_modules | ||
bower_components | ||
# ignore everything | ||
* | ||
|
||
.*.swp | ||
._* | ||
.DS_Store | ||
.git | ||
.hg | ||
.npmrc | ||
.lock-wscript | ||
.svn | ||
.wafpickle-* | ||
config.gypi | ||
CVS | ||
npm-debug.log | ||
# but not these files... | ||
!getStats.js | ||
!getStats.min.js | ||
!index.html | ||
!package.json | ||
!bower.json | ||
!server.js | ||
!README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
getStatsParser.bweforvideo = function(result) { | ||
if (result.type !== 'VideoBwe') return; | ||
|
||
// id === 'bweforvideo' | ||
getStatsResult.bandwidth.availableSendBandwidth = result.googAvailableSendBandwidth; | ||
|
||
getStatsResult.video.bandwidth = { | ||
googActualEncBitrate: result.googActualEncBitrate, | ||
googAvailableSendBandwidth: result.googAvailableSendBandwidth, | ||
googAvailableReceiveBandwidth: result.googAvailableReceiveBandwidth, | ||
googRetransmitBitrate: result.googRetransmitBitrate, | ||
googTargetEncBitrate: result.googTargetEncBitrate, | ||
googBucketDelay: result.googBucketDelay, | ||
googTransmitBitrate: result.googTransmitBitrate | ||
}; | ||
getStatsResult.bandwidth.googActualEncBitrate = result.googActualEncBitrate; | ||
getStatsResult.bandwidth.googAvailableSendBandwidth = result.googAvailableSendBandwidth; | ||
getStatsResult.bandwidth.googAvailableReceiveBandwidth = result.googAvailableReceiveBandwidth; | ||
getStatsResult.bandwidth.googRetransmitBitrate = result.googRetransmitBitrate; | ||
getStatsResult.bandwidth.googTargetEncBitrate = result.googTargetEncBitrate; | ||
getStatsResult.bandwidth.googBucketDelay = result.googBucketDelay; | ||
getStatsResult.bandwidth.googTransmitBitrate = result.googTransmitBitrate; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
getStatsParser.candidatePair = function(result) { | ||
if (result.type !== 'googCandidatePair' && result.type !== 'candidate-pair') return; | ||
|
||
// result.googActiveConnection means either STUN or TURN is used. | ||
|
||
if (result.googActiveConnection == 'true') { | ||
// id === 'Conn-audio-1-0' | ||
// localCandidateId, remoteCandidateId | ||
|
||
// bytesSent, bytesReceived | ||
|
||
Object.keys(getStatsResult.internal.candidates).forEach(function(cid) { | ||
var candidate = getStatsResult.internal.candidates[cid]; | ||
if (candidate.ipAddress.indexOf(result.googLocalAddress) !== -1) { | ||
getStatsResult.connectionType.local.candidateType = candidate.candidateType; | ||
getStatsResult.connectionType.local.ipAddress = candidate.ipAddress; | ||
getStatsResult.connectionType.local.networkType = candidate.networkType; | ||
getStatsResult.connectionType.local.transport = candidate.transport; | ||
} | ||
if (candidate.ipAddress.indexOf(result.googRemoteAddress) !== -1) { | ||
getStatsResult.connectionType.remote.candidateType = candidate.candidateType; | ||
getStatsResult.connectionType.remote.ipAddress = candidate.ipAddress; | ||
getStatsResult.connectionType.remote.networkType = candidate.networkType; | ||
getStatsResult.connectionType.remote.transport = candidate.transport; | ||
} | ||
}); | ||
|
||
getStatsResult.connectionType.transport = result.googTransportType; | ||
|
||
var localCandidate = getStatsResult.internal.candidates[result.localCandidateId]; | ||
if (localCandidate) { | ||
if (localCandidate.ipAddress) { | ||
getStatsResult.connectionType.systemIpAddress = localCandidate.ipAddress; | ||
} | ||
} | ||
|
||
var remoteCandidate = getStatsResult.internal.candidates[result.remoteCandidateId]; | ||
if (remoteCandidate) { | ||
if (remoteCandidate.ipAddress) { | ||
getStatsResult.connectionType.systemIpAddress = remoteCandidate.ipAddress; | ||
} | ||
} | ||
} | ||
|
||
if (result.type === 'candidate-pair') { | ||
if (result.selected === true && result.nominated === true && result.state === 'succeeded') { | ||
// remoteCandidateId, localCandidateId, componentId | ||
var localCandidate = getStatsResult.internal.candidates[result.remoteCandidateId]; | ||
var remoteCandidate = getStatsResult.internal.candidates[result.remoteCandidateId]; | ||
|
||
// Firefox used above two pairs for connection | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
var LOCAL_candidateType = {}; | ||
var LOCAL_transport = {}; | ||
var LOCAL_ipAddress = {}; | ||
var LOCAL_networkType = {}; | ||
|
||
getStatsParser.localcandidate = function(result) { | ||
if (result.type !== 'localcandidate' && result.type !== 'local-candidate') return; | ||
if (!result.id) return; | ||
|
||
if (!LOCAL_candidateType[result.id]) { | ||
LOCAL_candidateType[result.id] = []; | ||
} | ||
|
||
if (!LOCAL_transport[result.id]) { | ||
LOCAL_transport[result.id] = []; | ||
} | ||
|
||
if (!LOCAL_ipAddress[result.id]) { | ||
LOCAL_ipAddress[result.id] = []; | ||
} | ||
|
||
if (!LOCAL_networkType[result.id]) { | ||
LOCAL_networkType[result.id] = []; | ||
} | ||
|
||
if (result.candidateType && LOCAL_candidateType[result.id].indexOf(result.candidateType) === -1) { | ||
LOCAL_candidateType[result.id].push(result.candidateType); | ||
} | ||
|
||
if (result.transport && LOCAL_transport[result.id].indexOf(result.transport) === -1) { | ||
LOCAL_transport[result.id].push(result.transport); | ||
} | ||
|
||
if (result.ipAddress && LOCAL_ipAddress[result.id].indexOf(result.ipAddress + ':' + result.portNumber) === -1) { | ||
LOCAL_ipAddress[result.id].push(result.ipAddress + ':' + result.portNumber); | ||
} | ||
|
||
if (result.networkType && LOCAL_networkType[result.id].indexOf(result.networkType) === -1) { | ||
LOCAL_networkType[result.id].push(result.networkType); | ||
} | ||
|
||
getStatsResult.internal.candidates[result.id] = { | ||
candidateType: LOCAL_candidateType[result.id], | ||
ipAddress: LOCAL_ipAddress[result.id], | ||
portNumber: result.portNumber, | ||
networkType: LOCAL_networkType[result.id], | ||
priority: result.priority, | ||
transport: LOCAL_transport[result.id], | ||
timestamp: result.timestamp, | ||
id: result.id, | ||
type: result.type | ||
}; | ||
|
||
getStatsResult.connectionType.local.candidateType = LOCAL_candidateType[result.id]; | ||
getStatsResult.connectionType.local.ipAddress = LOCAL_ipAddress[result.id]; | ||
getStatsResult.connectionType.local.networkType = LOCAL_networkType[result.id]; | ||
getStatsResult.connectionType.local.transport = LOCAL_transport[result.id]; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
var REMOTE_candidateType = {}; | ||
var REMOTE_transport = {}; | ||
var REMOTE_ipAddress = {}; | ||
var REMOTE_networkType = {}; | ||
|
||
getStatsParser.remotecandidate = function(result) { | ||
if (result.type !== 'remotecandidate' && result.type !== 'remote-candidate') return; | ||
if (!result.id) return; | ||
|
||
if (!REMOTE_candidateType[result.id]) { | ||
REMOTE_candidateType[result.id] = []; | ||
} | ||
|
||
if (!REMOTE_transport[result.id]) { | ||
REMOTE_transport[result.id] = []; | ||
} | ||
|
||
if (!REMOTE_ipAddress[result.id]) { | ||
REMOTE_ipAddress[result.id] = []; | ||
} | ||
|
||
if (!REMOTE_networkType[result.id]) { | ||
REMOTE_networkType[result.id] = []; | ||
} | ||
|
||
if (result.candidateType && REMOTE_candidateType[result.id].indexOf(result.candidateType) === -1) { | ||
REMOTE_candidateType[result.id].push(result.candidateType); | ||
} | ||
|
||
if (result.transport && REMOTE_transport[result.id].indexOf(result.transport) === -1) { | ||
REMOTE_transport[result.id].push(result.transport); | ||
} | ||
|
||
if (result.ipAddress && REMOTE_ipAddress[result.id].indexOf(result.ipAddress + ':' + result.portNumber) === -1) { | ||
REMOTE_ipAddress[result.id].push(result.ipAddress + ':' + result.portNumber); | ||
} | ||
|
||
if (result.networkType && REMOTE_networkType[result.id].indexOf(result.networkType) === -1) { | ||
REMOTE_networkType[result.id].push(result.networkType); | ||
} | ||
|
||
getStatsResult.internal.candidates[result.id] = { | ||
candidateType: REMOTE_candidateType[result.id], | ||
ipAddress: REMOTE_ipAddress[result.id], | ||
portNumber: result.portNumber, | ||
networkType: REMOTE_networkType[result.id], | ||
priority: result.priority, | ||
transport: REMOTE_transport[result.id], | ||
timestamp: result.timestamp, | ||
id: result.id, | ||
type: result.type | ||
}; | ||
|
||
getStatsResult.connectionType.remote.candidateType = REMOTE_candidateType[result.id]; | ||
getStatsResult.connectionType.remote.ipAddress = REMOTE_ipAddress[result.id]; | ||
getStatsResult.connectionType.remote.networkType = REMOTE_networkType[result.id]; | ||
getStatsResult.connectionType.remote.transport = REMOTE_transport[result.id]; | ||
}; |
Oops, something went wrong.