Skip to content

Commit

Permalink
Using final instead override.
Browse files Browse the repository at this point in the history
  • Loading branch information
dchapyshev committed Apr 8, 2024
1 parent c07ff32 commit 98f972a
Show file tree
Hide file tree
Showing 238 changed files with 1,170 additions and 1,170 deletions.
8 changes: 4 additions & 4 deletions source/base/audio/audio_capturer_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@

namespace base {

class AudioCapturerLinux
class AudioCapturerLinux final
: public AudioCapturer,
public AudioPipeReader::Delegate
{
public:
AudioCapturerLinux();
~AudioCapturerLinux() override;
~AudioCapturerLinux() final;

// AudioCapturer interface.
bool start(const PacketCapturedCallback& callback) override;
bool start(const PacketCapturedCallback& callback) final;

protected:
// AudioPipeReader::Delegate implementation.
void onDataRead(const std::string& data) override;
void onDataRead(const std::string& data) final;

private:
local_shared_ptr<AudioPipeReader> pipe_reader_;
Expand Down
6 changes: 3 additions & 3 deletions source/base/audio/audio_capturer_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ class DefaultAudioDeviceChangeDetector;
// An AudioCapturer implementation for Windows by using Windows Audio Session API, a.k.a. WASAPI.
// It supports up to 8 channels, but treats all layouts as a most commonly used one. E.g. 3.1 and
// surround layouts will both be marked as surround layout.
class AudioCapturerWin : public AudioCapturer
class AudioCapturerWin final : public AudioCapturer
{
public:
AudioCapturerWin();
~AudioCapturerWin() override;
~AudioCapturerWin() final;

// AudioCapturer interface.
bool start(const PacketCapturedCallback& callback) override;
bool start(const PacketCapturedCallback& callback) final;

private:
// Executes deinitialize() and initialize(). If initialize() function call returns false,
Expand Down
8 changes: 4 additions & 4 deletions source/base/audio/audio_capturer_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ namespace base {
class AudioCapturer;
class IpcChannelProxy;

class AudioCapturerWrapper : public Thread::Delegate
class AudioCapturerWrapper final : public Thread::Delegate
{
public:
explicit AudioCapturerWrapper(std::shared_ptr<IpcChannelProxy> channel_proxy);
~AudioCapturerWrapper() override;
~AudioCapturerWrapper() final;

void start();

protected:
// Thread::Delegate implementation.
void onBeforeThreadRunning() override;
void onAfterThreadRunning() override;
void onBeforeThreadRunning() final;
void onAfterThreadRunning() final;

private:
std::shared_ptr<IpcChannelProxy> channel_proxy_;
Expand Down
6 changes: 3 additions & 3 deletions source/base/audio/audio_output_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ namespace base {

class SimpleThread;

class AudioOutputMac : public AudioOutput
class AudioOutputMac final : public AudioOutput
{
public:
explicit AudioOutputMac(const NeedMoreDataCB& need_more_data_cb);
~AudioOutputMac();

// AudioOutput implementation.
bool start() override;
bool stop() override;
bool start() final;
bool stop() final;

private:
bool initDevice();
Expand Down
6 changes: 3 additions & 3 deletions source/base/audio/audio_output_pulse.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ namespace base {

class SimpleThread;

class AudioOutputPulse : public AudioOutput
class AudioOutputPulse final : public AudioOutput
{
public:
explicit AudioOutputPulse(const NeedMoreDataCB& need_more_data_cb);
~AudioOutputPulse();

// AudioOutput implementation.
bool start() override;
bool stop() override;
bool start() final;
bool stop() final;

private:
static void paContextStateCallback(pa_context* context, void* self);
Expand Down
28 changes: 14 additions & 14 deletions source/base/audio/audio_output_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ namespace base {

class SimpleThread;

class AudioOutputWin
class AudioOutputWin final
: public AudioOutput,
public IAudioSessionEvents
{
public:
explicit AudioOutputWin(const NeedMoreDataCB& need_more_data_cb);
~AudioOutputWin() override;
~AudioOutputWin() final;

// AudioOutput implementation.
bool start() override;
bool stop() override;
bool start() final;
bool stop() final;

private:
void threadRun();
Expand All @@ -54,29 +54,29 @@ class AudioOutputWin
void releaseCOMObjects();

// IUnknown (required by IAudioSessionEvents and IMMNotificationClient).
ULONG __stdcall AddRef() override;
ULONG __stdcall Release() override;
HRESULT __stdcall QueryInterface(REFIID iid, void** object) override;
ULONG __stdcall AddRef() final;
ULONG __stdcall Release() final;
HRESULT __stdcall QueryInterface(REFIID iid, void** object) final;

// IAudioSessionEvents implementation.
// These methods are called on separate threads owned by the session manager. More than one
// thread can be involved depending on the type of callback and audio session.
HRESULT __stdcall OnStateChanged(AudioSessionState new_state) override;
HRESULT __stdcall OnStateChanged(AudioSessionState new_state) final;
HRESULT __stdcall OnSessionDisconnected(
AudioSessionDisconnectReason disconnect_reason) override;
AudioSessionDisconnectReason disconnect_reason) final;
HRESULT __stdcall OnDisplayNameChanged(LPCWSTR new_display_name,
LPCGUID event_context) override;
LPCGUID event_context) final;
HRESULT __stdcall OnIconPathChanged(LPCWSTR new_icon_path,
LPCGUID event_context) override;
LPCGUID event_context) final;
HRESULT __stdcall OnSimpleVolumeChanged(float new_simple_volume,
BOOL new_mute,
LPCGUID event_context) override;
LPCGUID event_context) final;
HRESULT __stdcall OnChannelVolumeChanged(DWORD channel_count,
float new_channel_volumes[],
DWORD changed_channel,
LPCGUID event_context) override;
LPCGUID event_context) final;
HRESULT __stdcall OnGroupingParamChanged(LPCGUID new_grouping_param,
LPCGUID event_context) override;
LPCGUID event_context) final;

bool is_initialized_ = false;
bool is_active_ = false;
Expand Down
6 changes: 3 additions & 3 deletions source/base/audio/audio_volume_filter_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@
namespace base {

// An implementation of AudioVolumeFilter for Windows only.
class AudioVolumeFilterWin : public AudioVolumeFilter
class AudioVolumeFilterWin final : public AudioVolumeFilter
{
public:
explicit AudioVolumeFilterWin(int silence_threshold);
~AudioVolumeFilterWin() override;
~AudioVolumeFilterWin() final;

// Initializes |audio_volume_|. Returns false if Windows APIs fail.
bool activateBy(IMMDevice* mm_device);

protected:
// Returns current audio level from |audio_volume_|. If the initialization failed, this
// function returns 1.
float audioLevel() override;
float audioLevel() final;

private:
Microsoft::WRL::ComPtr<IAudioEndpointVolume> audio_volume_;
Expand Down
16 changes: 8 additions & 8 deletions source/base/audio/win/default_audio_device_change_detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ class DefaultAudioDeviceChangeDetector final : public IMMNotificationClient
// IMMNotificationClient implementation.
HRESULT __stdcall OnDefaultDeviceChanged(EDataFlow flow,
ERole role,
LPCWSTR pwstrDefaultDevice) override;
HRESULT __stdcall QueryInterface(REFIID iid, void** object) override;
LPCWSTR pwstrDefaultDevice) final;
HRESULT __stdcall QueryInterface(REFIID iid, void** object) final;

// No-ops overrides.
HRESULT __stdcall OnDeviceAdded(LPCWSTR pwstrDeviceId) override;
HRESULT __stdcall OnDeviceRemoved(LPCWSTR pwstrDeviceId) override;
HRESULT __stdcall OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState) override;
HRESULT __stdcall OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key) override;
ULONG __stdcall AddRef() override;
ULONG __stdcall Release() override;
HRESULT __stdcall OnDeviceAdded(LPCWSTR pwstrDeviceId) final;
HRESULT __stdcall OnDeviceRemoved(LPCWSTR pwstrDeviceId) final;
HRESULT __stdcall OnDeviceStateChanged(LPCWSTR pwstrDeviceId, DWORD dwNewState) final;
HRESULT __stdcall OnPropertyValueChanged(LPCWSTR pwstrDeviceId, const PROPERTYKEY key) final;
ULONG __stdcall AddRef() final;
ULONG __stdcall Release() final;

const Microsoft::WRL::ComPtr<IMMDeviceEnumerator> enumerator_;
bool changed_ = false;
Expand Down
6 changes: 3 additions & 3 deletions source/base/codec/audio_decoder_opus.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ struct OpusDecoder;

namespace base {

class AudioDecoderOpus : public AudioDecoder
class AudioDecoderOpus final : public AudioDecoder
{
public:
AudioDecoderOpus();
~AudioDecoderOpus() override;
~AudioDecoderOpus() final;

// AudioDecoder interface.
std::unique_ptr<proto::AudioPacket> decode(const proto::AudioPacket& packet) override;
std::unique_ptr<proto::AudioPacket> decode(const proto::AudioPacket& packet) final;

private:
void initDecoder();
Expand Down
10 changes: 5 additions & 5 deletions source/base/codec/audio_encoder_opus.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ namespace base {
class AudioBus;
class MultiChannelResampler;

class AudioEncoderOpus : public AudioEncoder
class AudioEncoderOpus final : public AudioEncoder
{
public:
AudioEncoderOpus();
~AudioEncoderOpus() override;
~AudioEncoderOpus() final;

// AudioEncoder interface.
bool encode(const proto::AudioPacket& input_packet, proto::AudioPacket* output_packet) override;
int bitrate() override;
bool setBitrate(int bitrate) override;
bool encode(const proto::AudioPacket& input_packet, proto::AudioPacket* output_packet) final;
int bitrate() final;
bool setBitrate(int bitrate) final;

private:
void initEncoder();
Expand Down
12 changes: 6 additions & 6 deletions source/base/codec/pixel_translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace {
const int kBlockSize = 16;

template<typename SourceT, typename TargetT>
class PixelTranslatorT : public PixelTranslator
class PixelTranslatorT final : public PixelTranslator
{
public:
PixelTranslatorT(const PixelFormat& source_format,
Expand Down Expand Up @@ -61,7 +61,7 @@ class PixelTranslatorT : public PixelTranslator
}
}

~PixelTranslatorT() override = default;
~PixelTranslatorT() final = default;

void translatePixel(const SourceT* src_ptr, TargetT* dst_ptr)
{
Expand All @@ -77,7 +77,7 @@ class PixelTranslatorT : public PixelTranslator

void translate(const uint8_t* src, int src_stride,
uint8_t* dst, int dst_stride,
int width, int height) override
int width, int height) final
{
const int block_count = width / kBlockSize;
const int partial_width = width - (block_count * kBlockSize);
Expand Down Expand Up @@ -127,7 +127,7 @@ class PixelTranslatorT : public PixelTranslator
};

template<typename SourceT, typename TargetT>
class PixelTranslatorFrom8_16bppT : public PixelTranslator
class PixelTranslatorFrom8_16bppT final : public PixelTranslator
{
public:
PixelTranslatorFrom8_16bppT(const PixelFormat& source_format,
Expand Down Expand Up @@ -161,11 +161,11 @@ class PixelTranslatorFrom8_16bppT : public PixelTranslator
}
}

~PixelTranslatorFrom8_16bppT() override = default;
~PixelTranslatorFrom8_16bppT() final = default;

void translate(const uint8_t* src, int src_stride,
uint8_t* dst, int dst_stride,
int width, int height) override
int width, int height) final
{
const int block_count = width / kBlockSize;
const int partial_width = width - (block_count * kBlockSize);
Expand Down
6 changes: 3 additions & 3 deletions source/base/codec/video_decoder_vpx.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@

namespace base {

class VideoDecoderVPX : public VideoDecoder
class VideoDecoderVPX final : public VideoDecoder
{
public:
~VideoDecoderVPX() override;
~VideoDecoderVPX() final;

static std::unique_ptr<VideoDecoderVPX> createVP8();
static std::unique_ptr<VideoDecoderVPX> createVP9();

bool decode(const proto::VideoPacket& packet, Frame* frame) override;
bool decode(const proto::VideoPacket& packet, Frame* frame) final;

private:
explicit VideoDecoderVPX(proto::VideoEncoding encoding);
Expand Down
6 changes: 3 additions & 3 deletions source/base/codec/video_decoder_zstd.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ namespace base {

class PixelTranslator;

class VideoDecoderZstd : public VideoDecoder
class VideoDecoderZstd final : public VideoDecoder
{
public:
~VideoDecoderZstd() override;
~VideoDecoderZstd() final;

static std::unique_ptr<VideoDecoderZstd> create();

bool decode(const proto::VideoPacket& packet, Frame* target_frame) override;
bool decode(const proto::VideoPacket& packet, Frame* target_frame) final;

private:
VideoDecoderZstd();
Expand Down
6 changes: 3 additions & 3 deletions source/base/codec/video_encoder_vpx.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@

namespace base {

class VideoEncoderVPX : public VideoEncoder
class VideoEncoderVPX final : public VideoEncoder
{
public:
~VideoEncoderVPX() override = default;
~VideoEncoderVPX() final = default;

static std::unique_ptr<VideoEncoderVPX> createVP8();
static std::unique_ptr<VideoEncoderVPX> createVP9();

bool encode(const Frame* frame, proto::VideoPacket* packet) override;
bool encode(const Frame* frame, proto::VideoPacket* packet) final;

bool setMinQuantizer(uint32_t min_quantizer);
uint32_t minQuantizer() const;
Expand Down
6 changes: 3 additions & 3 deletions source/base/codec/video_encoder_zstd.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ namespace base {

class PixelTranslator;

class VideoEncoderZstd : public VideoEncoder
class VideoEncoderZstd final : public VideoEncoder
{
public:
~VideoEncoderZstd() override;
~VideoEncoderZstd() final;

static std::unique_ptr<VideoEncoderZstd> create(
const PixelFormat& target_format, int compression_ratio);

bool encode(const Frame* frame, proto::VideoPacket* packet) override;
bool encode(const Frame* frame, proto::VideoPacket* packet) final;

bool setCompressRatio(int compression_ratio);
int compressRatio() const;
Expand Down
8 changes: 4 additions & 4 deletions source/base/crypto/data_cryptor_chacha20_poly1305.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

namespace base {

class DataCryptorChaCha20Poly1305 : public DataCryptor
class DataCryptorChaCha20Poly1305 final : public DataCryptor
{
public:
explicit DataCryptorChaCha20Poly1305(std::string_view key);
~DataCryptorChaCha20Poly1305() override;
~DataCryptorChaCha20Poly1305() final;

bool encrypt(std::string_view in, std::string* out) override;
bool decrypt(std::string_view in, std::string* out) override;
bool encrypt(std::string_view in, std::string* out) final;
bool decrypt(std::string_view in, std::string* out) final;

private:
std::string key_;
Expand Down
Loading

0 comments on commit 98f972a

Please sign in to comment.