mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "Visualizer: make the range align with VISUALIZER_CAPTURE_SIZE_*" into main
This commit is contained in:
@@ -19,20 +19,22 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <aidl/android/hardware/audio/effect/BnEffect.h>
|
#include <aidl/android/hardware/audio/effect/BnEffect.h>
|
||||||
|
#include <system/audio_effects/effect_visualizer.h>
|
||||||
#include "effect-impl/EffectImpl.h"
|
#include "effect-impl/EffectImpl.h"
|
||||||
|
|
||||||
namespace aidl::android::hardware::audio::effect {
|
namespace aidl::android::hardware::audio::effect {
|
||||||
|
|
||||||
class VisualizerSwContext final : public EffectContext {
|
class VisualizerSwContext final : public EffectContext {
|
||||||
public:
|
public:
|
||||||
static const int kMinCaptureSize = 0x80;
|
// need align the min/max capture size to VISUALIZER_CAPTURE_SIZE_MIN and
|
||||||
static const int kMaxCaptureSize = 0x400;
|
// VISUALIZER_CAPTURE_SIZE_MAX because of limitation in audio_utils fixedfft.
|
||||||
static const int kMaxLatencyMs = 3000;
|
static constexpr int32_t kMinCaptureSize = VISUALIZER_CAPTURE_SIZE_MIN;
|
||||||
static const int kMaxCaptureBufSize = 0xffff;
|
static constexpr int32_t kMaxCaptureSize = VISUALIZER_CAPTURE_SIZE_MAX;
|
||||||
|
static constexpr int32_t kMaxLatencyMs = 3000;
|
||||||
VisualizerSwContext(int statusDepth, const Parameter::Common& common)
|
VisualizerSwContext(int statusDepth, const Parameter::Common& common)
|
||||||
: EffectContext(statusDepth, common) {
|
: EffectContext(statusDepth, common) {
|
||||||
LOG(DEBUG) << __func__;
|
LOG(DEBUG) << __func__;
|
||||||
mCaptureSampleBuffer.resize(kMaxCaptureBufSize);
|
mCaptureSampleBuffer.resize(kMaxCaptureSize);
|
||||||
fill(mCaptureSampleBuffer.begin(), mCaptureSampleBuffer.end(), 0x80);
|
fill(mCaptureSampleBuffer.begin(), mCaptureSampleBuffer.end(), 0x80);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user