summaryrefslogtreecommitdiff
path: root/apps/plugin.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2009-01-05 10:31:19 +0000
committerMichael Sevakis <jethead71@rockbox.org>2009-01-05 10:31:19 +0000
commit2054627caa7f71c564ce35b4525b6281fcd2cc39 (patch)
tree2b0aa3b9b8888c4746b75d4750d90f79552159ee /apps/plugin.h
parent45aa9a22f9a3e08505cc2f2999459d249356ed9c (diff)
downloadrockbox-2054627caa7f71c564ce35b4525b6281fcd2cc39.zip
rockbox-2054627caa7f71c564ce35b4525b6281fcd2cc39.tar.gz
rockbox-2054627caa7f71c564ce35b4525b6281fcd2cc39.tar.bz2
rockbox-2054627caa7f71c564ce35b4525b6281fcd2cc39.tar.xz
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
Diffstat (limited to 'apps/plugin.h')
-rw-r--r--apps/plugin.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/plugin.h b/apps/plugin.h
index a06f009..390a65c 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);