getStats: add kind alias for mediaType
see https://github.com/w3c/webrtc-stats/issues/301 IDL: https://w3c.github.io/webrtc-stats/#dom-rtcrtpstreamstats Change-Id: I7da443bd1cbf07c9a3118ac04329db28b3543b3f BUG=webrtc:9674 Change-Id: I7da443bd1cbf07c9a3118ac04329db28b3543b3f Reviewed-on: https://webrtc-review.googlesource.com/96420 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/master@{#24532}
This commit is contained in:

committed by
Commit Bot

parent
55de08e7ef
commit
3bc0166a4e
@ -337,7 +337,8 @@ class RTCRTPStreamStats : public RTCStats {
|
||||
// TODO(hbos): Remote case not supported by |RTCStatsCollector|.
|
||||
// crbug.com/657855, 657856
|
||||
RTCStatsMember<bool> is_remote; // = false
|
||||
RTCStatsMember<std::string> media_type;
|
||||
RTCStatsMember<std::string> media_type; // renamed to kind.
|
||||
RTCStatsMember<std::string> kind;
|
||||
RTCStatsMember<std::string> track_id;
|
||||
RTCStatsMember<std::string> transport_id;
|
||||
RTCStatsMember<std::string> codec_id;
|
||||
|
@ -628,6 +628,7 @@ class RTCStatsReportVerifier {
|
||||
verifier->TestMemberIsUndefined(stream.associate_stats_id);
|
||||
verifier->TestMemberIsDefined(stream.is_remote);
|
||||
verifier->TestMemberIsDefined(stream.media_type);
|
||||
verifier->TestMemberIsDefined(stream.kind);
|
||||
verifier->TestMemberIsIDReference(stream.track_id,
|
||||
RTCMediaStreamTrackStats::kType);
|
||||
verifier->TestMemberIsIDReference(stream.transport_id,
|
||||
|
@ -233,6 +233,7 @@ void SetInboundRTPStreamStatsFromVoiceReceiverInfo(
|
||||
SetInboundRTPStreamStatsFromMediaReceiverInfo(
|
||||
voice_receiver_info, inbound_audio);
|
||||
inbound_audio->media_type = "audio";
|
||||
inbound_audio->kind = "audio";
|
||||
if (voice_receiver_info.codec_payload_type) {
|
||||
inbound_audio->codec_id = RTCCodecStatsIDFromMidDirectionAndPayload(
|
||||
mid, true, *voice_receiver_info.codec_payload_type);
|
||||
@ -251,6 +252,7 @@ void SetInboundRTPStreamStatsFromVideoReceiverInfo(
|
||||
SetInboundRTPStreamStatsFromMediaReceiverInfo(
|
||||
video_receiver_info, inbound_video);
|
||||
inbound_video->media_type = "video";
|
||||
inbound_video->kind = "video";
|
||||
if (video_receiver_info.codec_payload_type) {
|
||||
inbound_video->codec_id = RTCCodecStatsIDFromMidDirectionAndPayload(
|
||||
mid, true, *video_receiver_info.codec_payload_type);
|
||||
@ -287,6 +289,7 @@ void SetOutboundRTPStreamStatsFromVoiceSenderInfo(
|
||||
SetOutboundRTPStreamStatsFromMediaSenderInfo(
|
||||
voice_sender_info, outbound_audio);
|
||||
outbound_audio->media_type = "audio";
|
||||
outbound_audio->kind = "audio";
|
||||
if (voice_sender_info.codec_payload_type) {
|
||||
outbound_audio->codec_id = RTCCodecStatsIDFromMidDirectionAndPayload(
|
||||
mid, false, *voice_sender_info.codec_payload_type);
|
||||
@ -302,6 +305,7 @@ void SetOutboundRTPStreamStatsFromVideoSenderInfo(
|
||||
SetOutboundRTPStreamStatsFromMediaSenderInfo(
|
||||
video_sender_info, outbound_video);
|
||||
outbound_video->media_type = "video";
|
||||
outbound_video->kind = "video";
|
||||
if (video_sender_info.codec_payload_type) {
|
||||
outbound_video->codec_id = RTCCodecStatsIDFromMidDirectionAndPayload(
|
||||
mid, false, *video_sender_info.codec_payload_type);
|
||||
|
@ -1605,6 +1605,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio) {
|
||||
expected_audio.ssrc = 1;
|
||||
expected_audio.is_remote = false;
|
||||
expected_audio.media_type = "audio";
|
||||
expected_audio.kind = "audio";
|
||||
expected_audio.track_id = stats_of_track_type[0]->id();
|
||||
expected_audio.transport_id = "RTCTransport_TransportName_1";
|
||||
expected_audio.codec_id = "RTCCodec_AudioMid_Inbound_42";
|
||||
@ -1660,6 +1661,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) {
|
||||
expected_video.ssrc = 1;
|
||||
expected_video.is_remote = false;
|
||||
expected_video.media_type = "video";
|
||||
expected_video.kind = "video";
|
||||
expected_video.track_id = IdForType<RTCMediaStreamTrackStats>(report);
|
||||
expected_video.transport_id = "RTCTransport_TransportName_1";
|
||||
expected_video.codec_id = "RTCCodec_VideoMid_Inbound_42";
|
||||
@ -1724,6 +1726,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Audio) {
|
||||
expected_audio.ssrc = 1;
|
||||
expected_audio.is_remote = false;
|
||||
expected_audio.media_type = "audio";
|
||||
expected_audio.kind = "audio";
|
||||
expected_audio.track_id = IdForType<RTCMediaStreamTrackStats>(report);
|
||||
expected_audio.transport_id = "RTCTransport_TransportName_1";
|
||||
expected_audio.codec_id = "RTCCodec_AudioMid_Outbound_42";
|
||||
@ -1784,6 +1787,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) {
|
||||
expected_video.ssrc = 1;
|
||||
expected_video.is_remote = false;
|
||||
expected_video.media_type = "video";
|
||||
expected_video.kind = "video";
|
||||
expected_video.track_id = stats_of_track_type[0]->id();
|
||||
expected_video.transport_id = "RTCTransport_TransportName_1";
|
||||
expected_video.codec_id = "RTCCodec_VideoMid_Outbound_42";
|
||||
@ -1984,6 +1988,7 @@ TEST_F(RTCStatsCollectorTest, CollectNoStreamRTCOutboundRTPStreamStats_Audio) {
|
||||
expected_audio.ssrc = 1;
|
||||
expected_audio.is_remote = false;
|
||||
expected_audio.media_type = "audio";
|
||||
expected_audio.kind = "audio";
|
||||
expected_audio.track_id = IdForType<RTCMediaStreamTrackStats>(report);
|
||||
expected_audio.transport_id = "RTCTransport_TransportName_1";
|
||||
expected_audio.codec_id = "RTCCodec_AudioMid_Outbound_42";
|
||||
|
@ -473,6 +473,7 @@ WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
|
||||
&associate_stats_id,
|
||||
&is_remote,
|
||||
&media_type,
|
||||
&kind,
|
||||
&track_id,
|
||||
&transport_id,
|
||||
&codec_id,
|
||||
@ -493,6 +494,7 @@ RTCRTPStreamStats::RTCRTPStreamStats(std::string&& id, int64_t timestamp_us)
|
||||
associate_stats_id("associateStatsId"),
|
||||
is_remote("isRemote", false),
|
||||
media_type("mediaType"),
|
||||
kind("kind"),
|
||||
track_id("trackId"),
|
||||
transport_id("transportId"),
|
||||
codec_id("codecId"),
|
||||
@ -508,6 +510,7 @@ RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other)
|
||||
associate_stats_id(other.associate_stats_id),
|
||||
is_remote(other.is_remote),
|
||||
media_type(other.media_type),
|
||||
kind(other.kind),
|
||||
track_id(other.track_id),
|
||||
transport_id(other.transport_id),
|
||||
codec_id(other.codec_id),
|
||||
|
Reference in New Issue
Block a user