stats: remove media_type which was an alias for kind

The web compat requirement that was the reason for keeping
is now solved in Chromium and its stats bindings.

BUG=webrtc:9674

Change-Id: Ifb722769414b2bcc5f4d36d7dff87a875336e039
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303860
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40024}
This commit is contained in:
Philipp Hancke 2023-04-28 14:55:40 +02:00 committed by WebRTC LUCI CQ
parent 1276ce3512
commit e0034a800e
5 changed files with 2 additions and 18 deletions

View File

@ -368,9 +368,6 @@ class RTC_EXPORT RTCRtpStreamStats : public RTCStats {
RTCStatsMember<std::string> transport_id;
RTCStatsMember<std::string> codec_id;
// Obsolete
RTCStatsMember<std::string> media_type; // renamed to kind.
protected:
RTCRtpStreamStats(std::string id, Timestamp timestamp);
};

View File

@ -463,7 +463,6 @@ std::unique_ptr<RTCInboundRtpStreamStats> CreateInboundAudioStreamStats(
inbound_audio.get());
inbound_audio->transport_id = transport_id;
inbound_audio->mid = mid;
inbound_audio->media_type = "audio";
inbound_audio->kind = "audio";
if (voice_receiver_info.codec_payload_type.has_value()) {
auto codec_param_it = voice_media_info.receive_codecs.find(
@ -609,7 +608,6 @@ CreateInboundRTPStreamStatsFromVideoReceiverInfo(
inbound_video.get());
inbound_video->transport_id = transport_id;
inbound_video->mid = mid;
inbound_video->media_type = "video";
inbound_video->kind = "video";
if (video_receiver_info.codec_payload_type.has_value()) {
auto codec_param_it = video_media_info.receive_codecs.find(
@ -737,7 +735,6 @@ CreateOutboundRTPStreamStatsFromVoiceSenderInfo(
outbound_audio.get());
outbound_audio->transport_id = transport_id;
outbound_audio->mid = mid;
outbound_audio->media_type = "audio";
outbound_audio->kind = "audio";
if (voice_sender_info.target_bitrate.has_value() &&
*voice_sender_info.target_bitrate > 0) {
@ -774,7 +771,6 @@ CreateOutboundRTPStreamStatsFromVideoSenderInfo(
outbound_video.get());
outbound_video->transport_id = transport_id;
outbound_video->mid = mid;
outbound_video->media_type = "video";
outbound_video->kind = "video";
if (video_sender_info.codec_payload_type.has_value()) {
auto codec_param_it = video_media_info.send_codecs.find(

View File

@ -2530,7 +2530,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRtpStreamStats_Audio) {
RTCInboundRtpStreamStats expected_audio("ITTransportName1A1",
report->timestamp());
expected_audio.ssrc = 1;
expected_audio.media_type = "audio";
expected_audio.kind = "audio";
expected_audio.track_identifier = "RemoteAudioTrackID";
expected_audio.mid = "AudioMid";
@ -2701,7 +2700,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRtpStreamStats_Video) {
RTCInboundRtpStreamStats expected_video("ITTransportName1V1",
report->timestamp());
expected_video.ssrc = 1;
expected_video.media_type = "video";
expected_video.kind = "video";
expected_video.track_identifier = "RemoteVideoTrackID";
expected_video.mid = "VideoMid";
@ -2877,7 +2875,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRtpStreamStats_Audio) {
// `expected_audio.remote_id` should be undefined.
expected_audio.mid = "AudioMid";
expected_audio.ssrc = 1;
expected_audio.media_type = "audio";
expected_audio.kind = "audio";
expected_audio.track_id =
IdForType<DEPRECATED_RTCMediaStreamTrackStats>(report.get());
@ -2973,7 +2970,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRtpStreamStats_Video) {
// `expected_video.remote_id` should be undefined.
expected_video.mid = "VideoMid";
expected_video.ssrc = 1;
expected_video.media_type = "video";
expected_video.kind = "video";
expected_video.track_id = stats_of_track_type[0]->id();
expected_video.transport_id = "TTransportName1";
@ -3319,7 +3315,6 @@ TEST_F(RTCStatsCollectorTest, CollectNoStreamRTCOutboundRtpStreamStats_Audio) {
expected_audio.media_source_id = "SA50";
expected_audio.mid = "AudioMid";
expected_audio.ssrc = 1;
expected_audio.media_type = "audio";
expected_audio.kind = "audio";
expected_audio.track_id =
IdForType<DEPRECATED_RTCMediaStreamTrackStats>(report.get());

View File

@ -723,11 +723,9 @@ class RTCStatsReportVerifier {
// hierarcy.
if (stream.type() == RTCInboundRtpStreamStats::kType ||
stream.type() == RTCOutboundRtpStreamStats::kType) {
verifier.TestMemberIsDefined(stream.media_type);
verifier.TestMemberIsIDReference(
stream.track_id, DEPRECATED_RTCMediaStreamTrackStats::kType);
} else {
verifier.TestMemberIsUndefined(stream.media_type);
verifier.TestMemberIsUndefined(stream.track_id);
}
verifier.TestMemberIsIDReference(stream.transport_id,

View File

@ -401,8 +401,7 @@ WEBRTC_RTCSTATS_IMPL(RTCRtpStreamStats, RTCStats, "rtp",
&kind,
&track_id,
&transport_id,
&codec_id,
&media_type)
&codec_id)
// clang-format on
RTCRtpStreamStats::RTCRtpStreamStats(std::string id, Timestamp timestamp)
@ -411,8 +410,7 @@ RTCRtpStreamStats::RTCRtpStreamStats(std::string id, Timestamp timestamp)
kind("kind"),
track_id("trackId"),
transport_id("transportId"),
codec_id("codecId"),
media_type("mediaType") {}
codec_id("codecId") {}
RTCRtpStreamStats::RTCRtpStreamStats(const RTCRtpStreamStats& other) = default;