Skip to content

Commit

Permalink
Backed out changeset 44c7e645f9c4 (bug 1790508) for causing mochitest…
Browse files Browse the repository at this point in the history
… failures. CLOSED TREE
  • Loading branch information
crisscozmuta committed Sep 15, 2022
1 parent 017264f commit ce6a8e1
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 245 deletions.
40 changes: 0 additions & 40 deletions dom/media/webrtc/WebrtcGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,33 +301,16 @@ struct ParamTraits<mozilla::dom::RTCInboundRtpStreamStats> {
WriteParam(aWriter, aParam.mFrameWidth);
WriteParam(aWriter, aParam.mFrameHeight);
WriteParam(aWriter, aParam.mFramesPerSecond);
WriteParam(aWriter, aParam.mQpSum);
WriteParam(aWriter, aParam.mTotalDecodeTime);
WriteParam(aWriter, aParam.mTotalInterFrameDelay);
WriteParam(aWriter, aParam.mTotalSquaredInterFrameDelay);
WriteParam(aWriter, aParam.mLastPacketReceivedTimestamp);
WriteParam(aWriter, aParam.mHeaderBytesReceived);
WriteParam(aWriter, aParam.mFecPacketsReceived);
WriteParam(aWriter, aParam.mFecPacketsDiscarded);
WriteParam(aWriter, aParam.mBytesReceived);
WriteParam(aWriter, aParam.mNackCount);
WriteParam(aWriter, aParam.mFirCount);
WriteParam(aWriter, aParam.mPliCount);
WriteParam(aWriter, aParam.mTotalProcessingDelay);
// Always missing from libwebrtc stats
// WriteParam(aWriter, aParam.mEstimatedPlayoutTimestamp);
WriteParam(aWriter, aParam.mFramesReceived);
WriteParam(aWriter, aParam.mJitterBufferDelay);
WriteParam(aWriter, aParam.mJitterBufferEmittedCount);
WriteParam(aWriter, aParam.mTotalSamplesReceived);
WriteParam(aWriter, aParam.mConcealedSamples);
WriteParam(aWriter, aParam.mSilentConcealedSamples);
WriteParam(aWriter, aParam.mConcealmentEvents);
WriteParam(aWriter, aParam.mInsertedSamplesForDeceleration);
WriteParam(aWriter, aParam.mRemovedSamplesForAcceleration);
WriteParam(aWriter, aParam.mAudioLevel);
WriteParam(aWriter, aParam.mTotalAudioEnergy);
WriteParam(aWriter, aParam.mTotalSamplesDuration);
WriteRTCReceivedRtpStreamStats(aWriter, aParam);
}

