media_effect_param.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2020, Actions Semi Co., Inc.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef __MEDIA_EFFECT_PARAM_H__
  7. #define __MEDIA_EFFECT_PARAM_H__
  8. #include <toolchain.h>
  9. #include <arithmetic.h>
  10. #define ASET_DAE_PEQ_POINT_NUM (AS_DAE_EQ_NUM_BANDS)
  11. /* 512 bytes */
  12. typedef struct aset_para_bin {
  13. char dae_para[AS_DAE_PARA_BIN_SIZE]; /* 512 bytes */
  14. } __packed aset_para_bin_t;
  15. #define ASET_MAX_VOLUME_TABLE_LEVEL 41
  16. typedef struct {
  17. int32_t nPAVal[ASET_MAX_VOLUME_TABLE_LEVEL]; /* unit: 0.001 dB */
  18. int16_t sDAVal[ASET_MAX_VOLUME_TABLE_LEVEL]; /* unit: 0.1 dB */
  19. int8_t bEnable;
  20. int8_t bRev[9];
  21. } __packed aset_volume_table_v2_t;
  22. #define ASQT_DAE_PEQ_POINT_NUM (AS_DAE_H_EQ_NUM_BANDS)
  23. /* 288 bytes */
  24. typedef struct asqt_para_bin {
  25. #ifndef CONFIG_DSP
  26. as_hfp_speech_para_bin_t sv_para; /* 60 bytes */
  27. char cRev1[12];
  28. char dae_para[AS_DAE_H_PARA_BIN_SIZE]; /* 192 bytes */
  29. char cRev2[24];
  30. #else
  31. char sv_para[330];
  32. #endif
  33. } __packed asqt_para_bin_t;
  34. /**
  35. * @brief Set user effect param.
  36. *
  37. * This routine set user effect param. The new param will take effect after
  38. * next media_player_open.
  39. *
  40. * @param stream_type stream type, see audio_stream_type_e
  41. * @param effect_type effect type, reserved for future
  42. * @param vaddr address of user effect param
  43. * @param size size of user effect param
  44. *
  45. * @return 0 if succeed; non-zero if fail.
  46. */
  47. int medie_effect_set_user_param(uint8_t stream_type, uint8_t effect_type, const void *vaddr, int size);
  48. /**
  49. * @brief Get effect param.
  50. *
  51. * This routine get effect param. User effect param will take
  52. * take precedence over effect file.
  53. *
  54. * @param stream_type stream type, see audio_stream_type_e
  55. * @param effect_type effect type, reserved for future
  56. * @param effect_size size of the effect param
  57. *
  58. * @return address of effect param.
  59. */
  60. const void *media_effect_get_param(uint8_t stream_type, uint8_t effect_type, int *effect_size);
  61. #endif /* __MEDIA_EFFECT_PARAM_H__ */