blob: c156899c1a9f560ca7be09148ca42627c3dc91d6 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:251/*
phoglund@webrtc.org8bfee842012-02-17 09:32:482 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:253 *
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 Bonadei92ea95e2017-09-15 04:47:3111#ifndef COMMON_TYPES_H_
12#define COMMON_TYPES_H_
niklase@google.com470e71d2011-07-07 08:21:2513
Yves Gerey988cc082018-10-23 10:03:0114#include <stddef.h> // For size_t
15#include <cstdint>
16
niklase@google.com470e71d2011-07-07 08:21:2517namespace webrtc {
18
pbos@webrtc.orgce4e9a32014-12-18 13:50:1619struct FrameCounts {
20 FrameCounts() : key_frames(0), delta_frames(0) {}
21 int key_frames;
22 int delta_frames;
23};
24
asapersson@webrtc.orgd08d3892014-12-16 12:03:1125// Callback, used to notify an observer whenever frame counts have been updated.
sprang@webrtc.orgdc50aae2013-11-20 16:47:0726class FrameCountObserver {
27 public:
sprang@webrtc.org72964bd2013-11-21 09:09:5428 virtual ~FrameCountObserver() {}
pbos@webrtc.orgce4e9a32014-12-18 13:50:1629 virtual void FrameCountUpdated(const FrameCounts& frame_counts,
30 uint32_t ssrc) = 0;
sprang@webrtc.orgdc50aae2013-11-20 16:47:0731};
32
michaelt4da30442016-11-17 09:38:4333// Callback, used to notify an observer when the overhead per packet
34// has changed.
35class OverheadObserver {
36 public:
37 virtual ~OverheadObserver() = default;
38 virtual void OnOverheadChanged(size_t overhead_bytes_per_packet) = 0;
39};
40
niklase@google.com470e71d2011-07-07 08:21:2541// ==================================================================
42// Video specific types
43// ==================================================================
44
magjede69a1a92016-11-25 18:06:3145// TODO(magjed): Move this and other H264 related classes out to their own file.
46namespace H264 {
47
48enum Profile {
49 kProfileConstrainedBaseline,
50 kProfileBaseline,
51 kProfileMain,
52 kProfileConstrainedHigh,
53 kProfileHigh,
54};
55
56} // namespace H264
57
Sergey Silkin13e74342018-03-02 11:28:0058struct SpatialLayer {
Niels Möllerdef1ef52018-03-19 12:48:4459 bool operator==(const SpatialLayer& other) const;
60 bool operator!=(const SpatialLayer& other) const { return !(*this == other); }
61
solenberg634b86e2016-09-01 14:54:5362 unsigned short width;
63 unsigned short height;
Sergey Silkin1946a3f2018-08-22 09:42:1664 float maxFramerate; // fps.
solenberg634b86e2016-09-01 14:54:5365 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 Hampsonf6464c92018-01-17 21:55:1470 bool active; // encoded and sent.
pwestin@webrtc.org1da1ce02011-10-13 15:19:5571};
72
Sergey Silkin13e74342018-03-02 11:28:0073// Simulcast is when the same stream is encoded multiple times with different
74// settings such as resolution.
75typedef SpatialLayer SimulcastStream;
sprangce4aef12015-11-02 15:23:2076
isheriff6b4b5f32016-06-08 07:24:2177// 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.
90struct PlayoutDelay {
91 int min_ms;
92 int max_ms;
93};
94
niklase@google.com470e71d2011-07-07 08:21:2595} // namespace webrtc
andrew@webrtc.orgeda189b2013-09-09 17:50:1096
Mirko Bonadei92ea95e2017-09-15 04:47:3197#endif // COMMON_TYPES_H_