Changeset 2829:d22cf56280bd in roaraudio


Ignore:
Timestamp:
10/02/09 23:45:18 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added vio thingy for parent stream

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/container_framework.c

    r2716 r2829  
    5252 self->state     = ROAR_STREAMSTATE_INITING; 
    5353 
     54 if ( cont_pvio_open(&(self->vio), self) == -1 ) { 
     55  free(self); 
     56  return -1; 
     57 } 
     58 
    5459 *inst = self; 
    5560 return 0; 
     
    104109} 
    105110 
    106 // VIOs: 
     111// VIO Client: 
    107112int     cont_fw_new_child(struct cont_fw_parent_inst  * inst, int id) { 
    108113 struct cont_fw_child_vio_inst * self; 
     
    229234 
    230235int     cont_fw_ctl     (struct roar_vio_calls * vio, int cmd, void * data); 
     236 
     237// VIO Parent: 
     238int     cont_pvio_open    (struct roar_vio_calls * vio, void * inst) { 
     239 memset(vio, 0, sizeof(struct roar_vio_calls)); 
     240 
     241 vio->inst  = inst; 
     242 
     243 vio->read     = cont_pvio_read; 
     244 vio->write    = cont_pvio_write; 
     245 vio->lseek    = cont_pvio_lseek; 
     246 vio->nonblock = cont_pvio_nonblock; 
     247 vio->sync     = cont_pvio_sync; 
     248 vio->ctl      = cont_pvio_ctl; 
     249 vio->close    = cont_pvio_close; 
     250 
     251 return 0; 
     252} 
     253 
     254ssize_t cont_pvio_read    (struct roar_vio_calls * vio, void *buf, size_t count) { 
     255 return stream_vio_s_read(((struct cont_fw_parent_inst*)(vio->inst))->stream.stream, buf, count); 
     256} 
     257 
     258ssize_t cont_pvio_write   (struct roar_vio_calls * vio, void *buf, size_t count) { 
     259 return stream_vio_s_write(((struct cont_fw_parent_inst*)(vio->inst))->stream.stream, buf, count); 
     260} 
     261 
     262off_t   cont_pvio_lseek   (struct roar_vio_calls * vio, off_t offset, int whence) { 
     263 return roar_vio_lseek(&(((struct cont_fw_parent_inst*)(vio->inst))->stream.stream->vio), offset, whence); 
     264} 
     265 
     266int     cont_pvio_nonblock(struct roar_vio_calls * vio, int state) { 
     267 return roar_vio_nonblock(&(((struct cont_fw_parent_inst*)(vio->inst))->stream.stream->vio), state); 
     268} 
     269 
     270int     cont_pvio_sync    (struct roar_vio_calls * vio) { 
     271 return roar_vio_sync(&(((struct cont_fw_parent_inst*)(vio->inst))->stream.stream->vio)); 
     272} 
     273 
     274int     cont_pvio_ctl     (struct roar_vio_calls * vio, int cmd, void * data) { 
     275 return roar_vio_ctl(&(((struct cont_fw_parent_inst*)(vio->inst))->stream.stream->vio), cmd, data); 
     276} 
     277 
     278int     cont_pvio_close   (struct roar_vio_calls * vio) { 
     279 return roar_vio_close(&(((struct cont_fw_parent_inst*)(vio->inst))->stream.stream->vio)); 
     280} 
    231281 
    232282// CF: 
  • roard/include/container_framework.h

    r2696 r2829  
    4444 void * u_inst; 
    4545 int state; 
     46 struct roar_vio_calls vio; 
    4647 struct { 
    4748  int id; 
     
    7778int     cont_fw_init_vio(struct roar_vio_calls * vio, void * inst); 
    7879 
    79 // VIO: 
     80// VIO Childs: 
    8081ssize_t cont_fw_read    (struct roar_vio_calls * vio, void *buf, size_t count); 
    8182ssize_t cont_fw_write   (struct roar_vio_calls * vio, void *buf, size_t count); 
     
    8586int     cont_fw_ctl     (struct roar_vio_calls * vio, int cmd, void * data); 
    8687int     cont_fw_close   (struct roar_vio_calls * vio); 
     88 
     89// VIO Parent: 
     90int     cont_pvio_open    (struct roar_vio_calls * vio, void * inst); 
     91ssize_t cont_pvio_read    (struct roar_vio_calls * vio, void *buf, size_t count); 
     92ssize_t cont_pvio_write   (struct roar_vio_calls * vio, void *buf, size_t count); 
     93off_t   cont_pvio_lseek   (struct roar_vio_calls * vio, off_t offset, int whence); 
     94int     cont_pvio_nonblock(struct roar_vio_calls * vio, int state); 
     95int     cont_pvio_sync    (struct roar_vio_calls * vio); 
     96int     cont_pvio_ctl     (struct roar_vio_calls * vio, int cmd, void * data); 
     97int     cont_pvio_close   (struct roar_vio_calls * vio); 
    8798 
    8899// CF: 
Note: See TracChangeset for help on using the changeset viewer.