Enable -Winconsistent-missing-override flag.
The problem with gmock is worked around by commenting out any other override declarations in classes using gmock. NOPRESUBMIT=True BUG=webrtc:3970 Review-Url: https://codereview.webrtc.org/1921653002 Cr-Commit-Position: refs/heads/master@{#12563}
This commit is contained in:
parent
b296d0591c
commit
ef8b61e110
@ -117,6 +117,7 @@ config("common_config") {
|
|||||||
cflags += [
|
cflags += [
|
||||||
"-Wimplicit-fallthrough",
|
"-Wimplicit-fallthrough",
|
||||||
"-Wthread-safety",
|
"-Wthread-safety",
|
||||||
|
"-Winconsistent-missing-override",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,7 +83,7 @@ class DtmfSender
|
|||||||
DtmfSender();
|
DtmfSender();
|
||||||
|
|
||||||
// Implements MessageHandler.
|
// Implements MessageHandler.
|
||||||
virtual void OnMessage(rtc::Message* msg);
|
void OnMessage(rtc::Message* msg) override;
|
||||||
|
|
||||||
// The DTMF sending task.
|
// The DTMF sending task.
|
||||||
void DoInsertDtmf();
|
void DoInsertDtmf();
|
||||||
|
|||||||
@ -96,7 +96,7 @@ class FakeDtmfProvider : public DtmfProviderInterface {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual sigslot::signal0<>* GetOnDestroyedSignal() {
|
sigslot::signal0<>* GetOnDestroyedSignal() override {
|
||||||
return &SignalDestroyed;
|
return &SignalDestroyed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -202,7 +202,7 @@ class PCOJava : public PeerConnectionObserver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OnIceCandidatesRemoved(
|
void OnIceCandidatesRemoved(
|
||||||
const std::vector<cricket::Candidate>& candidates) {
|
const std::vector<cricket::Candidate>& candidates) override {
|
||||||
ScopedLocalRefFrame local_ref_frame(jni());
|
ScopedLocalRefFrame local_ref_frame(jni());
|
||||||
jobjectArray candidates_array = ToJavaCandidateArray(jni(), candidates);
|
jobjectArray candidates_array = ToJavaCandidateArray(jni(), candidates);
|
||||||
jmethodID m =
|
jmethodID m =
|
||||||
|
|||||||
@ -31,10 +31,10 @@ class MediaStream : public Notifier<MediaStreamInterface> {
|
|||||||
bool AddTrack(VideoTrackInterface* track) override;
|
bool AddTrack(VideoTrackInterface* track) override;
|
||||||
bool RemoveTrack(AudioTrackInterface* track) override;
|
bool RemoveTrack(AudioTrackInterface* track) override;
|
||||||
bool RemoveTrack(VideoTrackInterface* track) override;
|
bool RemoveTrack(VideoTrackInterface* track) override;
|
||||||
virtual rtc::scoped_refptr<AudioTrackInterface>
|
rtc::scoped_refptr<AudioTrackInterface>
|
||||||
FindAudioTrack(const std::string& track_id);
|
FindAudioTrack(const std::string& track_id) override;
|
||||||
virtual rtc::scoped_refptr<VideoTrackInterface>
|
rtc::scoped_refptr<VideoTrackInterface>
|
||||||
FindVideoTrack(const std::string& track_id);
|
FindVideoTrack(const std::string& track_id) override;
|
||||||
|
|
||||||
AudioTrackVector GetAudioTracks() override { return audio_tracks_; }
|
AudioTrackVector GetAudioTracks() override { return audio_tracks_; }
|
||||||
VideoTrackVector GetVideoTracks() override { return video_tracks_; }
|
VideoTrackVector GetVideoTracks() override { return video_tracks_; }
|
||||||
|
|||||||
@ -35,7 +35,7 @@ typedef rtc::RefCountedObject<DtlsIdentityStoreImpl>
|
|||||||
|
|
||||||
class PeerConnectionFactory : public PeerConnectionFactoryInterface {
|
class PeerConnectionFactory : public PeerConnectionFactoryInterface {
|
||||||
public:
|
public:
|
||||||
virtual void SetOptions(const Options& options) {
|
void SetOptions(const Options& options) override {
|
||||||
options_ = options;
|
options_ = options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -424,8 +424,8 @@ class MockPeerConnectionObserver : public PeerConnectionObserver {
|
|||||||
state_ = pc_->signaling_state();
|
state_ = pc_->signaling_state();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual void OnSignalingChange(
|
void OnSignalingChange(
|
||||||
PeerConnectionInterface::SignalingState new_state) {
|
PeerConnectionInterface::SignalingState new_state) override {
|
||||||
EXPECT_EQ(pc_->signaling_state(), new_state);
|
EXPECT_EQ(pc_->signaling_state(), new_state);
|
||||||
state_ = new_state;
|
state_ = new_state;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,8 +98,8 @@ class AudioRtpSender : public ObserverInterface,
|
|||||||
|
|
||||||
void Stop() override;
|
void Stop() override;
|
||||||
|
|
||||||
RtpParameters GetParameters() const;
|
RtpParameters GetParameters() const override;
|
||||||
bool SetParameters(const RtpParameters& parameters);
|
bool SetParameters(const RtpParameters& parameters) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// TODO(nisse): Since SSRC == 0 is technically valid, figure out
|
// TODO(nisse): Since SSRC == 0 is technically valid, figure out
|
||||||
@ -164,8 +164,8 @@ class VideoRtpSender : public ObserverInterface,
|
|||||||
|
|
||||||
void Stop() override;
|
void Stop() override;
|
||||||
|
|
||||||
RtpParameters GetParameters() const;
|
RtpParameters GetParameters() const override;
|
||||||
bool SetParameters(const RtpParameters& parameters);
|
bool SetParameters(const RtpParameters& parameters) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool can_send_track() const { return track_ && ssrc_; }
|
bool can_send_track() const { return track_ && ssrc_; }
|
||||||
|
|||||||
@ -43,7 +43,11 @@ namespace webrtc {
|
|||||||
// Helper class to test RtpSender/RtpReceiver.
|
// Helper class to test RtpSender/RtpReceiver.
|
||||||
class MockAudioProvider : public AudioProviderInterface {
|
class MockAudioProvider : public AudioProviderInterface {
|
||||||
public:
|
public:
|
||||||
~MockAudioProvider() override {}
|
// TODO(nisse): Valid overrides commented out, because the gmock
|
||||||
|
// methods don't use any override declarations, and we want to avoid
|
||||||
|
// warnings from -Winconsistent-missing-override. See
|
||||||
|
// http://crbug.com/428099.
|
||||||
|
~MockAudioProvider() /* override */ {}
|
||||||
|
|
||||||
MOCK_METHOD2(SetAudioPlayout,
|
MOCK_METHOD2(SetAudioPlayout,
|
||||||
void(uint32_t ssrc,
|
void(uint32_t ssrc,
|
||||||
@ -58,8 +62,8 @@ class MockAudioProvider : public AudioProviderInterface {
|
|||||||
MOCK_METHOD2(SetAudioRtpParameters,
|
MOCK_METHOD2(SetAudioRtpParameters,
|
||||||
bool(uint32_t ssrc, const RtpParameters&));
|
bool(uint32_t ssrc, const RtpParameters&));
|
||||||
|
|
||||||
void SetRawAudioSink(uint32_t,
|
void SetRawAudioSink(
|
||||||
std::unique_ptr<AudioSinkInterface> sink) override {
|
uint32_t, std::unique_ptr<AudioSinkInterface> sink) /* override */ {
|
||||||
sink_ = std::move(sink);
|
sink_ = std::move(sink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -67,6 +67,10 @@ const uint32_t kSsrcOfTrack = 1234;
|
|||||||
|
|
||||||
class MockWebRtcSession : public webrtc::WebRtcSession {
|
class MockWebRtcSession : public webrtc::WebRtcSession {
|
||||||
public:
|
public:
|
||||||
|
// TODO(nisse): Valid overrides commented out, because the gmock
|
||||||
|
// methods don't use any override declarations, and we want to avoid
|
||||||
|
// warnings from -Winconsistent-missing-override. See
|
||||||
|
// http://crbug.com/428099.
|
||||||
explicit MockWebRtcSession(webrtc::MediaControllerInterface* media_controller)
|
explicit MockWebRtcSession(webrtc::MediaControllerInterface* media_controller)
|
||||||
: WebRtcSession(media_controller,
|
: WebRtcSession(media_controller,
|
||||||
rtc::Thread::Current(),
|
rtc::Thread::Current(),
|
||||||
@ -85,7 +89,7 @@ class MockWebRtcSession : public webrtc::WebRtcSession {
|
|||||||
|
|
||||||
// Workaround for gmock's inability to cope with move-only return values.
|
// Workaround for gmock's inability to cope with move-only return values.
|
||||||
std::unique_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate(
|
std::unique_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate(
|
||||||
const std::string& transport_name) override {
|
const std::string& transport_name) /* override */ {
|
||||||
return std::unique_ptr<rtc::SSLCertificate>(
|
return std::unique_ptr<rtc::SSLCertificate>(
|
||||||
GetRemoteSSLCertificate_ReturnsRawPointer(transport_name));
|
GetRemoteSSLCertificate_ReturnsRawPointer(transport_name));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -174,12 +174,12 @@ class FakeAudioCaptureModule
|
|||||||
int32_t ResetAudioDevice() override;
|
int32_t ResetAudioDevice() override;
|
||||||
int32_t SetLoudspeakerStatus(bool enable) override;
|
int32_t SetLoudspeakerStatus(bool enable) override;
|
||||||
int32_t GetLoudspeakerStatus(bool* enabled) const override;
|
int32_t GetLoudspeakerStatus(bool* enabled) const override;
|
||||||
virtual bool BuiltInAECIsAvailable() const { return false; }
|
bool BuiltInAECIsAvailable() const override { return false; }
|
||||||
virtual int32_t EnableBuiltInAEC(bool enable) { return -1; }
|
int32_t EnableBuiltInAEC(bool enable) override { return -1; }
|
||||||
virtual bool BuiltInAGCIsAvailable() const { return false; }
|
bool BuiltInAGCIsAvailable() const override { return false; }
|
||||||
virtual int32_t EnableBuiltInAGC(bool enable) { return -1; }
|
int32_t EnableBuiltInAGC(bool enable) override { return -1; }
|
||||||
virtual bool BuiltInNSIsAvailable() const { return false; }
|
bool BuiltInNSIsAvailable() const override { return false; }
|
||||||
virtual int32_t EnableBuiltInNS(bool enable) { return -1; }
|
int32_t EnableBuiltInNS(bool enable) override { return -1; }
|
||||||
// End of functions inherited from webrtc::AudioDeviceModule.
|
// End of functions inherited from webrtc::AudioDeviceModule.
|
||||||
|
|
||||||
// The following function is inherited from rtc::MessageHandler.
|
// The following function is inherited from rtc::MessageHandler.
|
||||||
|
|||||||
@ -31,7 +31,7 @@ class FakeAdmTest : public testing::Test,
|
|||||||
memset(rec_buffer_, 0, sizeof(rec_buffer_));
|
memset(rec_buffer_, 0, sizeof(rec_buffer_));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void SetUp() {
|
void SetUp() override {
|
||||||
fake_audio_capture_module_ = FakeAudioCaptureModule::Create();
|
fake_audio_capture_module_ = FakeAudioCaptureModule::Create();
|
||||||
EXPECT_TRUE(fake_audio_capture_module_.get() != NULL);
|
EXPECT_TRUE(fake_audio_capture_module_.get() != NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -146,7 +146,7 @@ class FakeDtlsIdentityStore : public webrtc::DtlsIdentityStoreInterface,
|
|||||||
const char* get_cert() { return kKeysAndCerts[key_index_].cert_pem; }
|
const char* get_cert() { return kKeysAndCerts[key_index_].cert_pem; }
|
||||||
|
|
||||||
// rtc::MessageHandler implementation.
|
// rtc::MessageHandler implementation.
|
||||||
void OnMessage(rtc::Message* msg) {
|
void OnMessage(rtc::Message* msg) override {
|
||||||
MessageData* message_data = static_cast<MessageData*>(msg->pdata);
|
MessageData* message_data = static_cast<MessageData*>(msg->pdata);
|
||||||
rtc::scoped_refptr<webrtc::DtlsIdentityRequestObserver> observer =
|
rtc::scoped_refptr<webrtc::DtlsIdentityRequestObserver> observer =
|
||||||
message_data->data();
|
message_data->data();
|
||||||
|
|||||||
@ -33,11 +33,11 @@ class VideoTrack : public MediaStreamTrack<VideoTrackInterface>,
|
|||||||
const rtc::VideoSinkWants& wants) override;
|
const rtc::VideoSinkWants& wants) override;
|
||||||
void RemoveSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink) override;
|
void RemoveSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink) override;
|
||||||
|
|
||||||
virtual VideoTrackSourceInterface* GetSource() const {
|
VideoTrackSourceInterface* GetSource() const override {
|
||||||
return video_source_.get();
|
return video_source_.get();
|
||||||
}
|
}
|
||||||
virtual bool set_enabled(bool enable);
|
bool set_enabled(bool enable) override;
|
||||||
virtual std::string kind() const;
|
std::string kind() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
VideoTrack(const std::string& id, VideoTrackSourceInterface* video_source);
|
VideoTrack(const std::string& id, VideoTrackSourceInterface* video_source);
|
||||||
|
|||||||
@ -36,8 +36,8 @@ class VideoTrackSource : public Notifier<VideoTrackSourceInterface> {
|
|||||||
void Stop() override{};
|
void Stop() override{};
|
||||||
void Restart() override{};
|
void Restart() override{};
|
||||||
|
|
||||||
virtual bool is_screencast() const { return false; }
|
bool is_screencast() const override { return false; }
|
||||||
virtual rtc::Optional<bool> needs_denoising() const {
|
rtc::Optional<bool> needs_denoising() const override {
|
||||||
return rtc::Optional<bool>(); }
|
return rtc::Optional<bool>(); }
|
||||||
|
|
||||||
bool GetStats(Stats* stats) override { return false; }
|
bool GetStats(Stats* stats) override { return false; }
|
||||||
|
|||||||
@ -267,10 +267,10 @@ class WebRtcSession : public AudioProviderInterface,
|
|||||||
const RtpParameters& parameters) override;
|
const RtpParameters& parameters) override;
|
||||||
|
|
||||||
// Implements DtmfProviderInterface.
|
// Implements DtmfProviderInterface.
|
||||||
virtual bool CanInsertDtmf(const std::string& track_id);
|
bool CanInsertDtmf(const std::string& track_id) override;
|
||||||
virtual bool InsertDtmf(const std::string& track_id,
|
bool InsertDtmf(const std::string& track_id,
|
||||||
int code, int duration);
|
int code, int duration) override;
|
||||||
virtual sigslot::signal0<>* GetOnDestroyedSignal();
|
sigslot::signal0<>* GetOnDestroyedSignal() override;
|
||||||
|
|
||||||
// Implements DataChannelProviderInterface.
|
// Implements DataChannelProviderInterface.
|
||||||
bool SendData(const cricket::SendDataParams& params,
|
bool SendData(const cricket::SendDataParams& params,
|
||||||
|
|||||||
@ -191,7 +191,7 @@ class MockIceObserver : public webrtc::IceObserver {
|
|||||||
|
|
||||||
// Some local candidates are removed.
|
// Some local candidates are removed.
|
||||||
void OnIceCandidatesRemoved(
|
void OnIceCandidatesRemoved(
|
||||||
const std::vector<cricket::Candidate>& candidates) {
|
const std::vector<cricket::Candidate>& candidates) override {
|
||||||
num_candidates_removed_ += candidates.size();
|
num_candidates_removed_ += candidates.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class RefCountedBindTester : public RefCountInterface {
|
|||||||
int AddRef() const override {
|
int AddRef() const override {
|
||||||
return ++count_;
|
return ++count_;
|
||||||
}
|
}
|
||||||
int Release() const {
|
int Release() const override {
|
||||||
return --count_;
|
return --count_;
|
||||||
}
|
}
|
||||||
int RefCount() const { return count_; }
|
int RefCount() const { return count_; }
|
||||||
|
|||||||
@ -37,13 +37,13 @@ class FakeSSLCertificate : public rtc::SSLCertificate {
|
|||||||
certs_.push_back(FakeSSLCertificate(*it));
|
certs_.push_back(FakeSSLCertificate(*it));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual FakeSSLCertificate* GetReference() const {
|
FakeSSLCertificate* GetReference() const override {
|
||||||
return new FakeSSLCertificate(*this);
|
return new FakeSSLCertificate(*this);
|
||||||
}
|
}
|
||||||
virtual std::string ToPEMString() const {
|
std::string ToPEMString() const override {
|
||||||
return data_;
|
return data_;
|
||||||
}
|
}
|
||||||
virtual void ToDER(Buffer* der_buffer) const {
|
void ToDER(Buffer* der_buffer) const override {
|
||||||
std::string der_string;
|
std::string der_string;
|
||||||
VERIFY(SSLIdentity::PemToDer(kPemTypeCertificate, data_, &der_string));
|
VERIFY(SSLIdentity::PemToDer(kPemTypeCertificate, data_, &der_string));
|
||||||
der_buffer->SetData(der_string.c_str(), der_string.size());
|
der_buffer->SetData(der_string.c_str(), der_string.size());
|
||||||
@ -57,19 +57,19 @@ class FakeSSLCertificate : public rtc::SSLCertificate {
|
|||||||
void set_digest_algorithm(const std::string& algorithm) {
|
void set_digest_algorithm(const std::string& algorithm) {
|
||||||
digest_algorithm_ = algorithm;
|
digest_algorithm_ = algorithm;
|
||||||
}
|
}
|
||||||
virtual bool GetSignatureDigestAlgorithm(std::string* algorithm) const {
|
bool GetSignatureDigestAlgorithm(std::string* algorithm) const override {
|
||||||
*algorithm = digest_algorithm_;
|
*algorithm = digest_algorithm_;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
virtual bool ComputeDigest(const std::string& algorithm,
|
bool ComputeDigest(const std::string& algorithm,
|
||||||
unsigned char* digest,
|
unsigned char* digest,
|
||||||
size_t size,
|
size_t size,
|
||||||
size_t* length) const {
|
size_t* length) const override {
|
||||||
*length = rtc::ComputeDigest(algorithm, data_.c_str(), data_.size(),
|
*length = rtc::ComputeDigest(algorithm, data_.c_str(), data_.size(),
|
||||||
digest, size);
|
digest, size);
|
||||||
return (*length != 0);
|
return (*length != 0);
|
||||||
}
|
}
|
||||||
virtual std::unique_ptr<SSLCertChain> GetChain() const {
|
std::unique_ptr<SSLCertChain> GetChain() const override {
|
||||||
if (certs_.empty())
|
if (certs_.empty())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
std::vector<SSLCertificate*> new_certs(certs_.size());
|
std::vector<SSLCertificate*> new_certs(certs_.size());
|
||||||
|
|||||||
@ -36,13 +36,13 @@ class RTCCertificateGeneratorFixture : public RTCCertificateGeneratorCallback {
|
|||||||
RTCCertificateGenerator* generator() const { return generator_.get(); }
|
RTCCertificateGenerator* generator() const { return generator_.get(); }
|
||||||
RTCCertificate* certificate() const { return certificate_.get(); }
|
RTCCertificate* certificate() const { return certificate_.get(); }
|
||||||
|
|
||||||
void OnSuccess(const scoped_refptr<RTCCertificate>& certificate) {
|
void OnSuccess(const scoped_refptr<RTCCertificate>& certificate) override {
|
||||||
RTC_CHECK(signaling_thread_->IsCurrent());
|
RTC_CHECK(signaling_thread_->IsCurrent());
|
||||||
RTC_CHECK(certificate);
|
RTC_CHECK(certificate);
|
||||||
certificate_ = certificate;
|
certificate_ = certificate;
|
||||||
generate_async_completed_ = true;
|
generate_async_completed_ = true;
|
||||||
}
|
}
|
||||||
void OnFailure() {
|
void OnFailure() override {
|
||||||
RTC_CHECK(signaling_thread_->IsCurrent());
|
RTC_CHECK(signaling_thread_->IsCurrent());
|
||||||
certificate_ = nullptr;
|
certificate_ = nullptr;
|
||||||
generate_async_completed_ = true;
|
generate_async_completed_ = true;
|
||||||
|
|||||||
@ -562,7 +562,7 @@ class SSLStreamAdapterTestTLS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test data transfer for TLS
|
// Test data transfer for TLS
|
||||||
virtual void TestTransfer(int size) {
|
void TestTransfer(int size) override {
|
||||||
LOG(LS_INFO) << "Starting transfer test with " << size << " bytes";
|
LOG(LS_INFO) << "Starting transfer test with " << size << " bytes";
|
||||||
// Create some dummy data to send.
|
// Create some dummy data to send.
|
||||||
size_t received;
|
size_t received;
|
||||||
@ -591,7 +591,7 @@ class SSLStreamAdapterTestTLS
|
|||||||
recv_stream_.GetBuffer(), size));
|
recv_stream_.GetBuffer(), size));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteData() {
|
void WriteData() override {
|
||||||
size_t position, tosend, size;
|
size_t position, tosend, size;
|
||||||
rtc::StreamResult rv;
|
rtc::StreamResult rv;
|
||||||
size_t sent;
|
size_t sent;
|
||||||
@ -627,7 +627,7 @@ class SSLStreamAdapterTestTLS
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void ReadData(rtc::StreamInterface *stream) {
|
void ReadData(rtc::StreamInterface *stream) override {
|
||||||
char buffer[1600];
|
char buffer[1600];
|
||||||
size_t bread;
|
size_t bread;
|
||||||
int err2;
|
int err2;
|
||||||
@ -691,7 +691,7 @@ class SSLStreamAdapterTestDTLS
|
|||||||
new SSLDummyStreamDTLS(this, "s2c", &server_buffer_, &client_buffer_);
|
new SSLDummyStreamDTLS(this, "s2c", &server_buffer_, &client_buffer_);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void WriteData() {
|
void WriteData() override {
|
||||||
unsigned char *packet = new unsigned char[1600];
|
unsigned char *packet = new unsigned char[1600];
|
||||||
|
|
||||||
while (sent_ < count_) {
|
while (sent_ < count_) {
|
||||||
@ -720,7 +720,7 @@ class SSLStreamAdapterTestDTLS
|
|||||||
delete [] packet;
|
delete [] packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void ReadData(rtc::StreamInterface *stream) {
|
void ReadData(rtc::StreamInterface *stream) override {
|
||||||
unsigned char buffer[2000];
|
unsigned char buffer[2000];
|
||||||
size_t bread;
|
size_t bread;
|
||||||
int err2;
|
int err2;
|
||||||
@ -756,7 +756,7 @@ class SSLStreamAdapterTestDTLS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void TestTransfer(int count) {
|
void TestTransfer(int count) override {
|
||||||
count_ = count;
|
count_ = count;
|
||||||
|
|
||||||
WriteData();
|
WriteData();
|
||||||
|
|||||||
@ -309,6 +309,7 @@
|
|||||||
'cflags': [
|
'cflags': [
|
||||||
'-Wimplicit-fallthrough',
|
'-Wimplicit-fallthrough',
|
||||||
'-Wthread-safety',
|
'-Wthread-safety',
|
||||||
|
'-Winconsistent-missing-override',
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
|
|||||||
@ -395,7 +395,7 @@ void CallPerfTest::TestCaptureNtpTime(const FakeNetworkPipe::Config& net_config,
|
|||||||
EXPECT_TRUE(std::abs(time_offset_ms) < threshold_ms_);
|
EXPECT_TRUE(std::abs(time_offset_ms) < threshold_ms_);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Action OnSendRtp(const uint8_t* packet, size_t length) {
|
Action OnSendRtp(const uint8_t* packet, size_t length) override {
|
||||||
rtc::CritScope lock(&crit_);
|
rtc::CritScope lock(&crit_);
|
||||||
RTPHeader header;
|
RTPHeader header;
|
||||||
EXPECT_TRUE(parser_->Parse(packet, length, &header));
|
EXPECT_TRUE(parser_->Parse(packet, length, &header));
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class PooledI420Buffer : public webrtc::VideoFrameBuffer {
|
|||||||
const uint8_t* DataU() const override { return buffer_->DataU(); }
|
const uint8_t* DataU() const override { return buffer_->DataU(); }
|
||||||
const uint8_t* DataV() const override { return buffer_->DataV(); }
|
const uint8_t* DataV() const override { return buffer_->DataV(); }
|
||||||
|
|
||||||
bool IsMutable() { return HasOneRef(); }
|
bool IsMutable() override { return HasOneRef(); }
|
||||||
// Make the IsMutable() check here instead of in |buffer_|, because the pool
|
// Make the IsMutable() check here instead of in |buffer_|, because the pool
|
||||||
// also has a reference to |buffer_|.
|
// also has a reference to |buffer_|.
|
||||||
uint8_t* MutableDataY() override {
|
uint8_t* MutableDataY() override {
|
||||||
|
|||||||
@ -482,23 +482,23 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
|
|||||||
return sinks_;
|
return sinks_;
|
||||||
}
|
}
|
||||||
int max_bps() const { return max_bps_; }
|
int max_bps() const { return max_bps_; }
|
||||||
virtual bool SetSendParameters(const VideoSendParameters& params) {
|
bool SetSendParameters(const VideoSendParameters& params) override {
|
||||||
return (SetSendCodecs(params.codecs) &&
|
return (SetSendCodecs(params.codecs) &&
|
||||||
SetSendRtpHeaderExtensions(params.extensions) &&
|
SetSendRtpHeaderExtensions(params.extensions) &&
|
||||||
SetMaxSendBandwidth(params.max_bandwidth_bps));
|
SetMaxSendBandwidth(params.max_bandwidth_bps));
|
||||||
}
|
}
|
||||||
virtual bool SetRecvParameters(const VideoRecvParameters& params) {
|
bool SetRecvParameters(const VideoRecvParameters& params) override {
|
||||||
return (SetRecvCodecs(params.codecs) &&
|
return (SetRecvCodecs(params.codecs) &&
|
||||||
SetRecvRtpHeaderExtensions(params.extensions));
|
SetRecvRtpHeaderExtensions(params.extensions));
|
||||||
}
|
}
|
||||||
virtual bool AddSendStream(const StreamParams& sp) {
|
bool AddSendStream(const StreamParams& sp) override {
|
||||||
return RtpHelper<VideoMediaChannel>::AddSendStream(sp);
|
return RtpHelper<VideoMediaChannel>::AddSendStream(sp);
|
||||||
}
|
}
|
||||||
virtual bool RemoveSendStream(uint32_t ssrc) {
|
bool RemoveSendStream(uint32_t ssrc) override {
|
||||||
return RtpHelper<VideoMediaChannel>::RemoveSendStream(ssrc);
|
return RtpHelper<VideoMediaChannel>::RemoveSendStream(ssrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool GetSendCodec(VideoCodec* send_codec) {
|
bool GetSendCodec(VideoCodec* send_codec) override {
|
||||||
if (send_codecs_.empty()) {
|
if (send_codecs_.empty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -516,9 +516,9 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool SetSend(bool send) { return set_sending(send); }
|
bool SetSend(bool send) override { return set_sending(send); }
|
||||||
virtual bool SetVideoSend(uint32_t ssrc, bool enable,
|
bool SetVideoSend(uint32_t ssrc, bool enable,
|
||||||
const VideoOptions* options) {
|
const VideoOptions* options) override {
|
||||||
if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, !enable)) {
|
if (!RtpHelper<VideoMediaChannel>::MuteStream(ssrc, !enable)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -536,20 +536,20 @@ class FakeVideoMediaChannel : public RtpHelper<VideoMediaChannel> {
|
|||||||
bool HasSource(uint32_t ssrc) const {
|
bool HasSource(uint32_t ssrc) const {
|
||||||
return sources_.find(ssrc) != sources_.end();
|
return sources_.find(ssrc) != sources_.end();
|
||||||
}
|
}
|
||||||
virtual bool AddRecvStream(const StreamParams& sp) {
|
bool AddRecvStream(const StreamParams& sp) override {
|
||||||
if (!RtpHelper<VideoMediaChannel>::AddRecvStream(sp))
|
if (!RtpHelper<VideoMediaChannel>::AddRecvStream(sp))
|
||||||
return false;
|
return false;
|
||||||
sinks_[sp.first_ssrc()] = NULL;
|
sinks_[sp.first_ssrc()] = NULL;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
virtual bool RemoveRecvStream(uint32_t ssrc) {
|
bool RemoveRecvStream(uint32_t ssrc) override {
|
||||||
if (!RtpHelper<VideoMediaChannel>::RemoveRecvStream(ssrc))
|
if (!RtpHelper<VideoMediaChannel>::RemoveRecvStream(ssrc))
|
||||||
return false;
|
return false;
|
||||||
sinks_.erase(ssrc);
|
sinks_.erase(ssrc);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool GetStats(VideoMediaInfo* info) { return false; }
|
bool GetStats(VideoMediaInfo* info) override { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool SetRecvCodecs(const std::vector<VideoCodec>& codecs) {
|
bool SetRecvCodecs(const std::vector<VideoCodec>& codecs) {
|
||||||
|
|||||||
@ -182,8 +182,8 @@ class FakeWebRtcVideoEncoderFactory : public WebRtcVideoEncoderFactory {
|
|||||||
num_created_encoders_(0),
|
num_created_encoders_(0),
|
||||||
encoders_have_internal_sources_(false) {}
|
encoders_have_internal_sources_(false) {}
|
||||||
|
|
||||||
virtual webrtc::VideoEncoder* CreateVideoEncoder(
|
webrtc::VideoEncoder* CreateVideoEncoder(
|
||||||
webrtc::VideoCodecType type) {
|
webrtc::VideoCodecType type) override {
|
||||||
rtc::CritScope lock(&crit_);
|
rtc::CritScope lock(&crit_);
|
||||||
if (supported_codec_types_.count(type) == 0) {
|
if (supported_codec_types_.count(type) == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -203,7 +203,7 @@ class FakeWebRtcVideoEncoderFactory : public WebRtcVideoEncoderFactory {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) {
|
void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) override {
|
||||||
rtc::CritScope lock(&crit_);
|
rtc::CritScope lock(&crit_);
|
||||||
encoders_.erase(
|
encoders_.erase(
|
||||||
std::remove(encoders_.begin(), encoders_.end(), encoder),
|
std::remove(encoders_.begin(), encoders_.end(), encoder),
|
||||||
@ -211,12 +211,12 @@ class FakeWebRtcVideoEncoderFactory : public WebRtcVideoEncoderFactory {
|
|||||||
delete encoder;
|
delete encoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const std::vector<WebRtcVideoEncoderFactory::VideoCodec>& codecs()
|
const std::vector<WebRtcVideoEncoderFactory::VideoCodec>& codecs()
|
||||||
const {
|
const override {
|
||||||
return codecs_;
|
return codecs_;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool EncoderTypeHasInternalSource(
|
bool EncoderTypeHasInternalSource(
|
||||||
webrtc::VideoCodecType type) const override {
|
webrtc::VideoCodecType type) const override {
|
||||||
return encoders_have_internal_sources_;
|
return encoders_have_internal_sources_;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -298,7 +298,7 @@ class FakeWebRtcVoiceEngine
|
|||||||
channels_[channel]->associate_send_channel = accociate_send_channel;
|
channels_[channel]->associate_send_channel = accociate_send_channel;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
webrtc::RtcEventLog* GetEventLog() { return nullptr; }
|
webrtc::RtcEventLog* GetEventLog() override { return nullptr; }
|
||||||
|
|
||||||
// webrtc::VoECodec
|
// webrtc::VoECodec
|
||||||
WEBRTC_STUB(NumOfCodecs, ());
|
WEBRTC_STUB(NumOfCodecs, ());
|
||||||
@ -449,11 +449,11 @@ class FakeWebRtcVoiceEngine
|
|||||||
WEBRTC_STUB(SetPlayoutSampleRate, (unsigned int samples_per_sec));
|
WEBRTC_STUB(SetPlayoutSampleRate, (unsigned int samples_per_sec));
|
||||||
WEBRTC_STUB_CONST(PlayoutSampleRate, (unsigned int* samples_per_sec));
|
WEBRTC_STUB_CONST(PlayoutSampleRate, (unsigned int* samples_per_sec));
|
||||||
WEBRTC_STUB(EnableBuiltInAEC, (bool enable));
|
WEBRTC_STUB(EnableBuiltInAEC, (bool enable));
|
||||||
virtual bool BuiltInAECIsAvailable() const { return false; }
|
bool BuiltInAECIsAvailable() const override { return false; }
|
||||||
WEBRTC_STUB(EnableBuiltInAGC, (bool enable));
|
WEBRTC_STUB(EnableBuiltInAGC, (bool enable));
|
||||||
virtual bool BuiltInAGCIsAvailable() const { return false; }
|
bool BuiltInAGCIsAvailable() const override { return false; }
|
||||||
WEBRTC_STUB(EnableBuiltInNS, (bool enable));
|
WEBRTC_STUB(EnableBuiltInNS, (bool enable));
|
||||||
virtual bool BuiltInNSIsAvailable() const { return false; }
|
bool BuiltInNSIsAvailable() const override { return false; }
|
||||||
|
|
||||||
// webrtc::VoENetwork
|
// webrtc::VoENetwork
|
||||||
WEBRTC_FUNC(RegisterExternalTransport, (int channel,
|
WEBRTC_FUNC(RegisterExternalTransport, (int channel,
|
||||||
@ -661,17 +661,17 @@ class FakeWebRtcVoiceEngine
|
|||||||
int reportingThreshold,
|
int reportingThreshold,
|
||||||
int penaltyDecay,
|
int penaltyDecay,
|
||||||
int typeEventDelay));
|
int typeEventDelay));
|
||||||
int EnableHighPassFilter(bool enable) {
|
int EnableHighPassFilter(bool enable) override {
|
||||||
highpass_filter_enabled_ = enable;
|
highpass_filter_enabled_ = enable;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
bool IsHighPassFilterEnabled() {
|
bool IsHighPassFilterEnabled() override {
|
||||||
return highpass_filter_enabled_;
|
return highpass_filter_enabled_;
|
||||||
}
|
}
|
||||||
bool IsStereoChannelSwappingEnabled() {
|
bool IsStereoChannelSwappingEnabled() override {
|
||||||
return stereo_swapping_enabled_;
|
return stereo_swapping_enabled_;
|
||||||
}
|
}
|
||||||
void EnableStereoChannelSwapping(bool enable) {
|
void EnableStereoChannelSwapping(bool enable) override {
|
||||||
stereo_swapping_enabled_ = enable;
|
stereo_swapping_enabled_ = enable;
|
||||||
}
|
}
|
||||||
int GetNetEqCapacity() const {
|
int GetNetEqCapacity() const {
|
||||||
|
|||||||
@ -61,14 +61,14 @@ class WebRtcVideoCapturer : public VideoCapturer,
|
|||||||
protected:
|
protected:
|
||||||
void OnSinkWantsChanged(const rtc::VideoSinkWants& wants) override;
|
void OnSinkWantsChanged(const rtc::VideoSinkWants& wants) override;
|
||||||
// Override virtual methods of the parent class VideoCapturer.
|
// Override virtual methods of the parent class VideoCapturer.
|
||||||
virtual bool GetPreferredFourccs(std::vector<uint32_t>* fourccs);
|
bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Callback when a frame is captured by camera.
|
// Callback when a frame is captured by camera.
|
||||||
virtual void OnIncomingCapturedFrame(const int32_t id,
|
void OnIncomingCapturedFrame(const int32_t id,
|
||||||
const webrtc::VideoFrame& frame);
|
const webrtc::VideoFrame& frame) override;
|
||||||
virtual void OnCaptureDelayChanged(const int32_t id,
|
void OnCaptureDelayChanged(const int32_t id,
|
||||||
const int32_t delay);
|
const int32_t delay) override;
|
||||||
|
|
||||||
// Used to signal captured frames on the same thread as invoked Start().
|
// Used to signal captured frames on the same thread as invoked Start().
|
||||||
// With WebRTC's current VideoCapturer implementations, this will mean a
|
// With WebRTC's current VideoCapturer implementations, this will mean a
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class AcmSendTestOldApi : public AudioPacketizationCallback,
|
|||||||
// Returns the next encoded packet. Returns NULL if the test duration was
|
// Returns the next encoded packet. Returns NULL if the test duration was
|
||||||
// exceeded. Ownership of the packet is handed over to the caller.
|
// exceeded. Ownership of the packet is handed over to the caller.
|
||||||
// Inherited from PacketSource.
|
// Inherited from PacketSource.
|
||||||
Packet* NextPacket();
|
Packet* NextPacket() override;
|
||||||
|
|
||||||
// Inherited from AudioPacketizationCallback.
|
// Inherited from AudioPacketizationCallback.
|
||||||
int32_t SendData(FrameType frame_type,
|
int32_t SendData(FrameType frame_type,
|
||||||
|
|||||||
@ -608,7 +608,7 @@ class AcmIsacMtTestOldApi : public AudioCodingModuleMtTestOldApi {
|
|||||||
|
|
||||||
~AcmIsacMtTestOldApi() {}
|
~AcmIsacMtTestOldApi() {}
|
||||||
|
|
||||||
void SetUp() {
|
void SetUp() override {
|
||||||
AudioCodingModuleTestOldApi::SetUp();
|
AudioCodingModuleTestOldApi::SetUp();
|
||||||
RegisterCodec(); // Must be called before the threads start below.
|
RegisterCodec(); // Must be called before the threads start below.
|
||||||
|
|
||||||
@ -642,7 +642,7 @@ class AcmIsacMtTestOldApi : public AudioCodingModuleMtTestOldApi {
|
|||||||
ASSERT_EQ(0, acm_->RegisterSendCodec(codec_));
|
ASSERT_EQ(0, acm_->RegisterSendCodec(codec_));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InsertPacket() {
|
void InsertPacket() override {
|
||||||
int num_calls = packet_cb_.num_calls(); // Store locally for thread safety.
|
int num_calls = packet_cb_.num_calls(); // Store locally for thread safety.
|
||||||
if (num_calls > last_packet_number_) {
|
if (num_calls > last_packet_number_) {
|
||||||
// Get the new payload out from the callback handler.
|
// Get the new payload out from the callback handler.
|
||||||
@ -661,7 +661,7 @@ class AcmIsacMtTestOldApi : public AudioCodingModuleMtTestOldApi {
|
|||||||
&last_payload_vec_[0], last_payload_vec_.size(), rtp_header_));
|
&last_payload_vec_[0], last_payload_vec_.size(), rtp_header_));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InsertAudio() {
|
void InsertAudio() override {
|
||||||
// TODO(kwiberg): Use std::copy here. Might be complications because AFAICS
|
// TODO(kwiberg): Use std::copy here. Might be complications because AFAICS
|
||||||
// this call confuses the number of samples with the number of bytes, and
|
// this call confuses the number of samples with the number of bytes, and
|
||||||
// ends up copying only half of what it should.
|
// ends up copying only half of what it should.
|
||||||
@ -677,7 +677,7 @@ class AcmIsacMtTestOldApi : public AudioCodingModuleMtTestOldApi {
|
|||||||
// This method is the same as AudioCodingModuleMtTestOldApi::TestDone(), but
|
// This method is the same as AudioCodingModuleMtTestOldApi::TestDone(), but
|
||||||
// here it is using the constants defined in this class (i.e., shorter test
|
// here it is using the constants defined in this class (i.e., shorter test
|
||||||
// run).
|
// run).
|
||||||
virtual bool TestDone() {
|
bool TestDone() override {
|
||||||
if (packet_cb_.num_calls() > kNumPackets) {
|
if (packet_cb_.num_calls() > kNumPackets) {
|
||||||
rtc::CritScope lock(&crit_sect_);
|
rtc::CritScope lock(&crit_sect_);
|
||||||
if (pull_audio_count_ > kNumPullCalls) {
|
if (pull_audio_count_ > kNumPullCalls) {
|
||||||
@ -728,7 +728,7 @@ class AcmReRegisterIsacMtTestOldApi : public AudioCodingModuleTestOldApi {
|
|||||||
clock_ = fake_clock_.get();
|
clock_ = fake_clock_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetUp() {
|
void SetUp() override {
|
||||||
AudioCodingModuleTestOldApi::SetUp();
|
AudioCodingModuleTestOldApi::SetUp();
|
||||||
// Set up input audio source to read from specified file, loop after 5
|
// Set up input audio source to read from specified file, loop after 5
|
||||||
// seconds, and deliver blocks of 10 ms.
|
// seconds, and deliver blocks of 10 ms.
|
||||||
@ -757,7 +757,7 @@ class AcmReRegisterIsacMtTestOldApi : public AudioCodingModuleTestOldApi {
|
|||||||
codec_registration_thread_.SetPriority(rtc::kRealtimePriority);
|
codec_registration_thread_.SetPriority(rtc::kRealtimePriority);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TearDown() {
|
void TearDown() override {
|
||||||
AudioCodingModuleTestOldApi::TearDown();
|
AudioCodingModuleTestOldApi::TearDown();
|
||||||
receive_thread_.Stop();
|
receive_thread_.Stop();
|
||||||
codec_registration_thread_.Stop();
|
codec_registration_thread_.Stop();
|
||||||
@ -1737,7 +1737,7 @@ class AcmSwitchingOutputFrequencyOldApi : public ::testing::Test,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Inherited from test::AudioSink.
|
// Inherited from test::AudioSink.
|
||||||
bool WriteArray(const int16_t* audio, size_t num_samples) {
|
bool WriteArray(const int16_t* audio, size_t num_samples) override {
|
||||||
// Skip checking the first output frame, since it has a number of zeros
|
// Skip checking the first output frame, since it has a number of zeros
|
||||||
// due to how NetEq is initialized.
|
// due to how NetEq is initialized.
|
||||||
if (first_output_) {
|
if (first_output_) {
|
||||||
|
|||||||
@ -25,10 +25,10 @@ class IsacSpeedTest : public AudioCodecSpeedTest {
|
|||||||
IsacSpeedTest();
|
IsacSpeedTest();
|
||||||
void SetUp() override;
|
void SetUp() override;
|
||||||
void TearDown() override;
|
void TearDown() override;
|
||||||
virtual float EncodeABlock(int16_t* in_data, uint8_t* bit_stream,
|
float EncodeABlock(int16_t* in_data, uint8_t* bit_stream,
|
||||||
size_t max_bytes, size_t* encoded_bytes);
|
size_t max_bytes, size_t* encoded_bytes) override;
|
||||||
virtual float DecodeABlock(const uint8_t* bit_stream, size_t encoded_bytes,
|
float DecodeABlock(const uint8_t* bit_stream, size_t encoded_bytes,
|
||||||
int16_t* out_data);
|
int16_t* out_data) override;
|
||||||
ISACFIX_MainStruct *ISACFIX_main_inst_;
|
ISACFIX_MainStruct *ISACFIX_main_inst_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,11 @@ namespace webrtc {
|
|||||||
|
|
||||||
class MockAudioEncoder : public AudioEncoder {
|
class MockAudioEncoder : public AudioEncoder {
|
||||||
public:
|
public:
|
||||||
~MockAudioEncoder() override { Die(); }
|
// TODO(nisse): Valid overrides commented out, because the gmock
|
||||||
|
// methods don't use any override declarations, and we want to avoid
|
||||||
|
// warnings from -Winconsistent-missing-override. See
|
||||||
|
// http://crbug.com/428099.
|
||||||
|
~MockAudioEncoder() /* override */ { Die(); }
|
||||||
MOCK_METHOD0(Die, void());
|
MOCK_METHOD0(Die, void());
|
||||||
MOCK_METHOD1(Mark, void(std::string desc));
|
MOCK_METHOD1(Mark, void(std::string desc));
|
||||||
MOCK_CONST_METHOD0(SampleRateHz, int());
|
MOCK_CONST_METHOD0(SampleRateHz, int());
|
||||||
|
|||||||
@ -23,10 +23,10 @@ class OpusSpeedTest : public AudioCodecSpeedTest {
|
|||||||
OpusSpeedTest();
|
OpusSpeedTest();
|
||||||
void SetUp() override;
|
void SetUp() override;
|
||||||
void TearDown() override;
|
void TearDown() override;
|
||||||
virtual float EncodeABlock(int16_t* in_data, uint8_t* bit_stream,
|
float EncodeABlock(int16_t* in_data, uint8_t* bit_stream,
|
||||||
size_t max_bytes, size_t* encoded_bytes);
|
size_t max_bytes, size_t* encoded_bytes) override;
|
||||||
virtual float DecodeABlock(const uint8_t* bit_stream, size_t encoded_bytes,
|
float DecodeABlock(const uint8_t* bit_stream, size_t encoded_bytes,
|
||||||
int16_t* out_data);
|
int16_t* out_data) override;
|
||||||
WebRtcOpusEncInst* opus_encoder_;
|
WebRtcOpusEncInst* opus_encoder_;
|
||||||
WebRtcOpusDecInst* opus_decoder_;
|
WebRtcOpusDecInst* opus_decoder_;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -783,11 +783,15 @@ TEST_F(NetEqImplTest, UnsupportedDecoder) {
|
|||||||
|
|
||||||
class MockAudioDecoder : public AudioDecoder {
|
class MockAudioDecoder : public AudioDecoder {
|
||||||
public:
|
public:
|
||||||
void Reset() override {}
|
// TODO(nisse): Valid overrides commented out, because the gmock
|
||||||
|
// methods don't use any override declarations, and we want to avoid
|
||||||
|
// warnings from -Winconsistent-missing-override. See
|
||||||
|
// http://crbug.com/428099.
|
||||||
|
void Reset() /* override */ {}
|
||||||
MOCK_CONST_METHOD2(PacketDuration, int(const uint8_t*, size_t));
|
MOCK_CONST_METHOD2(PacketDuration, int(const uint8_t*, size_t));
|
||||||
MOCK_METHOD5(DecodeInternal, int(const uint8_t*, size_t, int, int16_t*,
|
MOCK_METHOD5(DecodeInternal, int(const uint8_t*, size_t, int, int16_t*,
|
||||||
SpeechType*));
|
SpeechType*));
|
||||||
size_t Channels() const override { return kChannels; }
|
size_t Channels() const /* override */ { return kChannels; }
|
||||||
} decoder_;
|
} decoder_;
|
||||||
|
|
||||||
const uint8_t kFirstPayloadValue = 1;
|
const uint8_t kFirstPayloadValue = 1;
|
||||||
|
|||||||
@ -24,31 +24,36 @@ using ::testing::Return;
|
|||||||
|
|
||||||
class MockAudioDecoder final : public AudioDecoder {
|
class MockAudioDecoder final : public AudioDecoder {
|
||||||
public:
|
public:
|
||||||
|
// TODO(nisse): Valid overrides commented out, because the gmock
|
||||||
|
// methods don't use any override declarations, and we want to avoid
|
||||||
|
// warnings from -Winconsistent-missing-override. See
|
||||||
|
// http://crbug.com/428099.
|
||||||
static const int kPacketDuration = 960; // 48 kHz * 20 ms
|
static const int kPacketDuration = 960; // 48 kHz * 20 ms
|
||||||
|
|
||||||
explicit MockAudioDecoder(size_t num_channels)
|
explicit MockAudioDecoder(size_t num_channels)
|
||||||
: num_channels_(num_channels), fec_enabled_(false) {
|
: num_channels_(num_channels), fec_enabled_(false) {
|
||||||
}
|
}
|
||||||
~MockAudioDecoder() override { Die(); }
|
~MockAudioDecoder() /* override */ { Die(); }
|
||||||
MOCK_METHOD0(Die, void());
|
MOCK_METHOD0(Die, void());
|
||||||
|
|
||||||
MOCK_METHOD0(Reset, void());
|
MOCK_METHOD0(Reset, void());
|
||||||
|
|
||||||
int PacketDuration(const uint8_t* encoded,
|
int PacketDuration(const uint8_t* encoded,
|
||||||
size_t encoded_len) const override {
|
size_t encoded_len) const /* override */ {
|
||||||
return kPacketDuration;
|
return kPacketDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PacketDurationRedundant(const uint8_t* encoded,
|
int PacketDurationRedundant(const uint8_t* encoded,
|
||||||
size_t encoded_len) const override {
|
size_t encoded_len) const /* override */ {
|
||||||
return kPacketDuration;
|
return kPacketDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const override {
|
bool PacketHasFec(
|
||||||
|
const uint8_t* encoded, size_t encoded_len) const /* override */ {
|
||||||
return fec_enabled_;
|
return fec_enabled_;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Channels() const override { return num_channels_; }
|
size_t Channels() const /* override */ { return num_channels_; }
|
||||||
|
|
||||||
void set_fec_enabled(bool enable_fec) { fec_enabled_ = enable_fec; }
|
void set_fec_enabled(bool enable_fec) { fec_enabled_ = enable_fec; }
|
||||||
|
|
||||||
@ -60,7 +65,7 @@ class MockAudioDecoder final : public AudioDecoder {
|
|||||||
size_t encoded_len,
|
size_t encoded_len,
|
||||||
int /*sample_rate_hz*/,
|
int /*sample_rate_hz*/,
|
||||||
int16_t* decoded,
|
int16_t* decoded,
|
||||||
SpeechType* speech_type) override {
|
SpeechType* speech_type) /* override */ {
|
||||||
*speech_type = kSpeech;
|
*speech_type = kSpeech;
|
||||||
memset(decoded, 0, sizeof(int16_t) * kPacketDuration * Channels());
|
memset(decoded, 0, sizeof(int16_t) * kPacketDuration * Channels());
|
||||||
return kPacketDuration * Channels();
|
return kPacketDuration * Channels();
|
||||||
@ -70,7 +75,7 @@ class MockAudioDecoder final : public AudioDecoder {
|
|||||||
size_t encoded_len,
|
size_t encoded_len,
|
||||||
int sample_rate_hz,
|
int sample_rate_hz,
|
||||||
int16_t* decoded,
|
int16_t* decoded,
|
||||||
SpeechType* speech_type) override {
|
SpeechType* speech_type) /* override */ {
|
||||||
return DecodeInternal(encoded, encoded_len, sample_rate_hz, decoded,
|
return DecodeInternal(encoded, encoded_len, sample_rate_hz, decoded,
|
||||||
speech_type);
|
speech_type);
|
||||||
}
|
}
|
||||||
@ -294,7 +299,3 @@ TEST(NetEqNetworkStatsTest, NoiseExpansionTest) {
|
|||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -43,8 +43,8 @@ class NetEqIsacQualityTest : public NetEqQualityTest {
|
|||||||
NetEqIsacQualityTest();
|
NetEqIsacQualityTest();
|
||||||
void SetUp() override;
|
void SetUp() override;
|
||||||
void TearDown() override;
|
void TearDown() override;
|
||||||
virtual int EncodeBlock(int16_t* in_data, size_t block_size_samples,
|
int EncodeBlock(int16_t* in_data, size_t block_size_samples,
|
||||||
rtc::Buffer* payload, size_t max_bytes);
|
rtc::Buffer* payload, size_t max_bytes) override;
|
||||||
private:
|
private:
|
||||||
ISACFIX_MainStruct* isac_encoder_;
|
ISACFIX_MainStruct* isac_encoder_;
|
||||||
int bit_rate_kbps_;
|
int bit_rate_kbps_;
|
||||||
|
|||||||
@ -103,8 +103,8 @@ class NetEqOpusQualityTest : public NetEqQualityTest {
|
|||||||
NetEqOpusQualityTest();
|
NetEqOpusQualityTest();
|
||||||
void SetUp() override;
|
void SetUp() override;
|
||||||
void TearDown() override;
|
void TearDown() override;
|
||||||
virtual int EncodeBlock(int16_t* in_data, size_t block_size_samples,
|
int EncodeBlock(int16_t* in_data, size_t block_size_samples,
|
||||||
rtc::Buffer* payload, size_t max_bytes);
|
rtc::Buffer* payload, size_t max_bytes) override;
|
||||||
private:
|
private:
|
||||||
WebRtcOpusEncInst* opus_encoder_;
|
WebRtcOpusEncInst* opus_encoder_;
|
||||||
OpusRepacketizer* repacketizer_;
|
OpusRepacketizer* repacketizer_;
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class WrappingBitrateEstimator : public RemoteBitrateEstimator {
|
|||||||
return rbe_->LatestEstimate(ssrcs, bitrate_bps);
|
return rbe_->LatestEstimate(ssrcs, bitrate_bps);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetMinBitrate(int min_bitrate_bps) {
|
void SetMinBitrate(int min_bitrate_bps) override {
|
||||||
CriticalSectionScoped cs(crit_sect_.get());
|
CriticalSectionScoped cs(crit_sect_.get());
|
||||||
rbe_->SetMinBitrate(min_bitrate_bps);
|
rbe_->SetMinBitrate(min_bitrate_bps);
|
||||||
min_bitrate_bps_ = min_bitrate_bps;
|
min_bitrate_bps_ = min_bitrate_bps;
|
||||||
|
|||||||
@ -157,8 +157,8 @@ TEST_F(ReceiveStatisticsTest, RtcpCallbacks) {
|
|||||||
: RtcpStatisticsCallback(), num_calls_(0), ssrc_(0), stats_() {}
|
: RtcpStatisticsCallback(), num_calls_(0), ssrc_(0), stats_() {}
|
||||||
virtual ~TestCallback() {}
|
virtual ~TestCallback() {}
|
||||||
|
|
||||||
virtual void StatisticsUpdated(const RtcpStatistics& statistics,
|
void StatisticsUpdated(const RtcpStatistics& statistics,
|
||||||
uint32_t ssrc) {
|
uint32_t ssrc) override {
|
||||||
ssrc_ = ssrc;
|
ssrc_ = ssrc;
|
||||||
stats_ = statistics;
|
stats_ = statistics;
|
||||||
++num_calls_;
|
++num_calls_;
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class ReceiverReport : public RtcpPacket {
|
|||||||
static const size_t kRrBaseLength = 4;
|
static const size_t kRrBaseLength = 4;
|
||||||
static const size_t kMaxNumberOfReportBlocks = 0x1F;
|
static const size_t kMaxNumberOfReportBlocks = 0x1F;
|
||||||
|
|
||||||
size_t BlockLength() const {
|
size_t BlockLength() const override {
|
||||||
return kHeaderLength + kRrBaseLength +
|
return kHeaderLength + kRrBaseLength +
|
||||||
report_blocks_.size() * ReportBlock::kLength;
|
report_blocks_.size() * ReportBlock::kLength;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -406,7 +406,8 @@ class RTPPayloadAudioStrategy : public RTPPayloadStrategy {
|
|||||||
return payload;
|
return payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetPayloadTypeFrequency(const RtpUtility::Payload& payload) const {
|
int GetPayloadTypeFrequency(
|
||||||
|
const RtpUtility::Payload& payload) const override {
|
||||||
return payload.typeSpecific.Audio.frequency;
|
return payload.typeSpecific.Audio.frequency;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -456,7 +457,8 @@ class RTPPayloadVideoStrategy : public RTPPayloadStrategy {
|
|||||||
return payload;
|
return payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetPayloadTypeFrequency(const RtpUtility::Payload& payload) const {
|
int GetPayloadTypeFrequency(
|
||||||
|
const RtpUtility::Payload& payload) const override {
|
||||||
return kVideoPayloadTypeFrequency;
|
return kVideoPayloadTypeFrequency;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -31,15 +31,15 @@ class RTPReceiverAudio : public RTPReceiverStrategy,
|
|||||||
|
|
||||||
// The following three methods implement the TelephoneEventHandler interface.
|
// The following three methods implement the TelephoneEventHandler interface.
|
||||||
// Forward DTMFs to decoder for playout.
|
// Forward DTMFs to decoder for playout.
|
||||||
void SetTelephoneEventForwardToDecoder(bool forward_to_decoder);
|
void SetTelephoneEventForwardToDecoder(bool forward_to_decoder) override;
|
||||||
|
|
||||||
// Is forwarding of outband telephone events turned on/off?
|
// Is forwarding of outband telephone events turned on/off?
|
||||||
bool TelephoneEventForwardToDecoder() const;
|
bool TelephoneEventForwardToDecoder() const override;
|
||||||
|
|
||||||
// Is TelephoneEvent configured with payload type payload_type
|
// Is TelephoneEvent configured with payload type payload_type
|
||||||
bool TelephoneEventPayloadType(const int8_t payload_type) const;
|
bool TelephoneEventPayloadType(const int8_t payload_type) const override;
|
||||||
|
|
||||||
TelephoneEventHandler* GetTelephoneEventHandler() { return this; }
|
TelephoneEventHandler* GetTelephoneEventHandler() override { return this; }
|
||||||
|
|
||||||
// Returns true if CNG is configured with payload type payload_type. If so,
|
// Returns true if CNG is configured with payload type payload_type. If so,
|
||||||
// the frequency and cng_payload_type_has_changed are filled in.
|
// the frequency and cng_payload_type_has_changed are filled in.
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class RTPReceiverVideo : public RTPReceiverStrategy {
|
|||||||
int64_t timestamp,
|
int64_t timestamp,
|
||||||
bool is_first_packet) override;
|
bool is_first_packet) override;
|
||||||
|
|
||||||
TelephoneEventHandler* GetTelephoneEventHandler() { return NULL; }
|
TelephoneEventHandler* GetTelephoneEventHandler() override { return NULL; }
|
||||||
|
|
||||||
int GetPayloadTypeFrequency() const override;
|
int GetPayloadTypeFrequency() const override;
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,10 @@ namespace webrtc {
|
|||||||
|
|
||||||
class MockProcessThread : public ProcessThread {
|
class MockProcessThread : public ProcessThread {
|
||||||
public:
|
public:
|
||||||
|
// TODO(nisse): Valid overrides commented out, because the gmock
|
||||||
|
// methods don't use any override declarations, and we want to avoid
|
||||||
|
// warnings from -Winconsistent-missing-override. See
|
||||||
|
// http://crbug.com/428099.
|
||||||
MOCK_METHOD0(Start, void());
|
MOCK_METHOD0(Start, void());
|
||||||
MOCK_METHOD0(Stop, void());
|
MOCK_METHOD0(Stop, void());
|
||||||
MOCK_METHOD1(WakeUp, void(Module* module));
|
MOCK_METHOD1(WakeUp, void(Module* module));
|
||||||
@ -31,7 +35,7 @@ class MockProcessThread : public ProcessThread {
|
|||||||
// MOCK_METHOD1 gets confused with mocking this method, so we work around it
|
// MOCK_METHOD1 gets confused with mocking this method, so we work around it
|
||||||
// by overriding the method from the interface and forwarding the call to a
|
// by overriding the method from the interface and forwarding the call to a
|
||||||
// mocked, simpler method.
|
// mocked, simpler method.
|
||||||
void PostTask(std::unique_ptr<ProcessTask> task) override {
|
void PostTask(std::unique_ptr<ProcessTask> task) /* override */ {
|
||||||
PostTask(task.get());
|
PostTask(task.get());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -45,23 +45,23 @@ public:
|
|||||||
virtual ~FileRecorderImpl();
|
virtual ~FileRecorderImpl();
|
||||||
|
|
||||||
// FileRecorder functions.
|
// FileRecorder functions.
|
||||||
virtual int32_t RegisterModuleFileCallback(FileCallback* callback);
|
int32_t RegisterModuleFileCallback(FileCallback* callback) override;
|
||||||
virtual FileFormats RecordingFileFormat() const;
|
FileFormats RecordingFileFormat() const override;
|
||||||
virtual int32_t StartRecordingAudioFile(
|
int32_t StartRecordingAudioFile(
|
||||||
const char* fileName,
|
const char* fileName,
|
||||||
const CodecInst& codecInst,
|
const CodecInst& codecInst,
|
||||||
uint32_t notificationTimeMs) override;
|
uint32_t notificationTimeMs) override;
|
||||||
virtual int32_t StartRecordingAudioFile(
|
int32_t StartRecordingAudioFile(
|
||||||
OutStream& destStream,
|
OutStream& destStream,
|
||||||
const CodecInst& codecInst,
|
const CodecInst& codecInst,
|
||||||
uint32_t notificationTimeMs) override;
|
uint32_t notificationTimeMs) override;
|
||||||
virtual int32_t StopRecording();
|
int32_t StopRecording() override;
|
||||||
virtual bool IsRecording() const;
|
bool IsRecording() const override;
|
||||||
virtual int32_t codec_info(CodecInst& codecInst) const;
|
int32_t codec_info(CodecInst& codecInst) const override;
|
||||||
virtual int32_t RecordAudioToFile(
|
int32_t RecordAudioToFile(
|
||||||
const AudioFrame& frame,
|
const AudioFrame& frame,
|
||||||
const TickTime* playoutTS = NULL);
|
const TickTime* playoutTS = NULL) override;
|
||||||
virtual int32_t StartRecordingVideoFile(
|
int32_t StartRecordingVideoFile(
|
||||||
const char* fileName,
|
const char* fileName,
|
||||||
const CodecInst& audioCodecInst,
|
const CodecInst& audioCodecInst,
|
||||||
const VideoCodec& videoCodecInst,
|
const VideoCodec& videoCodecInst,
|
||||||
@ -69,7 +69,7 @@ public:
|
|||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
virtual int32_t RecordVideoToFile(const VideoFrame& videoFrame) {
|
int32_t RecordVideoToFile(const VideoFrame& videoFrame) override {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -101,10 +101,10 @@ class RealTimeTemporalLayers : public TemporalLayers {
|
|||||||
|
|
||||||
virtual ~RealTimeTemporalLayers() {}
|
virtual ~RealTimeTemporalLayers() {}
|
||||||
|
|
||||||
virtual bool ConfigureBitrates(int bitrate_kbit,
|
bool ConfigureBitrates(int bitrate_kbit,
|
||||||
int max_bitrate_kbit,
|
int max_bitrate_kbit,
|
||||||
int framerate,
|
int framerate,
|
||||||
vpx_codec_enc_cfg_t* cfg) {
|
vpx_codec_enc_cfg_t* cfg) override {
|
||||||
temporal_layers_ =
|
temporal_layers_ =
|
||||||
CalculateNumberOfTemporalLayers(temporal_layers_, framerate);
|
CalculateNumberOfTemporalLayers(temporal_layers_, framerate);
|
||||||
temporal_layers_ = std::min(temporal_layers_, max_temporal_layers_);
|
temporal_layers_ = std::min(temporal_layers_, max_temporal_layers_);
|
||||||
@ -184,7 +184,7 @@ class RealTimeTemporalLayers : public TemporalLayers {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int EncodeFlags(uint32_t timestamp) {
|
int EncodeFlags(uint32_t timestamp) override {
|
||||||
frame_counter_++;
|
frame_counter_++;
|
||||||
return CurrentEncodeFlags();
|
return CurrentEncodeFlags();
|
||||||
}
|
}
|
||||||
@ -196,16 +196,16 @@ class RealTimeTemporalLayers : public TemporalLayers {
|
|||||||
return encode_flags_[index];
|
return encode_flags_[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int CurrentLayerId() const {
|
int CurrentLayerId() const override {
|
||||||
assert(layer_ids_length_ > 0 && layer_ids_ != NULL);
|
assert(layer_ids_length_ > 0 && layer_ids_ != NULL);
|
||||||
int index = frame_counter_ % layer_ids_length_;
|
int index = frame_counter_ % layer_ids_length_;
|
||||||
assert(index >= 0 && index < layer_ids_length_);
|
assert(index >= 0 && index < layer_ids_length_);
|
||||||
return layer_ids_[index];
|
return layer_ids_[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void PopulateCodecSpecific(bool base_layer_sync,
|
void PopulateCodecSpecific(bool base_layer_sync,
|
||||||
CodecSpecificInfoVP8* vp8_info,
|
CodecSpecificInfoVP8* vp8_info,
|
||||||
uint32_t timestamp) {
|
uint32_t timestamp) override {
|
||||||
assert(temporal_layers_ > 0);
|
assert(temporal_layers_ > 0);
|
||||||
|
|
||||||
if (temporal_layers_ == 1) {
|
if (temporal_layers_ == 1) {
|
||||||
|
|||||||
@ -107,34 +107,40 @@ TEST_F(TestSimulcastEncoderAdapter, DISABLED_TestRPSIEncoder) {
|
|||||||
|
|
||||||
class MockVideoEncoder : public VideoEncoder {
|
class MockVideoEncoder : public VideoEncoder {
|
||||||
public:
|
public:
|
||||||
|
// TODO(nisse): Valid overrides commented out, because the gmock
|
||||||
|
// methods don't use any override declarations, and we want to avoid
|
||||||
|
// warnings from -Winconsistent-missing-override. See
|
||||||
|
// http://crbug.com/428099.
|
||||||
int32_t InitEncode(const VideoCodec* codecSettings,
|
int32_t InitEncode(const VideoCodec* codecSettings,
|
||||||
int32_t numberOfCores,
|
int32_t numberOfCores,
|
||||||
size_t maxPayloadSize) override {
|
size_t maxPayloadSize) /* override */ {
|
||||||
codec_ = *codecSettings;
|
codec_ = *codecSettings;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Encode(const VideoFrame& inputImage,
|
int32_t Encode(const VideoFrame& inputImage,
|
||||||
const CodecSpecificInfo* codecSpecificInfo,
|
const CodecSpecificInfo* codecSpecificInfo,
|
||||||
const std::vector<FrameType>* frame_types) override {
|
const std::vector<FrameType>* frame_types) /* override */ {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t RegisterEncodeCompleteCallback(
|
int32_t RegisterEncodeCompleteCallback(
|
||||||
EncodedImageCallback* callback) override {
|
EncodedImageCallback* callback) /* override */ {
|
||||||
callback_ = callback;
|
callback_ = callback;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Release() override { return 0; }
|
int32_t Release() /* override */ { return 0; }
|
||||||
|
|
||||||
int32_t SetRates(uint32_t newBitRate, uint32_t frameRate) override {
|
int32_t SetRates(uint32_t newBitRate, uint32_t frameRate) /* override */ {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
MOCK_METHOD2(SetChannelParameters, int32_t(uint32_t packetLoss, int64_t rtt));
|
MOCK_METHOD2(SetChannelParameters, int32_t(uint32_t packetLoss, int64_t rtt));
|
||||||
|
|
||||||
bool SupportsNativeHandle() const override { return supports_native_handle_; }
|
bool SupportsNativeHandle() const /* override */ {
|
||||||
|
return supports_native_handle_;
|
||||||
|
}
|
||||||
|
|
||||||
virtual ~MockVideoEncoder() {}
|
virtual ~MockVideoEncoder() {}
|
||||||
|
|
||||||
|
|||||||
@ -168,7 +168,7 @@ class SkipEncodingUnusedStreamsTest {
|
|||||||
|
|
||||||
virtual ~SpyingTemporalLayers() { delete layers_; }
|
virtual ~SpyingTemporalLayers() { delete layers_; }
|
||||||
|
|
||||||
virtual int EncodeFlags(uint32_t timestamp) {
|
int EncodeFlags(uint32_t timestamp) override {
|
||||||
return layers_->EncodeFlags(timestamp);
|
return layers_->EncodeFlags(timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -40,21 +40,21 @@ class VP8EncoderImpl : public VP8Encoder {
|
|||||||
|
|
||||||
virtual ~VP8EncoderImpl();
|
virtual ~VP8EncoderImpl();
|
||||||
|
|
||||||
virtual int Release();
|
int Release() override;
|
||||||
|
|
||||||
virtual int InitEncode(const VideoCodec* codec_settings,
|
int InitEncode(const VideoCodec* codec_settings,
|
||||||
int number_of_cores,
|
int number_of_cores,
|
||||||
size_t max_payload_size);
|
size_t max_payload_size) override;
|
||||||
|
|
||||||
virtual int Encode(const VideoFrame& input_image,
|
int Encode(const VideoFrame& input_image,
|
||||||
const CodecSpecificInfo* codec_specific_info,
|
const CodecSpecificInfo* codec_specific_info,
|
||||||
const std::vector<FrameType>* frame_types);
|
const std::vector<FrameType>* frame_types) override;
|
||||||
|
|
||||||
virtual int RegisterEncodeCompleteCallback(EncodedImageCallback* callback);
|
int RegisterEncodeCompleteCallback(EncodedImageCallback* callback) override;
|
||||||
|
|
||||||
virtual int SetChannelParameters(uint32_t packet_loss, int64_t rtt);
|
int SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
|
||||||
|
|
||||||
virtual int SetRates(uint32_t new_bitrate_kbit, uint32_t frame_rate);
|
int SetRates(uint32_t new_bitrate_kbit, uint32_t frame_rate) override;
|
||||||
|
|
||||||
void OnDroppedFrame() override {}
|
void OnDroppedFrame() override {}
|
||||||
|
|
||||||
|
|||||||
@ -215,7 +215,7 @@ class TestBasicJitterBuffer : public ::testing::TestWithParam<std::string>,
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
TestBasicJitterBuffer() : scoped_field_trial_(GetParam()) {}
|
TestBasicJitterBuffer() : scoped_field_trial_(GetParam()) {}
|
||||||
virtual void SetUp() {
|
void SetUp() override {
|
||||||
clock_.reset(new SimulatedClock(0));
|
clock_.reset(new SimulatedClock(0));
|
||||||
jitter_buffer_.reset(new VCMJitterBuffer(
|
jitter_buffer_.reset(new VCMJitterBuffer(
|
||||||
clock_.get(),
|
clock_.get(),
|
||||||
|
|||||||
@ -231,7 +231,7 @@ class FakeTransportChannel : public TransportChannelImpl,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool SetLocalCertificate(
|
bool SetLocalCertificate(
|
||||||
const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) {
|
const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) override {
|
||||||
local_cert_ = certificate;
|
local_cert_ = certificate;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -257,7 +257,7 @@ class FakeTransportChannel : public TransportChannelImpl,
|
|||||||
|
|
||||||
bool GetSslCipherSuite(int* cipher_suite) override { return false; }
|
bool GetSslCipherSuite(int* cipher_suite) override { return false; }
|
||||||
|
|
||||||
rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const {
|
rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const override {
|
||||||
return local_cert_;
|
return local_cert_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -965,7 +965,7 @@ class FakePacketSocketFactory : public rtc::PacketSocketFactory {
|
|||||||
void set_next_client_tcp_socket(AsyncPacketSocket* next_client_tcp_socket) {
|
void set_next_client_tcp_socket(AsyncPacketSocket* next_client_tcp_socket) {
|
||||||
next_client_tcp_socket_ = next_client_tcp_socket;
|
next_client_tcp_socket_ = next_client_tcp_socket;
|
||||||
}
|
}
|
||||||
rtc::AsyncResolverInterface* CreateAsyncResolver() {
|
rtc::AsyncResolverInterface* CreateAsyncResolver() override {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,10 @@ namespace test {
|
|||||||
// able to get the various interfaces as usual, via T::GetInterface().
|
// able to get the various interfaces as usual, via T::GetInterface().
|
||||||
class MockVoiceEngine : public VoiceEngineImpl {
|
class MockVoiceEngine : public VoiceEngineImpl {
|
||||||
public:
|
public:
|
||||||
|
// TODO(nisse): Valid overrides commented out, because the gmock
|
||||||
|
// methods don't use any override declarations, and we want to avoid
|
||||||
|
// warnings from -Winconsistent-missing-override. See
|
||||||
|
// http://crbug.com/428099.
|
||||||
MockVoiceEngine() : VoiceEngineImpl(new Config(), true) {
|
MockVoiceEngine() : VoiceEngineImpl(new Config(), true) {
|
||||||
// Increase ref count so this object isn't automatically deleted whenever
|
// Increase ref count so this object isn't automatically deleted whenever
|
||||||
// interfaces are Release():d.
|
// interfaces are Release():d.
|
||||||
@ -36,7 +40,7 @@ class MockVoiceEngine : public VoiceEngineImpl {
|
|||||||
return new testing::NiceMock<MockVoEChannelProxy>();
|
return new testing::NiceMock<MockVoEChannelProxy>();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
~MockVoiceEngine() override {
|
~MockVoiceEngine() /* override */ {
|
||||||
// Decrease ref count before base class d-tor is called; otherwise it will
|
// Decrease ref count before base class d-tor is called; otherwise it will
|
||||||
// trigger an assertion.
|
// trigger an assertion.
|
||||||
--_ref_count;
|
--_ref_count;
|
||||||
@ -45,7 +49,8 @@ class MockVoiceEngine : public VoiceEngineImpl {
|
|||||||
MOCK_METHOD1(ChannelProxyFactory, voe::ChannelProxy*(int channel_id));
|
MOCK_METHOD1(ChannelProxyFactory, voe::ChannelProxy*(int channel_id));
|
||||||
|
|
||||||
// VoiceEngineImpl
|
// VoiceEngineImpl
|
||||||
std::unique_ptr<voe::ChannelProxy> GetChannelProxy(int channel_id) override {
|
std::unique_ptr<voe::ChannelProxy> GetChannelProxy(
|
||||||
|
int channel_id) /* override */ {
|
||||||
return std::unique_ptr<voe::ChannelProxy>(ChannelProxyFactory(channel_id));
|
return std::unique_ptr<voe::ChannelProxy>(ChannelProxyFactory(channel_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -131,7 +131,7 @@ class RtpDumpReader : public RtpFileReaderImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Init(const std::string& filename,
|
bool Init(const std::string& filename,
|
||||||
const std::set<uint32_t>& ssrc_filter) {
|
const std::set<uint32_t>& ssrc_filter) override {
|
||||||
file_ = fopen(filename.c_str(), "rb");
|
file_ = fopen(filename.c_str(), "rb");
|
||||||
if (file_ == NULL) {
|
if (file_ == NULL) {
|
||||||
printf("ERROR: Can't open file: %s\n", filename.c_str());
|
printf("ERROR: Can't open file: %s\n", filename.c_str());
|
||||||
|
|||||||
@ -1765,7 +1765,7 @@ TEST_F(EndToEndTest, RembWithSendSideBwe) {
|
|||||||
|
|
||||||
~BweObserver() {}
|
~BweObserver() {}
|
||||||
|
|
||||||
test::PacketTransport* CreateReceiveTransport() {
|
test::PacketTransport* CreateReceiveTransport() override {
|
||||||
receive_transport_ = new test::PacketTransport(
|
receive_transport_ = new test::PacketTransport(
|
||||||
nullptr, this, test::PacketTransport::kReceiver,
|
nullptr, this, test::PacketTransport::kReceiver,
|
||||||
FakeNetworkPipe::Config());
|
FakeNetworkPipe::Config());
|
||||||
@ -2248,7 +2248,7 @@ void EndToEndTest::TestXrReceiverReferenceTimeReport(bool enable_rrtr) {
|
|||||||
return SEND_PACKET;
|
return SEND_PACKET;
|
||||||
}
|
}
|
||||||
// Send stream should send SR packets (and DLRR packets if enabled).
|
// Send stream should send SR packets (and DLRR packets if enabled).
|
||||||
virtual Action OnSendRtcp(const uint8_t* packet, size_t length) {
|
Action OnSendRtcp(const uint8_t* packet, size_t length) override {
|
||||||
rtc::CritScope lock(&crit_);
|
rtc::CritScope lock(&crit_);
|
||||||
RTCPUtility::RTCPParserV2 parser(packet, length, true);
|
RTCPUtility::RTCPParserV2 parser(packet, length, true);
|
||||||
EXPECT_TRUE(parser.IsValid());
|
EXPECT_TRUE(parser.IsValid());
|
||||||
|
|||||||
@ -53,7 +53,7 @@ class CpuOveruseObserverImpl : public CpuOveruseObserver {
|
|||||||
class OveruseFrameDetectorTest : public ::testing::Test,
|
class OveruseFrameDetectorTest : public ::testing::Test,
|
||||||
public CpuOveruseMetricsObserver {
|
public CpuOveruseMetricsObserver {
|
||||||
protected:
|
protected:
|
||||||
virtual void SetUp() {
|
void SetUp() override {
|
||||||
clock_.reset(new SimulatedClock(1234));
|
clock_.reset(new SimulatedClock(1234));
|
||||||
observer_.reset(new MockCpuOveruseObserver());
|
observer_.reset(new MockCpuOveruseObserver());
|
||||||
options_.min_process_count = 0;
|
options_.min_process_count = 0;
|
||||||
|
|||||||
@ -708,7 +708,7 @@ void VideoSendStreamTest::TestPacketFragmentationSize(VideoFormat format,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void EncodedFrameCallback(const EncodedFrame& encoded_frame) {
|
void EncodedFrameCallback(const EncodedFrame& encoded_frame) override {
|
||||||
// Increase frame size for next encoded frame, in the context of the
|
// Increase frame size for next encoded frame, in the context of the
|
||||||
// encoder thread.
|
// encoder thread.
|
||||||
if (!use_fec_ &&
|
if (!use_fec_ &&
|
||||||
@ -999,8 +999,8 @@ TEST_F(VideoSendStreamTest, NoPaddingWhenVideoIsMuted) {
|
|||||||
|
|
||||||
size_t GetNumVideoStreams() const override { return 3; }
|
size_t GetNumVideoStreams() const override { return 3; }
|
||||||
|
|
||||||
virtual void OnFrameGeneratorCapturerCreated(
|
void OnFrameGeneratorCapturerCreated(
|
||||||
test::FrameGeneratorCapturer* frame_generator_capturer) {
|
test::FrameGeneratorCapturer* frame_generator_capturer) override {
|
||||||
rtc::CritScope lock(&crit_);
|
rtc::CritScope lock(&crit_);
|
||||||
capturer_ = frame_generator_capturer;
|
capturer_ = frame_generator_capturer;
|
||||||
}
|
}
|
||||||
@ -1040,7 +1040,7 @@ TEST_F(VideoSendStreamTest, MinTransmitBitrateRespectsRemb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual Action OnSendRtp(const uint8_t* packet, size_t length) {
|
Action OnSendRtp(const uint8_t* packet, size_t length) override {
|
||||||
if (RtpHeaderParser::IsRtcp(packet, length))
|
if (RtpHeaderParser::IsRtcp(packet, length))
|
||||||
return DROP_PACKET;
|
return DROP_PACKET;
|
||||||
|
|
||||||
|
|||||||
@ -81,11 +81,10 @@ class ViEChannel : public VCMFrameTypeCallback,
|
|||||||
CallStatsObserver* GetStatsObserver();
|
CallStatsObserver* GetStatsObserver();
|
||||||
|
|
||||||
// Implements VCMReceiveCallback.
|
// Implements VCMReceiveCallback.
|
||||||
virtual int32_t FrameToRender(VideoFrame& video_frame); // NOLINT
|
int32_t FrameToRender(VideoFrame& video_frame) override; // NOLINT
|
||||||
|
|
||||||
// Implements VCMReceiveCallback.
|
// Implements VCMReceiveCallback.
|
||||||
virtual int32_t ReceivedDecodedReferenceFrame(
|
int32_t ReceivedDecodedReferenceFrame(const uint64_t picture_id) override;
|
||||||
const uint64_t picture_id);
|
|
||||||
|
|
||||||
// Implements VCMReceiveCallback.
|
// Implements VCMReceiveCallback.
|
||||||
void OnIncomingPayloadType(int payload_type) override;
|
void OnIncomingPayloadType(int payload_type) override;
|
||||||
@ -97,20 +96,20 @@ class ViEChannel : public VCMFrameTypeCallback,
|
|||||||
void OnFrameCountsUpdated(const FrameCounts& frame_counts) override;
|
void OnFrameCountsUpdated(const FrameCounts& frame_counts) override;
|
||||||
|
|
||||||
// Implements VCMDecoderTimingCallback.
|
// Implements VCMDecoderTimingCallback.
|
||||||
virtual void OnDecoderTiming(int decode_ms,
|
void OnDecoderTiming(int decode_ms,
|
||||||
int max_decode_ms,
|
int max_decode_ms,
|
||||||
int current_delay_ms,
|
int current_delay_ms,
|
||||||
int target_delay_ms,
|
int target_delay_ms,
|
||||||
int jitter_buffer_ms,
|
int jitter_buffer_ms,
|
||||||
int min_playout_delay_ms,
|
int min_playout_delay_ms,
|
||||||
int render_delay_ms);
|
int render_delay_ms) override;
|
||||||
|
|
||||||
// Implements FrameTypeCallback.
|
// Implements FrameTypeCallback.
|
||||||
virtual int32_t RequestKeyFrame();
|
int32_t RequestKeyFrame() override;
|
||||||
|
|
||||||
// Implements FrameTypeCallback.
|
// Implements FrameTypeCallback.
|
||||||
virtual int32_t SliceLossIndicationRequest(
|
int32_t SliceLossIndicationRequest(
|
||||||
const uint64_t picture_id);
|
const uint64_t picture_id) override;
|
||||||
|
|
||||||
// Implements VideoPacketRequestCallback.
|
// Implements VideoPacketRequestCallback.
|
||||||
int32_t ResendPackets(const uint16_t* sequence_numbers,
|
int32_t ResendPackets(const uint16_t* sequence_numbers,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user