Fix chromium-style warnings.
Separate the null implementation from rtp_rtcp_defines.h, and follow chromium style guide for virtual functions. BUG=webrtc:163 Review-Url: https://codereview.webrtc.org/2400993002 Cr-Commit-Position: refs/heads/master@{#14738}
This commit is contained in:
parent
c22bcf4f4b
commit
509eadd554
@ -136,6 +136,8 @@ 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",
|
||||
|
||||
@ -321,39 +321,6 @@ 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 {
|
||||
|
||||
@ -111,6 +111,8 @@
|
||||
'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',
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#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"
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
#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"
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
#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"
|
||||
|
||||
35
webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.cc
Normal file
35
webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.cc
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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
|
||||
49
webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h
Normal file
49
webrtc/modules/rtp_rtcp/source/rtp_rtcp_defines_nullimpl.h
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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 <stddef.h>
|
||||
|
||||
#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_
|
||||
@ -18,6 +18,7 @@
|
||||
#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"
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#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 {
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
#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"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user