#include "third_party/blink/renderer/platform/peerconnection/rtc_encoded_video_stream_transformer.h"
#include <stdint.h>
#include <memory>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/test/task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/renderer/platform/peerconnection/rtc_scoped_refptr_cross_thread_copier.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_std.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/webrtc/api/array_view.h"
#include "third_party/webrtc/api/frame_transformer_interface.h"
#include "third_party/webrtc/api/test/mock_transformable_video_frame.h"
#include "third_party/webrtc/api/units/time_delta.h"
#include "third_party/webrtc/rtc_base/ref_counted_object.h"
_;
NiceMock;
Return;
SaveArg;
namespace blink {
namespace {
const uint32_t kSSRC = …;
const uint32_t kNonexistentSSRC = …;
class MockWebRtcTransformedFrameCallback
: public webrtc::TransformedFrameCallback { … };
class MockTransformerCallbackHolder { … };
class MockMetronome : public webrtc::Metronome { … };
std::unique_ptr<webrtc::MockTransformableVideoFrame> CreateMockFrame() { … }
}
class RTCEncodedVideoStreamTransformerTest
: public testing::TestWithParam<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(RTCEncodedVideoStreamTransformerTest,
TransformerForwardsFrameToTransformerCallback) { … }
TEST_P(RTCEncodedVideoStreamTransformerTest, TransformerForwardsFrameToWebRTC) { … }
TEST_P(RTCEncodedVideoStreamTransformerTest, IgnoresSsrcForSinglecast) { … }
TEST_P(RTCEncodedVideoStreamTransformerTest, ShortCircuitingPropagated) { … }
TEST_P(RTCEncodedVideoStreamTransformerTest,
ShortCircuitingSetOnLateRegisteredCallback) { … }
TEST_P(RTCEncodedVideoStreamTransformerTest, WaitsForMetronomeTick) { … }
TEST_P(RTCEncodedVideoStreamTransformerTest,
FramesBufferedBeforeShortcircuiting) { … }
TEST_P(RTCEncodedVideoStreamTransformerTest,
FrameArrivingAfterShortcircuitingIsPassedBack) { … }
TEST_P(RTCEncodedVideoStreamTransformerTest,
FramesBufferedBeforeSettingTransform) { … }
}