Changeset 5168:38e69b0d26e0 in roaraudio for plugins/alsa


Ignore:
Timestamp:
10/18/11 12:24:42 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support to set stream role

Location:
plugins/alsa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/alsa/pcm_roar.c

    r5167 r5168  
    6060 } 
    6161 
     62 if ( self->stream_role != ROAR_ROLE_UNKNOWN ) { 
     63  if ( roar_stream_set_role(&(self->roar.con), &(self->stream), self->stream_role) == -1 ) { 
     64   ROAR_WARN("roar_pcm_start(*): Can not set stream role: %i: %s", self->stream_role, roar_error2str(roar_error)); 
     65  } 
     66 } 
     67 
    6268 if ( roar_vio_ctl(&(self->stream_vio),  
    6369    io->stream == SND_PCM_STREAM_PLAYBACK ? ROAR_VIO_CTL_GET_SELECT_WRITE_FH : 
     
    415421 const char   * para; 
    416422 const char   * server = NULL; 
     423 const char   * tmp; 
     424 int            role = ROAR_ROLE_UNKNOWN; 
    417425 int            ret; 
    418426 
     
    431439  if ( !strcmp(para, "server") ) { 
    432440   if (snd_config_get_string(n, &server) < 0) { 
     441    return -EINVAL; 
     442   } 
     443  } else if ( !strcmp(para, "role") ) { 
     444   if (snd_config_get_string(n, &tmp) < 0) { 
     445    return -EINVAL; 
     446   } 
     447   if ( (role = roar_str2role(tmp)) == -1 ) { 
    433448    return -EINVAL; 
    434449   } 
     
    444459 
    445460 memset(self, 0, sizeof(struct roar_alsa_pcm)); 
     461 
     462 self->stream_role = role; 
    446463 
    447464 errno = ENOSYS; 
  • plugins/alsa/roar.h

    r5157 r5168  
    5959 struct roar_stream     stream; 
    6060 struct roar_vio_calls  stream_vio; 
     61 int                    stream_role; 
    6162 int                    stream_opened; 
    6263 size_t                 writec; 
Note: See TracChangeset for help on using the changeset viewer.