Add static constexpr type to RTC event log events.

This allows (among other things) type-checked down-casts (similar to dynamic_cast) This will be used in a follow-up CL.

This CL also moves some one-liner functions from the .cc file to the .h file.

Bug: webrtc:11933
Change-Id: Ic89de8fa6c445ecbe108f2fbf68b44b655f819f5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/199970
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32905}
This commit is contained in:
Björn Terelius
2021-01-05 13:26:43 +01:00
committed by Commit Bot
parent fc6b87192d
commit b26335a116
51 changed files with 105 additions and 275 deletions

View File

@ -21,14 +21,6 @@ RtcEventAlrState::RtcEventAlrState(const RtcEventAlrState& other)
RtcEventAlrState::~RtcEventAlrState() = default;
RtcEvent::Type RtcEventAlrState::GetType() const {
return RtcEvent::Type::AlrStateEvent;
}
bool RtcEventAlrState::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventAlrState> RtcEventAlrState::Copy() const {
return absl::WrapUnique<RtcEventAlrState>(new RtcEventAlrState(*this));
}

View File

@ -19,12 +19,13 @@ namespace webrtc {
class RtcEventAlrState final : public RtcEvent {
public:
static constexpr Type kType = Type::AlrStateEvent;
explicit RtcEventAlrState(bool in_alr);
~RtcEventAlrState() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventAlrState> Copy() const;

View File

@ -31,14 +31,6 @@ RtcEventAudioNetworkAdaptation::RtcEventAudioNetworkAdaptation(
RtcEventAudioNetworkAdaptation::~RtcEventAudioNetworkAdaptation() = default;
RtcEvent::Type RtcEventAudioNetworkAdaptation::GetType() const {
return RtcEvent::Type::AudioNetworkAdaptation;
}
bool RtcEventAudioNetworkAdaptation::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventAudioNetworkAdaptation>
RtcEventAudioNetworkAdaptation::Copy() const {
return absl::WrapUnique(new RtcEventAudioNetworkAdaptation(*this));

View File

@ -21,13 +21,14 @@ struct AudioEncoderRuntimeConfig;
class RtcEventAudioNetworkAdaptation final : public RtcEvent {
public:
static constexpr Type kType = Type::AudioNetworkAdaptation;
explicit RtcEventAudioNetworkAdaptation(
std::unique_ptr<AudioEncoderRuntimeConfig> config);
~RtcEventAudioNetworkAdaptation() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventAudioNetworkAdaptation> Copy() const;

View File

@ -19,14 +19,6 @@ RtcEventAudioPlayout::RtcEventAudioPlayout(uint32_t ssrc) : ssrc_(ssrc) {}
RtcEventAudioPlayout::RtcEventAudioPlayout(const RtcEventAudioPlayout& other)
: RtcEvent(other.timestamp_us_), ssrc_(other.ssrc_) {}
RtcEvent::Type RtcEventAudioPlayout::GetType() const {
return RtcEvent::Type::AudioPlayout;
}
bool RtcEventAudioPlayout::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventAudioPlayout> RtcEventAudioPlayout::Copy() const {
return absl::WrapUnique<RtcEventAudioPlayout>(
new RtcEventAudioPlayout(*this));

View File

@ -21,12 +21,13 @@ namespace webrtc {
class RtcEventAudioPlayout final : public RtcEvent {
public:
static constexpr Type kType = Type::AudioPlayout;
explicit RtcEventAudioPlayout(uint32_t ssrc);
~RtcEventAudioPlayout() override = default;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventAudioPlayout> Copy() const;

View File

@ -31,14 +31,6 @@ RtcEventAudioReceiveStreamConfig::RtcEventAudioReceiveStreamConfig(
RtcEventAudioReceiveStreamConfig::~RtcEventAudioReceiveStreamConfig() = default;
RtcEvent::Type RtcEventAudioReceiveStreamConfig::GetType() const {
return RtcEvent::Type::AudioReceiveStreamConfig;
}
bool RtcEventAudioReceiveStreamConfig::IsConfigEvent() const {
return true;
}
std::unique_ptr<RtcEventAudioReceiveStreamConfig>
RtcEventAudioReceiveStreamConfig::Copy() const {
return absl::WrapUnique<RtcEventAudioReceiveStreamConfig>(

View File

@ -23,13 +23,14 @@ struct StreamConfig;
class RtcEventAudioReceiveStreamConfig final : public RtcEvent {
public:
static constexpr Type kType = Type::AudioReceiveStreamConfig;
explicit RtcEventAudioReceiveStreamConfig(
std::unique_ptr<rtclog::StreamConfig> config);
~RtcEventAudioReceiveStreamConfig() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return true; }
std::unique_ptr<RtcEventAudioReceiveStreamConfig> Copy() const;

View File

@ -31,14 +31,6 @@ RtcEventAudioSendStreamConfig::RtcEventAudioSendStreamConfig(
RtcEventAudioSendStreamConfig::~RtcEventAudioSendStreamConfig() = default;
RtcEvent::Type RtcEventAudioSendStreamConfig::GetType() const {
return RtcEvent::Type::AudioSendStreamConfig;
}
bool RtcEventAudioSendStreamConfig::IsConfigEvent() const {
return true;
}
std::unique_ptr<RtcEventAudioSendStreamConfig>
RtcEventAudioSendStreamConfig::Copy() const {
return absl::WrapUnique<RtcEventAudioSendStreamConfig>(

View File

@ -23,13 +23,14 @@ struct StreamConfig;
class RtcEventAudioSendStreamConfig final : public RtcEvent {
public:
static constexpr Type kType = Type::AudioSendStreamConfig;
explicit RtcEventAudioSendStreamConfig(
std::unique_ptr<rtclog::StreamConfig> config);
~RtcEventAudioSendStreamConfig() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return true; }
std::unique_ptr<RtcEventAudioSendStreamConfig> Copy() const;

View File

@ -28,14 +28,6 @@ RtcEventBweUpdateDelayBased::RtcEventBweUpdateDelayBased(
RtcEventBweUpdateDelayBased::~RtcEventBweUpdateDelayBased() = default;
RtcEvent::Type RtcEventBweUpdateDelayBased::GetType() const {
return RtcEvent::Type::BweUpdateDelayBased;
}
bool RtcEventBweUpdateDelayBased::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventBweUpdateDelayBased> RtcEventBweUpdateDelayBased::Copy()
const {
return absl::WrapUnique<RtcEventBweUpdateDelayBased>(

View File

@ -23,13 +23,14 @@ enum class BandwidthUsage;
class RtcEventBweUpdateDelayBased final : public RtcEvent {
public:
static constexpr Type kType = Type::BweUpdateDelayBased;
RtcEventBweUpdateDelayBased(int32_t bitrate_bps,
BandwidthUsage detector_state);
~RtcEventBweUpdateDelayBased() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventBweUpdateDelayBased> Copy() const;

View File

@ -30,14 +30,6 @@ RtcEventBweUpdateLossBased::RtcEventBweUpdateLossBased(
RtcEventBweUpdateLossBased::~RtcEventBweUpdateLossBased() = default;
RtcEvent::Type RtcEventBweUpdateLossBased::GetType() const {
return RtcEvent::Type::BweUpdateLossBased;
}
bool RtcEventBweUpdateLossBased::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventBweUpdateLossBased> RtcEventBweUpdateLossBased::Copy()
const {
return absl::WrapUnique<RtcEventBweUpdateLossBased>(

View File

@ -21,14 +21,15 @@ namespace webrtc {
class RtcEventBweUpdateLossBased final : public RtcEvent {
public:
static constexpr Type kType = Type::BweUpdateLossBased;
RtcEventBweUpdateLossBased(int32_t bitrate_bps_,
uint8_t fraction_loss_,
int32_t total_packets_);
~RtcEventBweUpdateLossBased() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventBweUpdateLossBased> Copy() const;

View File

@ -24,14 +24,6 @@ RtcEventDtlsTransportState::RtcEventDtlsTransportState(
RtcEventDtlsTransportState::~RtcEventDtlsTransportState() = default;
RtcEvent::Type RtcEventDtlsTransportState::GetType() const {
return RtcEvent::Type::DtlsTransportState;
}
bool RtcEventDtlsTransportState::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventDtlsTransportState> RtcEventDtlsTransportState::Copy()
const {
return absl::WrapUnique<RtcEventDtlsTransportState>(

View File

@ -20,11 +20,13 @@ namespace webrtc {
class RtcEventDtlsTransportState : public RtcEvent {
public:
static constexpr Type kType = Type::DtlsTransportState;
explicit RtcEventDtlsTransportState(DtlsTransportState state);
~RtcEventDtlsTransportState() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventDtlsTransportState> Copy() const;

View File

@ -23,14 +23,6 @@ RtcEventDtlsWritableState::RtcEventDtlsWritableState(
RtcEventDtlsWritableState::~RtcEventDtlsWritableState() = default;
RtcEvent::Type RtcEventDtlsWritableState::GetType() const {
return RtcEvent::Type::DtlsWritableState;
}
bool RtcEventDtlsWritableState::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventDtlsWritableState> RtcEventDtlsWritableState::Copy()
const {
return absl::WrapUnique<RtcEventDtlsWritableState>(

View File

@ -19,11 +19,13 @@ namespace webrtc {
class RtcEventDtlsWritableState : public RtcEvent {
public:
static constexpr Type kType = Type::DtlsWritableState;
explicit RtcEventDtlsWritableState(bool writable);
~RtcEventDtlsWritableState() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventDtlsWritableState> Copy() const;

View File

@ -36,14 +36,6 @@ RtcEventFrameDecoded::RtcEventFrameDecoded(const RtcEventFrameDecoded& other)
codec_(other.codec_),
qp_(other.qp_) {}
RtcEvent::Type RtcEventFrameDecoded::GetType() const {
return RtcEvent::Type::FrameDecoded;
}
bool RtcEventFrameDecoded::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventFrameDecoded> RtcEventFrameDecoded::Copy() const {
return absl::WrapUnique<RtcEventFrameDecoded>(
new RtcEventFrameDecoded(*this));

View File

@ -22,6 +22,8 @@ namespace webrtc {
class RtcEventFrameDecoded final : public RtcEvent {
public:
static constexpr Type kType = Type::FrameDecoded;
RtcEventFrameDecoded(int64_t render_time_ms,
uint32_t ssrc,
int width,
@ -30,9 +32,8 @@ class RtcEventFrameDecoded final : public RtcEvent {
uint8_t qp);
~RtcEventFrameDecoded() override = default;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventFrameDecoded> Copy() const;

View File

@ -51,12 +51,4 @@ RtcEventGenericAckReceived::RtcEventGenericAckReceived(
RtcEventGenericAckReceived::~RtcEventGenericAckReceived() = default;
RtcEvent::Type RtcEventGenericAckReceived::GetType() const {
return RtcEvent::Type::GenericAckReceived;
}
bool RtcEventGenericAckReceived::IsConfigEvent() const {
return false;
}
} // namespace webrtc

View File

@ -30,6 +30,8 @@ struct AckedPacket {
class RtcEventGenericAckReceived final : public RtcEvent {
public:
static constexpr Type kType = Type::GenericAckReceived;
// For a collection of acked packets, it creates a vector of logs to log with
// the same timestamp.
static std::vector<std::unique_ptr<RtcEventGenericAckReceived>> CreateLogs(
@ -40,9 +42,8 @@ class RtcEventGenericAckReceived final : public RtcEvent {
std::unique_ptr<RtcEventGenericAckReceived> Copy() const;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
// An identifier of the packet which contained an ack.
int64_t packet_number() const { return packet_number_; }

View File

@ -28,12 +28,5 @@ std::unique_ptr<RtcEventGenericPacketReceived>
RtcEventGenericPacketReceived::Copy() const {
return absl::WrapUnique(new RtcEventGenericPacketReceived(*this));
}
RtcEvent::Type RtcEventGenericPacketReceived::GetType() const {
return RtcEvent::Type::GenericPacketReceived;
}
bool RtcEventGenericPacketReceived::IsConfigEvent() const {
return false;
}
} // namespace webrtc

View File

@ -19,14 +19,15 @@ namespace webrtc {
class RtcEventGenericPacketReceived final : public RtcEvent {
public:
static constexpr Type kType = Type::GenericPacketReceived;
RtcEventGenericPacketReceived(int64_t packet_number, size_t packet_length);
~RtcEventGenericPacketReceived() override;
std::unique_ptr<RtcEventGenericPacketReceived> Copy() const;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
// An identifier of the packet.
int64_t packet_number() const { return packet_number_; }

View File

@ -33,12 +33,4 @@ std::unique_ptr<RtcEventGenericPacketSent> RtcEventGenericPacketSent::Copy()
return absl::WrapUnique(new RtcEventGenericPacketSent(*this));
}
RtcEvent::Type RtcEventGenericPacketSent::GetType() const {
return RtcEvent::Type::GenericPacketSent;
}
bool RtcEventGenericPacketSent::IsConfigEvent() const {
return false;
}
} // namespace webrtc

View File

@ -19,6 +19,8 @@ namespace webrtc {
class RtcEventGenericPacketSent final : public RtcEvent {
public:
static constexpr Type kType = Type::GenericPacketSent;
RtcEventGenericPacketSent(int64_t packet_number,
size_t overhead_length,
size_t payload_length,
@ -27,9 +29,8 @@ class RtcEventGenericPacketSent final : public RtcEvent {
std::unique_ptr<RtcEventGenericPacketSent> Copy() const;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
// An identifier of the packet.
int64_t packet_number() const { return packet_number_; }

View File

@ -31,14 +31,6 @@ RtcEventIceCandidatePair::RtcEventIceCandidatePair(
RtcEventIceCandidatePair::~RtcEventIceCandidatePair() = default;
RtcEvent::Type RtcEventIceCandidatePair::GetType() const {
return RtcEvent::Type::IceCandidatePairEvent;
}
bool RtcEventIceCandidatePair::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventIceCandidatePair> RtcEventIceCandidatePair::Copy()
const {
return absl::WrapUnique<RtcEventIceCandidatePair>(

View File

@ -29,15 +29,16 @@ enum class IceCandidatePairEventType {
class RtcEventIceCandidatePair final : public RtcEvent {
public:
static constexpr Type kType = Type::IceCandidatePairEvent;
RtcEventIceCandidatePair(IceCandidatePairEventType type,
uint32_t candidate_pair_id,
uint32_t transaction_id);
~RtcEventIceCandidatePair() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventIceCandidatePair> Copy() const;

View File

@ -54,16 +54,6 @@ RtcEventIceCandidatePairConfig::RtcEventIceCandidatePairConfig(
RtcEventIceCandidatePairConfig::~RtcEventIceCandidatePairConfig() = default;
RtcEvent::Type RtcEventIceCandidatePairConfig::GetType() const {
return RtcEvent::Type::IceCandidatePairConfig;
}
// The ICE candidate pair config event is not equivalent to a RtcEventLog config
// event.
bool RtcEventIceCandidatePairConfig::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventIceCandidatePairConfig>
RtcEventIceCandidatePairConfig::Copy() const {
return absl::WrapUnique<RtcEventIceCandidatePairConfig>(

View File

@ -83,6 +83,8 @@ class IceCandidatePairDescription {
class RtcEventIceCandidatePairConfig final : public RtcEvent {
public:
static constexpr Type kType = Type::IceCandidatePairConfig;
RtcEventIceCandidatePairConfig(
IceCandidatePairConfigType type,
uint32_t candidate_pair_id,
@ -90,9 +92,9 @@ class RtcEventIceCandidatePairConfig final : public RtcEvent {
~RtcEventIceCandidatePairConfig() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
// N.B. An ICE config event is not considered an RtcEventLog config event.
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventIceCandidatePairConfig> Copy() const;

View File

@ -31,14 +31,6 @@ RtcEventProbeClusterCreated::RtcEventProbeClusterCreated(
min_probes_(other.min_probes_),
min_bytes_(other.min_bytes_) {}
RtcEvent::Type RtcEventProbeClusterCreated::GetType() const {
return RtcEvent::Type::ProbeClusterCreated;
}
bool RtcEventProbeClusterCreated::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventProbeClusterCreated> RtcEventProbeClusterCreated::Copy()
const {
return absl::WrapUnique<RtcEventProbeClusterCreated>(

View File

@ -21,15 +21,16 @@ namespace webrtc {
class RtcEventProbeClusterCreated final : public RtcEvent {
public:
static constexpr Type kType = Type::ProbeClusterCreated;
RtcEventProbeClusterCreated(int32_t id,
int32_t bitrate_bps,
uint32_t min_probes,
uint32_t min_bytes);
~RtcEventProbeClusterCreated() override = default;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventProbeClusterCreated> Copy() const;

View File

@ -25,14 +25,6 @@ RtcEventProbeResultFailure::RtcEventProbeResultFailure(
id_(other.id_),
failure_reason_(other.failure_reason_) {}
RtcEvent::Type RtcEventProbeResultFailure::GetType() const {
return RtcEvent::Type::ProbeResultFailure;
}
bool RtcEventProbeResultFailure::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventProbeResultFailure> RtcEventProbeResultFailure::Copy()
const {
return absl::WrapUnique<RtcEventProbeResultFailure>(

View File

@ -28,12 +28,13 @@ enum class ProbeFailureReason {
class RtcEventProbeResultFailure final : public RtcEvent {
public:
static constexpr Type kType = Type::ProbeResultFailure;
RtcEventProbeResultFailure(int32_t id, ProbeFailureReason failure_reason);
~RtcEventProbeResultFailure() override = default;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventProbeResultFailure> Copy() const;

View File

@ -24,14 +24,6 @@ RtcEventProbeResultSuccess::RtcEventProbeResultSuccess(
id_(other.id_),
bitrate_bps_(other.bitrate_bps_) {}
RtcEvent::Type RtcEventProbeResultSuccess::GetType() const {
return RtcEvent::Type::ProbeResultSuccess;
}
bool RtcEventProbeResultSuccess::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventProbeResultSuccess> RtcEventProbeResultSuccess::Copy()
const {
return absl::WrapUnique<RtcEventProbeResultSuccess>(

View File

@ -21,12 +21,13 @@ namespace webrtc {
class RtcEventProbeResultSuccess final : public RtcEvent {
public:
static constexpr Type kType = Type::ProbeResultSuccess;
RtcEventProbeResultSuccess(int32_t id, int32_t bitrate_bps);
~RtcEventProbeResultSuccess() override = default;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventProbeResultSuccess> Copy() const;

View File

@ -20,11 +20,14 @@ namespace webrtc {
class RtcEventRemoteEstimate final : public RtcEvent {
public:
static constexpr Type kType = Type::RemoteEstimateEvent;
RtcEventRemoteEstimate(DataRate link_capacity_lower,
DataRate link_capacity_upper)
: link_capacity_lower_(link_capacity_lower),
link_capacity_upper_(link_capacity_upper) {}
Type GetType() const override { return RtcEvent::Type::RemoteEstimateEvent; }
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
const DataRate link_capacity_lower_;

View File

@ -24,14 +24,6 @@ RtcEventRouteChange::RtcEventRouteChange(const RtcEventRouteChange& other)
RtcEventRouteChange::~RtcEventRouteChange() = default;
RtcEvent::Type RtcEventRouteChange::GetType() const {
return RtcEvent::Type::RouteChangeEvent;
}
bool RtcEventRouteChange::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventRouteChange> RtcEventRouteChange::Copy() const {
return absl::WrapUnique<RtcEventRouteChange>(new RtcEventRouteChange(*this));
}

View File

@ -19,12 +19,13 @@ namespace webrtc {
class RtcEventRouteChange final : public RtcEvent {
public:
static constexpr Type kType = Type::RouteChangeEvent;
RtcEventRouteChange(bool connected, uint32_t overhead);
~RtcEventRouteChange() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventRouteChange> Copy() const;

View File

@ -25,14 +25,6 @@ RtcEventRtcpPacketIncoming::RtcEventRtcpPacketIncoming(
RtcEventRtcpPacketIncoming::~RtcEventRtcpPacketIncoming() = default;
RtcEvent::Type RtcEventRtcpPacketIncoming::GetType() const {
return RtcEvent::Type::RtcpPacketIncoming;
}
bool RtcEventRtcpPacketIncoming::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventRtcpPacketIncoming> RtcEventRtcpPacketIncoming::Copy()
const {
return absl::WrapUnique<RtcEventRtcpPacketIncoming>(

View File

@ -23,12 +23,13 @@ namespace webrtc {
class RtcEventRtcpPacketIncoming final : public RtcEvent {
public:
static constexpr Type kType = Type::RtcpPacketIncoming;
explicit RtcEventRtcpPacketIncoming(rtc::ArrayView<const uint8_t> packet);
~RtcEventRtcpPacketIncoming() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventRtcpPacketIncoming> Copy() const;

View File

@ -25,14 +25,6 @@ RtcEventRtcpPacketOutgoing::RtcEventRtcpPacketOutgoing(
RtcEventRtcpPacketOutgoing::~RtcEventRtcpPacketOutgoing() = default;
RtcEvent::Type RtcEventRtcpPacketOutgoing::GetType() const {
return RtcEvent::Type::RtcpPacketOutgoing;
}
bool RtcEventRtcpPacketOutgoing::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventRtcpPacketOutgoing> RtcEventRtcpPacketOutgoing::Copy()
const {
return absl::WrapUnique<RtcEventRtcpPacketOutgoing>(

View File

@ -23,12 +23,13 @@ namespace webrtc {
class RtcEventRtcpPacketOutgoing final : public RtcEvent {
public:
static constexpr Type kType = Type::RtcpPacketOutgoing;
explicit RtcEventRtcpPacketOutgoing(rtc::ArrayView<const uint8_t> packet);
~RtcEventRtcpPacketOutgoing() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventRtcpPacketOutgoing> Copy() const;

View File

@ -37,14 +37,6 @@ RtcEventRtpPacketIncoming::RtcEventRtpPacketIncoming(
RtcEventRtpPacketIncoming::~RtcEventRtpPacketIncoming() = default;
RtcEvent::Type RtcEventRtpPacketIncoming::GetType() const {
return RtcEvent::Type::RtpPacketIncoming;
}
bool RtcEventRtpPacketIncoming::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventRtpPacketIncoming> RtcEventRtpPacketIncoming::Copy()
const {
return absl::WrapUnique<RtcEventRtpPacketIncoming>(

View File

@ -22,12 +22,13 @@ class RtpPacketReceived;
class RtcEventRtpPacketIncoming final : public RtcEvent {
public:
static constexpr Type kType = Type::RtpPacketIncoming;
explicit RtcEventRtpPacketIncoming(const RtpPacketReceived& packet);
~RtcEventRtpPacketIncoming() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventRtpPacketIncoming> Copy() const;

View File

@ -40,14 +40,6 @@ RtcEventRtpPacketOutgoing::RtcEventRtpPacketOutgoing(
RtcEventRtpPacketOutgoing::~RtcEventRtpPacketOutgoing() = default;
RtcEvent::Type RtcEventRtpPacketOutgoing::GetType() const {
return RtcEvent::Type::RtpPacketOutgoing;
}
bool RtcEventRtpPacketOutgoing::IsConfigEvent() const {
return false;
}
std::unique_ptr<RtcEventRtpPacketOutgoing> RtcEventRtpPacketOutgoing::Copy()
const {
return absl::WrapUnique<RtcEventRtpPacketOutgoing>(

View File

@ -22,13 +22,14 @@ class RtpPacketToSend;
class RtcEventRtpPacketOutgoing final : public RtcEvent {
public:
static constexpr Type kType = Type::RtpPacketOutgoing;
RtcEventRtpPacketOutgoing(const RtpPacketToSend& packet,
int probe_cluster_id);
~RtcEventRtpPacketOutgoing() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
std::unique_ptr<RtcEventRtpPacketOutgoing> Copy() const;

View File

@ -30,14 +30,6 @@ RtcEventVideoReceiveStreamConfig::RtcEventVideoReceiveStreamConfig(
RtcEventVideoReceiveStreamConfig::~RtcEventVideoReceiveStreamConfig() = default;
RtcEvent::Type RtcEventVideoReceiveStreamConfig::GetType() const {
return Type::VideoReceiveStreamConfig;
}
bool RtcEventVideoReceiveStreamConfig::IsConfigEvent() const {
return true;
}
std::unique_ptr<RtcEventVideoReceiveStreamConfig>
RtcEventVideoReceiveStreamConfig::Copy() const {
return absl::WrapUnique<RtcEventVideoReceiveStreamConfig>(

View File

@ -20,13 +20,14 @@ namespace webrtc {
class RtcEventVideoReceiveStreamConfig final : public RtcEvent {
public:
static constexpr Type kType = Type::VideoReceiveStreamConfig;
explicit RtcEventVideoReceiveStreamConfig(
std::unique_ptr<rtclog::StreamConfig> config);
~RtcEventVideoReceiveStreamConfig() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return true; }
std::unique_ptr<RtcEventVideoReceiveStreamConfig> Copy() const;

View File

@ -27,14 +27,6 @@ RtcEventVideoSendStreamConfig::RtcEventVideoSendStreamConfig(
RtcEventVideoSendStreamConfig::~RtcEventVideoSendStreamConfig() = default;
RtcEvent::Type RtcEventVideoSendStreamConfig::GetType() const {
return RtcEvent::Type::VideoSendStreamConfig;
}
bool RtcEventVideoSendStreamConfig::IsConfigEvent() const {
return true;
}
std::unique_ptr<RtcEventVideoSendStreamConfig>
RtcEventVideoSendStreamConfig::Copy() const {
return absl::WrapUnique<RtcEventVideoSendStreamConfig>(

View File

@ -20,13 +20,14 @@ namespace webrtc {
class RtcEventVideoSendStreamConfig final : public RtcEvent {
public:
static constexpr Type kType = Type::VideoSendStreamConfig;
explicit RtcEventVideoSendStreamConfig(
std::unique_ptr<rtclog::StreamConfig> config);
~RtcEventVideoSendStreamConfig() override;
Type GetType() const override;
bool IsConfigEvent() const override;
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return true; }
std::unique_ptr<RtcEventVideoSendStreamConfig> Copy() const;