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 | |
12 #ifndef WEBRTC_MODULES_VIDEO_CODING_UTILITY_SIMULCAST_STATE_H_ | |
13 #define WEBRTC_MODULES_VIDEO_CODING_UTILITY_SIMULCAST_STATE_H_ | |
14 | |
15 #include <vector> | |
16 | |
17 #include "webrtc/common_types.h" | |
18 | |
19 namespace webrtc { | |
20 | |
21 class SimulcastState { | |
22 public: | |
23 explicit SimulcastState(const VideoCodec& codec); | |
24 virtual ~SimulcastState(); | |
25 | |
26 int AllocateBitrate(int target_bitrate_bps); | |
27 void RequestKeyFrame(uint8_t idx); | |
stefan-webrtc
2016/05/06 11:43:20
Could we split this class in two and have one for
| |
28 bool GetAndResetKeyFrameRequest(uint8_t idx); | |
29 void SetSending(uint8_t idx, bool sending); | |
30 | |
31 size_t NumStreams() const; | |
32 size_t NumSendingStreams() const; | |
33 bool IsSending(uint8_t idx) const; | |
34 int AllocatedRate(uint8_t idx) const; | |
35 | |
36 struct Stream { | |
37 Stream(uint8_t idx, VideoCodec* codec, int start_bitrate_bps); | |
38 VideoCodec AsCodec() const; | |
39 | |
40 uint8_t idx; | |
41 SimulcastStream config; | |
42 int start_bitrate; | |
43 VideoCodec* parent_codec; | |
44 bool sending; | |
45 bool keyframe_request; | |
46 int allocated_rate_bps; | |
47 }; | |
48 const std::vector<Stream>& Streams() const; | |
49 | |
50 private: | |
51 int IncreaseBitrateAllocation(Stream* stream, int bitrate_bps_delta); | |
52 | |
53 VideoCodec codec_; | |
54 std::vector<Stream> streams_; | |
55 }; | |
56 | |
57 } // namespace webrtc | |
58 | |
59 #endif // WEBRTC_MODULES_VIDEO_CODING_UTILITY_SIMULCAST_STATE_H_ | |
OLD | NEW |