The ProcessingModuleInterface class defines the interface that user-defined module shall comply with to be manageable by the ADSP System.
More...
#include <processing_module_interface.h>
|
| virtual ErrorCode::Type | Init (void)=0 |
| | Additional method called after module initialization.
|
| virtual ErrorCode::Type | Delete (void)=0 |
| | Destructor that may contain logic executed on module destruction.
|
| virtual uint32_t | Process (InputStreamBuffer *input_stream_buffers, OutputStreamBuffer *output_stream_buffers)=0 |
| | Processes the stream buffers extracted from the input pins and produces the resulting signal in stream buffer of the output pins.
|
| virtual void | Reset (void)=0 |
| | Upon call to this method the ADSP system requires the module to reset its internal state into a well-known initial value.
|
| virtual void | SetProcessingMode (ProcessingMode mode)=0 |
| | Sets the processing mode for the module.
|
| virtual ProcessingMode | GetProcessingMode (void)=0 |
| | Gets the processing mode for the module.
|
| virtual ErrorCode::Type | SetConfiguration (uint32_t config_id, ConfigurationFragmentPosition fragment_position, uint32_t data_offset_size, const uint8_t *fragment_buffer, size_t fragment_size, uint8_t *response, size_t &response_size)=0 |
| | Applies the upcoming configuration message for the given configuration ID.
|
| virtual ErrorCode::Type | GetConfiguration (uint32_t config_id, ConfigurationFragmentPosition fragment_position, uint32_t &data_offset_size, uint8_t *fragment_buffer, size_t &fragment_size)=0 |
| | Retrieves the configuration message for the given configuration ID.
|
The ProcessingModuleInterface class defines the interface that user-defined module shall comply with to be manageable by the ADSP System.
It is also configurable through the couple of method SetConfiguration() / GetConfiguration(). A ProcessingModuleInterface object consumes data stream from its input pins and produces data stream into its output pins.
See also
◆ Delete()
| virtual ErrorCode::Type intel_adsp::ProcessingModuleInterface::Delete |
( |
void | | ) |
|
|
pure virtual |
Destructor that may contain logic executed on module destruction.
◆ GetConfiguration()
| virtual ErrorCode::Type intel_adsp::ProcessingModuleInterface::GetConfiguration |
( |
uint32_t | config_id, |
|
|
ConfigurationFragmentPosition | fragment_position, |
|
|
uint32_t & | data_offset_size, |
|
|
uint8_t * | fragment_buffer, |
|
|
size_t & | fragment_size ) |
|
pure virtual |
Retrieves the configuration message for the given configuration ID.
If the complete configuration message is greater than 4096 bytes, the transmission will be split into several fragments (lesser or equal to 4096 bytes). In this case the ADSP System will perform multiple call to GetConfiguration() until completion of the configuration message retrieval.
- Note
- config_id indicates ID of the configuration message only on first fragment retrieval otherwise it is set to 0.
- Parameters
-
| [in] | config_id | indicates ID of the configuration message that is requested to be returned |
| [in] | fragment_position | indicates position of the fragment in the whole message transmission |
| [in,out] | data_offset_size | Meaning of parameter depends on the fragment_position value.
|
| [out] | fragment_buffer | the fragment buffer to fill |
| [in,out] | fragment_size | the fragment buffer size. The actual size of data written into the fragment buffer shall be reported to the ADSP System. |
◆ GetProcessingMode()
| virtual ProcessingMode intel_adsp::ProcessingModuleInterface::GetProcessingMode |
( |
void | | ) |
|
|
pure virtual |
Gets the processing mode for the module.
◆ Init()
| virtual ErrorCode::Type intel_adsp::ProcessingModuleInterface::Init |
( |
void | | ) |
|
|
pure virtual |
Additional method called after module initialization.
◆ Process()
Processes the stream buffers extracted from the input pins and produces the resulting signal in stream buffer of the output pins.
The user-defined implementation of Process() is generally expected to consume all the samples available in the input stream buffers and should produce the samples for all free room available in the output stream buffers. Note that in normal condition all connected input pins will receive "ibs" (i.e. "Input Buffer Size") data bytes in their input stream buffers and output pins should produce "obs" (i.e. "Output Buffer Size") data bytes in their output stream buffers. ("ibs" and "obs" values are given to module at construction time within the ModuleInitialSettings parameter). However in "end of stream" condition input stream buffers may be filled with less data count than "ibs". Therefore less data count than "obs" can be put in the output buffers.
- Returns
- Custom implementation can return a user-defined error code value. This user-defined error code will be transmitted to host driver if the value is different from 0 (0 is considered as a "no-error value")
- Parameters
-
| [in,out] | input_stream_buffers | C-array of input buffers to process. "data" field value can be NULL if the associated pin is not connected |
| [in,out] | output_stream_buffers | C-array of output buffers to produce. "data" field value can be NULL if the associated pin is not connected |
- Note
- "size" field value is set with the total room available in the output buffers at Process() method call. It shall be updated within the method to report to the ADSP System the actual data size put in the output buffers.
◆ Reset()
| virtual void intel_adsp::ProcessingModuleInterface::Reset |
( |
void | | ) |
|
|
pure virtual |
Upon call to this method the ADSP system requires the module to reset its internal state into a well-known initial value.
Parameters which may have been set through SetConfiguration() are supposed to be left unchanged.
◆ SetConfiguration()
| virtual ErrorCode::Type intel_adsp::ProcessingModuleInterface::SetConfiguration |
( |
uint32_t | config_id, |
|
|
ConfigurationFragmentPosition | fragment_position, |
|
|
uint32_t | data_offset_size, |
|
|
const uint8_t * | fragment_buffer, |
|
|
size_t | fragment_size, |
|
|
uint8_t * | response, |
|
|
size_t & | response_size ) |
|
pure virtual |
Applies the upcoming configuration message for the given configuration ID.
If the complete configuration message is greater than 4096 bytes, the transmission will be split into several fragments (lesser or equal to 4096 bytes). In this case the ADSP System will perform multiple calls to SetConfiguration() until completion of the configuration message sending.
- Note
- config_id indicates ID of the configuration message only on the first fragment sending otherwise it is set to 0.
- Parameters
-
| [in] | config_id | indicates ID of the configuration message that is provided |
| [in] | fragment_position | indicates position of the fragment in the whole message transmission |
| [in] | data_offset_size | Meaning of parameter depends on the fragment_position value:
|
| [in] | fragment_buffer | the configuration fragment buffer |
| [in] | fragment_size | the fragment buffer size. As per ADSP System design the fragment_size value will not exceed 4096 bytes. |
| [out] | response | the response message buffer to optionally fill |
| [in,out] | response_size | the response message size. As per ADSP System design the response_size value shall not exceed 2048 bytes. Implementation of SetConfiguration shall set response_size value to the actual size (in bytes) of the response message |
◆ SetProcessingMode()
| virtual void intel_adsp::ProcessingModuleInterface::SetProcessingMode |
( |
ProcessingMode | mode | ) |
|
|
pure virtual |
Sets the processing mode for the module.
Upon the transition from one processing mode to another, the module is required to handle enabling/disabling of its custom processing as smoothly as possible (no glitch, no signal discontinuity).
- Note
- This method is actually only relevant for modules which only manipulate PCM signal streams. Thus, the ADSP System will only fire the SetProcessingMode() method for those kind of modules. (e.g. not for signal decoders, encoders etc.) Moreover, disabling the processing of modules which convert the trait of the signal samples (bit depth, sampling rate, etc.) would make the resulting stream(s) unsuitable for the downstream modules. Therefore ADSP System will not fire this method for such modules too.
The documentation for this class was generated from the following file: