summaryrefslogtreecommitdiffstats
path: root/media/cast/test
diff options
context:
space:
mode:
Diffstat (limited to 'media/cast/test')
-rw-r--r--media/cast/test/cast_benchmarks.cc34
-rw-r--r--media/cast/test/end2end_unittest.cc11
-rw-r--r--media/cast/test/fake_receiver_time_offset_estimator.h10
-rw-r--r--media/cast/test/fake_single_thread_task_runner.h17
-rw-r--r--media/cast/test/fake_video_encode_accelerator.h28
-rw-r--r--media/cast/test/loopback_transport.cc4
-rw-r--r--media/cast/test/loopback_transport.h7
-rw-r--r--media/cast/test/receiver.cc23
-rw-r--r--media/cast/test/skewed_single_thread_task_runner.h17
-rw-r--r--media/cast/test/skewed_tick_clock.h2
-rw-r--r--media/cast/test/utility/standalone_cast_environment.h2
-rw-r--r--media/cast/test/utility/udp_proxy.cc40
-rw-r--r--media/cast/test/utility/udp_proxy_main.cc3
13 files changed, 89 insertions, 109 deletions
diff --git a/media/cast/test/cast_benchmarks.cc b/media/cast/test/cast_benchmarks.cc
index 6e1f8f1..bfa1270 100644
--- a/media/cast/test/cast_benchmarks.cc
+++ b/media/cast/test/cast_benchmarks.cc
@@ -108,24 +108,21 @@ class CastTransportSenderWrapper : public CastTransportSender {
encoded_audio_bytes_ = encoded_audio_bytes;
}
- virtual void InitializeAudio(
- const CastTransportRtpConfig& config,
- const RtcpCastMessageCallback& cast_message_cb,
- const RtcpRttCallback& rtt_cb) override {
+ void InitializeAudio(const CastTransportRtpConfig& config,
+ const RtcpCastMessageCallback& cast_message_cb,
+ const RtcpRttCallback& rtt_cb) override {
audio_ssrc_ = config.ssrc;
transport_->InitializeAudio(config, cast_message_cb, rtt_cb);
}
- virtual void InitializeVideo(
- const CastTransportRtpConfig& config,
- const RtcpCastMessageCallback& cast_message_cb,
- const RtcpRttCallback& rtt_cb) override {
+ void InitializeVideo(const CastTransportRtpConfig& config,
+ const RtcpCastMessageCallback& cast_message_cb,
+ const RtcpRttCallback& rtt_cb) override {
video_ssrc_ = config.ssrc;
transport_->InitializeVideo(config, cast_message_cb, rtt_cb);
}
- virtual void InsertFrame(uint32 ssrc,
- const EncodedFrame& frame) override {
+ void InsertFrame(uint32 ssrc, const EncodedFrame& frame) override {
if (ssrc == audio_ssrc_) {
*encoded_audio_bytes_ += frame.data.size();
} else if (ssrc == video_ssrc_) {
@@ -134,27 +131,24 @@ class CastTransportSenderWrapper : public CastTransportSender {
transport_->InsertFrame(ssrc, frame);
}
- virtual void SendSenderReport(
- uint32 ssrc,
- base::TimeTicks current_time,
- uint32 current_time_as_rtp_timestamp) override {
+ void SendSenderReport(uint32 ssrc,
+ base::TimeTicks current_time,
+ uint32 current_time_as_rtp_timestamp) override {
transport_->SendSenderReport(ssrc,
current_time,
current_time_as_rtp_timestamp);
}
- virtual void CancelSendingFrames(
- uint32 ssrc,
- const std::vector<uint32>& frame_ids) override {
+ void CancelSendingFrames(uint32 ssrc,
+ const std::vector<uint32>& frame_ids) override {
transport_->CancelSendingFrames(ssrc, frame_ids);
}
- virtual void ResendFrameForKickstart(uint32 ssrc,
- uint32 frame_id) override {
+ void ResendFrameForKickstart(uint32 ssrc, uint32 frame_id) override {
transport_->ResendFrameForKickstart(ssrc, frame_id);
}
- virtual PacketReceiverCallback PacketReceiverForTesting() override {
+ PacketReceiverCallback PacketReceiverForTesting() override {
return transport_->PacketReceiverForTesting();
}
diff --git a/media/cast/test/end2end_unittest.cc b/media/cast/test/end2end_unittest.cc
index 7845ca9..7489927 100644
--- a/media/cast/test/end2end_unittest.cc
+++ b/media/cast/test/end2end_unittest.cc
@@ -171,10 +171,10 @@ class LoopBackPacketPipe : public test::PacketPipe {
LoopBackPacketPipe(const PacketReceiverCallback& packet_receiver)
: packet_receiver_(packet_receiver) {}
- virtual ~LoopBackPacketPipe() {}
+ ~LoopBackPacketPipe() override {}
// PacketPipe implementations.
- virtual void Send(scoped_ptr<Packet> packet) override {
+ void Send(scoped_ptr<Packet> packet) override {
packet_receiver_.Run(packet.Pass());
}
@@ -206,8 +206,7 @@ class LoopBackTransport : public PacketSender {
packet_pipe_->InitOnIOThread(task_runner, clock);
}
- virtual bool SendPacket(PacketRef packet,
- const base::Closure& cb) override {
+ bool SendPacket(PacketRef packet, const base::Closure& cb) override {
DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
if (!send_packets_)
return true;
@@ -224,9 +223,7 @@ class LoopBackTransport : public PacketSender {
return true;
}
- virtual int64 GetBytesSent() override {
- return bytes_sent_;
- }
+ int64 GetBytesSent() override { return bytes_sent_; }
void SetSendPackets(bool send_packets) { send_packets_ = send_packets; }
diff --git a/media/cast/test/fake_receiver_time_offset_estimator.h b/media/cast/test/fake_receiver_time_offset_estimator.h
index 2b78c06..fc3a901 100644
--- a/media/cast/test/fake_receiver_time_offset_estimator.h
+++ b/media/cast/test/fake_receiver_time_offset_estimator.h
@@ -20,15 +20,15 @@ class FakeReceiverTimeOffsetEstimator : public ReceiverTimeOffsetEstimator {
public:
FakeReceiverTimeOffsetEstimator(base::TimeDelta offset);
- virtual ~FakeReceiverTimeOffsetEstimator();
+ ~FakeReceiverTimeOffsetEstimator() override;
// RawReventSubscriber implementations.
- virtual void OnReceiveFrameEvent(const FrameEvent& frame_event) override;
- virtual void OnReceivePacketEvent(const PacketEvent& packet_event) override;
+ void OnReceiveFrameEvent(const FrameEvent& frame_event) override;
+ void OnReceivePacketEvent(const PacketEvent& packet_event) override;
// ReceiverTimeOffsetEstimator
- virtual bool GetReceiverOffsetBounds(base::TimeDelta* lower_bound,
- base::TimeDelta* upper_bound) override;
+ bool GetReceiverOffsetBounds(base::TimeDelta* lower_bound,
+ base::TimeDelta* upper_bound) override;
private:
const base::TimeDelta offset_;
diff --git a/media/cast/test/fake_single_thread_task_runner.h b/media/cast/test/fake_single_thread_task_runner.h
index 8392e4a..60aaae4 100644
--- a/media/cast/test/fake_single_thread_task_runner.h
+++ b/media/cast/test/fake_single_thread_task_runner.h
@@ -28,20 +28,19 @@ class FakeSingleThreadTaskRunner : public base::SingleThreadTaskRunner {
void Sleep(base::TimeDelta t);
// base::SingleThreadTaskRunner implementation.
- virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
- const base::Closure& task,
- base::TimeDelta delay) override;
+ bool PostDelayedTask(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) override;
- virtual bool RunsTasksOnCurrentThread() const override;
+ bool RunsTasksOnCurrentThread() const override;
// This function is currently not used, and will return false.
- virtual bool PostNonNestableDelayedTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task,
- base::TimeDelta delay) override;
+ bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) override;
protected:
- virtual ~FakeSingleThreadTaskRunner();
+ ~FakeSingleThreadTaskRunner() override;
private:
base::SimpleTestTickClock* const clock_;
diff --git a/media/cast/test/fake_video_encode_accelerator.h b/media/cast/test/fake_video_encode_accelerator.h
index 01f3441..65cc36c 100644
--- a/media/cast/test/fake_video_encode_accelerator.h
+++ b/media/cast/test/fake_video_encode_accelerator.h
@@ -26,25 +26,25 @@ class FakeVideoEncodeAccelerator : public VideoEncodeAccelerator {
explicit FakeVideoEncodeAccelerator(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
std::vector<uint32>* stored_bitrates);
- virtual ~FakeVideoEncodeAccelerator();
+ ~FakeVideoEncodeAccelerator() override;
- virtual std::vector<VideoEncodeAccelerator::SupportedProfile>
- GetSupportedProfiles() override;
- virtual bool Initialize(media::VideoFrame::Format input_format,
- const gfx::Size& input_visible_size,
- VideoCodecProfile output_profile,
- uint32 initial_bitrate,
- Client* client) override;
+ std::vector<VideoEncodeAccelerator::SupportedProfile> GetSupportedProfiles()
+ override;
+ bool Initialize(media::VideoFrame::Format input_format,
+ const gfx::Size& input_visible_size,
+ VideoCodecProfile output_profile,
+ uint32 initial_bitrate,
+ Client* client) override;
- virtual void Encode(const scoped_refptr<VideoFrame>& frame,
- bool force_keyframe) override;
+ void Encode(const scoped_refptr<VideoFrame>& frame,
+ bool force_keyframe) override;
- virtual void UseOutputBitstreamBuffer(const BitstreamBuffer& buffer) override;
+ void UseOutputBitstreamBuffer(const BitstreamBuffer& buffer) override;
- virtual void RequestEncodingParametersChange(uint32 bitrate,
- uint32 framerate) override;
+ void RequestEncodingParametersChange(uint32 bitrate,
+ uint32 framerate) override;
- virtual void Destroy() override;
+ void Destroy() override;
void SendDummyFrameForTesting(bool key_frame);
void SetWillInitializationSucceed(bool will_initialization_succeed) {
diff --git a/media/cast/test/loopback_transport.cc b/media/cast/test/loopback_transport.cc
index f3fbd64..2b32fe33 100644
--- a/media/cast/test/loopback_transport.cc
+++ b/media/cast/test/loopback_transport.cc
@@ -20,10 +20,10 @@ class LoopBackPacketPipe : public test::PacketPipe {
const PacketReceiverCallback& packet_receiver)
: packet_receiver_(packet_receiver) {}
- virtual ~LoopBackPacketPipe() {}
+ ~LoopBackPacketPipe() override {}
// PacketPipe implementations.
- virtual void Send(scoped_ptr<Packet> packet) override {
+ void Send(scoped_ptr<Packet> packet) override {
packet_receiver_.Run(packet.Pass());
}
diff --git a/media/cast/test/loopback_transport.h b/media/cast/test/loopback_transport.h
index 64d99e6..2aca2f3 100644
--- a/media/cast/test/loopback_transport.h
+++ b/media/cast/test/loopback_transport.h
@@ -27,12 +27,11 @@ class LoopBackTransport : public PacketSender {
public:
explicit LoopBackTransport(
scoped_refptr<CastEnvironment> cast_environment);
- virtual ~LoopBackTransport();
+ ~LoopBackTransport() override;
- virtual bool SendPacket(PacketRef packet,
- const base::Closure& cb) override;
+ bool SendPacket(PacketRef packet, const base::Closure& cb) override;
- virtual int64 GetBytesSent() override;
+ int64 GetBytesSent() override;
// Initiailize this loopback transport.
// Establish a flow of packets from |pipe| to |packet_receiver|.
diff --git a/media/cast/test/receiver.cc b/media/cast/test/receiver.cc
index b83733a..d608669 100644
--- a/media/cast/test/receiver.cc
+++ b/media/cast/test/receiver.cc
@@ -202,9 +202,9 @@ class NaivePlayer : public InProcessReceiver,
num_audio_frames_processed_(0),
currently_playing_audio_frame_start_(-1) {}
- virtual ~NaivePlayer() {}
+ ~NaivePlayer() override {}
- virtual void Start() override {
+ void Start() override {
AudioManager::Get()->GetTaskRunner()->PostTask(
FROM_HERE,
base::Bind(&NaivePlayer::StartAudioOutputOnAudioManagerThread,
@@ -214,7 +214,7 @@ class NaivePlayer : public InProcessReceiver,
InProcessReceiver::Start();
}
- virtual void Stop() override {
+ void Stop() override {
// First, stop audio output to the Chromium audio stack.
base::WaitableEvent done(false, false);
DCHECK(!AudioManager::Get()->GetTaskRunner()->BelongsToCurrentThread());
@@ -265,9 +265,9 @@ class NaivePlayer : public InProcessReceiver,
////////////////////////////////////////////////////////////////////
// InProcessReceiver overrides.
- virtual void OnVideoFrame(const scoped_refptr<VideoFrame>& video_frame,
- const base::TimeTicks& playout_time,
- bool is_continuous) override {
+ void OnVideoFrame(const scoped_refptr<VideoFrame>& video_frame,
+ const base::TimeTicks& playout_time,
+ bool is_continuous) override {
DCHECK(cast_env()->CurrentlyOn(CastEnvironment::MAIN));
LOG_IF(WARNING, !is_continuous)
<< "Video: Discontinuity in received frames.";
@@ -282,9 +282,9 @@ class NaivePlayer : public InProcessReceiver,
}
}
- virtual void OnAudioFrame(scoped_ptr<AudioBus> audio_frame,
- const base::TimeTicks& playout_time,
- bool is_continuous) override {
+ void OnAudioFrame(scoped_ptr<AudioBus> audio_frame,
+ const base::TimeTicks& playout_time,
+ bool is_continuous) override {
DCHECK(cast_env()->CurrentlyOn(CastEnvironment::MAIN));
LOG_IF(WARNING, !is_continuous)
<< "Audio: Discontinuity in received frames.";
@@ -316,8 +316,7 @@ class NaivePlayer : public InProcessReceiver,
////////////////////////////////////////////////////////////////////
// AudioSourceCallback implementation.
- virtual int OnMoreData(AudioBus* dest, uint32 total_bytes_delay)
- override {
+ int OnMoreData(AudioBus* dest, uint32 total_bytes_delay) override {
// Note: This method is being invoked by a separate thread unknown to us
// (i.e., outside of CastEnvironment).
@@ -377,7 +376,7 @@ class NaivePlayer : public InProcessReceiver,
return dest->frames();
}
- virtual void OnError(AudioOutputStream* stream) override {
+ void OnError(AudioOutputStream* stream) override {
LOG(ERROR) << "AudioOutputStream reports an error. "
<< "Playback is unlikely to continue.";
}
diff --git a/media/cast/test/skewed_single_thread_task_runner.h b/media/cast/test/skewed_single_thread_task_runner.h
index 93fc6aa..1a4d0ab 100644
--- a/media/cast/test/skewed_single_thread_task_runner.h
+++ b/media/cast/test/skewed_single_thread_task_runner.h
@@ -29,20 +29,19 @@ class SkewedSingleThreadTaskRunner : public base::SingleThreadTaskRunner {
void SetSkew(double skew);
// base::SingleThreadTaskRunner implementation.
- virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
- const base::Closure& task,
- base::TimeDelta delay) override;
+ bool PostDelayedTask(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) override;
- virtual bool RunsTasksOnCurrentThread() const override;
+ bool RunsTasksOnCurrentThread() const override;
// This function is currently not used, and will return false.
- virtual bool PostNonNestableDelayedTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task,
- base::TimeDelta delay) override;
+ bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ base::TimeDelta delay) override;
protected:
- virtual ~SkewedSingleThreadTaskRunner();
+ ~SkewedSingleThreadTaskRunner() override;
private:
double skew_;
diff --git a/media/cast/test/skewed_tick_clock.h b/media/cast/test/skewed_tick_clock.h
index 3d5580f..a5539a3 100644
--- a/media/cast/test/skewed_tick_clock.h
+++ b/media/cast/test/skewed_tick_clock.h
@@ -25,7 +25,7 @@ class SkewedTickClock : public base::TickClock {
// jump forwards or backwards, only changing the offset will
// do that.
void SetSkew(double skew, base::TimeDelta offset);
- virtual base::TimeTicks NowTicks() override;
+ base::TimeTicks NowTicks() override;
private:
base::TimeTicks SkewTicks(base::TimeTicks now);
diff --git a/media/cast/test/utility/standalone_cast_environment.h b/media/cast/test/utility/standalone_cast_environment.h
index 91240e1..206de21 100644
--- a/media/cast/test/utility/standalone_cast_environment.h
+++ b/media/cast/test/utility/standalone_cast_environment.h
@@ -28,7 +28,7 @@ class StandaloneCastEnvironment : public CastEnvironment,
void Shutdown();
protected:
- virtual ~StandaloneCastEnvironment();
+ ~StandaloneCastEnvironment() override;
base::Thread main_thread_;
base::Thread audio_thread_;
diff --git a/media/cast/test/utility/udp_proxy.cc b/media/cast/test/utility/udp_proxy.cc
index a770834..237c1e7 100644
--- a/media/cast/test/utility/udp_proxy.cc
+++ b/media/cast/test/utility/udp_proxy.cc
@@ -56,7 +56,7 @@ class Buffer : public PacketPipe {
CHECK_GT(max_megabits_per_second, 0);
}
- virtual void Send(scoped_ptr<Packet> packet) override {
+ void Send(scoped_ptr<Packet> packet) override {
if (packet->size() + buffer_size_ <= max_buffer_size_) {
buffer_size_ += packet->size();
buffer_.push_back(linked_ptr<Packet>(packet.release()));
@@ -116,7 +116,7 @@ class RandomDrop : public PacketPipe {
RandomDrop(double drop_fraction)
: drop_fraction_(static_cast<int>(drop_fraction * RAND_MAX)) {}
- virtual void Send(scoped_ptr<Packet> packet) override {
+ void Send(scoped_ptr<Packet> packet) override {
if (rand() > drop_fraction_) {
pipe_->Send(packet.Pass());
}
@@ -133,9 +133,9 @@ scoped_ptr<PacketPipe> NewRandomDrop(double drop_fraction) {
class SimpleDelayBase : public PacketPipe {
public:
SimpleDelayBase() : weak_factory_(this) {}
- virtual ~SimpleDelayBase() {}
+ ~SimpleDelayBase() override {}
- virtual void Send(scoped_ptr<Packet> packet) override {
+ void Send(scoped_ptr<Packet> packet) override {
double seconds = GetDelay();
task_runner_->PostDelayedTask(
FROM_HERE,
@@ -158,9 +158,7 @@ class SimpleDelayBase : public PacketPipe {
class ConstantDelay : public SimpleDelayBase {
public:
ConstantDelay(double delay_seconds) : delay_seconds_(delay_seconds) {}
- virtual double GetDelay() override {
- return delay_seconds_;
- }
+ double GetDelay() override { return delay_seconds_; }
private:
double delay_seconds_;
@@ -174,9 +172,7 @@ class RandomUnsortedDelay : public SimpleDelayBase {
public:
RandomUnsortedDelay(double random_delay) : random_delay_(random_delay) {}
- virtual double GetDelay() override {
- return random_delay_ * base::RandDouble();
- }
+ double GetDelay() override { return random_delay_ * base::RandDouble(); }
private:
double random_delay_;
@@ -193,11 +189,11 @@ class DuplicateAndDelay : public RandomUnsortedDelay {
RandomUnsortedDelay(random_delay),
delay_min_(delay_min) {
}
- virtual void Send(scoped_ptr<Packet> packet) override {
+ void Send(scoped_ptr<Packet> packet) override {
pipe_->Send(scoped_ptr<Packet>(new Packet(*packet.get())));
RandomUnsortedDelay::Send(packet.Pass());
}
- virtual double GetDelay() override {
+ double GetDelay() override {
return RandomUnsortedDelay::GetDelay() + delay_min_;
}
private:
@@ -220,7 +216,7 @@ class RandomSortedDelay : public PacketPipe {
seconds_between_extra_delay_(seconds_between_extra_delay),
weak_factory_(this) {}
- virtual void Send(scoped_ptr<Packet> packet) override {
+ void Send(scoped_ptr<Packet> packet) override {
buffer_.push_back(linked_ptr<Packet>(packet.release()));
if (buffer_.size() == 1) {
next_send_ = std::max(
@@ -230,7 +226,7 @@ class RandomSortedDelay : public PacketPipe {
ProcessBuffer();
}
}
- virtual void InitOnIOThread(
+ void InitOnIOThread(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
base::TickClock* clock) override {
PacketPipe::InitOnIOThread(task_runner, clock);
@@ -309,14 +305,14 @@ class NetworkGlitchPipe : public PacketPipe {
max_outage_time_(average_outage_time * 2),
weak_factory_(this) {}
- virtual void InitOnIOThread(
+ void InitOnIOThread(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
base::TickClock* clock) override {
PacketPipe::InitOnIOThread(task_runner, clock);
Flip();
}
- virtual void Send(scoped_ptr<Packet> packet) override {
+ void Send(scoped_ptr<Packet> packet) override {
if (works_) {
pipe_->Send(packet.Pass());
}
@@ -360,7 +356,7 @@ class InterruptedPoissonProcess::InternalBuffer : public PacketPipe {
weak_factory_(this) {
}
- virtual void Send(scoped_ptr<Packet> packet) override {
+ void Send(scoped_ptr<Packet> packet) override {
// Drop if buffer is full.
if (stored_size_ >= stored_limit_)
return;
@@ -370,7 +366,7 @@ class InterruptedPoissonProcess::InternalBuffer : public PacketPipe {
DCHECK(buffer_.size() == buffer_time_.size());
}
- virtual void InitOnIOThread(
+ void InitOnIOThread(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
base::TickClock* clock) override {
clock_ = clock;
@@ -552,10 +548,8 @@ class PacketSender : public PacketPipe {
public:
PacketSender(UDPProxyImpl* udp_proxy, const net::IPEndPoint* destination)
: udp_proxy_(udp_proxy), destination_(destination) {}
- virtual void Send(scoped_ptr<Packet> packet) override;
- virtual void AppendToPipe(scoped_ptr<PacketPipe> pipe) override {
- NOTREACHED();
- }
+ void Send(scoped_ptr<Packet> packet) override;
+ void AppendToPipe(scoped_ptr<PacketPipe> pipe) override { NOTREACHED(); }
private:
UDPProxyImpl* udp_proxy_;
@@ -662,7 +656,7 @@ class UDPProxyImpl : public UDPProxy {
start_event.Wait();
}
- virtual ~UDPProxyImpl() {
+ ~UDPProxyImpl() override {
base::WaitableEvent stop_event(false, false);
proxy_thread_.message_loop_proxy()->PostTask(
FROM_HERE,
diff --git a/media/cast/test/utility/udp_proxy_main.cc b/media/cast/test/utility/udp_proxy_main.cc
index 425d2e3..212b597 100644
--- a/media/cast/test/utility/udp_proxy_main.cc
+++ b/media/cast/test/utility/udp_proxy_main.cc
@@ -68,8 +68,7 @@ ByteCounter out_pipe_output_counter;
class ByteCounterPipe : public media::cast::test::PacketPipe {
public:
ByteCounterPipe(ByteCounter* counter) : counter_(counter) {}
- virtual void Send(scoped_ptr<media::cast::Packet> packet)
- override {
+ void Send(scoped_ptr<media::cast::Packet> packet) override {
counter_->Increment(packet->size());
pipe_->Send(packet.Pass());
}