2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-02-17 09:32:48 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef COMMON_TYPES_H_
|
|
|
|
|
#define COMMON_TYPES_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2018-10-23 12:03:01 +02:00
|
|
|
#include <stddef.h> // For size_t
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
namespace webrtc {
|
|
|
|
|
|
2014-12-18 13:50:16 +00:00
|
|
|
struct FrameCounts {
|
|
|
|
|
FrameCounts() : key_frames(0), delta_frames(0) {}
|
|
|
|
|
int key_frames;
|
|
|
|
|
int delta_frames;
|
|
|
|
|
};
|
|
|
|
|
|
2014-12-16 12:03:11 +00:00
|
|
|
// Callback, used to notify an observer whenever frame counts have been updated.
|
2013-11-20 16:47:07 +00:00
|
|
|
class FrameCountObserver {
|
|
|
|
|
public:
|
2013-11-21 09:09:54 +00:00
|
|
|
virtual ~FrameCountObserver() {}
|
2014-12-18 13:50:16 +00:00
|
|
|
virtual void FrameCountUpdated(const FrameCounts& frame_counts,
|
|
|
|
|
uint32_t ssrc) = 0;
|
2013-11-20 16:47:07 +00:00
|
|
|
};
|
|
|
|
|
|
2016-11-17 01:38:43 -08:00
|
|
|
// Callback, used to notify an observer when the overhead per packet
|
|
|
|
|
// has changed.
|
|
|
|
|
class OverheadObserver {
|
|
|
|
|
public:
|
|
|
|
|
virtual ~OverheadObserver() = default;
|
|
|
|
|
virtual void OnOverheadChanged(size_t overhead_bytes_per_packet) = 0;
|
|
|
|
|
};
|
|
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
// ==================================================================
|
|
|
|
|
// Video specific types
|
|
|
|
|
// ==================================================================
|
|
|
|
|
|
2016-11-25 10:06:31 -08:00
|
|
|
// TODO(magjed): Move this and other H264 related classes out to their own file.
|
|
|
|
|
namespace H264 {
|
|
|
|
|
|
|
|
|
|
enum Profile {
|
|
|
|
|
kProfileConstrainedBaseline,
|
|
|
|
|
kProfileBaseline,
|
|
|
|
|
kProfileMain,
|
|
|
|
|
kProfileConstrainedHigh,
|
|
|
|
|
kProfileHigh,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace H264
|
|
|
|
|
|
2018-03-02 12:28:00 +01:00
|
|
|
struct SpatialLayer {
|
2018-03-19 13:48:44 +01:00
|
|
|
bool operator==(const SpatialLayer& other) const;
|
|
|
|
|
bool operator!=(const SpatialLayer& other) const { return !(*this == other); }
|
|
|
|
|
|
2016-09-01 07:54:53 -07:00
|
|
|
unsigned short width;
|
|
|
|
|
unsigned short height;
|
2018-08-22 11:42:16 +02:00
|
|
|
float maxFramerate; // fps.
|
2016-09-01 07:54:53 -07:00
|
|
|
unsigned char numberOfTemporalLayers;
|
|
|
|
|
unsigned int maxBitrate; // kilobits/sec.
|
|
|
|
|
unsigned int targetBitrate; // kilobits/sec.
|
|
|
|
|
unsigned int minBitrate; // kilobits/sec.
|
|
|
|
|
unsigned int qpMax; // minimum quality
|
2018-01-17 13:55:14 -08:00
|
|
|
bool active; // encoded and sent.
|
2011-10-13 15:19:55 +00:00
|
|
|
};
|
|
|
|
|
|
2018-03-02 12:28:00 +01:00
|
|
|
// Simulcast is when the same stream is encoded multiple times with different
|
|
|
|
|
// settings such as resolution.
|
|
|
|
|
typedef SpatialLayer SimulcastStream;
|
2015-11-02 07:23:20 -08:00
|
|
|
|
2016-06-08 00:24:21 -07:00
|
|
|
// Minimum and maximum playout delay values from capture to render.
|
|
|
|
|
// These are best effort values.
|
|
|
|
|
//
|
|
|
|
|
// A value < 0 indicates no change from previous valid value.
|
|
|
|
|
//
|
|
|
|
|
// min = max = 0 indicates that the receiver should try and render
|
|
|
|
|
// frame as soon as possible.
|
|
|
|
|
//
|
|
|
|
|
// min = x, max = y indicates that the receiver is free to adapt
|
|
|
|
|
// in the range (x, y) based on network jitter.
|
|
|
|
|
//
|
|
|
|
|
// Note: Given that this gets embedded in a union, it is up-to the owner to
|
|
|
|
|
// initialize these values.
|
|
|
|
|
struct PlayoutDelay {
|
|
|
|
|
int min_ms;
|
|
|
|
|
int max_ms;
|
|
|
|
|
};
|
|
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
} // namespace webrtc
|
2013-09-09 17:50:10 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // COMMON_TYPES_H_
|