Mark all virtual overrides in the hierarchies of RtpDump and

VCMPacketizationCallback as such.

This will make further changes to these classes safer by ensuring that the
compile breaks if the base class changes and not all overrides are fixed.

This also marks all other such overrides in the affected files.

BUG=none
TEST=none
R=henrike@webrtc.org, stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/19319004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7161 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org
2014-09-11 22:45:54 +00:00
parent ea77334c30
commit cc774a69cb
5 changed files with 45 additions and 37 deletions

View File

@@ -22,10 +22,11 @@ public:
RtpDumpImpl(); RtpDumpImpl();
virtual ~RtpDumpImpl(); virtual ~RtpDumpImpl();
virtual int32_t Start(const char* fileNameUTF8); virtual int32_t Start(const char* fileNameUTF8) OVERRIDE;
virtual int32_t Stop(); virtual int32_t Stop() OVERRIDE;
virtual bool IsActive() const; virtual bool IsActive() const OVERRIDE;
virtual int32_t DumpPacket(const uint8_t* packet, uint16_t packetLength); virtual int32_t DumpPacket(const uint8_t* packet,
uint16_t packetLength) OVERRIDE;
private: private:
// Return the system time in ms. // Return the system time in ms.
inline uint32_t GetTimeInMS() const; inline uint32_t GetTimeInMS() const;

View File

@@ -43,11 +43,11 @@ public:
private: private:
// VCMReceiveCallback function. // VCMReceiveCallback function.
// Note: called by VideoCodingModule when decoding finished. // Note: called by VideoCodingModule when decoding finished.
int32_t FrameToRender(I420VideoFrame& videoFrame); virtual int32_t FrameToRender(I420VideoFrame& videoFrame) OVERRIDE;
// VCMPacketizationCallback function. // VCMPacketizationCallback function.
// Note: called by VideoCodingModule when encoding finished. // Note: called by VideoCodingModule when encoding finished.
int32_t SendData( virtual int32_t SendData(
FrameType /*frameType*/, FrameType /*frameType*/,
uint8_t /*payloadType*/, uint8_t /*payloadType*/,
uint32_t /*timeStamp*/, uint32_t /*timeStamp*/,
@@ -55,7 +55,7 @@ private:
const uint8_t* payloadData, const uint8_t* payloadData,
uint32_t payloadSize, uint32_t payloadSize,
const RTPFragmentationHeader& /* fragmentationHeader*/, const RTPFragmentationHeader& /* fragmentationHeader*/,
const RTPVideoHeader* rtpTypeHdr); const RTPVideoHeader* rtpTypeHdr) OVERRIDE;
VideoCodingModule* _vcm; VideoCodingModule* _vcm;
I420VideoFrame* _decodedVideo; I420VideoFrame* _decodedVideo;

View File

