niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
phoglund@webrtc.org | 8bfee84 | 2012-02-17 09:32:48 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef COMMON_TYPES_H_ |
| 12 | #define COMMON_TYPES_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
Yves Gerey | 988cc08 | 2018-10-23 12:03:01 +0200 | [diff] [blame] | 14 | #include <stddef.h> // For size_t |
| 15 | #include <cstdint> |
| 16 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 17 | namespace webrtc { |
| 18 | |
pbos@webrtc.org | ce4e9a3 | 2014-12-18 13:50:16 +0000 | [diff] [blame] | 19 | struct FrameCounts { |
| 20 | FrameCounts() : key_frames(0), delta_frames(0) {} |
| 21 | int key_frames; |
| 22 | int delta_frames; |
| 23 | }; |
| 24 | |
asapersson@webrtc.org | d08d389 | 2014-12-16 12:03:11 +0000 | [diff] [blame] | 25 | // Callback, used to notify an observer whenever frame counts have been updated. |
sprang@webrtc.org | dc50aae | 2013-11-20 16:47:07 +0000 | [diff] [blame] | 26 | class FrameCountObserver { |
| 27 | public: |
sprang@webrtc.org | 72964bd | 2013-11-21 09:09:54 +0000 | [diff] [blame] | 28 | virtual ~FrameCountObserver() {} |
pbos@webrtc.org | ce4e9a3 | 2014-12-18 13:50:16 +0000 | [diff] [blame] | 29 | virtual void FrameCountUpdated(const FrameCounts& frame_counts, |
| 30 | uint32_t ssrc) = 0; |
sprang@webrtc.org | dc50aae | 2013-11-20 16:47:07 +0000 | [diff] [blame] | 31 | }; |
| 32 | |
michaelt | 4da3044 | 2016-11-17 01:38:43 -0800 | [diff] [blame] | 33 | // Callback, used to notify an observer when the overhead per packet |
| 34 | // has changed. |
| 35 | class OverheadObserver { |
| 36 | public: |
| 37 | virtual ~OverheadObserver() = default; |
| 38 | virtual void OnOverheadChanged(size_t overhead_bytes_per_packet) = 0; |
| 39 | }; |
| 40 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 41 | // ================================================================== |
| 42 | // Video specific types |
| 43 | // ================================================================== |
| 44 | |
magjed | e69a1a9 | 2016-11-25 10:06:31 -0800 | [diff] [blame] | 45 | // TODO(magjed): Move this and other H264 related classes out to their own file. |
| 46 | namespace H264 { |
| 47 | |
| 48 | enum Profile { |
| 49 | kProfileConstrainedBaseline, |
| 50 | kProfileBaseline, |
| 51 | kProfileMain, |
| 52 | kProfileConstrainedHigh, |
| 53 | kProfileHigh, |
| 54 | }; |
| 55 | |
| 56 | } // namespace H264 |
| 57 | |
Sergey Silkin | 13e7434 | 2018-03-02 12:28:00 +0100 | [diff] [blame] | 58 | struct SpatialLayer { |
Niels Möller | def1ef5 | 2018-03-19 13:48:44 +0100 | [diff] [blame] | 59 | bool operator==(const SpatialLayer& other) const; |
| 60 | bool operator!=(const SpatialLayer& other) const { return !(*this == other); } |
| 61 | |
solenberg | 634b86e | 2016-09-01 07:54:53 -0700 | [diff] [blame] | 62 | unsigned short width; |
| 63 | unsigned short height; |
Sergey Silkin | 1946a3f | 2018-08-22 11:42:16 +0200 | [diff] [blame] | 64 | float maxFramerate; // fps. |
solenberg | 634b86e | 2016-09-01 07:54:53 -0700 | [diff] [blame] | 65 | unsigned char numberOfTemporalLayers; |
| 66 | unsigned int maxBitrate; // kilobits/sec. |
| 67 | unsigned int targetBitrate; // kilobits/sec. |
| 68 | unsigned int minBitrate; // kilobits/sec. |
| 69 | unsigned int qpMax; // minimum quality |
Seth Hampson | f6464c9 | 2018-01-17 13:55:14 -0800 | [diff] [blame] | 70 | bool active; // encoded and sent. |
pwestin@webrtc.org | 1da1ce0 | 2011-10-13 15:19:55 +0000 | [diff] [blame] | 71 | }; |
| 72 | |
Sergey Silkin | 13e7434 | 2018-03-02 12:28:00 +0100 | [diff] [blame] | 73 | // Simulcast is when the same stream is encoded multiple times with different |
| 74 | // settings such as resolution. |
| 75 | typedef SpatialLayer SimulcastStream; |
sprang | ce4aef1 | 2015-11-02 07:23:20 -0800 | [diff] [blame] | 76 | |
isheriff | 6b4b5f3 | 2016-06-08 00:24:21 -0700 | [diff] [blame] | 77 | // Minimum and maximum playout delay values from capture to render. |
| 78 | // These are best effort values. |
| 79 | // |
| 80 | // A value < 0 indicates no change from previous valid value. |
| 81 | // |
| 82 | // min = max = 0 indicates that the receiver should try and render |
| 83 | // frame as soon as possible. |
| 84 | // |
| 85 | // min = x, max = y indicates that the receiver is free to adapt |
| 86 | // in the range (x, y) based on network jitter. |
| 87 | // |
| 88 | // Note: Given that this gets embedded in a union, it is up-to the owner to |
| 89 | // initialize these values. |
| 90 | struct PlayoutDelay { |
| 91 | int min_ms; |
| 92 | int max_ms; |
| 93 | }; |
| 94 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 95 | } // namespace webrtc |
andrew@webrtc.org | eda189b | 2013-09-09 17:50:10 +0000 | [diff] [blame] | 96 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 97 | #endif // COMMON_TYPES_H_ |