Skip to content

Commit

Permalink
Always enable resampler stats
Browse files Browse the repository at this point in the history
The define causes trouble with Firefox's build system and it's not
obvious how to fix it properly.

This is harmless enough and will probably be DCEed.
  • Loading branch information
padenot committed Mar 3, 2025
1 parent 34ff385 commit 15dc83f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 15 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ else()
endif()

if(BUILD_TESTS)
add_definitions(-DGTEST_ENABLED=1)
find_package(GTest QUIET)
if(TARGET GTest::Main)
add_library(gtest_main ALIAS GTest::Main)
Expand Down
2 changes: 0 additions & 2 deletions src/cubeb_resampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,8 @@ cubeb_resampler_latency(cubeb_resampler * resampler)
return resampler->latency();
}

#ifdef GTEST_ENABLED
cubeb_resampler_stats
cubeb_resampler_stats_get(cubeb_resampler * resampler)
{
return resampler->stats();
}
#endif
2 changes: 0 additions & 2 deletions src/cubeb_resampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ cubeb_resampler_latency(cubeb_resampler * resampler);
* Test-only introspection API to ensure that there is no buffering
* buildup when resampling.
*/
#ifdef GTEST_ENABLED
typedef struct {
size_t input_input_buffer_size;
size_t input_output_buffer_size;
Expand All @@ -98,7 +97,6 @@ typedef struct {

cubeb_resampler_stats
cubeb_resampler_stats_get(cubeb_resampler * resampler);
#endif

#if defined(__cplusplus)
}
Expand Down
10 changes: 0 additions & 10 deletions src/cubeb_resampler_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ struct cubeb_resampler {
virtual long fill(void * input_buffer, long * input_frames_count,
void * output_buffer, long frames_needed) = 0;
virtual long latency() = 0;
#ifdef GTEST_ENABLED
virtual cubeb_resampler_stats stats() = 0;
#endif
virtual ~cubeb_resampler() {}
};

Expand Down Expand Up @@ -89,7 +87,6 @@ class passthrough_resampler : public cubeb_resampler, public processor {

virtual long latency() { return 0; }

#ifdef GTEST_ENABLED
virtual cubeb_resampler_stats stats()
{
cubeb_resampler_stats stats;
Expand All @@ -99,7 +96,6 @@ class passthrough_resampler : public cubeb_resampler, public processor {
stats.output_output_buffer_size = 0;
return stats;
}
#endif

void drop_audio_if_needed()
{
Expand Down Expand Up @@ -137,7 +133,6 @@ class cubeb_resampler_speex : public cubeb_resampler {
virtual long fill(void * input_buffer, long * input_frames_count,
void * output_buffer, long output_frames_needed);

#ifdef GTEST_ENABLED
virtual cubeb_resampler_stats stats()
{
cubeb_resampler_stats stats = {};
Expand All @@ -151,7 +146,6 @@ class cubeb_resampler_speex : public cubeb_resampler {
}
return stats;
}
#endif

virtual long latency()
{
Expand Down Expand Up @@ -361,10 +355,8 @@ template <typename T> class cubeb_resampler_speex_one_way : public processor {
}
}

#ifdef GTEST_ENABLED
size_t input_buffer_size() const { return resampling_in_buffer.length(); }
size_t output_buffer_size() const { return resampling_out_buffer.length(); }
#endif

private:
/** Wrapper for the speex resampling functions to have a typed
Expand Down Expand Up @@ -514,10 +506,8 @@ template <typename T> class delay_line : public processor {
}
}

#ifdef GTEST_ENABLED
size_t input_buffer_size() const { return delay_input_buffer.length(); }
size_t output_buffer_size() const { return delay_output_buffer.length(); }
#endif

private:
/** The length, in frames, of this delay line */
Expand Down

0 comments on commit 15dc83f

Please sign in to comment.