* hardware playback
* The version and size fields must be initialized by the caller by using
* one of the constants defined here.
+ * Must be aligned to transmit as raw memory through Binder.
*/
typedef struct {
uint16_t version; // version of the info structure
uint32_t bit_width;
uint32_t offload_buffer_size; // offload fragment size
audio_usage_t usage;
-} audio_offload_info_t;
+} __attribute__((aligned(8))) audio_offload_info_t;
#define AUDIO_MAKE_OFFLOAD_INFO_VERSION(maj,min) \
((((maj) & 0xff) << 8) | ((min) & 0xff))
/* common audio stream configuration parameters
* You should memset() the entire structure to zero before use to
* ensure forward compatibility
+ * Must be aligned to transmit as raw memory through Binder.
*/
-struct audio_config {
+struct __attribute__((aligned(8))) audio_config {
uint32_t sample_rate;
audio_channel_mask_t channel_mask;
audio_format_t format;
audio_offload_info_t offload_info;
- size_t frame_count;
+ uint32_t frame_count;
};
typedef struct audio_config audio_config_t;
/*
* Generic recognition event sent via recognition callback
+ * Must be aligned to transmit as raw memory through Binder.
*/
-struct sound_trigger_recognition_event {
+struct __attribute__((aligned(8))) sound_trigger_recognition_event {
int status; /* recognition status e.g.
RECOGNITION_STATUS_SUCCESS */
sound_trigger_sound_model_type_t type; /* event type, same as sound model type.