summaryrefslogtreecommitdiff
path: root/lib/rbcodec/dsp/dsp_sample_io.h
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-12-03 15:33:15 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-12-23 12:47:10 -0500
commit6e794c9a2d9e91a926f70d0fcc66e255b0bdc221 (patch)
tree3a0d1371a0a259f2ed761e5db871064867b2a7ce /lib/rbcodec/dsp/dsp_sample_io.h
parent34a092a99729dd4de014aa1f76c48660f28a9c97 (diff)
downloadrockbox-6e794c9a2d9e91a926f70d0fcc66e255b0bdc221.tar.gz
rockbox-6e794c9a2d9e91a926f70d0fcc66e255b0bdc221.zip
rbcodec dsp: Refactor DSP init routines, restore INIT_ATTR
Refactor DSP init routines so there is a dedicated init function for the stages that need it. Remove the DSP_INIT configure message. This allows the init code to be safely marked INIT_ATTR, saving a bit of code size, and allowing the linker to verify that there are no unsafe references to the init routines. Change-Id: I1702f0f579bbb300a6fe7d0e67b13aa2e9dd7f8a
Diffstat (limited to 'lib/rbcodec/dsp/dsp_sample_io.h')
-rw-r--r--lib/rbcodec/dsp/dsp_sample_io.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rbcodec/dsp/dsp_sample_io.h b/lib/rbcodec/dsp/dsp_sample_io.h
index 7e41337a5b..095aea3f3a 100644
--- a/lib/rbcodec/dsp/dsp_sample_io.h
+++ b/lib/rbcodec/dsp/dsp_sample_io.h
@@ -56,17 +56,18 @@ struct sample_io_data
56 uint8_t output_version; /* Format version of src buffer at output */ 56 uint8_t output_version; /* Format version of src buffer at output */
57}; 57};
58 58
59void dsp_sample_input_init(struct sample_io_data *this, unsigned int dsp_id); 59void dsp_sample_input_init(struct sample_io_data *this, unsigned int dsp_id) INIT_ATTR;
60void dsp_sample_input_flush(struct sample_io_data *this); 60void dsp_sample_input_flush(struct sample_io_data *this);
61void dsp_sample_input_format_change(struct sample_io_data *this, 61void dsp_sample_input_format_change(struct sample_io_data *this,
62 struct sample_format *format); 62 struct sample_format *format);
63 63
64void dsp_sample_output_init(struct sample_io_data *this); 64void dsp_sample_output_init(struct sample_io_data *this) INIT_ATTR;
65void dsp_sample_output_flush(struct sample_io_data *this); 65void dsp_sample_output_flush(struct sample_io_data *this);
66void dsp_sample_output_format_change(struct sample_io_data *this, 66void dsp_sample_output_format_change(struct sample_io_data *this,
67 struct sample_format *format); 67 struct sample_format *format);
68 68
69/* Sample IO watches the format setting from the codec */ 69/* Sample IO watches the format setting from the codec */
70void dsp_sample_io_init(struct sample_io_data *this, unsigned int dsp_id) INIT_ATTR;
70bool dsp_sample_io_configure(struct sample_io_data *this, 71bool dsp_sample_io_configure(struct sample_io_data *this,
71 unsigned int setting, 72 unsigned int setting,
72 intptr_t *value_p); 73 intptr_t *value_p);