atsushieno / aap-core

an Audio Plugin Format/Framework for Android
MIT License
90 stars 3 forks source link

Remove RT_SAFE and RT_UNSAFE annotations from host extension functions #183

Closed atsushieno closed 11 months ago

atsushieno commented 12 months ago

Currently we mark RT_SAFE and RTUNSAFE annotations on host extensions e.g.:

typedef struct aap_host_parameters_extension_t {
    RT_SAFE void (*notify_parameters_changed) (aap_host_parameters_extension_t* ext, AndroidAudioPluginHost* host, AndroidAudioPlugin *plugin);
} aap_host_parameters_extension_t;

However, there is no point of marking host extension functions by design; RT safety on extension functions are assured only by AAPXS SysEx8 which is based on the plugin's process() function which is a request from the host and reply from the plugin. The initiator is always the plugin side. Host extension functions are the other way around - sent either via a callback Binder (on non-RT INACTIVE mode) or AAPXS SysEx8 (on RT ACTIVE mode), and there is no round-trip reply from the host within the same process(). The reply from the host is always the next process() at the fastest.

Since there is no guarantee that two process() calls are made within a RT slot, everything is RT_UNSAFE in principle. Therefore, those annotations do not make sense.