From 2054627caa7f71c564ce35b4525b6281fcd2cc39 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Mon, 5 Jan 2009 10:31:19 +0000 Subject: Have the codec thread do callbacks instead of messing with the stack which is much simpler and safer. Remove threads array from plugin API since it now serves no purpose. Up minimum API version and sort. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19684 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugin.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'apps/plugin.h') diff --git a/apps/plugin.h b/apps/plugin.h index a06f009520..390a65c7ad 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -132,12 +132,12 @@ void* plugin_get_buffer(size_t *buffer_size); #define PLUGIN_MAGIC 0x526F634B /* RocK */ /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 134 +#define PLUGIN_API_VERSION 135 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any new function which are "waiting" at the end of the function table) */ -#define PLUGIN_MIN_API_VERSION 134 +#define PLUGIN_MIN_API_VERSION 135 /* plugin return codes */ enum plugin_status { @@ -410,7 +410,6 @@ struct plugin_api { volatile long* current_tick; long (*default_event_handler)(long event); long (*default_event_handler_ex)(long event, void (*callback)(void *), void *parameter); - struct thread_entry* threads; unsigned int (*create_thread)(void (*function)(void), void* stack, size_t stack_size, unsigned flags, const char *name @@ -419,6 +418,10 @@ struct plugin_api { void (*thread_exit)(void); void (*thread_wait)(unsigned int thread_id); #if CONFIG_CODEC == SWCODEC + void (*thread_thaw)(unsigned int thread_id); +#ifdef HAVE_PRIORITY_SCHEDULING + int (*thread_set_priority)(unsigned int thread_id, int priority); +#endif void (*mutex_init)(struct mutex *m); void (*mutex_lock)(struct mutex *m); void (*mutex_unlock)(struct mutex *m); @@ -693,6 +696,8 @@ struct plugin_api { struct system_status *global_status; void (*talk_disable)(bool disable); #if CONFIG_CODEC == SWCODEC + void (*codec_thread_do_callback)(void (*fn)(void), + unsigned int *audio_thread_id); int (*codec_load_file)(const char* codec, struct codec_api *api); const char *(*get_codec_filename)(int cod_spec); bool (*get_metadata)(struct mp3entry* id3, int fd, const char* trackname); @@ -775,8 +780,6 @@ struct plugin_api { char *buf, int buflen); #endif - void (*thread_thaw)(unsigned int thread_id); - #ifdef HAVE_SEMAPHORE_OBJECTS void (*semaphore_init)(struct semaphore *s, int max, int start); void (*semaphore_wait)(struct semaphore *s); -- cgit v1.2.3