#include "cast/streaming/public/sender.h"
#include <stdint.h>
#include <algorithm>
#include <array>
#include <chrono>
#include <limits>
#include <map>
#include <set>
#include <utility>
#include <vector>
#include "cast/streaming/impl/compound_rtcp_builder.h"
#include "cast/streaming/impl/frame_collector.h"
#include "cast/streaming/impl/frame_crypto.h"
#include "cast/streaming/impl/packet_util.h"
#include "cast/streaming/public/constants.h"
#include "cast/streaming/public/encoded_frame.h"
#include "cast/streaming/public/frame_id.h"
#include "cast/streaming/impl/rtcp_session.h"
#include "cast/streaming/impl/rtp_defines.h"
#include "cast/streaming/impl/rtp_packet_parser.h"
#include "cast/streaming/sender_packet_router.h"
#include "cast/streaming/impl/sender_report_parser.h"
#include "cast/streaming/impl/session_config.h"
#include "cast/streaming/ssrc.h"
#include "cast/streaming/testing/mock_environment.h"
#include "cast/streaming/testing/simple_socket_subscriber.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "platform/base/span.h"
#include "platform/test/byte_view_test_util.h"
#include "platform/test/fake_clock.h"
#include "platform/test/fake_task_runner.h"
#include "util/alarm.h"
#include "util/chrono_helpers.h"
#include "util/std_util.h"
#include "util/yet_another_bit_vector.h"
_;
AtLeast;
Invoke;
InvokeWithoutArgs;
Mock;
NiceMock;
Return;
Sequence;
StrictMock;
namespace openscreen::cast {
namespace {
constexpr Ssrc kSenderSsrc = …;
constexpr Ssrc kReceiverSsrc = …;
constexpr int kRtpTimebase = …;
constexpr milliseconds kTargetPlayoutDelay{ … };
constexpr auto kAesKey = …;
constexpr auto kCastIvMask = …;
constexpr RtpPayloadType kRtpPayloadType = …;
constexpr int kRtpTicksPerFrame = …;
constexpr milliseconds kFrameDuration{ … };
static_assert …;
struct EncodedFrameWithBuffer : public EncodedFrame { … };
constexpr int kNumPacketsPerBurst = …;
constexpr milliseconds kBurstInterval{ … };
constexpr milliseconds kCaptureDelay{ … };
#define EXPECT_NEARLY_EQUAL(duration_a, duration_b, epsilon) …
void OverrideRtpTimestamp(int frame_count, EncodedFrame* frame, int fps) { … }
class SimulatedNetworkPipe { … };
class MockReceiver : public Environment::PacketConsumer { … };
class MockObserver : public Sender::Observer { … };
class SenderTest : public testing::Test { … };
TEST_F(SenderTest, SendsFramesEfficiently) { … }
TEST_F(SenderTest, WaitsUntilEndOfReportToUpdateObservers) { … }
TEST_F(SenderTest, ComputesInFlightMediaDuration) { … }
TEST_F(SenderTest, RespondsToNetworkLatencyChanges) { … }
TEST_F(SenderTest, RejectsEnqueuingBeforeProtocolDesignLimit) { … }
TEST_F(SenderTest, CanCancelAllInFlightFrames) { … }
TEST_F(SenderTest, RejectsEnqueuingIfTooLongMediaDurationIsInFlight) { … }
TEST_F(SenderTest, ManagesReceiverPictureLossWorkflow) { … }
TEST_F(SenderTest, ProvidesSenderReports) { … }
TEST_F(SenderTest, ReferenceTimesCanBeNonMonotonic) { … }
TEST_F(SenderTest, ProvidesKickstartPacketsIfReceiverDoesNotACK) { … }
TEST_F(SenderTest, ResendsIndividuallyNackedPackets) { … }
TEST_F(SenderTest, ResendsMissingFrames) { … }
}
}