Chromium Code Reviews| Index: webrtc/common_types.h |
| diff --git a/webrtc/common_types.h b/webrtc/common_types.h |
| index 678b8566282ed97483d880e6d8ad911358023346..4765242fe66204e105296fa951b6881f4c9b8bf4 100644 |
| --- a/webrtc/common_types.h |
| +++ b/webrtc/common_types.h |
| @@ -18,6 +18,7 @@ |
| #include <string> |
| #include <vector> |
| +#include "webrtc/base/optional.h" |
| #include "webrtc/common_video/rotation.h" |
| #include "webrtc/typedefs.h" |
| @@ -522,7 +523,7 @@ struct VideoCodecVP8 { |
| bool automaticResizeOn; |
| bool frameDroppingOn; |
| int keyFrameInterval; |
| - const TemporalLayersFactory* tl_factory; |
| + TemporalLayersFactory* tl_factory; |
| }; |
| // VP9 specific. |
| @@ -562,6 +563,10 @@ enum VideoCodecType { |
| kVideoCodecUnknown |
| }; |
| +// Translates from name of codec to codec type and vice versa. |
| +rtc::Optional<std::string> CodecTypeToPayloadName(VideoCodecType type); |
|
perkj_webrtc
2016/11/01 18:40:10
nit: I would prefer empty string and unknown as re
sprang_webrtc
2016/11/02 13:28:32
I'm not sure I agree. There was at least one usage
|
| +rtc::Optional<VideoCodecType> PayloadNameToCodecType(const std::string& name); |
| + |
| union VideoCodecUnion { |
| VideoCodecVP8 VP8; |
| VideoCodecVP9 VP9; |
| @@ -638,6 +643,35 @@ class VideoCodec { |
| VideoCodecUnion codecSpecific; |
| }; |
| +class BitrateAllocation { |
| + public: |
| + static constexpr size_t kMaxBitrateBps = 100000000; // 100Mbps. |
| + BitrateAllocation(); |
| + |
| + bool SetBitrate(size_t spatial_index, |
| + size_t temporal_index, |
| + uint32_t bitrate_bps); |
| + |
| + uint32_t GetBitrate(size_t spatial_index, size_t temporal_index) const; |
| + |
| + // Get the sum of all the temporal layer for a specific spatial layer. |
| + uint32_t GetSpatialLayerSum(size_t spatial_index) const; |
| + |
| + uint32_t get_sum_bps() const { return sum_; } // Sum of all bitrates. |
| + uint32_t get_sum_kbps() const { return (sum_ + 500) / 1000; } |
|
stefan-webrtc
2016/11/02 10:26:34
Maybe skip get_ or call them GetSum*()? I at least
sprang_webrtc
2016/11/02 13:28:32
https://chromium.googlesource.com/chromium/src/+/m
stefan-webrtc
2016/11/03 13:34:58
Ack, things have apparently changed since I read t
|
| + |
| + inline bool operator==(const BitrateAllocation& other) const { |
| + return memcmp(bitrates_, other.bitrates_, sizeof(bitrates_)) == 0; |
| + } |
| + inline bool operator!=(const BitrateAllocation& other) const { |
| + return !(*this == other); |
| + } |
| + |
| + private: |
| + uint32_t sum_; |
| + uint32_t bitrates_[kMaxSpatialLayers][kMaxTemporalStreams]; |
| +}; |
| + |
| // Bandwidth over-use detector options. These are used to drive |
| // experimentation with bandwidth estimation parameters. |
| // See modules/remote_bitrate_estimator/overuse_detector.h |