#include "third_party/blink/renderer/modules/peerconnection/media_stream_remote_video_source.h"
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "media/base/video_frame.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/mediastream/media_stream.mojom-blink.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/public/web/modules/mediastream/media_stream_video_source.h"
#include "third_party/blink/public/web/web_heap.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_video_track.h"
#include "third_party/blink/renderer/modules/mediastream/mock_media_stream_video_sink.h"
#include "third_party/blink/renderer/modules/peerconnection/adapters/web_rtc_cross_thread_copier.h"
#include "third_party/blink/renderer/modules/peerconnection/mock_peer_connection_dependency_factory.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_source.h"
#include "third_party/blink/renderer/platform/testing/io_task_runner_testing_platform_support.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/webrtc/track_observer.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_base.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/webrtc/api/rtp_packet_infos.h"
#include "third_party/webrtc/api/video/color_space.h"
#include "third_party/webrtc/api/video/i420_buffer.h"
#include "third_party/webrtc/system_wrappers/include/clock.h"
#include "ui/gfx/color_space.h"
namespace blink {
namespace {
RunOnceClosure;
_;
Gt;
SaveArg;
Sequence;
}
webrtc::VideoFrame::Builder CreateBlackFrameBuilder() { … }
class MediaStreamRemoteVideoSourceUnderTest
: public blink::MediaStreamRemoteVideoSource { … };
class MediaStreamRemoteVideoSourceTest : public ::testing::Test { … };
TEST_F(MediaStreamRemoteVideoSourceTest, StartTrack) { … }
TEST_F(MediaStreamRemoteVideoSourceTest,
SourceTerminationWithEncodedSinkAdded) { … }
TEST_F(MediaStreamRemoteVideoSourceTest,
SourceTerminationBeforeEncodedSinkAdded) { … }
TEST_F(MediaStreamRemoteVideoSourceTest,
SourceTerminationBeforeRequestRefreshFrame) { … }
TEST_F(MediaStreamRemoteVideoSourceTest, SurvivesSourceTermination) { … }
TEST_F(MediaStreamRemoteVideoSourceTest, PreservesColorSpace) { … }
TEST_F(MediaStreamRemoteVideoSourceTest,
UnspecifiedColorSpaceIsTreatedAsBt709) { … }
TEST_F(MediaStreamRemoteVideoSourceTest, UnspecifiedColorSpaceIsIgnored) { … }
TEST_F(MediaStreamRemoteVideoSourceTest,
PopulateRequestAnimationFrameMetadata) { … }
TEST_F(MediaStreamRemoteVideoSourceTest, ReferenceTimeEqualsTimestampUs) { … }
TEST_F(MediaStreamRemoteVideoSourceTest, BaseTimeTicksAndRtcMicrosAreTheSame) { … }
TEST_F(MediaStreamRemoteVideoSourceTest, NoTimestampUsMeansNoReferenceTime) { … }
class TestEncodedVideoFrame : public webrtc::RecordableEncodedFrame { … };
TEST_F(MediaStreamRemoteVideoSourceTest, ForwardsEncodedVideoFrames) { … }
TEST_F(MediaStreamRemoteVideoSourceTest,
ForwardsFramesWithIncreasingTimestampsWithNullSourceTimestamp) { … }
TEST_F(MediaStreamRemoteVideoSourceTest,
ForwardsFramesWithIncreasingTimestampsWithSourceTimestamp) { … }
TEST_F(MediaStreamRemoteVideoSourceTest,
ForwardsEncodedFramesWithIncreasingTimestampsWithNullSourceTimestamp) { … }
TEST_F(MediaStreamRemoteVideoSourceTest,
ForwardsEncodedFramesWithIncreasingTimestampsWithSourceTimestamp) { … }
}