Measuring speed with Input Capture Mode [STM32 & CubeMx]
There's a few things wrong with it so far, so it will be difficult to get to the right answer in one go. Work on the following tips and see if you can get to somewhere with more specific questions to answer.

For starters you should heed the comments in the HAL boilerplate code: 1) implement your own HAL_TIM_IC_CaptureCallback so CubeMX doesn't overwrite your code. 2) don't use UNUSED if you use the argument.

As for the logic, the callback looks okay - you grab the timer value when the PPR trigger occurs. But then you need to use that value somewhere to do your RPM calculation.

I'm not sure what you mean by "the while loop" but the code snippet doesn't look useful. You've already called _GetCounter so no need to do it again. Just use the inputCaptureVal from your callback. Also be careful of concurrency - if you attempt to use inputCaptureVal while it is being updated in interrupt context, your calculation may be corrupted.

Finally, check your units. It sounds like your counter is in milliseconds (1MHz divided by 1000 prescaler), so to get RPM you'll need: RPM = 60000/counter.