audioconvert: add support of volume ramp scale parameter

- Add support for Linear and Cubic volume scales
- Also start treating a "zero" value of volume ramp parameters as invalid
This commit is contained in:
Ashok Sidipotu 2023-03-28 10:38:41 +05:30 committed by Wim Taymans
parent 7b91d506f1
commit 8bfafaeca2
3 changed files with 78 additions and 47 deletions

View file

@ -261,6 +261,11 @@ enum spa_audio_channel {
SPA_AUDIO_CHANNEL_START_Custom = 0x10000,
};
enum spa_audio_volume_ramp_scale {
SPA_AUDIO_VOLUME_RAMP_LINEAR,
SPA_AUDIO_VOLUME_RAMP_CUBIC,
};
/** Extra audio flags */
#define SPA_AUDIO_FLAG_NONE (0) /*< no valid flag */
#define SPA_AUDIO_FLAG_UNPOSITIONED (1 << 0) /*< the position array explicitly

View file

@ -59,15 +59,11 @@ enum spa_prop {
SPA_PROP_START_Audio = 0x10000, /**< audio related properties */
SPA_PROP_waveType,
SPA_PROP_frequency,
SPA_PROP_volume, /**< a volume (Float), 0.0 silence, 1.0 normal */
SPA_PROP_volumeRampSamples, /**< Samples to ramp the volume over
*-1 is invalid, 0 ramps over instantly*/
SPA_PROP_volumeRampStepSamples, /**< Step or incremental Samples to ramp the volume over
*-1 is invalid, 0 ramps over instantly */
SPA_PROP_volumeRampTime, /**< Time in millisec to ramp the volume over
*-1 is invalid, 0 ramps over instantly*/
SPA_PROP_volumeRampStepTime, /**< Step or incremental Time in nano seconds to ramp the
*volume over -1 is invalid, 0 ramps over instantly */
SPA_PROP_volume, /**< a volume (Float), 0.0 silence, 1.0 normal */
SPA_PROP_volumeRampSamples, /**< Samples to ramp the volume over */
SPA_PROP_volumeRampStepSamples, /**< Step or incremental Samples to ramp the volume over */
SPA_PROP_volumeRampTime, /**< Time in millisec to ramp the volume over */
SPA_PROP_volumeRampStepTime, /**< Step or incremental Time in nano seconds to ramp the */
SPA_PROP_volumeRampScale, /**< the scale or graph to used to ramp the volume */
SPA_PROP_mute, /**< mute (Bool) */
SPA_PROP_patternType,