1 /* 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef PC_VIDEO_TRACK_SOURCE_PROXY_H_ 12 #define PC_VIDEO_TRACK_SOURCE_PROXY_H_ 13 14 #include "absl/types/optional.h" 15 #include "api/media_stream_interface.h" 16 #include "api/video/recordable_encoded_frame.h" 17 #include "api/video/video_frame.h" 18 #include "api/video/video_sink_interface.h" 19 #include "api/video/video_source_interface.h" 20 #include "api/video_track_source_constraints.h" 21 #include "pc/proxy.h" 22 23 namespace webrtc { 24 25 // Makes sure the real VideoTrackSourceInterface implementation is destroyed on 26 // the signaling thread and marshals all method calls to the signaling thread. 27 // TODO(deadbeef): Move this to .cc file. What threads methods are called on is 28 // an implementation detail. 29 BEGIN_PROXY_MAP(VideoTrackSource) 30 31 PROXY_PRIMARY_THREAD_DESTRUCTOR() 32 PROXY_CONSTMETHOD0(SourceState, state) 33 BYPASS_PROXY_CONSTMETHOD0(bool, remote) 34 BYPASS_PROXY_CONSTMETHOD0(bool, is_screencast) 35 PROXY_CONSTMETHOD0(absl::optional<bool>, needs_denoising) 36 PROXY_METHOD1(bool, GetStats, Stats*) 37 PROXY_SECONDARY_METHOD2(void, 38 AddOrUpdateSink, 39 rtc::VideoSinkInterface<VideoFrame>*, 40 const rtc::VideoSinkWants&) 41 PROXY_SECONDARY_METHOD1(void, RemoveSink, rtc::VideoSinkInterface<VideoFrame>*) 42 PROXY_SECONDARY_METHOD0(void, RequestRefreshFrame) 43 PROXY_METHOD1(void, RegisterObserver, ObserverInterface*) 44 PROXY_METHOD1(void, UnregisterObserver, ObserverInterface*) 45 PROXY_CONSTMETHOD0(bool, SupportsEncodedOutput) 46 PROXY_SECONDARY_METHOD0(void, GenerateKeyFrame) 47 PROXY_SECONDARY_METHOD1(void, 48 AddEncodedSink, 49 rtc::VideoSinkInterface<RecordableEncodedFrame>*) 50 PROXY_SECONDARY_METHOD1(void, 51 RemoveEncodedSink, 52 rtc::VideoSinkInterface<RecordableEncodedFrame>*) 53 PROXY_SECONDARY_METHOD1(void, 54 ProcessConstraints, 55 const webrtc::VideoTrackSourceConstraints&) 56 END_PROXY_MAP(VideoTrackSource) 57 58 } // namespace webrtc 59 60 #endif // PC_VIDEO_TRACK_SOURCE_PROXY_H_ 61