chromium/third_party/openscreen/src/cast/streaming/impl/compound_rtcp_builder.h

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CAST_STREAMING_IMPL_COMPOUND_RTCP_BUILDER_H_
#define CAST_STREAMING_IMPL_COMPOUND_RTCP_BUILDER_H_

#include <chrono>
#include <optional>
#include <utility>
#include <vector>

#include "cast/streaming/public/constants.h"
#include "cast/streaming/public/frame_id.h"
#include "cast/streaming/impl/rtcp_common.h"
#include "cast/streaming/impl/rtp_defines.h"
#include "platform/base/span.h"

namespace openscreen::cast {

class RtcpSession;

// Collects current status and feedback messages from the Receiver in the
// current process, and builds compound RTCP packets to be transmitted to a
// Sender.
//
// Usage:
//
//   1. Call the various SetXYZ/IncludeXYZInNextPacket() methods as the
//      receiver's state changes. The SetXYZ() methods provide values that will
//      be included in every RTCP packet until they are changed, while the
//      IncludeXYZInNextPacket() methods provide values for only the next-built
//      RTCP packet. The latter case is part of the overall protocol design, to
//      help prevent the Sender from acting on stale Receiver state.
//
//   2. At certain times, call BuildPacket() and transmit it to the sender:
//      a. By default, every 1/2 sec, to provide the sender with a "keep alive"
//         ping that it can also use to monitor network round-trip times.
//      b. When there is new feedback, the collected information should be
//         immediately conveyed to the sender.
class CompoundRtcpBuilder {};

}  // namespace openscreen::cast

#endif  // CAST_STREAMING_IMPL_COMPOUND_RTCP_BUILDER_H_