Revert "Use internal() in VideoTrack when invoking the source."
This reverts commit 962bf1896185c0d84232f2bfae492eeb04e1236d. Reason for revert: Regressions in PC tests https://crbug.com/webrtc/13697 Original change's description: > Use internal() in VideoTrack when invoking the source. > > This skips going through the proxy and potentially hide a thread hop > should a regression occur. > > This CL contains a part of a previously reviewed, landed, reverted, > relanded and re-reverted CL: > https://webrtc-review.googlesource.com/c/src/+/250180 > > Bug: webrtc:13540 > Change-Id: If098f5c04a263547fb53f44e9f9738b8e941a294 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251861 > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#36026} Bug: webrtc:13540 Change-Id: Iea76094aedda91271154f89c356b140c95717976 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251981 Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36035}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
ba2677061a
commit
153c9e5107
@ -57,18 +57,18 @@ void VideoTrack::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
|
||||
VideoSourceBaseGuarded::AddOrUpdateSink(sink, wants);
|
||||
rtc::VideoSinkWants modified_wants = wants;
|
||||
modified_wants.black_frames = !enabled_w_;
|
||||
video_source_->internal()->AddOrUpdateSink(sink, modified_wants);
|
||||
video_source_->AddOrUpdateSink(sink, modified_wants);
|
||||
}
|
||||
|
||||
void VideoTrack::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
VideoSourceBaseGuarded::RemoveSink(sink);
|
||||
video_source_->internal()->RemoveSink(sink);
|
||||
video_source_->RemoveSink(sink);
|
||||
}
|
||||
|
||||
void VideoTrack::RequestRefreshFrame() {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
video_source_->internal()->RequestRefreshFrame();
|
||||
video_source_->RequestRefreshFrame();
|
||||
}
|
||||
|
||||
VideoTrackSourceInterface* VideoTrack::GetSource() const {
|
||||
@ -76,10 +76,6 @@ VideoTrackSourceInterface* VideoTrack::GetSource() const {
|
||||
return video_source_.get();
|
||||
}
|
||||
|
||||
VideoTrackSourceInterface* VideoTrack::GetSourceInternal() const {
|
||||
return video_source_->internal();
|
||||
}
|
||||
|
||||
VideoTrackInterface::ContentHint VideoTrack::content_hint() const {
|
||||
RTC_DCHECK_RUN_ON(&signaling_thread_);
|
||||
return content_hint_;
|
||||
|
@ -54,9 +54,6 @@ class VideoTrack : public MediaStreamTrack<VideoTrackInterface>,
|
||||
MediaStreamTrackInterface::TrackState state() const override;
|
||||
std::string kind() const override;
|
||||
|
||||
// Direct access to the non-proxied source object for internal implementation.
|
||||
VideoTrackSourceInterface* GetSourceInternal() const;
|
||||
|
||||
protected:
|
||||
VideoTrack(
|
||||
const std::string& id,
|
||||
|
@ -40,19 +40,10 @@ class VideoTrackTest : public ::testing::Test {
|
||||
|
||||
protected:
|
||||
rtc::scoped_refptr<FakeVideoTrackSource> video_track_source_;
|
||||
rtc::scoped_refptr<VideoTrack> video_track_;
|
||||
rtc::scoped_refptr<VideoTrackInterface> video_track_;
|
||||
cricket::FakeFrameSource frame_source_;
|
||||
};
|
||||
|
||||
// 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());
|
||||
|
Reference in New Issue
Block a user