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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/utility/simulcast_state.h
diff --git a/webrtc/modules/video_coding/utility/simulcast_state.h b/webrtc/modules/video_coding/utility/simulcast_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..a3226a5fc8f453562eb00186e23f4f75439a54a3
--- /dev/null
+++ b/webrtc/modules/video_coding/utility/simulcast_state.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ *
+ */
+
+#ifndef WEBRTC_MODULES_VIDEO_CODING_UTILITY_SIMULCAST_STATE_H_
+#define WEBRTC_MODULES_VIDEO_CODING_UTILITY_SIMULCAST_STATE_H_
+
+#include <vector>
+
+#include "webrtc/common_types.h"
+
+namespace webrtc {
+
+class SimulcastState {
+ public:
+ explicit SimulcastState(const VideoCodec& codec);
+ virtual ~SimulcastState();
+
+ int AllocateBitrate(int target_bitrate_bps);
+ void RequestKeyFrame(uint8_t idx);
stefan-webrtc 2016/05/06 11:43:20 Could we split this class in two and have one for
+ bool GetAndResetKeyFrameRequest(uint8_t idx);
+ void SetSending(uint8_t idx, bool sending);
+
+ size_t NumStreams() const;
+ size_t NumSendingStreams() const;
+ bool IsSending(uint8_t idx) const;
+ int AllocatedRate(uint8_t idx) const;
+
+ struct Stream {
+ Stream(uint8_t idx, VideoCodec* codec, int start_bitrate_bps);
+ VideoCodec AsCodec() const;
+
+ uint8_t idx;
+ SimulcastStream config;
+ int start_bitrate;
+ VideoCodec* parent_codec;
+ bool sending;
+ bool keyframe_request;
+ int allocated_rate_bps;
+ };
+ const std::vector<Stream>& Streams() const;
+
+ private:
+ int IncreaseBitrateAllocation(Stream* stream, int bitrate_bps_delta);
+
+ VideoCodec codec_;
+ std::vector<Stream> streams_;
+};
+
+} // namespace webrtc
+
+#endif // WEBRTC_MODULES_VIDEO_CODING_UTILITY_SIMULCAST_STATE_H_
« 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