Skip to content

Commit

Permalink
chore: Remove unneeded namespace qualifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
gavv committed May 15, 2024
1 parent bef7210 commit 78d85df
Show file tree
Hide file tree
Showing 30 changed files with 61 additions and 62 deletions.
8 changes: 4 additions & 4 deletions src/internal_modules/roc_audio/builtin_resampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ inline size_t get_window_size(ResamplerProfile profile) {
}

inline size_t get_frame_size(size_t window_size,
const audio::SampleSpec& in_spec,
const audio::SampleSpec& out_spec) {
const SampleSpec& in_spec,
const SampleSpec& out_spec) {
const float scaling =
(float)in_spec.sample_rate() / (float)out_spec.sample_rate() * 1.5f;

Expand All @@ -120,8 +120,8 @@ inline size_t get_frame_size(size_t window_size,
BuiltinResampler::BuiltinResampler(core::IArena& arena,
FrameFactory& frame_factory,
ResamplerProfile profile,
const audio::SampleSpec& in_spec,
const audio::SampleSpec& out_spec)
const SampleSpec& in_spec,
const SampleSpec& out_spec)
: IResampler(arena)
, in_spec_(in_spec)
, out_spec_(out_spec)
Expand Down
8 changes: 4 additions & 4 deletions src/internal_modules/roc_audio/builtin_resampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class BuiltinResampler : public IResampler, public core::NonCopyable<> {
BuiltinResampler(core::IArena& arena,
FrameFactory& frame_factory,
ResamplerProfile profile,
const audio::SampleSpec& in_spec,
const audio::SampleSpec& out_spec);
const SampleSpec& in_spec,
const SampleSpec& out_spec);

~BuiltinResampler();

Expand Down Expand Up @@ -93,8 +93,8 @@ class BuiltinResampler : public IResampler, public core::NonCopyable<> {
// (e.g. left -- 0, right -- 1, etc.).
sample_t resample_(size_t channel_offset);

const audio::SampleSpec in_spec_;
const audio::SampleSpec out_spec_;
const SampleSpec in_spec_;
const SampleSpec out_spec_;

core::Slice<sample_t> frames_[3];
size_t n_ready_frames_;
Expand Down
4 changes: 2 additions & 2 deletions src/internal_modules/roc_audio/decimation_resampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ DecimationResampler::DecimationResampler(
const core::SharedPtr<IResampler>& inner_resampler,
core::IArena& arena,
FrameFactory& frame_factory,
const audio::SampleSpec& in_spec,
const audio::SampleSpec& out_spec)
const SampleSpec& in_spec,
const SampleSpec& out_spec)
: IResampler(arena)
, inner_resampler_(inner_resampler)
, use_inner_resampler_(in_spec.sample_rate() != out_spec.sample_rate())
Expand Down
8 changes: 4 additions & 4 deletions src/internal_modules/roc_audio/decimation_resampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class DecimationResampler : public IResampler, public core::NonCopyable<> {
DecimationResampler(const core::SharedPtr<IResampler>& inner_resampler,
core::IArena& arena,
FrameFactory& frame_factory,
const audio::SampleSpec& in_spec,
const audio::SampleSpec& out_spec);
const SampleSpec& in_spec,
const SampleSpec& out_spec);

~DecimationResampler();

Expand Down Expand Up @@ -82,8 +82,8 @@ class DecimationResampler : public IResampler, public core::NonCopyable<> {
const core::SharedPtr<IResampler> inner_resampler_;
bool use_inner_resampler_;

audio::SampleSpec input_spec_;
audio::SampleSpec output_spec_;
SampleSpec input_spec_;
SampleSpec output_spec_;
float multiplier_;

const size_t num_ch_;
Expand Down
2 changes: 1 addition & 1 deletion src/internal_modules/roc_audio/depacketizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ inline void write_beep(sample_t* buf, size_t bufsz) {

Depacketizer::Depacketizer(packet::IReader& reader,
IFrameDecoder& payload_decoder,
const audio::SampleSpec& sample_spec,
const SampleSpec& sample_spec,
bool beep)
: reader_(reader)
, payload_decoder_(payload_decoder)
Expand Down
4 changes: 2 additions & 2 deletions src/internal_modules/roc_audio/depacketizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Depacketizer : public IFrameReader, public core::NonCopyable<> {
//! - @p beep enables weird beeps instead of silence on packet loss
Depacketizer(packet::IReader& reader,
IFrameDecoder& payload_decoder,
const audio::SampleSpec& sample_spec,
const SampleSpec& sample_spec,
bool beep);

//! Was depacketizer constructed without errors?
Expand Down Expand Up @@ -94,7 +94,7 @@ class Depacketizer : public IFrameReader, public core::NonCopyable<> {
packet::IReader& reader_;
IFrameDecoder& payload_decoder_;

const audio::SampleSpec sample_spec_;
const SampleSpec sample_spec_;

packet::PacketPtr packet_;

Expand Down
2 changes: 1 addition & 1 deletion src/internal_modules/roc_audio/feedback_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ FeedbackMonitor::FeedbackMonitor(IFrameWriter& writer,
, packetizer_(packetizer)
, writer_(writer)
, resampler_(resampler)
, enable_scaling_(latency_config.tuner_profile != audio::LatencyTunerProfile_Intact)
, enable_scaling_(latency_config.tuner_profile != LatencyTunerProfile_Intact)
, source_(0)
, source_change_limiter_(feedback_config.source_cooldown)
, sample_spec_(sample_spec)
Expand Down
2 changes: 1 addition & 1 deletion src/internal_modules/roc_audio/mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace roc {
namespace audio {

Mixer::Mixer(FrameFactory& frame_factory,
const audio::SampleSpec& sample_spec,
const SampleSpec& sample_spec,
bool enable_timestamps)
: sample_spec_(sample_spec)
, enable_timestamps_(enable_timestamps)
Expand Down
4 changes: 2 additions & 2 deletions src/internal_modules/roc_audio/mixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Mixer : public IFrameReader, public core::NonCopyable<> {
//! @p buffer_factory is used to allocate a temporary buffer for mixing.
//! @p enable_timestamps defines whether to enable calculation of capture timestamps.
Mixer(FrameFactory& frame_factory,
const audio::SampleSpec& sample_spec,
const SampleSpec& sample_spec,
bool enable_timestamps);

//! Check if the mixer was succefully constructed.
Expand All @@ -76,7 +76,7 @@ class Mixer : public IFrameReader, public core::NonCopyable<> {
core::List<IFrameReader, core::NoOwnership> readers_;
core::Slice<sample_t> temp_buf_;

const audio::SampleSpec sample_spec_;
const SampleSpec sample_spec_;
const bool enable_timestamps_;

bool valid_;
Expand Down
2 changes: 1 addition & 1 deletion src/internal_modules/roc_audio/packetizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Packetizer::Packetizer(packet::IWriter& writer,
IFrameEncoder& payload_encoder,
packet::PacketFactory& packet_factory,
core::nanoseconds_t packet_length,
const audio::SampleSpec& sample_spec)
const SampleSpec& sample_spec)
: writer_(writer)
, composer_(composer)
, sequencer_(sequencer)
Expand Down
4 changes: 2 additions & 2 deletions src/internal_modules/roc_audio/packetizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Packetizer : public IFrameWriter, public core::NonCopyable<> {
IFrameEncoder& payload_encoder,
packet::PacketFactory& packet_factory,
core::nanoseconds_t packet_length,
const audio::SampleSpec& sample_spec);
const SampleSpec& sample_spec);

//! Check if object is successfully constructed.
bool is_valid() const;
Expand Down Expand Up @@ -99,7 +99,7 @@ class Packetizer : public IFrameWriter, public core::NonCopyable<> {

packet::PacketFactory& packet_factory_;

const audio::SampleSpec sample_spec_;
const SampleSpec sample_spec_;
size_t samples_per_packet_;
size_t payload_size_;

Expand Down
2 changes: 1 addition & 1 deletion src/internal_modules/roc_audio/pcm_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void PcmDecoder::begin(packet::stream_timestamp_t frame_position,
packet::stream_timestamp_t(pcm_mapper_.input_sample_count(frame_size) / n_chans_);
}

size_t PcmDecoder::read(audio::sample_t* samples, size_t n_samples) {
size_t PcmDecoder::read(sample_t* samples, size_t n_samples) {
if (!frame_data_) {
roc_panic("pcm decoder: read should be called only between begin/end");
}
Expand Down
2 changes: 1 addition & 1 deletion src/internal_modules/roc_audio/pcm_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void PcmEncoder::begin(void* frame_data, size_t frame_size) {
frame_byte_size_ = frame_size;
}

size_t PcmEncoder::write(const audio::sample_t* samples, size_t n_samples) {
size_t PcmEncoder::write(const sample_t* samples, size_t n_samples) {
if (!frame_data_) {
roc_panic("pcm encoder: write should be called only between begin/end");
}
Expand Down
2 changes: 1 addition & 1 deletion src/internal_modules/roc_audio/profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace roc {
namespace audio {

Profiler::Profiler(core::IArena& arena,
const audio::SampleSpec& sample_spec,
const SampleSpec& sample_spec,
ProfilerConfig profiler_config)
: rate_limiter_(profiler_config.profiling_interval)
, interval_(profiler_config.profiling_interval)
Expand Down
4 changes: 2 additions & 2 deletions src/internal_modules/roc_audio/profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Profiler : public core::NonCopyable<> {
public:
//! Initialization.
Profiler(core::IArena& arena,
const audio::SampleSpec& sample_spec,
const SampleSpec& sample_spec,
ProfilerConfig profiler_config);

//! Check if the profiler was succefully constructed.
Expand Down Expand Up @@ -96,7 +96,7 @@ class Profiler : public core::NonCopyable<> {

float moving_avg_;

const audio::SampleSpec sample_spec_;
const SampleSpec sample_spec_;

bool valid_;
bool buffer_full_;
Expand Down
2 changes: 1 addition & 1 deletion src/internal_modules/roc_audio/profiling_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace audio {

ProfilingReader::ProfilingReader(IFrameReader& reader,
core::IArena& arena,
const audio::SampleSpec& sample_spec,
const SampleSpec& sample_spec,
ProfilerConfig profiler_config)
: profiler_(arena, sample_spec, profiler_config)
, reader_(reader) {
Expand Down
2 changes: 1 addition & 1 deletion src/internal_modules/roc_audio/profiling_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ProfilingReader : public IFrameReader, public core::NonCopyable<> {
//! Initialization.
ProfilingReader(IFrameReader& reader,
core::IArena& arena,
const audio::SampleSpec& sample_spec,
const SampleSpec& sample_spec,
ProfilerConfig profiler_config);

//! Check if the profiler was succefully constructed.
Expand Down
2 changes: 1 addition & 1 deletion src/internal_modules/roc_audio/profiling_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace audio {

ProfilingWriter::ProfilingWriter(IFrameWriter& writer,
core::IArena& arena,
const audio::SampleSpec& sample_spec,
const SampleSpec& sample_spec,
ProfilerConfig profiler_config)
: profiler_(arena, sample_spec, profiler_config)
, writer_(writer) {
Expand Down
2 changes: 1 addition & 1 deletion src/internal_modules/roc_audio/profiling_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ProfilingWriter : public IFrameWriter, public core::NonCopyable<> {
//! Initialization.
ProfilingWriter(IFrameWriter& writer,
core::IArena& arena,
const audio::SampleSpec& sample_spec,
const SampleSpec& sample_spec,
ProfilerConfig profiler_config);

//! Check if the profiler was succefully constructed.
Expand Down
19 changes: 9 additions & 10 deletions src/internal_modules/roc_audio/resampler_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ template <class T>
core::SharedPtr<IResampler> resampler_ctor(core::IArena& arena,
FrameFactory& frame_factory,
ResamplerProfile profile,
const audio::SampleSpec& in_spec,
const audio::SampleSpec& out_spec) {
const SampleSpec& in_spec,
const SampleSpec& out_spec) {
return new (arena) T(arena, frame_factory, profile, in_spec, out_spec);
}

template <class T>
core::SharedPtr<IResampler> resampler_dec_ctor(core::IArena& arena,
FrameFactory& frame_factory,
ResamplerProfile profile,
const audio::SampleSpec& in_spec,
const audio::SampleSpec& out_spec) {
const SampleSpec& in_spec,
const SampleSpec& out_spec) {
core::SharedPtr<IResampler> inner_resampler =
new (arena) T(arena, frame_factory, profile, in_spec, out_spec);

Expand Down Expand Up @@ -83,12 +83,11 @@ bool ResamplerMap::is_supported(ResamplerBackend backend_id) const {
return find_backend_(backend_id) != NULL;
}

core::SharedPtr<IResampler>
ResamplerMap::new_resampler(core::IArena& arena,
FrameFactory& frame_factory,
const ResamplerConfig& config,
const audio::SampleSpec& in_spec,
const audio::SampleSpec& out_spec) {
core::SharedPtr<IResampler> ResamplerMap::new_resampler(core::IArena& arena,
FrameFactory& frame_factory,
const ResamplerConfig& config,
const SampleSpec& in_spec,
const SampleSpec& out_spec) {
const Backend* backend = find_backend_(config.backend);
if (!backend) {
roc_log(LogError, "resampler map: unsupported resampler backend: [%d] %s",
Expand Down
8 changes: 4 additions & 4 deletions src/internal_modules/roc_audio/resampler_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class ResamplerMap : public core::NonCopyable<> {
core::SharedPtr<IResampler> new_resampler(core::IArena& arena,
FrameFactory& frame_factory,
const ResamplerConfig& config,
const audio::SampleSpec& in_spec,
const audio::SampleSpec& out_spec);
const SampleSpec& in_spec,
const SampleSpec& out_spec);

private:
friend class core::Singleton<ResamplerMap>;
Expand All @@ -65,8 +65,8 @@ class ResamplerMap : public core::NonCopyable<> {
core::SharedPtr<IResampler> (*ctor)(core::IArena& arena,
FrameFactory& frame_factory,
ResamplerProfile profile,
const audio::SampleSpec& in_spec,
const audio::SampleSpec& out_spec);
const SampleSpec& in_spec,
const SampleSpec& out_spec);
};

ResamplerMap();
Expand Down
4 changes: 2 additions & 2 deletions src/internal_modules/roc_audio/resampler_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class ResamplerReader : public IFrameReader, public core::NonCopyable<> {
IResampler& resampler_;
IFrameReader& reader_;

const audio::SampleSpec in_sample_spec_;
const audio::SampleSpec out_sample_spec_;
const SampleSpec in_sample_spec_;
const SampleSpec out_sample_spec_;

// timestamp of the last sample +1 of the last frame pushed into resampler
core::nanoseconds_t last_in_cts_;
Expand Down
4 changes: 2 additions & 2 deletions src/internal_modules/roc_audio/resampler_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class ResamplerWriter : public IFrameWriter, public core::NonCopyable<> {
IResampler& resampler_;
IFrameWriter& writer_;

const audio::SampleSpec in_sample_spec_;
const audio::SampleSpec out_sample_spec_;
const SampleSpec in_sample_spec_;
const SampleSpec out_sample_spec_;

core::Slice<sample_t> input_buf_;
core::Slice<sample_t> output_buf_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ inline int get_quality(ResamplerProfile profile) {
SpeexResampler::SpeexResampler(core::IArena& arena,
FrameFactory& frame_factory,
ResamplerProfile profile,
const audio::SampleSpec& in_spec,
const audio::SampleSpec& out_spec)
const SampleSpec& in_spec,
const SampleSpec& out_spec)
: IResampler(arena)
, speex_state_(NULL)
, num_ch_((spx_uint32_t)in_spec.num_channels())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class SpeexResampler : public IResampler, public core::NonCopyable<> {
SpeexResampler(core::IArena& arena,
FrameFactory& frame_factory,
ResamplerProfile profile,
const audio::SampleSpec& in_spec,
const audio::SampleSpec& out_spec);
const SampleSpec& in_spec,
const SampleSpec& out_spec);

~SpeexResampler();

Expand Down
2 changes: 1 addition & 1 deletion src/internal_modules/roc_audio/watchdog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void WatchdogConfig::deduce_defaults(core::nanoseconds_t target_latency) {
}

Watchdog::Watchdog(IFrameReader& reader,
const audio::SampleSpec& sample_spec,
const SampleSpec& sample_spec,
const WatchdogConfig& config,
core::IArena& arena)
: reader_(reader)
Expand Down
4 changes: 2 additions & 2 deletions src/internal_modules/roc_audio/watchdog.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Watchdog : public IFrameReader, public core::NonCopyable<> {
public:
//! Initialize.
Watchdog(IFrameReader& reader,
const audio::SampleSpec& sample_spec,
const SampleSpec& sample_spec,
const WatchdogConfig& config,
core::IArena& arena);

Expand Down Expand Up @@ -129,7 +129,7 @@ class Watchdog : public IFrameReader, public core::NonCopyable<> {

IFrameReader& reader_;

const audio::SampleSpec sample_spec_;
const SampleSpec sample_spec_;

packet::stream_timestamp_t max_blank_duration_;
packet::stream_timestamp_t max_drops_duration_;
Expand Down
4 changes: 2 additions & 2 deletions src/internal_modules/roc_packet/shipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ status::StatusCode Shipper::write(const PacketPtr& packet) {
}
}

if (!packet->has_flags(packet::Packet::FlagPrepared)) {
if (!packet->has_flags(Packet::FlagPrepared)) {
roc_panic("shipper: unexpected packet: should be prepared");
}

if (!packet->has_flags(packet::Packet::FlagComposed)) {
if (!packet->has_flags(Packet::FlagComposed)) {
if (!composer_.compose(*packet)) {
// TODO(gh-183): return status from composer
roc_panic("shipper: can't compose packet");
Expand Down
Loading

0 comments on commit 78d85df

Please sign in to comment.