From 838cdb3db6a24b9be3a3d2700144197935415463 Mon Sep 17 00:00:00 2001 From: terelius Date: Mon, 24 Oct 2016 09:38:22 -0700 Subject: [PATCH] Revert of Fix chromium-style warnings. (patchset #1 id:1 of https://codereview.webrtc.org/2400993002/ ) Reason for revert: Broke internal project Original issue's description: > Fix chromium-style warnings. > > Separate the null implementation from rtp_rtcp_defines.h, and follow chromium style guide for virtual functions. > > BUG=webrtc:163 > > Committed: https://crrev.com/509eadd554de6bf938da08071c5d2c2541703134 > Cr-Commit-Position: refs/heads/master@{#14738} TBR=danilchap@webrtc.org,kjellander@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:163 Review-Url: https://codereview.webrtc.org/2449523002 Cr-Commit-Position: refs/heads/master@{#14750} --- webrtc/modules/rtp_rtcp/BUILD.gn | 2 - .../rtp_rtcp/include/rtp_rtcp_defines.h | 33 +++++++++++++ webrtc/modules/rtp_rtcp/rtp_rtcp.gypi | 2 - .../rtp_rtcp/source/fec_receiver_unittest.cc | 1 - .../rtp_rtcp/source/nack_rtx_unittest.cc | 1 - .../rtp_rtcp/source/rtcp_sender_unittest.cc | 1 - .../source/rtp_rtcp_defines_nullimpl.cc | 35 ------------- .../source/rtp_rtcp_defines_nullimpl.h | 49 ------------------- .../rtp_rtcp/source/rtp_rtcp_impl_unittest.cc | 1 - webrtc/modules/rtp_rtcp/source/rtp_utility.cc | 1 - .../modules/rtp_rtcp/test/testAPI/test_api.h | 1 - 11 files changed, 33 insertions(+), 94 deletions(-) delete mode 100644 webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.cc delete mode 100644 webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h diff --git a/webrtc/modules/rtp_rtcp/BUILD.gn b/webrtc/modules/rtp_rtcp/BUILD.gn index 28966394ba..af216e792f 100644 --- a/webrtc/modules/rtp_rtcp/BUILD.gn +++ b/webrtc/modules/rtp_rtcp/BUILD.gn @@ -136,8 +136,6 @@ rtc_static_library("rtp_rtcp") { "source/rtp_receiver_video.cc", "source/rtp_receiver_video.h", "source/rtp_rtcp_config.h", - "source/rtp_rtcp_defines_nullimpl.cc", - "source/rtp_rtcp_defines_nullimpl.h", "source/rtp_rtcp_impl.cc", "source/rtp_rtcp_impl.h", "source/rtp_sender.cc", diff --git a/webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h b/webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h index 2a38e712fe..bd3aae72b5 100644 --- a/webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h +++ b/webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h @@ -321,6 +321,39 @@ class RtcpRttStats { virtual ~RtcpRttStats() {} }; +// Null object version of RtpFeedback. +class NullRtpFeedback : public RtpFeedback { + public: + virtual ~NullRtpFeedback() {} + + int32_t OnInitializeDecoder(int8_t payload_type, + const char payloadName[RTP_PAYLOAD_NAME_SIZE], + int frequency, + size_t channels, + uint32_t rate) override { + return 0; + } + + void OnIncomingSSRCChanged(uint32_t ssrc) override {} + void OnIncomingCSRCChanged(uint32_t csrc, bool added) override {} +}; + +// Null object version of RtpData. +class NullRtpData : public RtpData { + public: + virtual ~NullRtpData() {} + + int32_t OnReceivedPayloadData(const uint8_t* payload_data, + size_t payload_size, + const WebRtcRTPHeader* rtp_header) override { + return 0; + } + + bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override { + return true; + } +}; + // Statistics about packet loss for a single directional connection. All values // are totals since the connection initiated. struct RtpPacketLossStats { diff --git a/webrtc/modules/rtp_rtcp/rtp_rtcp.gypi b/webrtc/modules/rtp_rtcp/rtp_rtcp.gypi index 9dc0722c6b..0be12fe4f3 100644 --- a/webrtc/modules/rtp_rtcp/rtp_rtcp.gypi +++ b/webrtc/modules/rtp_rtcp/rtp_rtcp.gypi @@ -111,8 +111,6 @@ 'source/rtp_receiver_impl.cc', 'source/rtp_receiver_impl.h', 'source/rtp_rtcp_config.h', - 'source/rtp_rtcp_defines_nullimpl.cc', - 'source/rtp_rtcp_defines_nullimpl.h', 'source/rtp_rtcp_impl.cc', 'source/rtp_rtcp_impl.h', 'source/rtp_sender.cc', diff --git a/webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc b/webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc index 892fbe0979..0c4b4861cf 100644 --- a/webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc @@ -19,7 +19,6 @@ #include "webrtc/modules/rtp_rtcp/source/byte_io.h" #include "webrtc/modules/rtp_rtcp/source/fec_test_helper.h" #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" -#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h" #include "webrtc/test/gmock.h" #include "webrtc/test/gtest.h" diff --git a/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc b/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc index 9a1ee3cc7e..2a0fce5a06 100644 --- a/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc @@ -22,7 +22,6 @@ #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" -#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h" #include "webrtc/test/gtest.h" #include "webrtc/transport.h" diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc index 034bb13eb8..d348d3a94a 100644 --- a/webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc @@ -14,7 +14,6 @@ #include "webrtc/common_types.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" -#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h" #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" #include "webrtc/test/gmock.h" #include "webrtc/test/gtest.h" diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.cc deleted file mode 100644 index facf81248b..0000000000 --- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.cc +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2016 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 "webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h" - -namespace webrtc { - -int32_t NullRtpFeedback::OnInitializeDecoder( - int8_t payload_type, - const char payloadName[RTP_PAYLOAD_NAME_SIZE], - int frequency, - size_t channels, - uint32_t rate) { - return 0; -} - -int32_t NullRtpData::OnReceivedPayloadData(const uint8_t* payload_data, - size_t payload_size, - const WebRtcRTPHeader* rtp_header) { - return 0; -} - -bool NullRtpData::OnRecoveredPacket(const uint8_t* packet, - size_t packet_length) { - return true; -} - -} // namespace webrtc diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h deleted file mode 100644 index 6df346993a..0000000000 --- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2016 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 WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RTCP_DEFINES_NULLIMPL_H_ -#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RTCP_DEFINES_NULLIMPL_H_ - -#include - -#include "webrtc/modules/include/module_common_types.h" -#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" - -namespace webrtc { - -// Null object version of RtpFeedback. -class NullRtpFeedback : public RtpFeedback { - public: - ~NullRtpFeedback() override {} - - int32_t OnInitializeDecoder(int8_t payload_type, - const char payloadName[RTP_PAYLOAD_NAME_SIZE], - int frequency, - size_t channels, - uint32_t rate) override; - - void OnIncomingSSRCChanged(uint32_t ssrc) override {} - void OnIncomingCSRCChanged(uint32_t csrc, bool added) override {} -}; - -// Null object version of RtpData. -class NullRtpData : public RtpData { - public: - ~NullRtpData() override {} - - int32_t OnReceivedPayloadData(const uint8_t* payload_data, - size_t payload_size, - const WebRtcRTPHeader* rtp_header) override; - - bool OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override; -}; - -} // namespace webrtc -#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RTCP_DEFINES_NULLIMPL_H_ diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc index c700395f8f..dc4c73eb6f 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc @@ -18,7 +18,6 @@ #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/nack.h" -#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h" #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h" #include "webrtc/test/gmock.h" #include "webrtc/test/gtest.h" diff --git a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc index cd172a4f37..7dd59736fd 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc @@ -15,7 +15,6 @@ #include "webrtc/base/logging.h" #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" #include "webrtc/modules/rtp_rtcp/source/byte_io.h" -#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h" namespace webrtc { diff --git a/webrtc/modules/rtp_rtcp/test/testAPI/test_api.h b/webrtc/modules/rtp_rtcp/test/testAPI/test_api.h index f956904a39..b0dd4055f3 100644 --- a/webrtc/modules/rtp_rtcp/test/testAPI/test_api.h +++ b/webrtc/modules/rtp_rtcp/test/testAPI/test_api.h @@ -17,7 +17,6 @@ #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" -#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h" #include "webrtc/test/gtest.h" #include "webrtc/transport.h"