@@ -70,7 +70,10 @@ MATCHER_P(MatchesVp8StreamInfo, expected, "") {
class EmptyFrameGenerator : public FrameGenerator { class EmptyFrameGenerator : public FrameGenerator {
public: public:
I420VideoFrame* NextFrame() OVERRIDE { frame_.ResetSize(); return &frame_; } virtual I420VideoFrame* NextFrame() OVERRIDE {
frame_.ResetSize();
return &frame_;
}
private: private:
I420VideoFrame frame_; I420VideoFrame frame_;
@@ -90,7 +93,7 @@ class PacketizationCallback : public VCMPacketizationCallback {
const uint8_t* payload_data, const uint8_t* payload_data,
uint32_t payload_size, uint32_t payload_size,
const RTPFragmentationHeader& fragmentation_header, const RTPFragmentationHeader& fragmentation_header,
const RTPVideoHeader* rtp_video_header) { const RTPVideoHeader* rtp_video_header) OVERRIDE {
assert(rtp_video_header); assert(rtp_video_header);
frame_data_.push_back(FrameData(payload_size, *rtp_video_header)); frame_data_.push_back(FrameData(payload_size, *rtp_video_header));
return 0; return 0;
@@ -172,7 +175,7 @@ class TestVideoSender : public ::testing::Test {
// a special case (e.g. frame rate in media optimization). // a special case (e.g. frame rate in media optimization).
TestVideoSender() : clock_(1000), packetization_callback_(&clock_) {} TestVideoSender() : clock_(1000), packetization_callback_(&clock_) {}
virtual void SetUp() { virtual void SetUp() OVERRIDE {
sender_.reset(new VideoSender(&clock_, &post_encode_callback_)); sender_.reset(new VideoSender(&clock_, &post_encode_callback_));
EXPECT_EQ(0, sender_->InitializeSender()); EXPECT_EQ(0, sender_->InitializeSender());
EXPECT_EQ(0, sender_->RegisterTransportCallback(&packetization_callback_)); EXPECT_EQ(0, sender_->RegisterTransportCallback(&packetization_callback_));
@@ -198,7 +201,7 @@ class TestVideoSenderWithMockEncoder : public TestVideoSender {
static const int kNumberOfLayers = 3; static const int kNumberOfLayers = 3;
static const int kUnusedPayloadType = 10; static const int kUnusedPayloadType = 10;
virtual void SetUp() { virtual void SetUp() OVERRIDE {
TestVideoSender::SetUp(); TestVideoSender::SetUp();
generator_.reset(new EmptyFrameGenerator()); generator_.reset(new EmptyFrameGenerator());
EXPECT_EQ( EXPECT_EQ(
@@ -221,7 +224,7 @@ class TestVideoSenderWithMockEncoder : public TestVideoSender {
EXPECT_EQ(0, sender_->RegisterSendCodec(&settings_, 1, 1200)); EXPECT_EQ(0, sender_->RegisterSendCodec(&settings_, 1, 1200));
} }
virtual void TearDown() { sender_.reset(); } virtual void TearDown() OVERRIDE { sender_.reset(); }
void ExpectIntraRequest(int stream) { void ExpectIntraRequest(int stream) {
if (stream == -1) { if (stream == -1) {
@@ -314,7 +317,7 @@ class TestVideoSenderWithVp8 : public TestVideoSender {
TestVideoSenderWithVp8() TestVideoSenderWithVp8()
: codec_bitrate_kbps_(300), available_bitrate_kbps_(1000) {} : codec_bitrate_kbps_(300), available_bitrate_kbps_(1000) {}
virtual void SetUp() { virtual void SetUp() OVERRIDE {
TestVideoSender::SetUp(); TestVideoSender::SetUp();
const char* input_video = "foreman_cif"; const char* input_video = "foreman_cif";

View File

@@ -32,15 +32,15 @@ class VCMNTEncodeCompleteCallback : public webrtc::VCMPacketizationCallback
void RegisterTransportCallback(webrtc::VCMPacketizationCallback* transport); void RegisterTransportCallback(webrtc::VCMPacketizationCallback* transport);
// process encoded data received from the encoder, // process encoded data received from the encoder,
// pass stream to the VCMReceiver module // pass stream to the VCMReceiver module
int32_t virtual int32_t SendData(
SendData(const webrtc::FrameType frameType, const webrtc::FrameType frameType,
const uint8_t payloadType, const uint8_t payloadType,
const uint32_t timeStamp, const uint32_t timeStamp,
int64_t capture_time_ms, int64_t capture_time_ms,
const uint8_t* payloadData, const uint8_t* payloadData,
const uint32_t payloadSize, const uint32_t payloadSize,
const webrtc::RTPFragmentationHeader& fragmentationHeader, const webrtc::RTPFragmentationHeader& fragmentationHeader,
const webrtc::RTPVideoHeader* videoHdr); const webrtc::RTPVideoHeader* videoHdr) OVERRIDE;
// Register exisitng VCM. // Register exisitng VCM.
// Currently - encode and decode with the same vcm module. // Currently - encode and decode with the same vcm module.
@@ -73,8 +73,10 @@ public:
_currentHeight(0) {} _currentHeight(0) {}
virtual ~VCMNTDecodeCompleCallback(); virtual ~VCMNTDecodeCompleCallback();
void SetUserReceiveCallback(webrtc::VCMReceiveCallback* receiveCallback); void SetUserReceiveCallback(webrtc::VCMReceiveCallback* receiveCallback);
// will write decoded frame into file // will write decoded frame into file
int32_t FrameToRender(webrtc::I420VideoFrame& videoFrame); virtual int32_t FrameToRender(webrtc::I420VideoFrame& videoFrame) OVERRIDE;
int32_t DecodedBytes(); int32_t DecodedBytes();
private: private:
FILE* _decodedFile; FILE* _decodedFile;

View File

@@ -96,13 +96,13 @@ class ViEEncoder
virtual void DeliverFrame(int id, virtual void DeliverFrame(int id,
I420VideoFrame* video_frame, I420VideoFrame* video_frame,
int num_csrcs = 0, int num_csrcs = 0,
const uint32_t CSRC[kRtpCsrcSize] = NULL); const uint32_t CSRC[kRtpCsrcSize] = NULL) OVERRIDE;
virtual void DelayChanged(int id, int frame_delay); virtual void DelayChanged(int id, int frame_delay) OVERRIDE;
virtual int GetPreferedFrameSettings(int* width, virtual int GetPreferedFrameSettings(int* width,
int* height, int* height,
int* frame_rate); int* frame_rate) OVERRIDE;
virtual void ProviderDestroyed(int id) { virtual void ProviderDestroyed(int id) OVERRIDE {
return; return;
} }
@@ -129,7 +129,7 @@ class ViEEncoder
const uint8_t* payload_data, const uint8_t* payload_data,
uint32_t payload_size, uint32_t payload_size,
const RTPFragmentationHeader& fragmentation_header, const RTPFragmentationHeader& fragmentation_header,
const RTPVideoHeader* rtp_video_hdr); const RTPVideoHeader* rtp_video_hdr) OVERRIDE;
// Implements VideoProtectionCallback. // Implements VideoProtectionCallback.
virtual int ProtectionRequest( virtual int ProtectionRequest(
@@ -137,18 +137,20 @@ class ViEEncoder
const FecProtectionParams* key_fec_params, const FecProtectionParams* key_fec_params,
uint32_t* sent_video_rate_bps, uint32_t* sent_video_rate_bps,
uint32_t* sent_nack_rate_bps, uint32_t* sent_nack_rate_bps,
uint32_t* sent_fec_rate_bps); uint32_t* sent_fec_rate_bps) OVERRIDE;
// Implements VideoSendStatisticsCallback. // Implements VideoSendStatisticsCallback.
virtual int32_t SendStatistics(const uint32_t bit_rate, virtual int32_t SendStatistics(const uint32_t bit_rate,
const uint32_t frame_rate); const uint32_t frame_rate) OVERRIDE;
int32_t RegisterCodecObserver(ViEEncoderObserver* observer); int32_t RegisterCodecObserver(ViEEncoderObserver* observer);
// Implements RtcpIntraFrameObserver. // Implements RtcpIntraFrameObserver.
virtual void OnReceivedIntraFrameRequest(uint32_t ssrc); virtual void OnReceivedIntraFrameRequest(uint32_t ssrc) OVERRIDE;
virtual void OnReceivedSLI(uint32_t ssrc, uint8_t picture_id); virtual void OnReceivedSLI(uint32_t ssrc, uint8_t picture_id) OVERRIDE;
virtual void OnReceivedRPSI(uint32_t ssrc, uint64_t picture_id); virtual void OnReceivedRPSI(uint32_t ssrc, uint64_t picture_id) OVERRIDE;
virtual void OnLocalSsrcChanged(uint32_t old_ssrc, uint32_t new_ssrc); virtual void OnLocalSsrcChanged(uint32_t old_ssrc,
uint32_t new_ssrc) OVERRIDE;
// Sets SSRCs for all streams. // Sets SSRCs for all streams.
bool SetSsrcs(const std::list<unsigned int>& ssrcs); bool SetSsrcs(const std::list<unsigned int>& ssrcs);
@@ -159,15 +161,15 @@ class ViEEncoder
int32_t RegisterEffectFilter(ViEEffectFilter* effect_filter); int32_t RegisterEffectFilter(ViEEffectFilter* effect_filter);
// Enables recording of debugging information. // Enables recording of debugging information.
virtual int StartDebugRecording(const char* fileNameUTF8); int StartDebugRecording(const char* fileNameUTF8);
// Disables recording of debugging information. // Disables recording of debugging information.
virtual int StopDebugRecording(); int StopDebugRecording();
// Lets the sender suspend video when the rate drops below // Lets the sender suspend video when the rate drops below
// |threshold_bps|, and turns back on when the rate goes back up above // |threshold_bps|, and turns back on when the rate goes back up above
// |threshold_bps| + |window_bps|. // |threshold_bps| + |window_bps|.
virtual void SuspendBelowMinBitrate(); void SuspendBelowMinBitrate();
// New-style callbacks, used by VideoSendStream. // New-style callbacks, used by VideoSendStream.
void RegisterPreEncodeCallback(I420FrameCallback* pre_encode_callback); void RegisterPreEncodeCallback(I420FrameCallback* pre_encode_callback);