Changeset 2703:751e1ccd7b3a in roaraudio


Ignore:
Timestamp:
09/13/09 14:43:35 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added basic callbacks, added new debug lions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/codecfilter_raum.c

    r2691 r2703  
    2828#include <raum.h> 
    2929 
     30// PCBs: 
    3031int cf_raum_pcb_open  (struct cont_fw_parent_inst * self, 
    3132                       int                          codec, 
     
    6263 cont_fw_set_uinst(self, state); 
    6364 
    64  ROAR_DBG("cf_raum_pcb_open(*) = -1"); 
     65 ROAR_DBG("cf_raum_pcb_open(*) = 0"); 
    6566 return 0; 
    6667} 
     
    7879} 
    7980 
     81int cf_raum_pcb_new_child(struct cont_fw_parent_inst * self, struct cont_fw_child_vio_inst * child) { 
     82 struct roar_stream_server * ss; 
     83 struct roar_stream        *  s; 
     84 void                      * ps; 
     85 RAUMStream * stream; 
     86 int dir = ROAR_DIR_PLAY; 
     87 
     88 ROAR_DBG("cf_raum_pcb_new_child(self=%p, child=%p) = ?", self, child); 
     89 
     90 if ( streams_get(child->child, &ss) == -1 ) 
     91  return -1; 
     92 
     93 if ( (s = ROAR_STREAM(ss)) == NULL ) 
     94  return -1; 
     95 
     96 if ( cont_fw_get_uinst(self, &ps) == -1 ) 
     97  return -1; 
     98 
     99 if ( ps == NULL ) 
     100  return -1; 
     101 
     102 if ( (stream = RAUMStreamNewSimple(s->info.rate, s->info.channels, s->info.bits, s->info.codec, dir)) == NULL ) 
     103  return -1; 
     104 
     105 if ( RAUMAddStream(ps, stream) == -1 ) { 
     106  RAUMStreamClose(stream); 
     107  return -1; 
     108 } 
     109 
     110 child->u_inst = stream; 
     111 
     112 ROAR_DBG("cf_raum_pcb_new_child(self=%p, child=%p) = 0", self, child); 
     113 return 0; 
     114} 
     115 
     116// CCBs: 
     117ssize_t cf_raum_ccb_read (struct cont_fw_parent_inst * self, struct cont_fw_child_vio_inst * child, void *buf, size_t len) { 
     118 return RAUMStreamRead(child->u_inst, buf, len); 
     119} 
     120ssize_t cf_raum_ccb_write(struct cont_fw_parent_inst * self, struct cont_fw_child_vio_inst * child, void *buf, size_t len) { 
     121 return RAUMStreamWrite(child->u_inst, buf, len); 
     122} 
     123int     cf_raum_ccb_close(struct cont_fw_parent_inst * self, struct cont_fw_child_vio_inst * child) { 
     124 ROAR_DBG("cf_raum_ccb_close(self=%p, child=%p) = ?", self, child); 
     125 return RAUMStreamClose(child->u_inst); 
     126} 
     127 
     128// SETUP: 
    80129CONT_FW_SETUP_TYPE(cf_raum_setup) { 
    81130 ROAR_DBG("cf_raum_setup(*) = ?"); 
    82131 
    83  self->pcb.open  = cf_raum_pcb_open; 
    84  self->pcb.close = cf_raum_pcb_close; 
     132 // PCBs: 
     133 self->pcb.open      = cf_raum_pcb_open; 
     134 self->pcb.close     = cf_raum_pcb_close; 
     135 self->pcb.new_child = cf_raum_pcb_new_child; 
     136 
     137 // CCBs: 
     138 self->ccb.read      = cf_raum_ccb_read; 
     139 self->ccb.write     = cf_raum_ccb_write; 
     140 self->ccb.close     = cf_raum_ccb_close; 
    85141 
    86142 ROAR_DBG("cf_raum_setup(*) = 0"); 
Note: See TracChangeset for help on using the changeset viewer.