/* * Copyright 2012 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.
*/
using webrtc::FakeVideoTrackRenderer; using webrtc::FakeVideoTrackSource; using webrtc::MediaSourceInterface; using webrtc::MediaStreamTrackInterface; using webrtc::VideoTrack; using webrtc::VideoTrackInterface; using webrtc::VideoTrackSource;
// VideoTrack::Create will create an API proxy around the source object. // The `GetSource` method provides access to the proxy object intented for API // use while the GetSourceInternal() provides direct access to the source object // as provided to the `VideoTrack::Create` factory function.
TEST_F(VideoTrackTest, CheckApiProxyAndInternalSource) {
EXPECT_NE(video_track_->GetSource(), video_track_source_.get());
EXPECT_EQ(video_track_->GetSourceInternal(), video_track_source_.get());
}
// Test changing the source state also changes the track state.
TEST_F(VideoTrackTest, SourceStateChangeTrackState) {
EXPECT_EQ(MediaStreamTrackInterface::kLive, video_track_->state());
video_track_source_->SetState(MediaSourceInterface::kEnded);
EXPECT_EQ(MediaStreamTrackInterface::kEnded, video_track_->state());
}
// Test adding renderers to a video track and render to them by providing // frames to the source.
TEST_F(VideoTrackTest, RenderVideo) { // FakeVideoTrackRenderer register itself to `video_track_`
std::unique_ptr<FakeVideoTrackRenderer> renderer_1( new FakeVideoTrackRenderer(video_track_.get()));
// Test that disabling the track results in blacked out frames.
TEST_F(VideoTrackTest, DisableTrackBlackout) {
std::unique_ptr<FakeVideoTrackRenderer> renderer( new FakeVideoTrackRenderer(video_track_.get()));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.