1 /* 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 3 * 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 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_PROBE_RESULT_SUCCESS_H_ 12 #define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_PROBE_RESULT_SUCCESS_H_ 13 14 #include <stdint.h> 15 16 #include <memory> 17 18 #include "api/rtc_event_log/rtc_event.h" 19 20 namespace webrtc { 21 22 class RtcEventProbeResultSuccess final : public RtcEvent { 23 public: 24 static constexpr Type kType = Type::ProbeResultSuccess; 25 26 RtcEventProbeResultSuccess(int32_t id, int32_t bitrate_bps); 27 ~RtcEventProbeResultSuccess() override = default; 28 GetType()29 Type GetType() const override { return kType; } IsConfigEvent()30 bool IsConfigEvent() const override { return false; } 31 32 std::unique_ptr<RtcEventProbeResultSuccess> Copy() const; 33 id()34 int32_t id() const { return id_; } bitrate_bps()35 int32_t bitrate_bps() const { return bitrate_bps_; } 36 37 private: 38 RtcEventProbeResultSuccess(const RtcEventProbeResultSuccess& other); 39 40 const int32_t id_; 41 const int32_t bitrate_bps_; 42 }; 43 44 struct LoggedBweProbeSuccessEvent { 45 LoggedBweProbeSuccessEvent() = default; LoggedBweProbeSuccessEventLoggedBweProbeSuccessEvent46 LoggedBweProbeSuccessEvent(int64_t timestamp_us, 47 int32_t id, 48 int32_t bitrate_bps) 49 : timestamp_us(timestamp_us), id(id), bitrate_bps(bitrate_bps) {} 50 log_time_usLoggedBweProbeSuccessEvent51 int64_t log_time_us() const { return timestamp_us; } log_time_msLoggedBweProbeSuccessEvent52 int64_t log_time_ms() const { return timestamp_us / 1000; } 53 54 int64_t timestamp_us; 55 int32_t id; 56 int32_t bitrate_bps; 57 }; 58 59 } // namespace webrtc 60 61 #endif // LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_PROBE_RESULT_SUCCESS_H_ 62