OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 const char* RTCStatsIceCandidatePairState::kInProgress = "in-progress"; | 22 const char* RTCStatsIceCandidatePairState::kInProgress = "in-progress"; |
23 const char* RTCStatsIceCandidatePairState::kFailed = "failed"; | 23 const char* RTCStatsIceCandidatePairState::kFailed = "failed"; |
24 const char* RTCStatsIceCandidatePairState::kSucceeded = "succeeded"; | 24 const char* RTCStatsIceCandidatePairState::kSucceeded = "succeeded"; |
25 | 25 |
26 // Strings defined in https://tools.ietf.org/html/rfc5245. | 26 // Strings defined in https://tools.ietf.org/html/rfc5245. |
27 const char* RTCIceCandidateType::kHost = "host"; | 27 const char* RTCIceCandidateType::kHost = "host"; |
28 const char* RTCIceCandidateType::kSrflx = "srflx"; | 28 const char* RTCIceCandidateType::kSrflx = "srflx"; |
29 const char* RTCIceCandidateType::kPrflx = "prflx"; | 29 const char* RTCIceCandidateType::kPrflx = "prflx"; |
30 const char* RTCIceCandidateType::kRelay = "relay"; | 30 const char* RTCIceCandidateType::kRelay = "relay"; |
31 | 31 |
| 32 const char* RTCMediaStreamTrackKind::kAudio = "audio"; |
| 33 const char* RTCMediaStreamTrackKind::kVideo = "video"; |
| 34 |
32 WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate", | 35 WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate", |
33 &fingerprint, | 36 &fingerprint, |
34 &fingerprint_algorithm, | 37 &fingerprint_algorithm, |
35 &base64_certificate, | 38 &base64_certificate, |
36 &issuer_certificate_id); | 39 &issuer_certificate_id); |
37 | 40 |
38 RTCCertificateStats::RTCCertificateStats( | 41 RTCCertificateStats::RTCCertificateStats( |
39 const std::string& id, int64_t timestamp_us) | 42 const std::string& id, int64_t timestamp_us) |
40 : RTCCertificateStats(std::string(id), timestamp_us) { | 43 : RTCCertificateStats(std::string(id), timestamp_us) { |
41 } | 44 } |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 } | 340 } |
338 | 341 |
339 RTCMediaStreamStats::~RTCMediaStreamStats() { | 342 RTCMediaStreamStats::~RTCMediaStreamStats() { |
340 } | 343 } |
341 | 344 |
342 WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track", | 345 WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track", |
343 &track_identifier, | 346 &track_identifier, |
344 &remote_source, | 347 &remote_source, |
345 &ended, | 348 &ended, |
346 &detached, | 349 &detached, |
| 350 &kind, |
347 &ssrc_ids, | 351 &ssrc_ids, |
348 &frame_width, | 352 &frame_width, |
349 &frame_height, | 353 &frame_height, |
350 &frames_per_second, | 354 &frames_per_second, |
351 &frames_sent, | 355 &frames_sent, |
352 &frames_received, | 356 &frames_received, |
353 &frames_decoded, | 357 &frames_decoded, |
354 &frames_dropped, | 358 &frames_dropped, |
355 &frames_corrupted, | 359 &frames_corrupted, |
356 &partial_frames_lost, | 360 &partial_frames_lost, |
357 &full_frames_lost, | 361 &full_frames_lost, |
358 &audio_level, | 362 &audio_level, |
359 &echo_return_loss, | 363 &echo_return_loss, |
360 &echo_return_loss_enhancement); | 364 &echo_return_loss_enhancement); |
361 | 365 |
362 RTCMediaStreamTrackStats::RTCMediaStreamTrackStats( | 366 RTCMediaStreamTrackStats::RTCMediaStreamTrackStats( |
363 const std::string& id, int64_t timestamp_us) | 367 const std::string& id, int64_t timestamp_us, const char* kind) |
364 : RTCMediaStreamTrackStats(std::string(id), timestamp_us) { | 368 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) { |
365 } | 369 } |
366 | 370 |
367 RTCMediaStreamTrackStats::RTCMediaStreamTrackStats( | 371 RTCMediaStreamTrackStats::RTCMediaStreamTrackStats( |
368 std::string&& id, int64_t timestamp_us) | 372 std::string&& id, int64_t timestamp_us, const char* kind) |
369 : RTCStats(std::move(id), timestamp_us), | 373 : RTCStats(std::move(id), timestamp_us), |
370 track_identifier("trackIdentifier"), | 374 track_identifier("trackIdentifier"), |
371 remote_source("remoteSource"), | 375 remote_source("remoteSource"), |
372 ended("ended"), | 376 ended("ended"), |
373 detached("detached"), | 377 detached("detached"), |
| 378 kind("kind", kind), |
374 ssrc_ids("ssrcIds"), | 379 ssrc_ids("ssrcIds"), |
375 frame_width("frameWidth"), | 380 frame_width("frameWidth"), |
376 frame_height("frameHeight"), | 381 frame_height("frameHeight"), |
377 frames_per_second("framesPerSecond"), | 382 frames_per_second("framesPerSecond"), |
378 frames_sent("framesSent"), | 383 frames_sent("framesSent"), |
379 frames_received("framesReceived"), | 384 frames_received("framesReceived"), |
380 frames_decoded("framesDecoded"), | 385 frames_decoded("framesDecoded"), |
381 frames_dropped("framesDropped"), | 386 frames_dropped("framesDropped"), |
382 frames_corrupted("framesCorrupted"), | 387 frames_corrupted("framesCorrupted"), |
383 partial_frames_lost("partialFramesLost"), | 388 partial_frames_lost("partialFramesLost"), |
384 full_frames_lost("fullFramesLost"), | 389 full_frames_lost("fullFramesLost"), |
385 audio_level("audioLevel"), | 390 audio_level("audioLevel"), |
386 echo_return_loss("echoReturnLoss"), | 391 echo_return_loss("echoReturnLoss"), |
387 echo_return_loss_enhancement("echoReturnLossEnhancement") { | 392 echo_return_loss_enhancement("echoReturnLossEnhancement") { |
| 393 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio || |
| 394 kind == RTCMediaStreamTrackKind::kVideo); |
388 } | 395 } |
389 | 396 |
390 RTCMediaStreamTrackStats::RTCMediaStreamTrackStats( | 397 RTCMediaStreamTrackStats::RTCMediaStreamTrackStats( |
391 const RTCMediaStreamTrackStats& other) | 398 const RTCMediaStreamTrackStats& other) |
392 : RTCStats(other.id(), other.timestamp_us()), | 399 : RTCStats(other.id(), other.timestamp_us()), |
393 track_identifier(other.track_identifier), | 400 track_identifier(other.track_identifier), |
394 remote_source(other.remote_source), | 401 remote_source(other.remote_source), |
395 ended(other.ended), | 402 ended(other.ended), |
396 detached(other.detached), | 403 detached(other.detached), |
| 404 kind(other.kind), |
397 ssrc_ids(other.ssrc_ids), | 405 ssrc_ids(other.ssrc_ids), |
398 frame_width(other.frame_width), | 406 frame_width(other.frame_width), |
399 frame_height(other.frame_height), | 407 frame_height(other.frame_height), |
400 frames_per_second(other.frames_per_second), | 408 frames_per_second(other.frames_per_second), |
401 frames_sent(other.frames_sent), | 409 frames_sent(other.frames_sent), |
402 frames_received(other.frames_received), | 410 frames_received(other.frames_received), |
403 frames_decoded(other.frames_decoded), | 411 frames_decoded(other.frames_decoded), |
404 frames_dropped(other.frames_dropped), | 412 frames_dropped(other.frames_dropped), |
405 frames_corrupted(other.frames_corrupted), | 413 frames_corrupted(other.frames_corrupted), |
406 partial_frames_lost(other.partial_frames_lost), | 414 partial_frames_lost(other.partial_frames_lost), |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 active_connection(other.active_connection), | 643 active_connection(other.active_connection), |
636 selected_candidate_pair_id(other.selected_candidate_pair_id), | 644 selected_candidate_pair_id(other.selected_candidate_pair_id), |
637 local_certificate_id(other.local_certificate_id), | 645 local_certificate_id(other.local_certificate_id), |
638 remote_certificate_id(other.remote_certificate_id) { | 646 remote_certificate_id(other.remote_certificate_id) { |
639 } | 647 } |
640 | 648 |
641 RTCTransportStats::~RTCTransportStats() { | 649 RTCTransportStats::~RTCTransportStats() { |
642 } | 650 } |
643 | 651 |
644 } // namespace webrtc | 652 } // namespace webrtc |
OLD | NEW |