X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=resampling_queue.h;h=8462152e0fe91bee15bc24474db7e18254b9f5f2;hb=refs%2Fheads%2Fmultichannel_audio;hp=cd5b44aa6d4e68ee7909c958c598949886f5f7a0;hpb=a5abc10286e46900f000090d988119fe3c9227a4;p=nageru diff --git a/resampling_queue.h b/resampling_queue.h index cd5b44a..8462152 100644 --- a/resampling_queue.h +++ b/resampling_queue.h @@ -38,8 +38,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#include -#include #include #include #include @@ -52,9 +50,18 @@ public: // card_num is for debugging outputs only. ResamplingQueue(unsigned card_num, unsigned freq_in, unsigned freq_out, unsigned num_channels = 2); + // If policy is DO_NOT_ADJUST_RATE, the resampling rate will not be changed. + // This is primarily useful if you have an extraordinary situation, such as + // dropped frames. + enum RateAdjustmentPolicy { + DO_NOT_ADJUST_RATE, + ADJUST_RATE + }; + // Note: pts is always in seconds. void add_input_samples(double pts, const float *samples, ssize_t num_samples); - bool get_output_samples(double pts, float *samples, ssize_t num_samples); // Returns false if underrun. + // Returns false if underrun. + bool get_output_samples(double pts, float *samples, ssize_t num_samples, RateAdjustmentPolicy rate_adjustment_policy); private: void init_loop_filter(double bandwidth_hz);