diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2009-01-05 10:31:19 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2009-01-05 10:31:19 +0000 |
commit | 2054627caa7f71c564ce35b4525b6281fcd2cc39 (patch) | |
tree | 2b0aa3b9b8888c4746b75d4750d90f79552159ee /apps/plugin.h | |
parent | 45aa9a22f9a3e08505cc2f2999459d249356ed9c (diff) | |
download | rockbox-2054627caa7f71c564ce35b4525b6281fcd2cc39.tar.gz rockbox-2054627caa7f71c564ce35b4525b6281fcd2cc39.zip |
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.h | 13 |
1 files changed, 8 insertions, 5 deletions
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); | |||
132 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 132 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
133 | 133 | ||
134 | /* increase this every time the api struct changes */ | 134 | /* increase this every time the api struct changes */ |
135 | #define PLUGIN_API_VERSION 134 | 135 | #define PLUGIN_API_VERSION 135 |
136 | 136 | ||
137 | /* update this to latest version if a change to the api struct breaks | 137 | /* update this to latest version if a change to the api struct breaks |
138 | backwards compatibility (and please take the opportunity to sort in any | 138 | backwards compatibility (and please take the opportunity to sort in any |
139 | new function which are "waiting" at the end of the function table) */ | 139 | new function which are "waiting" at the end of the function table) */ |
140 | #define PLUGIN_MIN_API_VERSION 134 | 140 | #define PLUGIN_MIN_API_VERSION 135 |
141 | 141 | ||
142 | /* plugin return codes */ | 142 | /* plugin return codes */ |
143 | enum plugin_status { | 143 | enum plugin_status { |
@@ -410,7 +410,6 @@ struct plugin_api { | |||
410 | volatile long* current_tick; | 410 | volatile long* current_tick; |
411 | long (*default_event_handler)(long event); | 411 | long (*default_event_handler)(long event); |
412 | long (*default_event_handler_ex)(long event, void (*callback)(void *), void *parameter); | 412 | long (*default_event_handler_ex)(long event, void (*callback)(void *), void *parameter); |
413 | struct thread_entry* threads; | ||
414 | unsigned int (*create_thread)(void (*function)(void), void* stack, | 413 | unsigned int (*create_thread)(void (*function)(void), void* stack, |
415 | size_t stack_size, unsigned flags, | 414 | size_t stack_size, unsigned flags, |
416 | const char *name | 415 | const char *name |
@@ -419,6 +418,10 @@ struct plugin_api { | |||
419 | void (*thread_exit)(void); | 418 | void (*thread_exit)(void); |
420 | void (*thread_wait)(unsigned int thread_id); | 419 | void (*thread_wait)(unsigned int thread_id); |
421 | #if CONFIG_CODEC == SWCODEC | 420 | #if CONFIG_CODEC == SWCODEC |
421 | void (*thread_thaw)(unsigned int thread_id); | ||
422 | #ifdef HAVE_PRIORITY_SCHEDULING | ||
423 | int (*thread_set_priority)(unsigned int thread_id, int priority); | ||
424 | #endif | ||
422 | void (*mutex_init)(struct mutex *m); | 425 | void (*mutex_init)(struct mutex *m); |
423 | void (*mutex_lock)(struct mutex *m); | 426 | void (*mutex_lock)(struct mutex *m); |
424 | void (*mutex_unlock)(struct mutex *m); | 427 | void (*mutex_unlock)(struct mutex *m); |
@@ -693,6 +696,8 @@ struct plugin_api { | |||
693 | struct system_status *global_status; | 696 | struct system_status *global_status; |
694 | void (*talk_disable)(bool disable); | 697 | void (*talk_disable)(bool disable); |
695 | #if CONFIG_CODEC == SWCODEC | 698 | #if CONFIG_CODEC == SWCODEC |
699 | void (*codec_thread_do_callback)(void (*fn)(void), | ||
700 | unsigned int *audio_thread_id); | ||
696 | int (*codec_load_file)(const char* codec, struct codec_api *api); | 701 | int (*codec_load_file)(const char* codec, struct codec_api *api); |
697 | const char *(*get_codec_filename)(int cod_spec); | 702 | const char *(*get_codec_filename)(int cod_spec); |
698 | bool (*get_metadata)(struct mp3entry* id3, int fd, const char* trackname); | 703 | bool (*get_metadata)(struct mp3entry* id3, int fd, const char* trackname); |
@@ -775,8 +780,6 @@ struct plugin_api { | |||
775 | char *buf, int buflen); | 780 | char *buf, int buflen); |
776 | #endif | 781 | #endif |
777 | 782 | ||
778 | void (*thread_thaw)(unsigned int thread_id); | ||
779 | |||
780 | #ifdef HAVE_SEMAPHORE_OBJECTS | 783 | #ifdef HAVE_SEMAPHORE_OBJECTS |
781 | void (*semaphore_init)(struct semaphore *s, int max, int start); | 784 | void (*semaphore_init)(struct semaphore *s, int max, int start); |
782 | void (*semaphore_wait)(struct semaphore *s); | 785 | void (*semaphore_wait)(struct semaphore *s); |