mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 22:00:47 +01:00

Bug: webrtc:7660 Change-Id: I54009ebc5f65b6875a8c079ab5264e0c5ce9f654 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181500 Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31942}
62 lines
1.8 KiB
C++
62 lines
1.8 KiB
C++
/*
|
|
* Copyright (c) 2012 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 COMMON_TYPES_H_
|
|
#define COMMON_TYPES_H_
|
|
|
|
#include <stddef.h> // For size_t
|
|
|
|
#include <cstdint>
|
|
|
|
namespace webrtc {
|
|
|
|
struct FrameCounts {
|
|
FrameCounts() : key_frames(0), delta_frames(0) {}
|
|
int key_frames;
|
|
int delta_frames;
|
|
};
|
|
|
|
// Callback, used to notify an observer whenever frame counts have been updated.
|
|
class FrameCountObserver {
|
|
public:
|
|
virtual ~FrameCountObserver() {}
|
|
virtual void FrameCountUpdated(const FrameCounts& frame_counts,
|
|
uint32_t ssrc) = 0;
|
|
};
|
|
|
|
// 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 {
|
|
PlayoutDelay(int min_ms, int max_ms) : min_ms(min_ms), max_ms(max_ms) {}
|
|
int min_ms;
|
|
int max_ms;
|
|
|
|
static PlayoutDelay Noop() { return PlayoutDelay(-1, -1); }
|
|
|
|
bool IsNoop() const { return min_ms == -1 && max_ms == -1; }
|
|
bool operator==(const PlayoutDelay& rhs) const {
|
|
return min_ms == rhs.min_ms && max_ms == rhs.max_ms;
|
|
}
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // COMMON_TYPES_H_
|