diff options
author | Paul Adenot <[email protected]> | 2021-07-06 14:45:47 +0200 |
---|---|---|
committer | Paul Adenot <[email protected]> | 2021-07-13 13:51:30 +0200 |
commit | de7cf5cccea76e0c9c5393770acc481d6a51ca41 (patch) | |
tree | f5890a9bdf60c7eb51bd1a8f58bc8957591dbc7d | |
parent | cf7636f17c1847937f1c35be890bab45188d6eaa (diff) | |
download | cubeb-de7cf5cccea76e0c9c5393770acc481d6a51ca41.tar.gz cubeb-de7cf5cccea76e0c9c5393770acc481d6a51ca41.zip |
Log input and output frames
-rw-r--r-- | src/cubeb_wasapi.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cubeb_wasapi.cpp b/src/cubeb_wasapi.cpp index 272793e..6645ef7 100644 --- a/src/cubeb_wasapi.cpp +++ b/src/cubeb_wasapi.cpp @@ -353,6 +353,9 @@ struct cubeb_stream { /* This needs an active audio input stream to be known, and is updated in the * first audio input callback. */ std::atomic<int64_t> input_latency_hns { LATENCY_NOT_AVAILABLE_YET }; + + size_t total_input_frames = 0; + size_t total_output_frames = 0; }; class monitor_device_notifications { @@ -967,6 +970,8 @@ bool get_input_buffer(cubeb_stream * stm) } } + stm->total_input_frames += frames; + UINT32 input_stream_samples = frames * stm->input_stream_params.channels; // We do not explicitly handle the AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY // flag. There a two primary (non exhaustive) scenarios we anticipate this @@ -1110,6 +1115,13 @@ refill_callback_duplex(cubeb_stream * stm) return false; } + stm->total_output_frames += output_frames; + + ALOGV("in: %zu, out: %zu, missing: %ld, ratio: %f", + stm->total_input_frames, stm->total_output_frames, + static_cast<long>(stm->total_output_frames) - stm->total_input_frames, + static_cast<float>(stm->total_output_frames) / stm->total_input_frames); + if (stm->has_dummy_output) { ALOGV("Duplex callback (dummy output): input frames: %Iu, output frames: %Iu", input_frames, output_frames); |