test: replace media_type with kind

media_kind is the old name (that is kept around since we can't deprecate)

BUG=None

Change-Id: I445441a54bb4ff408502d1aba6834cdac874324b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259766
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#36625}
This commit is contained in:
Philipp Hancke
2022-04-22 15:09:54 +02:00
committed by WebRTC LUCI CQ
parent 61afb34d3f
commit a3b5c4e027
3 changed files with 11 additions and 11 deletions

View File

@ -518,7 +518,7 @@ class RTC_EXPORT RTCInboundRTPStreamStats final
// TODO(hbos): This is only implemented for video; implement it for audio as
// well.
RTCStatsMember<std::string> decoder_implementation;
// FIR and PLI counts are only defined for |media_type == "video"|.
// FIR and PLI counts are only defined for |kind == "video"|.
RTCStatsMember<uint32_t> fir_count;
RTCStatsMember<uint32_t> pli_count;
RTCStatsMember<uint32_t> nack_count;
@ -569,7 +569,7 @@ class RTC_EXPORT RTCOutboundRTPStreamStats final : public RTCRTPStreamStats {
// TODO(hbos): This is only implemented for video; implement it for audio as
// well.
RTCStatsMember<std::string> encoder_implementation;
// FIR and PLI counts are only defined for |media_type == "video"|.
// FIR and PLI counts are only defined for |kind == "video"|.
RTCStatsMember<uint32_t> fir_count;
RTCStatsMember<uint32_t> pli_count;
RTCStatsMember<uint32_t> nack_count;

View File

@ -810,11 +810,11 @@ class RTCStatsReportVerifier {
const RTCInboundRTPStreamStats& inbound_stream) {
RTCStatsVerifier verifier(report_.get(), &inbound_stream);
VerifyRTCReceivedRtpStreamStats(inbound_stream, verifier,
inbound_stream.media_type.is_defined() &&
inbound_stream.kind.is_defined() &&
*inbound_stream.media_type == "audio");
verifier.TestMemberIsOptionalIDReference(
inbound_stream.remote_id, RTCRemoteOutboundRtpStreamStats::kType);
if (inbound_stream.media_type.is_defined() &&
if (inbound_stream.kind.is_defined() &&
*inbound_stream.media_type == "video") {
verifier.TestMemberIsNonNegative<uint64_t>(inbound_stream.qp_sum);
verifier.TestMemberIsDefined(inbound_stream.decoder_implementation);
@ -823,7 +823,7 @@ class RTCStatsReportVerifier {
verifier.TestMemberIsUndefined(inbound_stream.decoder_implementation);
}
verifier.TestMemberIsNonNegative<uint32_t>(inbound_stream.packets_received);
if (inbound_stream.media_type.is_defined() &&
if (inbound_stream.kind.is_defined() &&
*inbound_stream.media_type == "audio") {
verifier.TestMemberIsNonNegative<uint64_t>(
inbound_stream.fec_packets_received);
@ -855,7 +855,7 @@ class RTCStatsReportVerifier {
inbound_stream.jitter_buffer_delay);
verifier.TestMemberIsNonNegative<uint64_t>(
inbound_stream.jitter_buffer_emitted_count);
if (inbound_stream.media_type.is_defined() &&
if (inbound_stream.kind.is_defined() &&
*inbound_stream.media_type == "video") {
verifier.TestMemberIsUndefined(inbound_stream.total_samples_received);
verifier.TestMemberIsUndefined(inbound_stream.concealed_samples);
@ -907,7 +907,7 @@ class RTCStatsReportVerifier {
// Test runtime too short to get an estimate (at least two RTCP sender
// reports need to be received).
verifier.MarkMemberTested(inbound_stream.estimated_playout_timestamp, true);
if (inbound_stream.media_type.is_defined() &&
if (inbound_stream.kind.is_defined() &&
*inbound_stream.media_type == "video") {
verifier.TestMemberIsDefined(inbound_stream.frames_decoded);
verifier.TestMemberIsDefined(inbound_stream.key_frames_decoded);
@ -938,7 +938,7 @@ class RTCStatsReportVerifier {
const RTCOutboundRTPStreamStats& outbound_stream) {
RTCStatsVerifier verifier(report_.get(), &outbound_stream);
VerifyRTCRTPStreamStats(outbound_stream, verifier);
if (outbound_stream.media_type.is_defined() &&
if (outbound_stream.kind.is_defined() &&
*outbound_stream.media_type == "video") {
verifier.TestMemberIsIDReference(outbound_stream.media_source_id,
RTCVideoSourceStats::kType);
@ -967,7 +967,7 @@ class RTCStatsReportVerifier {
outbound_stream.header_bytes_sent);
verifier.TestMemberIsNonNegative<uint64_t>(
outbound_stream.retransmitted_bytes_sent);
if (outbound_stream.media_type.is_defined() &&
if (outbound_stream.kind.is_defined() &&
*outbound_stream.media_type == "video") {
verifier.TestMemberIsDefined(outbound_stream.frames_encoded);
verifier.TestMemberIsDefined(outbound_stream.key_frames_encoded);

View File

@ -47,10 +47,10 @@ void VideoQualityMetricsReporter::OnStatsReports(
auto outbound_rtp_stats = report->GetStatsOfType<RTCOutboundRTPStreamStats>();
StatsSample sample;
for (auto& s : outbound_rtp_stats) {
if (!s->media_type.is_defined()) {
if (!s->kind.is_defined()) {
continue;
}
if (!(*s->media_type == RTCMediaStreamTrackKind::kVideo)) {
if (!(*s->kind == RTCMediaStreamTrackKind::kVideo)) {
continue;
}
if (s->timestamp_us() > sample.sample_time.us()) {