summaryrefslogtreecommitdiff
path: root/apps/codecs.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs.h')
-rw-r--r--apps/codecs.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/apps/codecs.h b/apps/codecs.h
index c3ef7c154e..252dafd1f4 100644
--- a/apps/codecs.h
+++ b/apps/codecs.h
@@ -75,17 +75,16 @@
75#define CODEC_ENC_MAGIC 0x52454E43 /* RENC */ 75#define CODEC_ENC_MAGIC 0x52454E43 /* RENC */
76 76
77/* increase this every time the api struct changes */ 77/* increase this every time the api struct changes */
78#define CODEC_API_VERSION 35 78#define CODEC_API_VERSION 36
79 79
80/* update this to latest version if a change to the api struct breaks 80/* update this to latest version if a change to the api struct breaks
81 backwards compatibility (and please take the opportunity to sort in any 81 backwards compatibility (and please take the opportunity to sort in any
82 new function which are "waiting" at the end of the function table) */ 82 new function which are "waiting" at the end of the function table) */
83#define CODEC_MIN_API_VERSION 35 83#define CODEC_MIN_API_VERSION 36
84 84
85/* codec return codes */ 85/* codec return codes */
86enum codec_status { 86enum codec_status {
87 CODEC_OK = 0, 87 CODEC_OK = 0,
88 CODEC_USB_CONNECTED,
89 CODEC_ERROR = -1, 88 CODEC_ERROR = -1,
90}; 89};
91 90
@@ -106,13 +105,13 @@ struct codec_api {
106 105
107 /* Codec should periodically check if stop_codec is set to true. 106 /* Codec should periodically check if stop_codec is set to true.
108 In case it is, codec must return immediately */ 107 In case it is, codec must return immediately */
109 bool stop_codec; 108 volatile bool stop_codec;
110 /* Codec should periodically check if new_track is non zero. 109 /* Codec should periodically check if new_track is non zero.
111 When it is, the codec should request a new track. */ 110 When it is, the codec should request a new track. */
112 int new_track; 111 volatile int new_track;
113 /* If seek_time != 0, codec should seek to that song position (in ms) 112 /* If seek_time != 0, codec should seek to that song position (in ms)
114 if codec supports seeking. */ 113 if codec supports seeking. */
115 long seek_time; 114 volatile long seek_time;
116 115
117 /* The dsp instance to be used for audio output */ 116 /* The dsp instance to be used for audio output */
118 struct dsp_config *dsp; 117 struct dsp_config *dsp;
@@ -145,8 +144,6 @@ struct codec_api {
145 track is available and changed. If return value is false, 144 track is available and changed. If return value is false,
146 codec should exit immediately with PLUGIN_OK status. */ 145 codec should exit immediately with PLUGIN_OK status. */
147 bool (*request_next_track)(void); 146 bool (*request_next_track)(void);
148 /* Free the buffer area of the current codec after its loaded */
149 void (*discard_codec)(void);
150 147
151 void (*set_offset)(size_t value); 148 void (*set_offset)(size_t value);
152 /* Configure different codec buffer parameters. */ 149 /* Configure different codec buffer parameters. */
@@ -210,8 +207,6 @@ struct codec_api {
210#endif 207#endif
211 208
212#ifdef HAVE_RECORDING 209#ifdef HAVE_RECORDING
213 volatile bool stop_encoder;
214 volatile int enc_codec_loaded; /* <0=error, 0=pending, >0=ok */
215 void (*enc_get_inputs)(struct enc_inputs *inputs); 210 void (*enc_get_inputs)(struct enc_inputs *inputs);
216 void (*enc_set_parameters)(struct enc_parameters *params); 211 void (*enc_set_parameters)(struct enc_parameters *params);
217 struct enc_chunk_hdr * (*enc_get_chunk)(void); 212 struct enc_chunk_hdr * (*enc_get_chunk)(void);
@@ -283,8 +278,10 @@ extern unsigned char plugin_end_addr[];
283void codec_get_full_path(char *path, const char *codec_root_fn); 278void codec_get_full_path(char *path, const char *codec_root_fn);
284 279
285/* defined by the codec loader (codec.c) */ 280/* defined by the codec loader (codec.c) */
286int codec_load_buf(unsigned int hid, struct codec_api *api); 281void * codec_load_buf(int hid, struct codec_api *api);
287int codec_load_file(const char* codec, struct codec_api *api); 282void * codec_load_file(const char* codec, struct codec_api *api);
283int codec_begin(void *handle);
284void codec_close(void *handle);
288 285
289/* defined by the codec */ 286/* defined by the codec */
290enum codec_status codec_start(void); 287enum codec_status codec_start(void);