/* * Copyright (c) 2026 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef API_VIDEO_TIMING_VIDEO_JITTER_TIMING_INTERFACE_H_ #define API_VIDEO_TIMING_VIDEO_JITTER_TIMING_INTERFACE_H_ #include #include #include "api/units/data_size.h" #include "api/units/time_delta.h" #include "api/units/timestamp.h" namespace webrtc { // NOTE: This class is still under development and may change without notice. class VideoJitterTimingInterface { public: struct FrameInfo { uint32_t rtp_timestamp = 0; Timestamp time = Timestamp::PlusInfinity(); bool last_spatial_layer = false; bool was_retransmitted = false; }; struct TemporalUnitInfo { uint32_t rtp_timestamp = 0; DataSize size = DataSize::Zero(); Timestamp time = Timestamp::PlusInfinity(); bool was_retransmitted = false; }; struct NetworkInfo { TimeDelta rtt = TimeDelta::PlusInfinity(); }; virtual ~VideoJitterTimingInterface() = default; // Resets the model to its initial state. virtual void Reset() = 0; // Updates the model with information of a complete frame. virtual void OnCompleteFrame(const FrameInfo& info) = 0; // Updates the model with information of a decodable temporal unit. // Returns the estimated jitter delay (or nullopt if not available). virtual std::optional OnDecodableTemporalUnit( const TemporalUnitInfo& info) = 0; // Updates the model with network information. virtual void OnNetworkUpdate(const NetworkInfo& info) = 0; // Returns the estimated local clock time for a given RTP timestamp (or // nullopt if not available). virtual std::optional LocalTime(uint32_t rtp_timestamp) const = 0; }; } // namespace webrtc #endif // API_VIDEO_TIMING_VIDEO_JITTER_TIMING_INTERFACE_H_