2018-03-06 06:17:12 +08:00
|
|
|
divert(-1)
|
|
|
|
|
|
|
|
dnl Define the macro for buffer widget
|
|
|
|
|
2020-03-10 21:16:09 +08:00
|
|
|
dnl N_BUFFER(name)
|
2018-03-06 06:17:12 +08:00
|
|
|
define(`N_BUFFER', `BUF'PIPELINE_ID`.'$1)
|
|
|
|
|
2021-12-15 19:36:06 +08:00
|
|
|
dnl W_BUFFER(name, size, capabilities)
|
2018-03-06 06:17:12 +08:00
|
|
|
define(`W_BUFFER',
|
|
|
|
`SectionVendorTuples."'N_BUFFER($1)`_tuples" {'
|
|
|
|
` tokens "sof_buffer_tokens"'
|
|
|
|
` tuples."word" {'
|
|
|
|
` SOF_TKN_BUF_SIZE' STR($2)
|
|
|
|
` SOF_TKN_BUF_CAPS' STR($3)
|
|
|
|
` }'
|
|
|
|
`}'
|
|
|
|
`SectionData."'N_BUFFER($1)`_data" {'
|
|
|
|
` tuples "'N_BUFFER($1)`_tuples"'
|
|
|
|
`}'
|
2020-03-10 21:16:09 +08:00
|
|
|
`ifelse(`$#', `4',
|
|
|
|
`SectionVendorTuples."'N_BUFFER($1)`_comp_tuples" {'
|
|
|
|
` tokens "sof_comp_tokens"'
|
|
|
|
` tuples."word" {'
|
2021-12-15 19:36:06 +08:00
|
|
|
` SOF_TKN_COMP_CORE_ID' 0
|
2020-03-10 21:16:09 +08:00
|
|
|
` }'
|
|
|
|
`}'
|
|
|
|
`SectionData."'N_BUFFER($1)`_comp" {'
|
|
|
|
` tuples "'N_BUFFER($1)`_comp_tuples"'
|
|
|
|
`}'
|
|
|
|
,` ')'
|
2018-03-06 06:17:12 +08:00
|
|
|
`SectionWidget."'N_BUFFER($1)`" {'
|
|
|
|
` index "'PIPELINE_ID`"'
|
|
|
|
` type "buffer"'
|
|
|
|
` no_pm "true"'
|
|
|
|
` data ['
|
|
|
|
` "'N_BUFFER($1)`_data"'
|
2020-03-10 21:16:09 +08:00
|
|
|
`ifelse(`$#', `4',
|
|
|
|
` "'N_BUFFER($1)`_comp"'
|
|
|
|
,` ')'
|
2018-03-06 06:17:12 +08:00
|
|
|
` ]'
|
|
|
|
`}')
|
|
|
|
|
2018-03-07 02:59:03 +08:00
|
|
|
dnl COMP_BUFFER_SIZE( num_periods, sample_size, channels, fmames)
|
|
|
|
define(`COMP_BUFFER_SIZE', `eval(`$1 * $2 * $3 * $4')')
|
|
|
|
|
2019-08-17 00:22:42 +08:00
|
|
|
dnl COMP_PERIOD_FRAMES( sample_rate, period_us)
|
|
|
|
define(`COMP_PERIOD_FRAMES', `eval(`($1 * $2) / 1000000')')
|
|
|
|
|
2018-03-06 06:17:12 +08:00
|
|
|
divert(0)dnl
|