Changeset 5504:ff89becc47ab in roaraudio
- Timestamp:
- 05/15/12 14:19:08 (11 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r5501 r5504 1 1 v. 1.0beta2 - ? 2 2 * ROAR_DL_PLUGIN_START() now checks para structure (Closes: #236) 3 * Added support for AutoAppSched to the plugin container. 3 4 4 5 v. 1.0beta1 - Sat May 12 2012 11:49 CEST -
include/libroar/plugincontainer.h
r5488 r5504 118 118 int roar_plugincontainer_unref(struct roar_plugincontainer * cont); 119 119 120 /* Set Autoappsched. 121 * If set the INIT and FREE appsched events are send automatically. 122 */ 123 int roar_plugincontainer_set_autoappsched(struct roar_plugincontainer * cont, int val); 124 120 125 /* Set callbacks. 121 126 */ -
libroar/plugincontainer.c
r5488 r5504 38 38 #define MAX_PLUGINS 64 39 39 40 #define OPT_AUTOAPPSCHED 0x0001 41 40 42 struct roar_plugincontainer { 41 43 size_t refc; 42 44 const struct roar_plugincontainer_callbacks * callbacks; 43 45 void * userdata; 46 unsigned int options; 44 47 struct roar_dl_librarypara * default_para; 45 48 struct roar_dl_lhandle * handle[MAX_PLUGINS]; … … 51 54 static inline void _unload(struct roar_plugincontainer * cont, size_t index) { 52 55 int err = roar_error; 56 57 if ( cont->options & OPT_AUTOAPPSCHED ) 58 roar_dl_appsched_trigger(cont->handle[index], ROAR_DL_APPSCHED_FREE); 53 59 54 60 if ( cont->callbacks != NULL && cont->callbacks->preunload != NULL ) … … 275 281 } 276 282 283 int roar_plugincontainer_set_autoappsched(struct roar_plugincontainer * cont, int val) { 284 if ( cont == NULL ) { 285 roar_err_set(ROAR_ERROR_FAULT); 286 return -1; 287 } 288 289 if ( val ) { 290 cont->options |= OPT_AUTOAPPSCHED; 291 return 0; 292 } else { 293 if ( cont->options & OPT_AUTOAPPSCHED ) { 294 roar_err_set(ROAR_ERROR_BUSY); 295 return -1; 296 } else { 297 return 0; 298 } 299 } 300 } 301 277 302 int roar_plugincontainer_set_callbacks(struct roar_plugincontainer * cont, 278 303 const struct roar_plugincontainer_callbacks * callbacks) { … … 450 475 if ( cont->callbacks != NULL && cont->callbacks->postra_init != NULL ) 451 476 cont->callbacks->postra_init(cont, &(cont->context[idx]), cont->handle[idx], para); 477 478 if ( cont->options & OPT_AUTOAPPSCHED ) 479 roar_dl_appsched_trigger(cont->handle[idx], ROAR_DL_APPSCHED_INIT); 452 480 } 453 481 … … 522 550 if ( cont->callbacks != NULL && cont->callbacks->postra_init != NULL ) 523 551 cont->callbacks->postra_init(cont, &(cont->context[i]), cont->handle[i], cont->default_para); 552 553 if ( cont->options & OPT_AUTOAPPSCHED ) 554 roar_dl_appsched_trigger(cont->handle[i], ROAR_DL_APPSCHED_INIT); 524 555 } 525 556
Note: See TracChangeset
for help on using the changeset viewer.