mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Fix circular dependencies in webrtc_common.
One reason for the circular deps is that common_types.h is a historical dumping ground for various structs and defines that are believed to be generally useful. I tried moving things out that did not appear to be used downstream (StreamCounters, RtpCounters etc) and moved the things that seemed used (RtpHeader + supporting structs) to a new file api/rtp_headers.h. This makes their place in the api more clear while moving out the things that don't belong in the API in the first place. I had to extract out typedefs.h from webrtc_common to resolve another circular dependency. I believe checks includes typedefs, but common depends on checks. Bug: webrtc:7745 Change-Id: I725d49616b1ec0cdc8b74be7c078f7a4d46f084b Reviewed-on: https://webrtc-review.googlesource.com/33001 Commit-Queue: Patrik Höglund <phoglund@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21295}
This commit is contained in:
parent
d5d0540b86
commit
3e113438b1
57 changed files with 559 additions and 316 deletions
1
.gn
1
.gn
|
@ -21,6 +21,7 @@ secondary_source = "//build/secondary/"
|
|||
# their includes checked for proper dependencies when you run either
|
||||
# "gn check" or "gn gen --check".
|
||||
check_targets = [
|
||||
":webrtc_common",
|
||||
"//api/*",
|
||||
"//audio/*",
|
||||
"//backup/*",
|
||||
|
|
15
BUILD.gn
15
BUILD.gn
|
@ -350,11 +350,24 @@ if (!build_with_chromium) {
|
|||
}
|
||||
}
|
||||
|
||||
rtc_source_set("typedefs") {
|
||||
sources = [
|
||||
"typedefs.h",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_static_library("webrtc_common") {
|
||||
sources = [
|
||||
"common_types.cc",
|
||||
"common_types.h",
|
||||
"typedefs.h",
|
||||
]
|
||||
deps = [
|
||||
":typedefs",
|
||||
"api:array_view",
|
||||
"api:optional",
|
||||
"rtc_base:checks",
|
||||
"rtc_base:deprecation",
|
||||
"rtc_base:stringutils",
|
||||
]
|
||||
|
||||
if (!build_with_chromium && is_clang) {
|
||||
|
|
|
@ -59,6 +59,8 @@ rtc_static_library("libjingle_peerconnection_api") {
|
|||
"proxy.h",
|
||||
"rtcerror.cc",
|
||||
"rtcerror.h",
|
||||
"rtp_headers.cc",
|
||||
"rtp_headers.h",
|
||||
"rtpparameters.cc",
|
||||
"rtpparameters.h",
|
||||
"rtpreceiverinterface.h",
|
||||
|
@ -84,6 +86,7 @@ rtc_static_library("libjingle_peerconnection_api") {
|
|||
]
|
||||
|
||||
deps = [
|
||||
":array_view",
|
||||
":optional",
|
||||
":rtc_stats_api",
|
||||
":video_frame_api",
|
||||
|
@ -93,10 +96,14 @@ rtc_static_library("libjingle_peerconnection_api") {
|
|||
# Basically, don't add stuff here. You might break sensitive downstream
|
||||
# targets like pnacl. API should not depend on anything outside of this
|
||||
# file, really. All these should arguably go away in time.
|
||||
"..:typedefs",
|
||||
"..:webrtc_common",
|
||||
"../modules/audio_processing:audio_processing_statistics",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:deprecation",
|
||||
"../rtc_base:rtc_base",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"../rtc_base:stringutils",
|
||||
]
|
||||
|
||||
# This is needed until bugs.webrtc.org/7504 is removed so this target can
|
||||
|
|
|
@ -29,7 +29,9 @@ rtc_source_set("audio_codecs_api") {
|
|||
"..:array_view",
|
||||
"..:optional",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:deprecation",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:sanitizer",
|
||||
]
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "api/optional.h"
|
||||
#include "api/ortc/packettransportinterface.h"
|
||||
#include "api/rtcerror.h"
|
||||
#include "api/rtp_headers.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
|
||||
namespace webrtc {
|
||||
|
|
62
api/rtp_headers.cc
Normal file
62
api/rtp_headers.cc
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (c) 2017 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.
|
||||
*/
|
||||
|
||||
#include "api/rtp_headers.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/stringutils.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
RTPHeaderExtension::RTPHeaderExtension()
|
||||
: hasTransmissionTimeOffset(false),
|
||||
transmissionTimeOffset(0),
|
||||
hasAbsoluteSendTime(false),
|
||||
absoluteSendTime(0),
|
||||
hasTransportSequenceNumber(false),
|
||||
transportSequenceNumber(0),
|
||||
hasAudioLevel(false),
|
||||
voiceActivity(false),
|
||||
audioLevel(0),
|
||||
hasVideoRotation(false),
|
||||
videoRotation(kVideoRotation_0),
|
||||
hasVideoContentType(false),
|
||||
videoContentType(VideoContentType::UNSPECIFIED),
|
||||
has_video_timing(false) {}
|
||||
|
||||
RTPHeaderExtension::RTPHeaderExtension(const RTPHeaderExtension& other) =
|
||||
default;
|
||||
|
||||
RTPHeaderExtension& RTPHeaderExtension::operator=(
|
||||
const RTPHeaderExtension& other) = default;
|
||||
|
||||
RTPHeader::RTPHeader()
|
||||
: markerBit(false),
|
||||
payloadType(0),
|
||||
sequenceNumber(0),
|
||||
timestamp(0),
|
||||
ssrc(0),
|
||||
numCSRCs(0),
|
||||
arrOfCSRCs(),
|
||||
paddingLength(0),
|
||||
headerLength(0),
|
||||
payload_type_frequency(0),
|
||||
extension() {}
|
||||
|
||||
RTPHeader::RTPHeader(const RTPHeader& other) = default;
|
||||
|
||||
RTPHeader& RTPHeader::operator=(const RTPHeader& other) = default;
|
||||
|
||||
} // namespace webrtc
|
178
api/rtp_headers.h
Normal file
178
api/rtp_headers.h
Normal file
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
* Copyright (c) 2017 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 API_RTP_HEADERS_H_
|
||||
#define API_RTP_HEADERS_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "api/optional.h"
|
||||
#include "api/video/video_content_type.h"
|
||||
#include "api/video/video_rotation.h"
|
||||
#include "api/video/video_timing.h"
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/deprecation.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "typedefs.h" // NOLINT(build/include)
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// Class to represent the value of RTP header extensions that are
|
||||
// variable-length strings (e.g., RtpStreamId and RtpMid).
|
||||
// Unlike std::string, it can be copied with memcpy and cleared with memset.
|
||||
//
|
||||
// Empty value represents unset header extension (use empty() to query).
|
||||
class StringRtpHeaderExtension {
|
||||
public:
|
||||
// String RTP header extensions are limited to 16 bytes because it is the
|
||||
// maximum length that can be encoded with one-byte header extensions.
|
||||
static constexpr size_t kMaxSize = 16;
|
||||
|
||||
static bool IsLegalName(rtc::ArrayView<const char> name);
|
||||
|
||||
StringRtpHeaderExtension() { value_[0] = 0; }
|
||||
explicit StringRtpHeaderExtension(rtc::ArrayView<const char> value) {
|
||||
Set(value.data(), value.size());
|
||||
}
|
||||
StringRtpHeaderExtension(const StringRtpHeaderExtension&) = default;
|
||||
StringRtpHeaderExtension& operator=(const StringRtpHeaderExtension&) =
|
||||
default;
|
||||
|
||||
bool empty() const { return value_[0] == 0; }
|
||||
const char* data() const { return value_; }
|
||||
size_t size() const { return strnlen(value_, kMaxSize); }
|
||||
|
||||
void Set(rtc::ArrayView<const uint8_t> value) {
|
||||
Set(reinterpret_cast<const char*>(value.data()), value.size());
|
||||
}
|
||||
void Set(const char* data, size_t size);
|
||||
|
||||
friend bool operator==(const StringRtpHeaderExtension& lhs,
|
||||
const StringRtpHeaderExtension& rhs) {
|
||||
return strncmp(lhs.value_, rhs.value_, kMaxSize) == 0;
|
||||
}
|
||||
friend bool operator!=(const StringRtpHeaderExtension& lhs,
|
||||
const StringRtpHeaderExtension& rhs) {
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
private:
|
||||
char value_[kMaxSize];
|
||||
};
|
||||
|
||||
// StreamId represents RtpStreamId which is a string.
|
||||
typedef StringRtpHeaderExtension StreamId;
|
||||
|
||||
// Mid represents RtpMid which is a string.
|
||||
typedef StringRtpHeaderExtension Mid;
|
||||
|
||||
struct RTPHeaderExtension {
|
||||
RTPHeaderExtension();
|
||||
RTPHeaderExtension(const RTPHeaderExtension& other);
|
||||
RTPHeaderExtension& operator=(const RTPHeaderExtension& other);
|
||||
|
||||
bool hasTransmissionTimeOffset;
|
||||
int32_t transmissionTimeOffset;
|
||||
bool hasAbsoluteSendTime;
|
||||
uint32_t absoluteSendTime;
|
||||
bool hasTransportSequenceNumber;
|
||||
uint16_t transportSequenceNumber;
|
||||
|
||||
// Audio Level includes both level in dBov and voiced/unvoiced bit. See:
|
||||
// https://datatracker.ietf.org/doc/draft-lennox-avt-rtp-audio-level-exthdr/
|
||||
bool hasAudioLevel;
|
||||
bool voiceActivity;
|
||||
uint8_t audioLevel;
|
||||
|
||||
// For Coordination of Video Orientation. See
|
||||
// http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/
|
||||
// ts_126114v120700p.pdf
|
||||
bool hasVideoRotation;
|
||||
VideoRotation videoRotation;
|
||||
|
||||
// TODO(ilnik): Refactor this and one above to be rtc::Optional() and remove
|
||||
// a corresponding bool flag.
|
||||
bool hasVideoContentType;
|
||||
VideoContentType videoContentType;
|
||||
|
||||
bool has_video_timing;
|
||||
VideoSendTiming video_timing;
|
||||
|
||||
PlayoutDelay playout_delay = {-1, -1};
|
||||
|
||||
// For identification of a stream when ssrc is not signaled. See
|
||||
// https://tools.ietf.org/html/draft-ietf-avtext-rid-09
|
||||
// TODO(danilchap): Update url from draft to release version.
|
||||
StreamId stream_id;
|
||||
StreamId repaired_stream_id;
|
||||
|
||||
// For identifying the media section used to interpret this RTP packet. See
|
||||
// https://tools.ietf.org/html/draft-ietf-mmusic-sdp-bundle-negotiation-38
|
||||
Mid mid;
|
||||
};
|
||||
|
||||
struct RTPHeader {
|
||||
RTPHeader();
|
||||
RTPHeader(const RTPHeader& other);
|
||||
RTPHeader& operator=(const RTPHeader& other);
|
||||
|
||||
bool markerBit;
|
||||
uint8_t payloadType;
|
||||
uint16_t sequenceNumber;
|
||||
uint32_t timestamp;
|
||||
uint32_t ssrc;
|
||||
uint8_t numCSRCs;
|
||||
uint32_t arrOfCSRCs[kRtpCsrcSize];
|
||||
size_t paddingLength;
|
||||
size_t headerLength;
|
||||
int payload_type_frequency;
|
||||
RTPHeaderExtension extension;
|
||||
};
|
||||
|
||||
// RTCP mode to use. Compound mode is described by RFC 4585 and reduced-size
|
||||
// RTCP mode is described by RFC 5506.
|
||||
enum class RtcpMode { kOff, kCompound, kReducedSize };
|
||||
|
||||
enum NetworkState {
|
||||
kNetworkUp,
|
||||
kNetworkDown,
|
||||
};
|
||||
|
||||
struct RtpKeepAliveConfig final {
|
||||
// If no packet has been sent for |timeout_interval_ms|, send a keep-alive
|
||||
// packet. The keep-alive packet is an empty (no payload) RTP packet with a
|
||||
// payload type of 20 as long as the other end has not negotiated the use of
|
||||
// this value. If this value has already been negotiated, then some other
|
||||
// unused static payload type from table 5 of RFC 3551 shall be used and set
|
||||
// in |payload_type|.
|
||||
int64_t timeout_interval_ms = -1;
|
||||
uint8_t payload_type = 20;
|
||||
|
||||
bool operator==(const RtpKeepAliveConfig& o) const {
|
||||
return timeout_interval_ms == o.timeout_interval_ms &&
|
||||
payload_type == o.payload_type;
|
||||
}
|
||||
bool operator!=(const RtpKeepAliveConfig& o) const { return !(*this == o); }
|
||||
};
|
||||
|
||||
// Currently only VP8/VP9 specific.
|
||||
struct RtpPayloadState {
|
||||
int16_t picture_id = -1;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // API_RTP_HEADERS_H_
|
|
@ -26,6 +26,7 @@ rtc_source_set("video_codecs_api") {
|
|||
"..:optional",
|
||||
"..:video_frame_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../common_video",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
|
|
|
@ -21,6 +21,7 @@ rtc_static_library("audio_frame_operations") {
|
|||
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../modules:module_api",
|
||||
"../../modules/audio_coding:audio_format_conversion",
|
||||
"../../rtc_base:checks",
|
||||
|
|
|
@ -24,6 +24,7 @@ rtc_source_set("call_interfaces") {
|
|||
":rtp_interfaces",
|
||||
":video_stream_api",
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:audio_mixer_api",
|
||||
"../api:libjingle_peerconnection_api",
|
||||
"../api:optional",
|
||||
|
@ -70,6 +71,7 @@ rtc_source_set("rtp_receiver") {
|
|||
":rtp_interfaces",
|
||||
"..:webrtc_common",
|
||||
"../api:array_view",
|
||||
"../api:libjingle_peerconnection_api",
|
||||
"../api:optional",
|
||||
"../modules/rtp_rtcp",
|
||||
"../modules/rtp_rtcp:rtp_rtcp_format",
|
||||
|
@ -176,6 +178,7 @@ rtc_source_set("video_stream_api") {
|
|||
"../api:optional",
|
||||
"../api:transport_api",
|
||||
"../common_video:common_video",
|
||||
"../modules/rtp_rtcp:rtp_rtcp_format",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
]
|
||||
}
|
||||
|
@ -204,6 +207,7 @@ if (rtc_include_tests) {
|
|||
":rtp_sender",
|
||||
"..:webrtc_common",
|
||||
"../api:array_view",
|
||||
"../api:libjingle_peerconnection_api",
|
||||
"../api:mock_audio_mixer",
|
||||
"../api/audio_codecs:builtin_audio_decoder_factory",
|
||||
"../logging:rtc_event_log_api",
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/rtp_headers.h"
|
||||
#include "api/call/transport.h"
|
||||
#include "api/rtpparameters.h"
|
||||
#include "call/rtp_packet_sink_interface.h"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "call/rtcp_demuxer.h"
|
||||
|
||||
#include "api/rtp_headers.h"
|
||||
#include "call/rtcp_packet_sink_interface.h"
|
||||
#include "call/rtp_rtcp_demuxer_helper.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
#include "api/rtp_headers.h"
|
||||
#include "call/rtcp_packet_sink_interface.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/bye.h"
|
||||
|
|
|
@ -16,12 +16,16 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/rtp_headers.h"
|
||||
#include "api/call/transport.h"
|
||||
#include "api/rtpparameters.h"
|
||||
#include "api/video/video_content_type.h"
|
||||
#include "api/video/video_timing.h"
|
||||
#include "call/rtp_config.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "common_video/include/frame_callback.h"
|
||||
#include "media/base/videosinkinterface.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "rtc_base/platform_file.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
|
|
@ -18,12 +18,14 @@
|
|||
|
||||
#include "api/call/transport.h"
|
||||
#include "api/rtpparameters.h"
|
||||
#include "api/rtp_headers.h"
|
||||
#include "call/rtp_config.h"
|
||||
#include "call/video_config.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "common_video/include/frame_callback.h"
|
||||
#include "media/base/videosinkinterface.h"
|
||||
#include "media/base/videosourceinterface.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "rtc_base/platform_file.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
|
|
@ -62,6 +62,7 @@ rtc_static_library("common_audio") {
|
|||
deps = [
|
||||
":sinc_resampler",
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:optional",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:gtest_prod",
|
||||
|
@ -223,6 +224,7 @@ rtc_source_set("common_audio_c") {
|
|||
":common_audio_c_arm_asm",
|
||||
":common_audio_cc",
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:compile_assert_c",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
|
@ -241,6 +243,7 @@ rtc_source_set("common_audio_cc") {
|
|||
public_configs = [ ":common_audio_config" ]
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"../system_wrappers",
|
||||
]
|
||||
|
@ -252,6 +255,7 @@ rtc_source_set("sinc_resampler") {
|
|||
]
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../rtc_base:gtest_prod",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"../system_wrappers",
|
||||
|
@ -447,6 +451,7 @@ if (rtc_include_tests) {
|
|||
":fir_filter_factory",
|
||||
":sinc_resampler",
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"../rtc_base:rtc_base_tests_utils",
|
||||
|
|
|
@ -20,66 +20,6 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
StreamDataCounters::StreamDataCounters() : first_packet_time_ms(-1) {}
|
||||
|
||||
constexpr size_t StreamId::kMaxSize;
|
||||
|
||||
bool StreamId::IsLegalName(rtc::ArrayView<const char> name) {
|
||||
return (name.size() <= kMaxSize && name.size() > 0 &&
|
||||
std::all_of(name.data(), name.data() + name.size(), isalnum));
|
||||
}
|
||||
|
||||
void StreamId::Set(const char* data, size_t size) {
|
||||
// If |data| contains \0, the stream id size might become less than |size|.
|
||||
RTC_CHECK_LE(size, kMaxSize);
|
||||
memcpy(value_, data, size);
|
||||
if (size < kMaxSize)
|
||||
value_[size] = 0;
|
||||
}
|
||||
|
||||
// StreamId is used as member of RTPHeader that is sometimes copied with memcpy
|
||||
// and thus assume trivial destructibility.
|
||||
static_assert(std::is_trivially_destructible<StreamId>::value, "");
|
||||
|
||||
RTPHeaderExtension::RTPHeaderExtension()
|
||||
: hasTransmissionTimeOffset(false),
|
||||
transmissionTimeOffset(0),
|
||||
hasAbsoluteSendTime(false),
|
||||
absoluteSendTime(0),
|
||||
hasTransportSequenceNumber(false),
|
||||
transportSequenceNumber(0),
|
||||
hasAudioLevel(false),
|
||||
voiceActivity(false),
|
||||
audioLevel(0),
|
||||
hasVideoRotation(false),
|
||||
videoRotation(kVideoRotation_0),
|
||||
hasVideoContentType(false),
|
||||
videoContentType(VideoContentType::UNSPECIFIED),
|
||||
has_video_timing(false) {}
|
||||
|
||||
RTPHeaderExtension::RTPHeaderExtension(const RTPHeaderExtension& other) =
|
||||
default;
|
||||
|
||||
RTPHeaderExtension& RTPHeaderExtension::operator=(
|
||||
const RTPHeaderExtension& other) = default;
|
||||
|
||||
RTPHeader::RTPHeader()
|
||||
: markerBit(false),
|
||||
payloadType(0),
|
||||
sequenceNumber(0),
|
||||
timestamp(0),
|
||||
ssrc(0),
|
||||
numCSRCs(0),
|
||||
arrOfCSRCs(),
|
||||
paddingLength(0),
|
||||
headerLength(0),
|
||||
payload_type_frequency(0),
|
||||
extension() {}
|
||||
|
||||
RTPHeader::RTPHeader(const RTPHeader& other) = default;
|
||||
|
||||
RTPHeader& RTPHeader::operator=(const RTPHeader& other) = default;
|
||||
|
||||
VideoCodec::VideoCodec()
|
||||
: codecType(kVideoCodecUnknown),
|
||||
plName(),
|
||||
|
|
241
common_types.h
241
common_types.h
|
@ -19,9 +19,6 @@
|
|||
|
||||
#include "api/array_view.h"
|
||||
#include "api/optional.h"
|
||||
#include "api/video/video_content_type.h"
|
||||
#include "api/video/video_rotation.h"
|
||||
#include "api/video/video_timing.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/deprecation.h"
|
||||
#include "typedefs.h" // NOLINT(build/include)
|
||||
|
@ -685,244 +682,6 @@ struct PlayoutDelay {
|
|||
int max_ms;
|
||||
};
|
||||
|
||||
// Class to represent the value of RTP header extensions that are
|
||||
// variable-length strings (e.g., RtpStreamId and RtpMid).
|
||||
// Unlike std::string, it can be copied with memcpy and cleared with memset.
|
||||
//
|
||||
// Empty value represents unset header extension (use empty() to query).
|
||||
class StringRtpHeaderExtension {
|
||||
public:
|
||||
// String RTP header extensions are limited to 16 bytes because it is the
|
||||
// maximum length that can be encoded with one-byte header extensions.
|
||||
static constexpr size_t kMaxSize = 16;
|
||||
|
||||
static bool IsLegalName(rtc::ArrayView<const char> name);
|
||||
|
||||
StringRtpHeaderExtension() { value_[0] = 0; }
|
||||
explicit StringRtpHeaderExtension(rtc::ArrayView<const char> value) {
|
||||
Set(value.data(), value.size());
|
||||
}
|
||||
StringRtpHeaderExtension(const StringRtpHeaderExtension&) = default;
|
||||
StringRtpHeaderExtension& operator=(const StringRtpHeaderExtension&) =
|
||||
default;
|
||||
|
||||
bool empty() const { return value_[0] == 0; }
|
||||
const char* data() const { return value_; }
|
||||
size_t size() const { return strnlen(value_, kMaxSize); }
|
||||
|
||||
void Set(rtc::ArrayView<const uint8_t> value) {
|
||||
Set(reinterpret_cast<const char*>(value.data()), value.size());
|
||||
}
|
||||
void Set(const char* data, size_t size);
|
||||
|
||||
friend bool operator==(const StringRtpHeaderExtension& lhs,
|
||||
const StringRtpHeaderExtension& rhs) {
|
||||
return strncmp(lhs.value_, rhs.value_, kMaxSize) == 0;
|
||||
}
|
||||
friend bool operator!=(const StringRtpHeaderExtension& lhs,
|
||||
const StringRtpHeaderExtension& rhs) {
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
private:
|
||||
char value_[kMaxSize];
|
||||
};
|
||||
|
||||
// StreamId represents RtpStreamId which is a string.
|
||||
typedef StringRtpHeaderExtension StreamId;
|
||||
|
||||
// Mid represents RtpMid which is a string.
|
||||
typedef StringRtpHeaderExtension Mid;
|
||||
|
||||
struct RTPHeaderExtension {
|
||||
RTPHeaderExtension();
|
||||
RTPHeaderExtension(const RTPHeaderExtension& other);
|
||||
RTPHeaderExtension& operator=(const RTPHeaderExtension& other);
|
||||
|
||||
bool hasTransmissionTimeOffset;
|
||||
int32_t transmissionTimeOffset;
|
||||
bool hasAbsoluteSendTime;
|
||||
uint32_t absoluteSendTime;
|
||||
bool hasTransportSequenceNumber;
|
||||
uint16_t transportSequenceNumber;
|
||||
|
||||
// Audio Level includes both level in dBov and voiced/unvoiced bit. See:
|
||||
// https://datatracker.ietf.org/doc/draft-lennox-avt-rtp-audio-level-exthdr/
|
||||
bool hasAudioLevel;
|
||||
bool voiceActivity;
|
||||
uint8_t audioLevel;
|
||||
|
||||
// For Coordination of Video Orientation. See
|
||||
// http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/
|
||||
// ts_126114v120700p.pdf
|
||||
bool hasVideoRotation;
|
||||
VideoRotation videoRotation;
|
||||
|
||||
// TODO(ilnik): Refactor this and one above to be rtc::Optional() and remove
|
||||
// a corresponding bool flag.
|
||||
bool hasVideoContentType;
|
||||
VideoContentType videoContentType;
|
||||
|
||||
bool has_video_timing;
|
||||
VideoSendTiming video_timing;
|
||||
|
||||
PlayoutDelay playout_delay = {-1, -1};
|
||||
|
||||
// For identification of a stream when ssrc is not signaled. See
|
||||
// https://tools.ietf.org/html/draft-ietf-avtext-rid-09
|
||||
// TODO(danilchap): Update url from draft to release version.
|
||||
StreamId stream_id;
|
||||
StreamId repaired_stream_id;
|
||||
|
||||
// For identifying the media section used to interpret this RTP packet. See
|
||||
// https://tools.ietf.org/html/draft-ietf-mmusic-sdp-bundle-negotiation-38
|
||||
Mid mid;
|
||||
};
|
||||
|
||||
struct RTPHeader {
|
||||
RTPHeader();
|
||||
RTPHeader(const RTPHeader& other);
|
||||
RTPHeader& operator=(const RTPHeader& other);
|
||||
|
||||
bool markerBit;
|
||||
uint8_t payloadType;
|
||||
uint16_t sequenceNumber;
|
||||
uint32_t timestamp;
|
||||
uint32_t ssrc;
|
||||
uint8_t numCSRCs;
|
||||
uint32_t arrOfCSRCs[kRtpCsrcSize];
|
||||
size_t paddingLength;
|
||||
size_t headerLength;
|
||||
int payload_type_frequency;
|
||||
RTPHeaderExtension extension;
|
||||
};
|
||||
|
||||
struct RtpPacketCounter {
|
||||
RtpPacketCounter()
|
||||
: header_bytes(0), payload_bytes(0), padding_bytes(0), packets(0) {}
|
||||
|
||||
void Add(const RtpPacketCounter& other) {
|
||||
header_bytes += other.header_bytes;
|
||||
payload_bytes += other.payload_bytes;
|
||||
padding_bytes += other.padding_bytes;
|
||||
packets += other.packets;
|
||||
}
|
||||
|
||||
void Subtract(const RtpPacketCounter& other) {
|
||||
RTC_DCHECK_GE(header_bytes, other.header_bytes);
|
||||
header_bytes -= other.header_bytes;
|
||||
RTC_DCHECK_GE(payload_bytes, other.payload_bytes);
|
||||
payload_bytes -= other.payload_bytes;
|
||||
RTC_DCHECK_GE(padding_bytes, other.padding_bytes);
|
||||
padding_bytes -= other.padding_bytes;
|
||||
RTC_DCHECK_GE(packets, other.packets);
|
||||
packets -= other.packets;
|
||||
}
|
||||
|
||||
void AddPacket(size_t packet_length, const RTPHeader& header) {
|
||||
++packets;
|
||||
header_bytes += header.headerLength;
|
||||
padding_bytes += header.paddingLength;
|
||||
payload_bytes +=
|
||||
packet_length - (header.headerLength + header.paddingLength);
|
||||
}
|
||||
|
||||
size_t TotalBytes() const {
|
||||
return header_bytes + payload_bytes + padding_bytes;
|
||||
}
|
||||
|
||||
size_t header_bytes; // Number of bytes used by RTP headers.
|
||||
size_t payload_bytes; // Payload bytes, excluding RTP headers and padding.
|
||||
size_t padding_bytes; // Number of padding bytes.
|
||||
uint32_t packets; // Number of packets.
|
||||
};
|
||||
|
||||
// Data usage statistics for a (rtp) stream.
|
||||
struct StreamDataCounters {
|
||||
StreamDataCounters();
|
||||
|
||||
void Add(const StreamDataCounters& other) {
|
||||
transmitted.Add(other.transmitted);
|
||||
retransmitted.Add(other.retransmitted);
|
||||
fec.Add(other.fec);
|
||||
if (other.first_packet_time_ms != -1 &&
|
||||
(other.first_packet_time_ms < first_packet_time_ms ||
|
||||
first_packet_time_ms == -1)) {
|
||||
// Use oldest time.
|
||||
first_packet_time_ms = other.first_packet_time_ms;
|
||||
}
|
||||
}
|
||||
|
||||
void Subtract(const StreamDataCounters& other) {
|
||||
transmitted.Subtract(other.transmitted);
|
||||
retransmitted.Subtract(other.retransmitted);
|
||||
fec.Subtract(other.fec);
|
||||
if (other.first_packet_time_ms != -1 &&
|
||||
(other.first_packet_time_ms > first_packet_time_ms ||
|
||||
first_packet_time_ms == -1)) {
|
||||
// Use youngest time.
|
||||
first_packet_time_ms = other.first_packet_time_ms;
|
||||
}
|
||||
}
|
||||
|
||||
int64_t TimeSinceFirstPacketInMs(int64_t now_ms) const {
|
||||
return (first_packet_time_ms == -1) ? -1 : (now_ms - first_packet_time_ms);
|
||||
}
|
||||
|
||||
// Returns the number of bytes corresponding to the actual media payload (i.e.
|
||||
// RTP headers, padding, retransmissions and fec packets are excluded).
|
||||
// Note this function does not have meaning for an RTX stream.
|
||||
size_t MediaPayloadBytes() const {
|
||||
return transmitted.payload_bytes - retransmitted.payload_bytes -
|
||||
fec.payload_bytes;
|
||||
}
|
||||
|
||||
int64_t first_packet_time_ms; // Time when first packet is sent/received.
|
||||
RtpPacketCounter transmitted; // Number of transmitted packets/bytes.
|
||||
RtpPacketCounter retransmitted; // Number of retransmitted packets/bytes.
|
||||
RtpPacketCounter fec; // Number of redundancy packets/bytes.
|
||||
};
|
||||
|
||||
// Callback, called whenever byte/packet counts have been updated.
|
||||
class StreamDataCountersCallback {
|
||||
public:
|
||||
virtual ~StreamDataCountersCallback() {}
|
||||
|
||||
virtual void DataCountersUpdated(const StreamDataCounters& counters,
|
||||
uint32_t ssrc) = 0;
|
||||
};
|
||||
|
||||
// RTCP mode to use. Compound mode is described by RFC 4585 and reduced-size
|
||||
// RTCP mode is described by RFC 5506.
|
||||
enum class RtcpMode { kOff, kCompound, kReducedSize };
|
||||
|
||||
enum NetworkState {
|
||||
kNetworkUp,
|
||||
kNetworkDown,
|
||||
};
|
||||
|
||||
struct RtpKeepAliveConfig final {
|
||||
// If no packet has been sent for |timeout_interval_ms|, send a keep-alive
|
||||
// packet. The keep-alive packet is an empty (no payload) RTP packet with a
|
||||
// payload type of 20 as long as the other end has not negotiated the use of
|
||||
// this value. If this value has already been negotiated, then some other
|
||||
// unused static payload type from table 5 of RFC 3551 shall be used and set
|
||||
// in |payload_type|.
|
||||
int64_t timeout_interval_ms = -1;
|
||||
uint8_t payload_type = 20;
|
||||
|
||||
bool operator==(const RtpKeepAliveConfig& o) const {
|
||||
return timeout_interval_ms == o.timeout_interval_ms &&
|
||||
payload_type == o.payload_type;
|
||||
}
|
||||
bool operator!=(const RtpKeepAliveConfig& o) const { return !(*this == o); }
|
||||
};
|
||||
|
||||
// Currently only VP8/VP9 specific.
|
||||
struct RtpPayloadState {
|
||||
int16_t picture_id = -1;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // COMMON_TYPES_H_
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
// to refactor and clean up related interfaces, at which point it
|
||||
// should be moved to somewhere under api/.
|
||||
|
||||
#include "api/rtp_headers.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "typedefs.h" // NOLINT(build/include)
|
||||
|
||||
|
|
|
@ -509,6 +509,7 @@ if (is_linux || is_win) {
|
|||
deps = [
|
||||
"../api:video_frame_api_i420",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:stringutils",
|
||||
]
|
||||
if (is_win) {
|
||||
sources += [
|
||||
|
@ -569,6 +570,7 @@ if (is_linux || is_win) {
|
|||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"../rtc_base:stringutils",
|
||||
"../rtc_tools:command_line_parser",
|
||||
]
|
||||
if (!build_with_chromium && is_clang) {
|
||||
|
@ -727,6 +729,7 @@ if (!build_with_chromium) {
|
|||
"../rtc_base:checks",
|
||||
"../rtc_base:rtc_base",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"../rtc_base:stringutils",
|
||||
"../system_wrappers:field_trial_default",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@ rtc_source_set("rtc_event_log_api") {
|
|||
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:array_view",
|
||||
"../api:libjingle_logging_api",
|
||||
"../api:libjingle_peerconnection_api",
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/rtp_headers.h"
|
||||
#include "api/rtpparameters.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ rtc_static_library("rtc_media_base") {
|
|||
deps = [
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:sanitizer",
|
||||
"../rtc_base:stringutils",
|
||||
]
|
||||
public_deps = []
|
||||
sources = [
|
||||
|
@ -133,6 +134,7 @@ rtc_static_library("rtc_audio_video") {
|
|||
"../call:call_interfaces",
|
||||
"../modules/video_coding:video_coding_utility",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:stringutils",
|
||||
"../system_wrappers:field_trial_api",
|
||||
"../system_wrappers:metrics_api",
|
||||
"//third_party/libyuv",
|
||||
|
@ -347,6 +349,7 @@ if (rtc_include_tests) {
|
|||
"../modules/video_coding:video_coding_utility",
|
||||
"../p2p:rtc_p2p",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:stringutils",
|
||||
]
|
||||
sources = [
|
||||
"base/fakemediaengine.h",
|
||||
|
@ -438,6 +441,7 @@ if (rtc_include_tests) {
|
|||
"../pc:rtc_pc",
|
||||
"../pc:rtc_pc_base",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:stringutils",
|
||||
"../test:field_trial",
|
||||
]
|
||||
sources = [
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "api/optional.h"
|
||||
#include "api/rtpparameters.h"
|
||||
#include "api/rtpreceiverinterface.h"
|
||||
#include "api/video/video_content_type.h"
|
||||
#include "api/video/video_timing.h"
|
||||
#include "call/video_config.h"
|
||||
#include "media/base/codec.h"
|
||||
|
|
|
@ -34,6 +34,7 @@ rtc_source_set("module_api_public") {
|
|||
]
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:optional",
|
||||
]
|
||||
}
|
||||
|
@ -46,9 +47,12 @@ rtc_source_set("module_api") {
|
|||
deps = [
|
||||
":module_api_public",
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:libjingle_peerconnection_api",
|
||||
"../api:optional",
|
||||
"../api:video_frame_api",
|
||||
"../api:video_frame_api_i420",
|
||||
"../rtc_base:deprecation",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"video_coding:codec_globals_headers",
|
||||
]
|
||||
|
|
|
@ -65,6 +65,7 @@ rtc_static_library("rent_a_codec") {
|
|||
"acm2/rent_a_codec.h",
|
||||
]
|
||||
deps = [
|
||||
"../../:typedefs",
|
||||
"../../rtc_base:checks",
|
||||
"../../api:array_view",
|
||||
"../../api:optional",
|
||||
|
@ -96,6 +97,7 @@ rtc_source_set("audio_coding_module_typedefs") {
|
|||
deps = [
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -132,6 +134,8 @@ rtc_static_library("audio_coding") {
|
|||
}
|
||||
|
||||
deps = audio_coding_deps + [
|
||||
"../../rtc_base:deprecation",
|
||||
"../../:typedefs",
|
||||
"../../rtc_base:checks",
|
||||
"../../system_wrappers:metrics_api",
|
||||
"..:module_api",
|
||||
|
@ -177,6 +181,7 @@ rtc_static_library("cng") {
|
|||
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:array_view",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../common_audio",
|
||||
|
@ -241,6 +246,7 @@ rtc_source_set("g711_c") {
|
|||
]
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -282,6 +288,7 @@ rtc_source_set("g722_c") {
|
|||
]
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -461,6 +468,7 @@ rtc_source_set("ilbc_c") {
|
|||
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:checks",
|
||||
|
@ -569,6 +577,7 @@ rtc_static_library("isac_c") {
|
|||
deps = [
|
||||
":isac_common",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:compile_assert_c",
|
||||
|
@ -675,6 +684,7 @@ rtc_source_set("isac_fix_c") {
|
|||
deps = [
|
||||
":isac_common",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:checks",
|
||||
|
@ -799,6 +809,7 @@ rtc_source_set("pcm16b_c") {
|
|||
public_configs = [ ":pcm16b_config" ]
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -856,6 +867,7 @@ rtc_source_set("webrtc_opus_c") {
|
|||
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
]
|
||||
|
@ -1042,6 +1054,8 @@ rtc_static_library("neteq") {
|
|||
":neteq_decoder_enum",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:libjingle_peerconnection_api",
|
||||
"../../api:optional",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../common_audio",
|
||||
|
@ -1084,6 +1098,8 @@ rtc_source_set("neteq_tools_minimal") {
|
|||
":neteq",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:libjingle_peerconnection_api",
|
||||
"../../api:optional",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../api/audio_codecs:builtin_audio_decoder_factory",
|
||||
|
@ -1121,7 +1137,9 @@ rtc_source_set("neteq_test_tools") {
|
|||
":pcm16b",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:array_view",
|
||||
"../../api:libjingle_peerconnection_api",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
|
@ -1169,6 +1187,7 @@ rtc_source_set("neteq_tools") {
|
|||
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:array_view",
|
||||
"../../api:optional",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
|
@ -1195,6 +1214,7 @@ rtc_source_set("neteq_input_audio_tools") {
|
|||
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
|
@ -1308,6 +1328,7 @@ if (rtc_include_tests) {
|
|||
":pcm16b_c",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:optional",
|
||||
"../../api/audio_codecs:builtin_audio_decoder_factory",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
|
@ -1339,6 +1360,7 @@ if (rtc_include_tests) {
|
|||
":neteq_test_support",
|
||||
":neteq_test_tools",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api/audio_codecs/opus:audio_encoder_opus",
|
||||
"../../rtc_base:protobuf_utils",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
|
@ -1411,6 +1433,7 @@ if (rtc_include_tests) {
|
|||
":audio_coding_module_typedefs",
|
||||
":audio_format_conversion",
|
||||
"..:module_api",
|
||||
"../../:typedefs",
|
||||
"../../:webrtc_common",
|
||||
"../../api:optional",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
|
@ -1441,6 +1464,7 @@ if (rtc_include_tests) {
|
|||
":audio_coding",
|
||||
":audio_format_conversion",
|
||||
"..:module_api",
|
||||
"../../:typedefs",
|
||||
"../../:webrtc_common",
|
||||
"../../api:optional",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
|
@ -1519,6 +1543,7 @@ if (rtc_include_tests) {
|
|||
defines = []
|
||||
deps = [
|
||||
"..:module_api",
|
||||
"../../:typedefs",
|
||||
"../../rtc_base:checks",
|
||||
]
|
||||
sources = [
|
||||
|
@ -1567,7 +1592,9 @@ if (rtc_include_tests) {
|
|||
rtc_test("audio_codec_speed_tests") {
|
||||
testonly = true
|
||||
defines = []
|
||||
deps = []
|
||||
deps = [
|
||||
"../../:typedefs",
|
||||
]
|
||||
sources = [
|
||||
"codecs/isac/fix/test/isac_speed_test.cc",
|
||||
"codecs/opus/opus_speed_test.cc",
|
||||
|
@ -1626,6 +1653,7 @@ if (rtc_include_tests) {
|
|||
":pcm16b",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../api/audio_codecs:builtin_audio_decoder_factory",
|
||||
"../../rtc_base:checks",
|
||||
|
@ -1653,6 +1681,7 @@ if (rtc_include_tests) {
|
|||
":neteq_test_tools",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api/audio_codecs:builtin_audio_decoder_factory",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
|
@ -1665,6 +1694,7 @@ if (rtc_include_tests) {
|
|||
testonly = true
|
||||
|
||||
deps = audio_coding_deps + [
|
||||
"../../:typedefs",
|
||||
":audio_coding",
|
||||
":neteq_input_audio_tools",
|
||||
"../../api/audio_codecs/g711:audio_encoder_g711",
|
||||
|
@ -1688,6 +1718,7 @@ if (rtc_include_tests) {
|
|||
testonly = true
|
||||
|
||||
deps = audio_coding_deps + [
|
||||
"../../:typedefs",
|
||||
"../../system_wrappers:system_wrappers_default",
|
||||
"../rtp_rtcp:rtp_rtcp_format",
|
||||
"../../api:array_view",
|
||||
|
@ -1768,6 +1799,7 @@ if (rtc_include_tests) {
|
|||
":neteq",
|
||||
":neteq_test_support",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../system_wrappers:system_wrappers_default",
|
||||
"../../test:test_support",
|
||||
|
@ -1915,6 +1947,7 @@ if (rtc_include_tests) {
|
|||
deps = [
|
||||
":g722",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -2098,6 +2131,7 @@ if (rtc_include_tests) {
|
|||
":webrtc_opus",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../api/audio_codecs:builtin_audio_decoder_factory",
|
||||
"../../api/audio_codecs:builtin_audio_encoder_factory",
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "api/audio_codecs/audio_decoder.h"
|
||||
#include "api/optional.h"
|
||||
#include "api/rtp_headers.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "modules/audio_coding/neteq/neteq_decoder_enum.h"
|
||||
#include "rtc_base/constructormagic.h"
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <list>
|
||||
#include <memory>
|
||||
|
||||
#include "api/rtp_headers.h" // NOLINT(build/include)
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "rtc_base/constructormagic.h"
|
||||
#include "typedefs.h" // NOLINT(build/include)
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#ifndef MODULES_AUDIO_CODING_NETEQ_TOOLS_RTP_GENERATOR_H_
|
||||
#define MODULES_AUDIO_CODING_NETEQ_TOOLS_RTP_GENERATOR_H_
|
||||
|
||||
#include "api/rtp_headers.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "rtc_base/constructormagic.h"
|
||||
#include "typedefs.h" // NOLINT(build/include)
|
||||
|
|
|
@ -100,6 +100,7 @@ rtc_source_set("audio_device_generic") {
|
|||
deps = [
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:array_view",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:checks",
|
||||
|
|
|
@ -36,6 +36,7 @@ rtc_static_library("audio_mixer_impl") {
|
|||
":audio_frame_manipulator",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:array_view",
|
||||
"../../api:audio_mixer_api",
|
||||
"../../audio/utility:audio_frame_operations",
|
||||
|
|
|
@ -226,10 +226,12 @@ rtc_static_library("audio_processing") {
|
|||
":audio_processing_statistics",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:array_view",
|
||||
"../../api:optional",
|
||||
"../../audio/utility:audio_frame_operations",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:deprecation",
|
||||
"../../rtc_base:gtest_prod",
|
||||
"../../rtc_base:protobuf_utils",
|
||||
"../../rtc_base:sanitizer",
|
||||
|
@ -341,6 +343,7 @@ rtc_source_set("audio_processing_c") {
|
|||
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
|
@ -371,6 +374,7 @@ rtc_source_set("apm_logging") {
|
|||
"../../api:array_view",
|
||||
"../../common_audio:common_audio",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:stringutils",
|
||||
]
|
||||
defines = []
|
||||
if (apm_debug_dump) {
|
||||
|
@ -404,6 +408,7 @@ rtc_source_set("aec_core") {
|
|||
":apm_logging",
|
||||
":audio_processing_statistics",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../common_audio:common_audio",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
|
@ -582,6 +587,7 @@ if (rtc_include_tests) {
|
|||
":audioproc_test_utils",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:array_view",
|
||||
"../../api:optional",
|
||||
"../../common_audio:common_audio",
|
||||
|
@ -768,6 +774,7 @@ if (rtc_include_tests) {
|
|||
"../../rtc_base:protobuf_utils",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:rtc_task_queue",
|
||||
"../../rtc_base:stringutils",
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:system_wrappers_default",
|
||||
"../../test:test_support",
|
||||
|
@ -819,6 +826,7 @@ if (rtc_include_tests) {
|
|||
":audio_processing",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../common_audio:common_audio",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../system_wrappers",
|
||||
|
@ -838,6 +846,7 @@ if (rtc_include_tests) {
|
|||
deps = [
|
||||
":audio_processing",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:metrics_default",
|
||||
]
|
||||
|
@ -892,6 +901,7 @@ if (rtc_include_tests) {
|
|||
deps = [
|
||||
":audioproc_debug_proto",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../rtc_base:protobuf_utils",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
]
|
||||
|
|
|
@ -45,6 +45,7 @@ rtc_static_library("lib") {
|
|||
]
|
||||
deps = [
|
||||
"../../../..:webrtc_common",
|
||||
"../../../../:typedefs",
|
||||
"../../../../api:array_view",
|
||||
"../../../../common_audio",
|
||||
"../../../../rtc_base:checks",
|
||||
|
@ -65,6 +66,7 @@ rtc_source_set("unittest") {
|
|||
deps = [
|
||||
":lib",
|
||||
"../../../..:webrtc_common",
|
||||
"../../../../:typedefs",
|
||||
"../../../../api:array_view",
|
||||
"../../../../api:optional",
|
||||
"../../../../common_audio",
|
||||
|
|
|
@ -49,6 +49,7 @@ rtc_static_library("congestion_controller") {
|
|||
deps = [
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:optional",
|
||||
"../../logging:rtc_event_log_api",
|
||||
"../../rtc_base:checks",
|
||||
|
|
|
@ -28,6 +28,7 @@ rtc_static_library("primitives") {
|
|||
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base", # TODO(kjellander): Cleanup in bugs.webrtc.org/3806.
|
||||
]
|
||||
|
@ -89,6 +90,7 @@ if (rtc_include_tests) {
|
|||
":desktop_capture_mock",
|
||||
":primitives",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../system_wrappers:cpu_features_api",
|
||||
|
@ -333,6 +335,7 @@ rtc_static_library("desktop_capture_generic") {
|
|||
deps = [
|
||||
":primitives",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:refcountedbase",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:rtc_base", # TODO(kjellander): Cleanup in bugs.webrtc.org/3806.
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <limits>
|
||||
|
||||
#include "api/optional.h"
|
||||
#include "api/rtp_headers.h"
|
||||
#include "api/video/video_rotation.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "modules/include/module_common_types_public.h"
|
||||
|
|
|
@ -35,6 +35,7 @@ rtc_static_library("media_file") {
|
|||
deps = [
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
]
|
||||
|
|
|
@ -34,6 +34,7 @@ rtc_static_library("pacing") {
|
|||
|
||||
deps = [
|
||||
"..:module_api",
|
||||
"../../:typedefs",
|
||||
"../../:webrtc_common",
|
||||
"../../api:optional",
|
||||
"../../logging:rtc_event_log_api",
|
||||
|
|
|
@ -46,6 +46,7 @@ rtc_static_library("remote_bitrate_estimator") {
|
|||
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:optional",
|
||||
"../../modules:module_api",
|
||||
"../../modules/rtp_rtcp:rtp_rtcp_format",
|
||||
|
@ -140,6 +141,7 @@ if (rtc_include_tests) {
|
|||
":remote_bitrate_estimator",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:optional",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:gtest_prod",
|
||||
|
|
|
@ -82,12 +82,14 @@ rtc_source_set("rtp_rtcp_format") {
|
|||
deps = [
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:array_view",
|
||||
"../../api:libjingle_peerconnection_api",
|
||||
"../../api:optional",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../common_video",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:deprecation",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../system_wrappers",
|
||||
]
|
||||
|
@ -192,6 +194,7 @@ rtc_static_library("rtp_rtcp") {
|
|||
":rtp_rtcp_format",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:array_view",
|
||||
"../../api:libjingle_peerconnection_api",
|
||||
"../../api:optional",
|
||||
|
@ -200,11 +203,13 @@ rtc_static_library("rtp_rtcp") {
|
|||
"../../common_video",
|
||||
"../../logging:rtc_event_log_api",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:deprecation",
|
||||
"../../rtc_base:gtest_prod",
|
||||
"../../rtc_base:rate_limiter",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:rtc_numerics",
|
||||
"../../rtc_base:sequenced_task_checker",
|
||||
"../../rtc_base:stringutils",
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:field_trial_api",
|
||||
"../../system_wrappers:metrics_api",
|
||||
|
@ -398,6 +403,7 @@ if (rtc_include_tests) {
|
|||
":rtp_rtcp_format",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:array_view",
|
||||
"../../api:libjingle_peerconnection_api",
|
||||
"../../api:optional",
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "modules/include/module.h"
|
||||
#include "modules/include/module_common_types.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/report_block.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "typedefs.h" // NOLINT(build/include)
|
||||
|
||||
namespace webrtc {
|
||||
|
|
|
@ -12,6 +12,27 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
StreamDataCounters::StreamDataCounters() : first_packet_time_ms(-1) {}
|
||||
|
||||
constexpr size_t StreamId::kMaxSize;
|
||||
|
||||
bool StreamId::IsLegalName(rtc::ArrayView<const char> name) {
|
||||
return (name.size() <= kMaxSize && name.size() > 0 &&
|
||||
std::all_of(name.data(), name.data() + name.size(), isalnum));
|
||||
}
|
||||
|
||||
void StreamId::Set(const char* data, size_t size) {
|
||||
// If |data| contains \0, the stream id size might become less than |size|.
|
||||
RTC_CHECK_LE(size, kMaxSize);
|
||||
memcpy(value_, data, size);
|
||||
if (size < kMaxSize)
|
||||
value_[size] = 0;
|
||||
}
|
||||
|
||||
// StreamId is used as member of RTPHeader that is sometimes copied with memcpy
|
||||
// and thus assume trivial destructibility.
|
||||
static_assert(std::is_trivially_destructible<StreamId>::value, "");
|
||||
|
||||
PayloadUnion::PayloadUnion(const AudioPayload& payload)
|
||||
: audio_payload_(payload) {}
|
||||
PayloadUnion::PayloadUnion(const VideoPayload& payload)
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "api/audio_codecs/audio_format.h"
|
||||
#include "api/rtp_headers.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "modules/include/module_common_types.h"
|
||||
#include "rtc_base/deprecation.h"
|
||||
|
@ -496,5 +497,100 @@ class TransportSequenceNumberAllocator {
|
|||
virtual uint16_t AllocateSequenceNumber() = 0;
|
||||
};
|
||||
|
||||
struct RtpPacketCounter {
|
||||
RtpPacketCounter()
|
||||
: header_bytes(0), payload_bytes(0), padding_bytes(0), packets(0) {}
|
||||
|
||||
void Add(const RtpPacketCounter& other) {
|
||||
header_bytes += other.header_bytes;
|
||||
payload_bytes += other.payload_bytes;
|
||||
padding_bytes += other.padding_bytes;
|
||||
packets += other.packets;
|
||||
}
|
||||
|
||||
void Subtract(const RtpPacketCounter& other) {
|
||||
RTC_DCHECK_GE(header_bytes, other.header_bytes);
|
||||
header_bytes -= other.header_bytes;
|
||||
RTC_DCHECK_GE(payload_bytes, other.payload_bytes);
|
||||
payload_bytes -= other.payload_bytes;
|
||||
RTC_DCHECK_GE(padding_bytes, other.padding_bytes);
|
||||
padding_bytes -= other.padding_bytes;
|
||||
RTC_DCHECK_GE(packets, other.packets);
|
||||
packets -= other.packets;
|
||||
}
|
||||
|
||||
void AddPacket(size_t packet_length, const RTPHeader& header) {
|
||||
++packets;
|
||||
header_bytes += header.headerLength;
|
||||
padding_bytes += header.paddingLength;
|
||||
payload_bytes +=
|
||||
packet_length - (header.headerLength + header.paddingLength);
|
||||
}
|
||||
|
||||
size_t TotalBytes() const {
|
||||
return header_bytes + payload_bytes + padding_bytes;
|
||||
}
|
||||
|
||||
size_t header_bytes; // Number of bytes used by RTP headers.
|
||||
size_t payload_bytes; // Payload bytes, excluding RTP headers and padding.
|
||||
size_t padding_bytes; // Number of padding bytes.
|
||||
uint32_t packets; // Number of packets.
|
||||
};
|
||||
|
||||
// Data usage statistics for a (rtp) stream.
|
||||
struct StreamDataCounters {
|
||||
StreamDataCounters();
|
||||
|
||||
void Add(const StreamDataCounters& other) {
|
||||
transmitted.Add(other.transmitted);
|
||||
retransmitted.Add(other.retransmitted);
|
||||
fec.Add(other.fec);
|
||||
if (other.first_packet_time_ms != -1 &&
|
||||
(other.first_packet_time_ms < first_packet_time_ms ||
|
||||
first_packet_time_ms == -1)) {
|
||||
// Use oldest time.
|
||||
first_packet_time_ms = other.first_packet_time_ms;
|
||||
}
|
||||
}
|
||||
|
||||
void Subtract(const StreamDataCounters& other) {
|
||||
transmitted.Subtract(other.transmitted);
|
||||
retransmitted.Subtract(other.retransmitted);
|
||||
fec.Subtract(other.fec);
|
||||
if (other.first_packet_time_ms != -1 &&
|
||||
(other.first_packet_time_ms > first_packet_time_ms ||
|
||||
first_packet_time_ms == -1)) {
|
||||
// Use youngest time.
|
||||
first_packet_time_ms = other.first_packet_time_ms;
|
||||
}
|
||||
}
|
||||
|
||||
int64_t TimeSinceFirstPacketInMs(int64_t now_ms) const {
|
||||
return (first_packet_time_ms == -1) ? -1 : (now_ms - first_packet_time_ms);
|
||||
}
|
||||
|
||||
// Returns the number of bytes corresponding to the actual media payload (i.e.
|
||||
// RTP headers, padding, retransmissions and fec packets are excluded).
|
||||
// Note this function does not have meaning for an RTX stream.
|
||||
size_t MediaPayloadBytes() const {
|
||||
return transmitted.payload_bytes - retransmitted.payload_bytes -
|
||||
fec.payload_bytes;
|
||||
}
|
||||
|
||||
int64_t first_packet_time_ms; // Time when first packet is sent/received.
|
||||
RtpPacketCounter transmitted; // Number of transmitted packets/bytes.
|
||||
RtpPacketCounter retransmitted; // Number of retransmitted packets/bytes.
|
||||
RtpPacketCounter fec; // Number of redundancy packets/bytes.
|
||||
};
|
||||
|
||||
// Callback, called whenever byte/packet counts have been updated.
|
||||
class StreamDataCountersCallback {
|
||||
public:
|
||||
virtual ~StreamDataCountersCallback() {}
|
||||
|
||||
virtual void DataCountersUpdated(const StreamDataCounters& counters,
|
||||
uint32_t ssrc) = 0;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
#endif // MODULES_RTP_RTCP_INCLUDE_RTP_RTCP_DEFINES_H_
|
||||
|
|
|
@ -32,6 +32,7 @@ rtc_static_library("utility") {
|
|||
deps = [
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../audio/utility:audio_frame_operations",
|
||||
"../../common_audio",
|
||||
"../../rtc_base:checks",
|
||||
|
|
|
@ -28,10 +28,12 @@ rtc_static_library("video_capture_module") {
|
|||
deps = [
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:video_frame_api_i420",
|
||||
"../../common_video",
|
||||
"../../media:rtc_media_base",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:stringutils",
|
||||
"../../system_wrappers",
|
||||
"//third_party/libyuv",
|
||||
]
|
||||
|
|
|
@ -99,6 +99,7 @@ rtc_static_library("video_coding") {
|
|||
"..:module_api",
|
||||
"..:module_api_public",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:optional",
|
||||
"../../api:video_frame_api_i420",
|
||||
"../../call:video_stream_api",
|
||||
|
@ -127,6 +128,7 @@ rtc_source_set("mock_headers") {
|
|||
deps = [
|
||||
":video_coding_utility",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../test:test_support",
|
||||
]
|
||||
}
|
||||
|
@ -169,6 +171,7 @@ rtc_source_set("video_coding_utility") {
|
|||
deps = [
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:optional",
|
||||
"../../api/video_codecs:video_codecs_api",
|
||||
"../../common_video",
|
||||
|
@ -239,6 +242,7 @@ rtc_static_library("webrtc_i420") {
|
|||
deps = [
|
||||
":video_coding_utility",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:video_frame_api_i420",
|
||||
"../../common_video:common_video",
|
||||
"../../rtc_base:checks",
|
||||
|
@ -301,6 +305,7 @@ rtc_static_library("webrtc_vp8") {
|
|||
":video_coding_utility",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:optional",
|
||||
"../../api/video_codecs:video_codecs_api",
|
||||
"../../common_video",
|
||||
|
@ -431,6 +436,7 @@ if (rtc_include_tests) {
|
|||
":video_coding_utility",
|
||||
":webrtc_vp8",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:video_frame_api_i420",
|
||||
"../../api/video_codecs:video_codecs_api",
|
||||
"../../common_video:common_video",
|
||||
|
@ -599,6 +605,7 @@ if (rtc_include_tests) {
|
|||
":webrtc_vp9",
|
||||
"..:module_api",
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:video_frame_api",
|
||||
"../../api:video_frame_api_i420",
|
||||
"../../api/video_codecs:video_codecs_api",
|
||||
|
|
|
@ -96,6 +96,7 @@ rtc_static_library("rtc_p2p") {
|
|||
"../api:ortc_api",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:rtc_base",
|
||||
"../rtc_base:stringutils",
|
||||
"../system_wrappers:field_trial_api",
|
||||
]
|
||||
|
||||
|
@ -183,6 +184,7 @@ if (rtc_include_tests) {
|
|||
"../rtc_base:rtc_base",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"../rtc_base:rtc_base_tests_utils",
|
||||
"../rtc_base:stringutils",
|
||||
"../test:test_support",
|
||||
"//testing/gmock",
|
||||
"//testing/gtest",
|
||||
|
@ -204,6 +206,7 @@ rtc_static_library("libstunprober") {
|
|||
deps = [
|
||||
":rtc_p2p",
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:rtc_base",
|
||||
]
|
||||
|
|
|
@ -78,6 +78,7 @@ rtc_static_library("rtc_pc_base") {
|
|||
"../rtc_base:checks",
|
||||
"../rtc_base:rtc_base",
|
||||
"../rtc_base:rtc_task_queue",
|
||||
"../rtc_base:stringutils",
|
||||
]
|
||||
|
||||
if (rtc_build_libsrtp) {
|
||||
|
@ -186,6 +187,7 @@ rtc_static_library("peerconnection") {
|
|||
"../rtc_base:checks",
|
||||
"../rtc_base:rtc_base",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"../rtc_base:stringutils",
|
||||
"../stats",
|
||||
"../system_wrappers",
|
||||
"../system_wrappers:field_trial_api",
|
||||
|
@ -441,6 +443,7 @@ if (rtc_include_tests) {
|
|||
":peerconnection",
|
||||
":rtc_pc_base",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:stringutils",
|
||||
]
|
||||
if (is_android) {
|
||||
deps += [ ":android_black_magic" ]
|
||||
|
|
|
@ -96,13 +96,18 @@ rtc_source_set("checks") {
|
|||
]
|
||||
deps = [
|
||||
":safe_compare",
|
||||
"..:webrtc_common",
|
||||
"..:typedefs",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("type_traits") {
|
||||
rtc_source_set("rate_limiter") {
|
||||
sources = [
|
||||
"type_traits.h",
|
||||
"rate_limiter.cc",
|
||||
"rate_limiter.h",
|
||||
]
|
||||
deps = [
|
||||
":rtc_base_approved",
|
||||
"../system_wrappers",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -121,14 +126,25 @@ rtc_source_set("safe_compare") {
|
|||
]
|
||||
}
|
||||
|
||||
rtc_source_set("rate_limiter") {
|
||||
rtc_source_set("stringutils") {
|
||||
sources = [
|
||||
"rate_limiter.cc",
|
||||
"rate_limiter.h",
|
||||
"stringutils.cc",
|
||||
"stringutils.h",
|
||||
]
|
||||
deps = [
|
||||
":rtc_base_approved",
|
||||
"../system_wrappers",
|
||||
":checks",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("type_traits") {
|
||||
sources = [
|
||||
"type_traits.h",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("deprecation") {
|
||||
sources = [
|
||||
"deprecation.h",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -146,7 +162,9 @@ rtc_source_set("rtc_base_approved_generic") {
|
|||
deps = [
|
||||
":checks",
|
||||
":safe_compare",
|
||||
":stringutils",
|
||||
":type_traits",
|
||||
"../:typedefs",
|
||||
]
|
||||
|
||||
sources = [
|
||||
|
@ -171,7 +189,6 @@ rtc_source_set("rtc_base_approved_generic") {
|
|||
"copyonwritebuffer.h",
|
||||
"criticalsection.cc",
|
||||
"criticalsection.h",
|
||||
"deprecation.h",
|
||||
"event_tracer.cc",
|
||||
"event_tracer.h",
|
||||
"file.cc",
|
||||
|
@ -216,8 +233,6 @@ rtc_source_set("rtc_base_approved_generic") {
|
|||
"stringencode.cc",
|
||||
"stringencode.h",
|
||||
"stringize_macros.h",
|
||||
"stringutils.cc",
|
||||
"stringutils.h",
|
||||
"swap_queue.h",
|
||||
"template_util.h",
|
||||
"thread_annotations.h",
|
||||
|
@ -526,6 +541,7 @@ rtc_static_library("rtc_base_generic") {
|
|||
defines = []
|
||||
deps = [
|
||||
":checks",
|
||||
":stringutils",
|
||||
"..:webrtc_common",
|
||||
"../api:optional",
|
||||
]
|
||||
|
@ -845,6 +861,7 @@ rtc_source_set("rtc_base_tests_utils") {
|
|||
deps = [
|
||||
":checks",
|
||||
":rtc_base",
|
||||
":stringutils",
|
||||
"../test:field_trial",
|
||||
"../test:test_support",
|
||||
]
|
||||
|
@ -956,6 +973,7 @@ if (rtc_include_tests) {
|
|||
":rtc_base_tests_utils",
|
||||
":rtc_task_queue",
|
||||
":safe_compare",
|
||||
":stringutils",
|
||||
"../api:array_view",
|
||||
"../system_wrappers:system_wrappers",
|
||||
"../test:test_support",
|
||||
|
@ -1080,6 +1098,7 @@ if (rtc_include_tests) {
|
|||
":checks",
|
||||
":rtc_base_tests_main",
|
||||
":rtc_base_tests_utils",
|
||||
":stringutils",
|
||||
"../api:optional",
|
||||
"../test:test_support",
|
||||
]
|
||||
|
|
|
@ -157,6 +157,7 @@ if (!build_with_chromium) {
|
|||
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../common_video",
|
||||
]
|
||||
}
|
||||
|
@ -379,6 +380,7 @@ if (rtc_include_tests) {
|
|||
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../common_audio",
|
||||
"../modules/audio_processing",
|
||||
"../modules/audio_processing:audioproc_debug_proto",
|
||||
|
|
|
@ -401,6 +401,7 @@ rtc_static_library("peerconnection_jni") {
|
|||
"../../rtc_base:rtc_base",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base:rtc_task_queue",
|
||||
"../../rtc_base:stringutils",
|
||||
"../../system_wrappers:field_trial_api",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ rtc_static_library("system_wrappers") {
|
|||
":field_trial_api",
|
||||
":metrics_api",
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:optional",
|
||||
"../modules:module_api_public",
|
||||
"../rtc_base:checks",
|
||||
|
@ -112,6 +113,7 @@ rtc_source_set("cpu_features_api") {
|
|||
]
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -215,6 +217,7 @@ if (rtc_include_tests) {
|
|||
":metrics_default",
|
||||
":system_wrappers",
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"../test:test_main",
|
||||
"//testing/gtest",
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class NtpTime {
|
||||
|
@ -40,8 +42,12 @@ class NtpTime {
|
|||
// NTP standard (RFC1305, section 3.1) explicitly state value 0 is invalid.
|
||||
bool Valid() const { return value_ != 0; }
|
||||
|
||||
uint32_t seconds() const { return value_ / kFractionsPerSecond; }
|
||||
uint32_t fractions() const { return value_ % kFractionsPerSecond; }
|
||||
uint32_t seconds() const {
|
||||
return rtc::dchecked_cast<uint32_t>(value_ / kFractionsPerSecond);
|
||||
}
|
||||
uint32_t fractions() const {
|
||||
return rtc::dchecked_cast<uint32_t>(value_ % kFractionsPerSecond);
|
||||
}
|
||||
|
||||
private:
|
||||
uint64_t value_;
|
||||
|
|
|
@ -60,6 +60,7 @@ rtc_source_set("video_test_common") {
|
|||
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:optional",
|
||||
"../api:video_frame_api_i420",
|
||||
"../api/video_codecs:video_codecs_api",
|
||||
|
@ -151,6 +152,7 @@ rtc_source_set("test_support") {
|
|||
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:array_view",
|
||||
"../common_video",
|
||||
"../rtc_base:gtest_prod",
|
||||
|
@ -215,6 +217,7 @@ if (rtc_include_tests) {
|
|||
":test_support",
|
||||
":video_test_common",
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:video_frame_api",
|
||||
"../api:video_frame_api_i420",
|
||||
"../common_video",
|
||||
|
@ -362,6 +365,7 @@ if (is_ios) {
|
|||
"testsupport/iosfileutils.mm",
|
||||
]
|
||||
deps = [
|
||||
"..:typedefs",
|
||||
"..:webrtc_common",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
|
@ -384,6 +388,7 @@ rtc_source_set("fileutils") {
|
|||
]
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:optional",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
|
@ -470,6 +475,7 @@ rtc_source_set("direct_transport") {
|
|||
}
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:transport_api",
|
||||
"../call",
|
||||
"../call:call_interfaces",
|
||||
|
@ -507,6 +513,7 @@ rtc_source_set("fake_audio_device") {
|
|||
}
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:array_view",
|
||||
"../common_audio:common_audio",
|
||||
"../modules/audio_device:audio_device",
|
||||
|
@ -565,6 +572,7 @@ rtc_source_set("test_common") {
|
|||
":test_support",
|
||||
":video_test_common",
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:transport_api",
|
||||
"../api:video_frame_api",
|
||||
"../api:video_frame_api_i420",
|
||||
|
@ -668,6 +676,7 @@ rtc_source_set("test_renderer_generic") {
|
|||
deps = [
|
||||
":test_support",
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../common_video",
|
||||
"../media:rtc_media_base",
|
||||
"../modules/media_file",
|
||||
|
|
|
@ -245,6 +245,7 @@ rtc_static_library("audio_decoder_fuzzer") {
|
|||
]
|
||||
deps = [
|
||||
"../..:webrtc_common",
|
||||
"../../:typedefs",
|
||||
"../../api:optional",
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../modules/rtp_rtcp:rtp_rtcp_format",
|
||||
|
|
|
@ -55,6 +55,7 @@ rtc_static_library("video") {
|
|||
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:optional",
|
||||
"../api:transport_api",
|
||||
"../api:video_frame_api_i420",
|
||||
|
@ -216,6 +217,7 @@ if (rtc_include_tests) {
|
|||
]
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api/video_codecs:video_codecs_api",
|
||||
"../call:call_interfaces",
|
||||
"../common_video",
|
||||
|
|
|
@ -52,6 +52,7 @@ rtc_static_library("voice_engine") {
|
|||
deps = [
|
||||
":audio_level",
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../api:array_view",
|
||||
"../api:audio_mixer_api",
|
||||
"../api:call_api",
|
||||
|
@ -94,6 +95,7 @@ rtc_static_library("audio_level") {
|
|||
|
||||
deps = [
|
||||
"..:webrtc_common",
|
||||
"../:typedefs",
|
||||
"../common_audio",
|
||||
"../modules:module_api",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
|
|
Loading…
Reference in a new issue