From 8643b78750bbd2a59482b9f36bccec91d2ed9238 Mon Sep 17 00:00:00 2001 From: Ilya Nikolaevskiy Date: Thu, 7 Jun 2018 16:15:40 +0200 Subject: [PATCH] Moved NackModule and VCMPacket to their own targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:9373 Change-Id: I1e882b734dcafb5c633eabf08bb8a1a6a407a251 Reviewed-on: https://webrtc-review.googlesource.com/81744 Reviewed-by: Philip Eliasson Reviewed-by: Åsa Persson Reviewed-by: Stefan Holmer Commit-Queue: Ilya Nikolaevskiy Cr-Commit-Position: refs/heads/master@{#23621} --- modules/include/module_common_types.h | 27 ++++++++++ modules/video_coding/BUILD.gn | 49 ++++++++++++++++--- .../include/video_coding_defines.h | 16 ------ modules/video_coding/jitter_buffer.h | 1 - modules/video_coding/jitter_buffer_common.h | 9 ---- modules/video_coding/nack_module.h | 2 +- modules/video_coding/packet.h | 1 - modules/video_coding/session_info.cc | 2 +- video/BUILD.gn | 3 ++ video/rtp_video_stream_receiver.cc | 1 + 10 files changed, 76 insertions(+), 35 deletions(-) diff --git a/modules/include/module_common_types.h b/modules/include/module_common_types.h index c46ca1d86f..65bb20777a 100644 --- a/modules/include/module_common_types.h +++ b/modules/include/module_common_types.h @@ -268,6 +268,33 @@ class CallStatsObserver { virtual ~CallStatsObserver() {} }; + +// Interface used by NackModule and JitterBuffer. +class NackSender { + public: + virtual void SendNack(const std::vector& sequence_numbers) = 0; + + protected: + virtual ~NackSender() {} +}; + +// Interface used by NackModule and JitterBuffer. +class KeyFrameRequestSender { + public: + virtual void RequestKeyFrame() = 0; + + protected: + virtual ~KeyFrameRequestSender() {} +}; + +// Used to indicate if a received packet contain a complete NALU (or equivalent) +enum VCMNaluCompleteness { + kNaluUnset = 0, // Packet has not been filled. + kNaluComplete = 1, // Packet can be decoded as is. + kNaluStart, // Packet contain beginning of NALU + kNaluIncomplete, // Packet is not beginning or end of NALU + kNaluEnd, // Packet is the end of a NALU +}; } // namespace webrtc #endif // MODULES_INCLUDE_MODULE_COMMON_TYPES_H_ diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index dd939ce401..18baa6891a 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -36,6 +36,46 @@ rtc_static_library("encoded_frame") { } } +rtc_static_library("nack_module") { + visibility = [ "*" ] + sources = [ + "histogram.cc", + "histogram.h", + "nack_module.cc", + "nack_module.h", + ] + + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } + + deps = [ + ":packet", + "..:module_api", + "../../rtc_base:checks", + "../../rtc_base:rtc_base_approved", + "../../rtc_base:rtc_numerics", + "../../system_wrappers", + "../utility:utility", + ] +} + +rtc_static_library("packet") { + visibility = [ "*" ] + sources = [ + "packet.cc", + "packet.h", + ] + deps = [ + "..:module_api", + "../../:typedefs", + ] +} + rtc_static_library("video_coding") { visibility = [ "*" ] deps = [] @@ -66,8 +106,6 @@ rtc_static_library("video_coding") { "h264_sprop_parameter_sets.h", "h264_sps_pps_tracker.cc", "h264_sps_pps_tracker.h", - "histogram.cc", - "histogram.h", "include/video_codec_initializer.h", "include/video_coding.h", "inter_frame_delay.cc", @@ -83,10 +121,6 @@ rtc_static_library("video_coding") { "media_optimization.cc", "media_optimization.h", "nack_fec_tables.h", - "nack_module.cc", - "nack_module.h", - "packet.cc", - "packet.h", "packet_buffer.cc", "packet_buffer.h", "qp_parser.cc", @@ -121,6 +155,7 @@ rtc_static_library("video_coding") { deps += [ ":codec_globals_headers", ":encoded_frame", + ":packet", ":video_codec_interface", ":video_coding_utility", ":webrtc_vp8_helpers", @@ -814,6 +849,8 @@ if (rtc_include_tests) { ":codec_globals_headers", ":encoded_frame", ":mock_headers", + ":nack_module", + ":packet", ":video_codec_interface", ":video_codecs_test_framework", ":video_coding", diff --git a/modules/video_coding/include/video_coding_defines.h b/modules/video_coding/include/video_coding_defines.h index ea3e3ecefc..596e5ca540 100644 --- a/modules/video_coding/include/video_coding_defines.h +++ b/modules/video_coding/include/video_coding_defines.h @@ -131,22 +131,6 @@ class VCMPacketRequestCallback { virtual ~VCMPacketRequestCallback() {} }; -class NackSender { - public: - virtual void SendNack(const std::vector& sequence_numbers) = 0; - - protected: - virtual ~NackSender() {} -}; - -class KeyFrameRequestSender { - public: - virtual void RequestKeyFrame() = 0; - - protected: - virtual ~KeyFrameRequestSender() {} -}; - } // namespace webrtc #endif // MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODING_DEFINES_H_ diff --git a/modules/video_coding/jitter_buffer.h b/modules/video_coding/jitter_buffer.h index 2732af8c0b..49080808f7 100644 --- a/modules/video_coding/jitter_buffer.h +++ b/modules/video_coding/jitter_buffer.h @@ -25,7 +25,6 @@ #include "modules/video_coding/inter_frame_delay.h" #include "modules/video_coding/jitter_buffer_common.h" #include "modules/video_coding/jitter_estimator.h" -#include "modules/video_coding/nack_module.h" #include "rtc_base/constructormagic.h" #include "rtc_base/criticalsection.h" #include "rtc_base/thread_annotations.h" diff --git a/modules/video_coding/jitter_buffer_common.h b/modules/video_coding/jitter_buffer_common.h index 257ebc0eac..0ea73eef79 100644 --- a/modules/video_coding/jitter_buffer_common.h +++ b/modules/video_coding/jitter_buffer_common.h @@ -58,15 +58,6 @@ enum VCMFrameBufferStateEnum { }; enum { kH264StartCodeLengthBytes = 4 }; - -// Used to indicate if a received packet contain a complete NALU (or equivalent) -enum VCMNaluCompleteness { - kNaluUnset = 0, // Packet has not been filled. - kNaluComplete = 1, // Packet can be decoded as is. - kNaluStart, // Packet contain beginning of NALU - kNaluIncomplete, // Packet is not beginning or end of NALU - kNaluEnd, // Packet is the end of a NALU -}; } // namespace webrtc #endif // MODULES_VIDEO_CODING_JITTER_BUFFER_COMMON_H_ diff --git a/modules/video_coding/nack_module.h b/modules/video_coding/nack_module.h index c18c99fc3c..5640ea89b8 100644 --- a/modules/video_coding/nack_module.h +++ b/modules/video_coding/nack_module.h @@ -16,8 +16,8 @@ #include #include "modules/include/module.h" +#include "modules/include/module_common_types.h" #include "modules/video_coding/histogram.h" -#include "modules/video_coding/include/video_coding_defines.h" #include "modules/video_coding/packet.h" #include "rtc_base/criticalsection.h" #include "rtc_base/numerics/sequence_number_util.h" diff --git a/modules/video_coding/packet.h b/modules/video_coding/packet.h index e377fb975e..53b69a372d 100644 --- a/modules/video_coding/packet.h +++ b/modules/video_coding/packet.h @@ -12,7 +12,6 @@ #define MODULES_VIDEO_CODING_PACKET_H_ #include "modules/include/module_common_types.h" -#include "modules/video_coding/jitter_buffer_common.h" #include "typedefs.h" // NOLINT(build/include) namespace webrtc { diff --git a/modules/video_coding/session_info.cc b/modules/video_coding/session_info.cc index f78b35c39e..74db4e7b35 100644 --- a/modules/video_coding/session_info.cc +++ b/modules/video_coding/session_info.cc @@ -9,7 +9,7 @@ */ #include "modules/video_coding/session_info.h" - +#include "modules/video_coding/jitter_buffer_common.h" #include "modules/video_coding/packet.h" #include "rtc_base/logging.h" diff --git a/video/BUILD.gn b/video/BUILD.gn index b00ea13425..f56a71dd6d 100644 --- a/video/BUILD.gn +++ b/video/BUILD.gn @@ -74,6 +74,8 @@ rtc_static_library("video") { "../call:video_stream_api", "../modules/rtp_rtcp:rtp_rtcp_format", "../modules/video_coding:codec_globals_headers", + "../modules/video_coding:nack_module", + "../modules/video_coding:packet", "../modules/video_coding:video_codec_interface", "../rtc_base:checks", "../rtc_base:stringutils", @@ -387,6 +389,7 @@ if (rtc_include_tests) { "../modules/utility", "../modules/video_coding", "../modules/video_coding:codec_globals_headers", + "../modules/video_coding:packet", "../modules/video_coding:video_codec_interface", "../modules/video_coding:video_coding_utility", "../modules/video_coding:webrtc_h264", diff --git a/video/rtp_video_stream_receiver.cc b/video/rtp_video_stream_receiver.cc index 589b0da805..996154f628 100644 --- a/video/rtp_video_stream_receiver.cc +++ b/video/rtp_video_stream_receiver.cc @@ -28,6 +28,7 @@ #include "modules/video_coding/frame_object.h" #include "modules/video_coding/h264_sprop_parameter_sets.h" #include "modules/video_coding/h264_sps_pps_tracker.h" +#include "modules/video_coding/nack_module.h" #include "modules/video_coding/packet_buffer.h" #include "modules/video_coding/video_coding_impl.h" #include "rtc_base/checks.h"