Changeset 5432:956f6af25715 in roaraudio


Ignore:
Timestamp:
03/20/12 13:04:08 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

support post ra_initing of plugins loaded by roar_plugincontainer_load_lhandle() but not ra_inited.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/plugincontainer.h

    r5429 r5432  
    6060struct roar_dl_lhandle * roar_plugincontainer_load_lhandle    (struct roar_plugincontainer * cont, 
    6161                                                               const char * name, 
     62                                                               int flags, 
     63                                                               int ra_init, 
    6264                                                               struct roar_dl_librarypara * para); 
    6365int                      roar_plugincontainer_unload          (struct roar_plugincontainer * cont, 
     
    6567int                      roar_plugincontainer_unload_lhandle  (struct roar_plugincontainer * cont, 
    6668                                                               struct roar_dl_lhandle * lhandle); 
     69int                      roar_plugincontainer_ra_init         (struct roar_plugincontainer * cont); 
    6770 
    6871// appsched: 
  • libroar/plugincontainer.c

    r5429 r5432  
    141141// plugin loading and unloading: 
    142142int roar_plugincontainer_load(struct roar_plugincontainer * cont, const char * name, struct roar_dl_librarypara * para) { 
    143  struct roar_dl_lhandle * ret = roar_plugincontainer_load_lhandle(cont, name, para); 
     143 struct roar_dl_lhandle * ret = roar_plugincontainer_load_lhandle(cont, name, ROAR_DL_FLAG_PLUGIN, 1, para); 
    144144 
    145145 if ( ret == NULL ) 
     
    153153struct roar_dl_lhandle * roar_plugincontainer_load_lhandle    (struct roar_plugincontainer * cont, 
    154154                                                               const char * name, 
     155                                                               int flags, 
     156                                                               int ra_init, 
    155157                                                               struct roar_dl_librarypara * para) { 
    156158 ssize_t idx = -1; 
     
    185187 } 
    186188 
    187  cont->handle[idx] = roar_dl_open(name, ROAR_DL_FLAG_PLUGIN, 1, para); 
     189 cont->handle[idx] = roar_dl_open(name, flags, ra_init, para); 
    188190 if ( cont->handle[idx] == NULL ) 
    189191  return NULL; 
     
    251253} 
    252254 
     255int                      roar_plugincontainer_ra_init         (struct roar_plugincontainer * cont) { 
     256 size_t i; 
     257 
     258 if ( cont == NULL ) { 
     259  roar_err_set(ROAR_ERROR_FAULT); 
     260  return -1; 
     261 } 
     262 
     263 for (i = 0; i < MAX_PLUGINS; i++) { 
     264  if ( cont->handle[i] == NULL ) 
     265   continue; 
     266  roar_dl_ra_init(cont->handle[i], NULL, cont->default_para); 
     267 } 
     268 
     269 return 0; 
     270} 
     271 
    253272// appsched: 
    254273int roar_plugincontainer_appsched_trigger(struct roar_plugincontainer * cont, enum roar_dl_appsched_trigger trigger) { 
Note: See TracChangeset for help on using the changeset viewer.