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_VIDEOBROADCASTER_H_ | |
12 #define WEBRTC_MEDIA_BASE_VIDEOBROADCASTER_H_ | |
13 | |
14 #include <utility> | |
15 #include <vector> | |
16 | |
17 #include "webrtc/base/thread_checker.h" | |
18 #include "webrtc/media/base/videoframe.h" | |
19 #include "webrtc/media/base/videosinkinterface.h" | |
20 #include "webrtc/media/base/videosourceinterface.h" | |
21 | |
22 namespace rtc { | |
23 | |
24 class VideoBroadCaster : public VideoSourceInterface<cricket::VideoFrame>, | |
25 public VideoSinkInterface<cricket::VideoFrame> { | |
pthatcher1
2016/02/08 20:59:39
"broadcast" is one word, so "Broadcaster", with a
perkj_webrtc
2016/02/09 13:23:57
sorry - I realized that on my way home yesterday..
| |
26 public: | |
27 VideoBroadCaster(); | |
28 void AddSink(VideoSinkInterface<cricket::VideoFrame>* sink) override; | |
29 void RemoveSink(VideoSinkInterface<cricket::VideoFrame>* sink) override; | |
30 void AddOrUpdateSink(VideoSinkInterface<cricket::VideoFrame>* sink, | |
31 const VideoSinkHints& hints) override; | |
32 | |
33 // Returns true if the next frame will be delivered to at least one sink. | |
34 bool FrameWillBeDelivered() const; | |
pthatcher1
2016/02/08 20:59:39
How about calling this frame_wanted()?
perkj_webrtc
2016/02/09 13:23:57
Done.
| |
35 | |
36 // Returns the hints a source is requested to fulfill. They are aggregated | |
37 // by all hints from all sinks. | |
38 VideoSinkHints DerivedHints() const; | |
pthatcher1
2016/02/08 20:59:39
I'd prefer a name like AggregateSinkHints(), or be
perkj_webrtc
2016/02/09 13:23:57
Done.
| |
39 | |
40 void OnFrame(const cricket::VideoFrame& frame) override; | |
41 | |
42 protected: | |
43 ThreadChecker thread_checker_; | |
44 std::pair<VideoSinkInterface<cricket::VideoFrame>*, VideoSinkHints> | |
45 current_hints_; | |
nisse-webrtc
2016/02/08 14:57:04
This makes me puzzled. Maybe simply don't understa
pthatcher1
2016/02/08 20:59:39
I was thinking the same thing.
perkj_webrtc
2016/02/09 13:23:57
I wanted to not actually do the aggregation of wan
| |
46 using Sinks = std::vector<VideoSinkInterface<cricket::VideoFrame>*>; | |
47 Sinks sinks_; | |
48 }; | |
49 | |
50 } // namespace rtc | |
51 | |
52 #endif // WEBRTC_MEDIA_BASE_VIDEOBROADCASTER_H_ | |
OLD | NEW |