Expand All @@ -337,33 +320,16 @@ struct ParamTraits<mozilla::dom::RTCInboundRtpStreamStats> {
ReadParam(aReader, &(aResult->mFrameWidth)) &&
ReadParam(aReader, &(aResult->mFrameHeight)) &&
ReadParam(aReader, &(aResult->mFramesPerSecond)) &&
ReadParam(aReader, &(aResult->mQpSum)) &&
ReadParam(aReader, &(aResult->mTotalDecodeTime)) &&
ReadParam(aReader, &(aResult->mTotalInterFrameDelay)) &&
ReadParam(aReader, &(aResult->mTotalSquaredInterFrameDelay)) &&
ReadParam(aReader, &(aResult->mLastPacketReceivedTimestamp)) &&
ReadParam(aReader, &(aResult->mHeaderBytesReceived)) &&
ReadParam(aReader, &(aResult->mFecPacketsReceived)) &&
ReadParam(aReader, &(aResult->mFecPacketsDiscarded)) &&
ReadParam(aReader, &(aResult->mBytesReceived)) &&
ReadParam(aReader, &(aResult->mNackCount)) &&
ReadParam(aReader, &(aResult->mFirCount)) &&
ReadParam(aReader, &(aResult->mPliCount)) &&
ReadParam(aReader, &(aResult->mTotalProcessingDelay)) &&
// Always missing from libwebrtc
// ReadParam(aReader, &(aResult->mEstimatedPlayoutTimestamp)) &&
ReadParam(aReader, &(aResult->mFramesReceived)) &&
ReadParam(aReader, &(aResult->mJitterBufferDelay)) &&
ReadParam(aReader, &(aResult->mJitterBufferEmittedCount)) &&
ReadParam(aReader, &(aResult->mTotalSamplesReceived)) &&
ReadParam(aReader, &(aResult->mConcealedSamples)) &&
ReadParam(aReader, &(aResult->mSilentConcealedSamples)) &&
ReadParam(aReader, &(aResult->mConcealmentEvents)) &&
ReadParam(aReader, &(aResult->mInsertedSamplesForDeceleration)) &&
ReadParam(aReader, &(aResult->mRemovedSamplesForAcceleration)) &&
ReadParam(aReader, &(aResult->mAudioLevel)) &&
ReadParam(aReader, &(aResult->mTotalAudioEnergy)) &&
ReadParam(aReader, &(aResult->mTotalSamplesDuration)) &&
ReadRTCReceivedRtpStreamStats(aReader, aResult);
}
};
Expand Down Expand Up @@ -432,18 +398,12 @@ struct ParamTraits<mozilla::dom::RTCRemoteInboundRtpStreamStats> {
static void Write(MessageWriter* aWriter, const paramType& aParam) {
WriteParam(aWriter, aParam.mLocalId);
WriteParam(aWriter, aParam.mRoundTripTime);
WriteParam(aWriter, aParam.mTotalRoundTripTime);
WriteParam(aWriter, aParam.mFractionLost);
WriteParam(aWriter, aParam.mRoundTripTimeMeasurements);
WriteRTCReceivedRtpStreamStats(aWriter, aParam);
}

static bool Read(MessageReader* aReader, paramType* aResult) {
return ReadParam(aReader, &(aResult->mLocalId)) &&
ReadParam(aReader, &(aResult->mRoundTripTime)) &&
ReadParam(aReader, &(aResult->mTotalRoundTripTime)) &&
ReadParam(aReader, &(aResult->mFractionLost)) &&
ReadParam(aReader, &(aResult->mRoundTripTimeMeasurements)) &&
ReadRTCReceivedRtpStreamStats(aReader, aResult);
}
};
Expand Down
29 changes: 13 additions & 16 deletions dom/media/webrtc/jsapi/RTCRtpReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,6 @@ nsTArray<RefPtr<RTCStatsPromise>> RTCRtpReceiver::GetStatsInternal() {
local.mPacketsReceived.Construct(audioStats->packets_rcvd);
local.mPacketsDiscarded.Construct(audioStats->packets_discarded);
local.mBytesReceived.Construct(audioStats->payload_bytes_rcvd);
// Always missing from libwebrtc stats
// if (audioStats->estimated_playout_ntp_timestamp_ms) {
// local.mEstimatedPlayoutTimestamp.Construct(
// aConduit->GetTimestampMaker().ConvertNtpToDomTime(
// webrtc::Timestamp::Millis(
// *audioStats->estimated_playout_ntp_timestamp_ms)));
// }
local.mJitterBufferDelay.Construct(
audioStats->jitter_buffer_delay_seconds);
local.mJitterBufferEmittedCount.Construct(
Expand All @@ -340,6 +333,8 @@ nsTArray<RefPtr<RTCStatsPromise>> RTCRtpReceiver::GetStatsInternal() {
local.mConcealedSamples.Construct(audioStats->concealed_samples);
local.mSilentConcealedSamples.Construct(
audioStats->silent_concealed_samples);
/*
* Potential new stats that are now available upstream.
if (audioStats->last_packet_received_timestamp_ms) {
local.mLastPacketReceivedTimestamp.Construct(
aConduit->GetTimestampMaker().ConvertNtpToDomTime(
Expand All @@ -353,9 +348,14 @@ nsTArray<RefPtr<RTCStatsPromise>> RTCRtpReceiver::GetStatsInternal() {
audioStats->fec_packets_received);
local.mFecPacketsDiscarded.Construct(
audioStats->fec_packets_discarded);
if (audioStats->estimated_playout_ntp_timestamp_ms) {
local.mEstimatedPlayoutTimestamp.Construct(
aConduit->GetTimestampMaker().ConvertNtpToDomTime(
webrtc::Timestamp::Millis(
*audioStats->estimated_playout_ntp_timestamp_ms)));
}
local.mConcealmentEvents.Construct(
audioStats->concealment_events);

local.mInsertedSamplesForDeceleration.Construct(
audioStats->inserted_samples_for_deceleration);
local.mRemovedSamplesForAcceleration.Construct(
Expand All @@ -368,7 +368,7 @@ nsTArray<RefPtr<RTCStatsPromise>> RTCRtpReceiver::GetStatsInternal() {
audioStats->total_output_energy);
local.mTotalSamplesDuration.Construct(
audioStats->total_output_duration);

*/
if (!report->mInboundRtpStreamStats.AppendElement(
std::move(local), fallible)) {
mozalloc_handle_oom(0);
Expand Down Expand Up @@ -449,9 +449,10 @@ nsTArray<RefPtr<RTCStatsPromise>> RTCRtpReceiver::GetStatsInternal() {
videoStats->jitter_buffer_delay_seconds);
local.mJitterBufferEmittedCount.Construct(
videoStats->jitter_buffer_emitted_count);

/*
* Potential new stats that are now available upstream.
if (videoStats->qp_sum) {
local.mQpSum.Construct(videoStats->qp_sum.value());
local.mQpSum.Construct(*videoStats->qp_sum.value);
}
local.mTotalDecodeTime.Construct(
double(videoStats->total_decode_time_ms) / 1000);
Expand All @@ -460,7 +461,7 @@ nsTArray<RefPtr<RTCStatsPromise>> RTCRtpReceiver::GetStatsInternal() {
local.mTotalSquaredInterFrameDelay.Construct(
videoStats->total_squared_inter_frame_delay);
if (videoStats->rtp_stats.last_packet_received_timestamp_ms) {
local.mLastPacketReceivedTimestamp.Construct(
local.mLastPacketReceiveTimestamp.Construct(
aConduit->GetTimestampMaker().ConvertNtpToDomTime(
webrtc::Timestamp::Millis(
*videoStats->rtp_stats
Expand All @@ -470,10 +471,6 @@ nsTArray<RefPtr<RTCStatsPromise>> RTCRtpReceiver::GetStatsInternal() {
local.mHeaderBytesReceived.Construct(
videoStats->rtp_stats.packet_counter.header_bytes +
videoStats->rtp_stats.packet_counter.padding_bytes);
local.mTotalProcessingDelay.Construct(
videoStats->total_processing_delay.seconds<double>());
/*
* Potential new stats that are now available upstream.
if (videoStats->estimated_playout_ntp_timestamp_ms) {
local.mEstimatedPlayoutTimestamp.Construct(
aConduit->GetTimestampMaker().ConvertNtpToDomTime(
Expand Down
11 changes: 8 additions & 3 deletions dom/media/webrtc/jsapi/RTCRtpSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,14 @@ nsTArray<RefPtr<dom::RTCStatsPromise>> RTCRtpSender::GetStatsInternal() {
remote.mRoundTripTime.Construct(
static_cast<double>(audioStats->rtt_ms) / 1000.0);
}
/*
* Potential new stats that are now available upstream.
remote.mFractionLost.Construct(audioStats->fraction_lost);
remote.mTotalRoundTripTime.Construct(
double(aReportBlockData.sum_rtt_ms()) / 1000);
remote.mRoundTripTimeMeasurements.Construct(
aReportBlockData.num_rtts());
*/
if (!report->mRemoteInboundRtpStreamStats.AppendElement(
std::move(remote), fallible)) {
mozalloc_handle_oom(0);
Expand Down Expand Up @@ -333,14 +336,16 @@ nsTArray<RefPtr<dom::RTCStatsPromise>> RTCRtpSender::GetStatsInternal() {
static_cast<double>(rtcpReportData.last_rtt_ms()) / 1000.0);
}
constructCommonRemoteInboundRtpStats(remote, rtcpReportData);
/*
* Potential new stats that are now available upstream.
remote.mTotalRoundTripTime.Construct(
streamStats->report_block_data->sum_rtt_ms() / 1000.0);
remote.mFractionLost.Construct(
static_cast<float>(
rtcpReportData.report_block().fraction_lost) /
static_cast<float>(streamStats->rtcp_stats.fraction_lost) /
(1 << 8));
remote.mRoundTripTimeMeasurements.Construct(
streamStats->report_block_data->num_rtts());
streamStats->report_block_data.num_rtts());
*/
if (!report->mRemoteInboundRtpStreamStats.AppendElement(
std::move(remote), fallible)) {
mozalloc_handle_oom(0);
Expand Down
Loading

0 comments on commit ce6a8e1

Please sign in to comment.