diff --git a/call/BUILD.gn b/call/BUILD.gn index 65b545c11e..a415df6bc1 100644 --- a/call/BUILD.gn +++ b/call/BUILD.gn @@ -97,6 +97,7 @@ rtc_library("rtp_interfaces") { "../api/rtc_event_log", "../api/transport:bitrate_settings", "../api/units:timestamp", + "../common_video:frame_counts", "../modules/rtp_rtcp:rtp_rtcp_format", "../rtc_base:checks", "../rtc_base:rtc_base_approved", @@ -316,6 +317,7 @@ rtc_library("video_stream_api") { "../api/video:video_stream_encoder", "../api/video_codecs:video_codecs_api", "../common_video", + "../common_video:frame_counts", "../modules/rtp_rtcp:rtp_rtcp_format", "../rtc_base:checks", "../rtc_base:rtc_base_approved", diff --git a/call/DEPS b/call/DEPS index f823a7b9c3..b3a89a2d93 100644 --- a/call/DEPS +++ b/call/DEPS @@ -17,11 +17,12 @@ include_rules = [ specific_include_rules = { "video_receive_stream\.h": [ - "+common_video/include", - "+media/base", + "+common_video/frame_counts.h", ], "video_send_stream\.h": [ - "+common_video/include", - "+media/base", + "+common_video", ], + "rtp_transport_controller_send_interface\.h": [ + "+common_video/frame_counts.h", + ] } diff --git a/call/rtp_transport_controller_send_interface.h b/call/rtp_transport_controller_send_interface.h index f073424968..3c24c018e2 100644 --- a/call/rtp_transport_controller_send_interface.h +++ b/call/rtp_transport_controller_send_interface.h @@ -26,6 +26,7 @@ #include "api/transport/bitrate_settings.h" #include "api/units/timestamp.h" #include "call/rtp_config.h" +#include "common_video/frame_counts.h" #include "modules/rtp_rtcp/include/report_block_data.h" #include "modules/rtp_rtcp/include/rtcp_statistics.h" #include "modules/rtp_rtcp/include/rtp_packet_sender.h" diff --git a/call/video_receive_stream.h b/call/video_receive_stream.h index 91c637160a..7a6803d9e2 100644 --- a/call/video_receive_stream.h +++ b/call/video_receive_stream.h @@ -32,6 +32,7 @@ #include "api/video/video_timing.h" #include "api/video_codecs/sdp_video_format.h" #include "call/rtp_config.h" +#include "common_video/frame_counts.h" #include "modules/rtp_rtcp/include/rtcp_statistics.h" #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" diff --git a/call/video_send_stream.h b/call/video_send_stream.h index 715d5d73e7..0df9e6ce05 100644 --- a/call/video_send_stream.h +++ b/call/video_send_stream.h @@ -31,6 +31,7 @@ #include "api/video/video_stream_encoder_settings.h" #include "api/video_codecs/video_encoder_config.h" #include "call/rtp_config.h" +#include "common_video/frame_counts.h" #include "common_video/include/quality_limitation_reason.h" #include "modules/rtp_rtcp/include/report_block_data.h" #include "modules/rtp_rtcp/include/rtcp_statistics.h" diff --git a/common_types.h b/common_types.h index de1a5fd50b..9221cde5a1 100644 --- a/common_types.h +++ b/common_types.h @@ -11,26 +11,8 @@ #ifndef COMMON_TYPES_H_ #define COMMON_TYPES_H_ -#include // For size_t - -#include - 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. // diff --git a/common_video/BUILD.gn b/common_video/BUILD.gn index dd92ee3fbf..28ffcb220e 100644 --- a/common_video/BUILD.gn +++ b/common_video/BUILD.gn @@ -65,6 +65,12 @@ rtc_library("common_video") { absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] } +rtc_source_set("frame_counts") { + visibility = [ "*" ] + + sources = [ "frame_counts.h" ] +} + if (rtc_include_tests) { common_video_resources = [ "../resources/foreman_cif.yuv" ] diff --git a/common_video/frame_counts.h b/common_video/frame_counts.h new file mode 100644 index 0000000000..663fda4a2f --- /dev/null +++ b/common_video/frame_counts.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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_VIDEO_FRAME_COUNTS_H_ +#define COMMON_VIDEO_FRAME_COUNTS_H_ + +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; +}; + +} // namespace webrtc + +#endif // COMMON_VIDEO_FRAME_COUNTS_H_