Changeset 5639:b8cdcac37ffe in roaraudio for roard


Ignore:
Timestamp:
09/10/12 15:56:42 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Removed roard's sched support (Closes: #277)

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/include/plugins.h

    r5592 r5639  
    3232#define ROARD_DL_ABIVERSION "1.0beta1" 
    3333 
    34 struct roard_plugins_sched { 
    35  int (*init)(void); 
    36  int (*free)(void); 
    37  int (*update)(void); 
    38 }; 
    39  
    4034int plugins_preinit  (void); 
    4135int plugins_init     (void); 
     
    4741void print_pluginlist(enum output_format format); 
    4842 
    49 int plugins_reg_sched(struct roard_plugins_sched * sched); 
    5043int plugins_reg_proto(struct roard_proto         * proto); 
    5144 
     
    6053  return 0; \ 
    6154 } 
    62  
    63 #define ROARD_DL_REG_SCHED(sched) \ 
    64  ROARD_DL_REG__UNI_PRE(sched) \ 
    65   for (i = 0; i < (sizeof((sched))/sizeof(*(sched))); i++) \ 
    66    plugins_reg_sched(&((sched)[i])); \ 
    67  ROARD_DL_REG__UNI_POST 
    68  
    69 // Register Scheduler callbacks: 
    70 #define ROARD_DL_REGFN_SCHED() ROAR_DL_PLUGIN_REG(ROAR_DL_FN_ROARDSCHED, __reg_sched) 
    7155 
    7256#define ROARD_DL_REG_PROTO(proto) \ 
  • roard/plugins.c

    r5592 r5639  
    3030static struct _roard_plugin { 
    3131 struct roar_dl_lhandle     * lhandle; 
    32  struct roard_plugins_sched * sched; 
    3332 int protocols[MAX_PROTOS]; 
    3433} g_plugins[MAX_PLUGINS]; 
     
    8180 ROAR_DBG("plugins_delete(plugin=%p) = ?", plugin); 
    8281 
    83  if ( plugin->sched != NULL ) { 
    84   if ( plugin->sched->free != NULL ) { 
    85    roar_dl_context_restore(plugin->lhandle); 
    86    plugin->sched->free(); 
    87    roar_dl_context_store(plugin->lhandle); 
    88   } 
    89  } 
    90  
    9182 roar_dl_appsched_trigger(plugin->lhandle, ROAR_DL_APPSCHED_FREE); 
    9283 
     
    109100 
    110101 _pp = plugin; 
    111  _pp->sched = NULL; 
    112102 
    113103 if ( roar_dl_ra_init(plugin->lhandle, NULL, NULL) == -1 ) { 
     
    117107 } 
    118108 
    119  if ( plugin->sched != NULL ) { 
    120   if ( plugin->sched->init != NULL ) { 
    121    roar_dl_context_restore(plugin->lhandle); 
    122    plugin->sched->init(); 
    123    roar_dl_context_store(plugin->lhandle); 
    124   } 
    125  } 
    126  
    127109 roar_dl_appsched_trigger(plugin->lhandle, ROAR_DL_APPSCHED_INIT); 
    128110 
     
    185167 for (i = 0; i < MAX_PLUGINS; i++) { 
    186168  if ( g_plugins[i].lhandle != NULL ) { 
    187    if ( g_plugins[i].sched != NULL ) { 
    188     if ( g_plugins[i].sched->update != NULL ) { 
    189      roar_dl_context_restore(g_plugins[i].lhandle); 
    190      if ( g_plugins[i].sched->update() == -1 ) 
    191       ret = -1; 
    192      roar_dl_context_store(g_plugins[i].lhandle); 
    193     } 
    194    } 
    195169   if ( roar_dl_appsched_trigger(g_plugins[i].lhandle, ROAR_DL_APPSCHED_UPDATE) == -1 ) 
    196170    if ( roar_error != ROAR_ERROR_NOENT ) 
     
    261235  } else { 
    262236   printf("  %s\n", libname->libname); 
    263    printf("   Flags:       %s\n", p->sched != NULL ? "roardsched" : ""); 
     237   printf("   Flags:       %s\n", ""); 
    264238   if ( libname->description != NULL ) 
    265239    printf("   Description: %s\n", libname->description); 
     
    268242  } 
    269243 } 
    270 } 
    271  
    272 int plugins_reg_sched(struct roard_plugins_sched * sched) { 
    273  if ( _pp == NULL ) 
    274   return -1; 
    275  
    276  _pp->sched = sched; 
    277  
    278  return 0; 
    279244} 
    280245 
Note: See TracChangeset for help on using the changeset viewer.