| 128 | } |
| 129 | |
| 130 | void GrStatistics::ProcessAudioSpectrum(const MsgServerAudioSpectrum& msg) { |
| 131 | this->audio_samples_ = msg.spectrum_->samples(); |
| 132 | this->audio_channels_ = msg.spectrum_->channels(); |
| 133 | this->audio_bits_ = msg.spectrum_->bits(); |
| 134 | if (this->left_spectrum_.Size() != msg.spectrum_->left_spectrum().size()) { |
| 135 | this->left_spectrum_.Resize(msg.spectrum_->left_spectrum().size()); |
| 136 | } |
| 137 | //memcpy(this->left_spectrum_.data(), msg.spectrum_->left_spectrum().data(), msg.spectrum_->left_spectrum().size() * sizeof(double)); |
| 138 | if (!this->left_spectrum_.CopyMemFrom<>(msg.spectrum_->left_spectrum())) { |
| 139 | LOGE("copy left spectrum failed."); |
| 140 | } |
| 141 | |
| 142 | if (this->right_spectrum_.Size() != msg.spectrum_->right_spectrum().size()) { |
| 143 | this->right_spectrum_.Resize(msg.spectrum_->right_spectrum().size()); |
| 144 | } |
| 145 | if (!this->right_spectrum_.CopyMemFrom<>(msg.spectrum_->right_spectrum())) { |
| 146 | LOGE("copy left spectrum failed."); |
| 147 | } |
| 148 | //memcpy(this->right_spectrum_.data(), msg.spectrum_->right_spectrum().data(), msg.spectrum_->right_spectrum().size() * sizeof(double)); |
| 149 | } |
| 150 | |
| 151 | void GrStatistics::Process1SCalculation() { |
| 152 | // speed |
nothing calls this directly
no outgoing calls
no test coverage detected