OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2016 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 WEBRTC_MEDIA_BASE_VIDEOSOURCEINTERFACE_H_ | |
12 #define WEBRTC_MEDIA_BASE_VIDEOSOURCEINTERFACE_H_ | |
13 | |
14 #include "webrtc/media/base/videosinkinterface.h" | |
15 #include "webrtc/base/callback.h" | |
16 | |
17 namespace rtc { | |
18 | |
19 struct VideoSinkHints { | |
pthatcher1
2016/02/08 20:59:40
This could use a comment explaining what it is and
perkj_webrtc
2016/02/09 13:23:57
Done.
| |
20 bool operator==(const VideoSinkHints& rh) const { | |
21 return can_apply_rotation == rh.can_apply_rotation; | |
22 } | |
23 bool operator!=(const VideoSinkHints& rh) const { return !operator==(rh); } | |
24 | |
25 // Tells the source whether the sink can handle rotation. By default, the | |
26 // rotation is applied by the source. | |
27 bool can_apply_rotation = false; | |
28 }; | |
29 | |
30 template <typename VideoFrameT> | |
31 class VideoSourceInterface { | |
32 public: | |
33 virtual void AddSink(VideoSinkInterface<VideoFrameT>* sink) = 0; | |
nisse-webrtc
2016/02/08 14:57:04
I don't quite understand the need for both AddSink
pthatcher1
2016/02/08 20:59:40
Originally, I thought that would be annoying to th
perkj_webrtc
2016/02/09 13:23:57
Done.
| |
34 // RemoveSink must guarantee that at the time the method returns, | |
35 // there is no current and no future calls to VideoSinkInterface::OnFrame. | |
36 virtual void RemoveSink(VideoSinkInterface<VideoFrameT>* sink) = 0; | |
37 virtual void AddOrUpdateSink(VideoSinkInterface<VideoFrameT>* sink, | |
38 const VideoSinkHints& hints) = 0; | |
39 | |
40 protected: | |
41 virtual ~VideoSourceInterface() {} | |
42 }; | |
43 | |
44 } // namespace rtc | |
45 #endif // WEBRTC_MEDIA_BASE_VIDEOSOURCEINTERFACE_H_ | |
OLD | NEW |