Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Side by Side Diff: webrtc/modules/video_coding/utility/simulcast_state.h

Issue 1913073002: Extract common simulcast logic from VP8 wrapper and simulcast adapter (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address comments, added tests Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc ('k') | webrtc/modules/video_coding/utility/simulcast_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698