Changeset 5238:5117fb0e7ed4 in roaraudio
- Timestamp:
- 11/12/11 17:41:13 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/stream.h
r5219 r5238 57 57 }; 58 58 59 int roar_stream_connect (struct roar_connection * con, struct roar_stream * s, int dir) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED; 60 int roar_stream_connect2 (struct roar_connection * con, struct roar_stream * s, int dir, int mixer) _LIBROAR_STREAM_STDATTRS; 59 int roar_stream_connect (struct roar_connection * con, struct roar_stream * s, int dir, int mixer) _LIBROAR_STREAM_STDATTRS; 61 60 62 61 int roar_stream_new (struct roar_stream * s, unsigned int rate, unsigned int channels, unsigned int bits, unsigned int codec) _LIBROAR_ATTR_NONNULL_ALL; … … 84 83 int roar_stream_attach_simple (struct roar_connection * con, struct roar_stream * s, int client) _LIBROAR_STREAM_STDATTRS; 85 84 86 int roar_stream_add_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED;87 88 int roar_stream_send_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED;89 90 85 int roar_stream_get_info (struct roar_connection * con, struct roar_stream * s, struct roar_stream_info * info) _LIBROAR_STREAM_STDATTRS; 91 86 int roar_stream_get_name (struct roar_connection * con, struct roar_stream * s, char * name, size_t len) _LIBROAR_STREAM_STDATTRS; … … 94 89 int roar_stream_set_chanmap (struct roar_connection * con, struct roar_stream * s, char * map, size_t len) _LIBROAR_STREAM_STDATTRS; 95 90 96 int roar_stream_set_flags (struct roar_connection * con, struct roar_stream * s, int flags, int reset) _LIBROAR_STREAM_STDATTRS _LIBROAR_ATTR_DEPRECATED; 97 int roar_stream_set_flags2 (struct roar_connection * con, struct roar_stream * s, uint32_t flags, int action) _LIBROAR_STREAM_STDATTRS; 91 int roar_stream_set_flags (struct roar_connection * con, struct roar_stream * s, uint32_t flags, int action) _LIBROAR_STREAM_STDATTRS; 98 92 99 93 int roar_stream_set_role (struct roar_connection * con, struct roar_stream * s, int role) _LIBROAR_STREAM_STDATTRS; -
libroar/enumdev.c
r5145 r5238 52 52 53 53 roar_libroar_nowarn(); 54 if ( roar_connect 2(&con, c->server, 0, 0) == -1 ) {54 if ( roar_connect(&con, c->server, 0, 0) == -1 ) { 55 55 roar_libroar_warn(); 56 56 return -1; -
libroar/simple.c
r5237 r5238 82 82 } 83 83 84 if ( roar_stream_connect 2(&con, s, dir, -1) == -1 ) {84 if ( roar_stream_connect(&con, s, dir, -1) == -1 ) { 85 85 safe_error = roar_error; 86 86 roar_disconnect(&con); … … 254 254 } 255 255 256 if ( roar_stream_connect 2(con, s, dir, -1) == -1 ) {256 if ( roar_stream_connect(con, s, dir, -1) == -1 ) { 257 257 return -1; 258 258 } … … 417 417 return -1; 418 418 419 if ( roar_stream_connect 2(con, s, dir, -1) == -1 )420 return -1; 421 422 if ( roar_stream_set_flags 2(con, s, ROAR_FLAG_VIRTUAL, ROAR_SET_FLAG) == -1 ) {419 if ( roar_stream_connect(con, s, dir, -1) == -1 ) 420 return -1; 421 422 if ( roar_stream_set_flags(con, s, ROAR_FLAG_VIRTUAL, ROAR_SET_FLAG) == -1 ) { 423 423 roar_kick(con, ROAR_OT_STREAM, roar_stream_get_id(s)); 424 424 return -1; -
libroar/stream.c
r5229 r5238 36 36 #include "libroar.h" 37 37 38 int roar_stream_connect (struct roar_connection * con, struct roar_stream * s, int dir) { 39 return roar_stream_connect2(con, s, dir, -1); 40 } 41 42 int roar_stream_connect2 (struct roar_connection * con, struct roar_stream * s, int dir, int mixer) { 38 int roar_stream_connect(struct roar_connection * con, struct roar_stream * s, int dir, int mixer) { 43 39 struct roar_libroar_config * config = roar_libroar_get_config(); 44 40 struct roar_stream ms; … … 380 376 } 381 377 382 int roar_stream_add_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) {383 struct roar_message m;384 385 if ( con == NULL || s == NULL || data == NULL ) {386 roar_err_set(ROAR_ERROR_FAULT);387 return -1;388 }389 390 memset(&m, 0, sizeof(m));391 392 m.cmd = ROAR_CMD_ADD_DATA;393 m.stream = s->id;394 m.pos = 0;395 m.datalen = len;396 397 // if ( roar_req(con, &m, (void**)&data) == -1 )398 // return -1;399 if ( roar_send_message(con, &m, data) != 0 )400 return -1;401 402 if ( roar_recv_message(con, &m, NULL) == -1 )403 return -1;404 405 if ( m.cmd == ROAR_CMD_OK )406 return 0;407 return -1;408 }409 410 int roar_stream_send_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len) {411 412 roar_debug_warn_obsolete("roar_stream_send_data", "roar_vio_write", NULL);413 414 if ( s == NULL ) {415 roar_err_set(ROAR_ERROR_FAULT);416 return -1;417 }418 419 if ( s->fh == -1 ) {420 if ( con == NULL ) {421 roar_err_set(ROAR_ERROR_NOTSUP);422 return -1;423 }424 425 if ( roar_stream_add_data(con, s, data, len) == -1 )426 return -1;427 428 return len;429 }430 431 #ifdef ROAR_HAVE_IO_POSIX432 return ROAR_NETWORK_WRITE(s->fh, data, len);433 #endif434 435 roar_err_set(ROAR_ERROR_NOTSUP);436 return -1;437 }438 439 378 int roar_stream_get_info (struct roar_connection * con, struct roar_stream * s, struct roar_stream_info * info) { 440 379 struct roar_message m; … … 709 648 710 649 711 int roar_stream_set_flags (struct roar_connection * con, struct roar_stream * s, int flags, int reset) { 712 return roar_stream_set_flags2(con, s, flags, reset == ROAR_RESET_FLAG ? ROAR_RESET_FLAG : ROAR_SET_FLAG); 713 } 714 715 int roar_stream_set_flags2 (struct roar_connection * con, struct roar_stream * s, uint32_t flags, int action) { 650 int roar_stream_set_flags (struct roar_connection * con, struct roar_stream * s, uint32_t flags, int action) { 716 651 struct roar_message m; 717 652 uint16_t * data = (uint16_t *) m.data; -
libroar/vio_stream.c
r5118 r5238 121 121 } 122 122 123 if ( roar_stream_connect 2(con, &stream, dir, -1) == -1 ) {123 if ( roar_stream_connect(con, &stream, dir, -1) == -1 ) { 124 124 err = roar_error; 125 125 roar_disconnect(con); -
libroar/vs.c
r5236 r5238 1050 1050 case ROAR_VS_TRUE: 1051 1051 case ROAR_VS_FALSE: 1052 if ( roar_stream_set_flags 2(vss->con, &(vss->stream), flag,1052 if ( roar_stream_set_flags(vss->con, &(vss->stream), flag, 1053 1053 val == ROAR_VS_TRUE ? ROAR_SET_FLAG : ROAR_RESET_FLAG) == -1 ) { 1054 1054 _seterrre(); -
libroarrsound/libroarrsound.c
r4893 r5238 500 500 return -1; 501 501 502 return roar_stream_set_flags 2(&(self->con), &(self->stream), ROAR_FLAG_PAUSE, enable ? ROAR_SET_FLAG : ROAR_RESET_FLAG);502 return roar_stream_set_flags(&(self->con), &(self->stream), ROAR_FLAG_PAUSE, enable ? ROAR_SET_FLAG : ROAR_RESET_FLAG); 503 503 } 504 504 -
libroaryiff/playback.c
r5221 r5238 100 100 } 101 101 102 if ( roar_stream_connect 2(con, s, ROAR_DIR_PLAY, -1) == -1 ) {102 if ( roar_stream_connect(con, s, ROAR_DIR_PLAY, -1) == -1 ) { 103 103 close(in); 104 104 return -1; -
plugins/gstreamer0.10/roarmixer.c
r5236 r5238 363 363 364 364 if (mute) { 365 _LIBROAR_IGNORE_RET(roar_stream_set_flags 2(&(mixer->con), &s, ROAR_FLAG_MUTE, ROAR_SET_FLAG));365 _LIBROAR_IGNORE_RET(roar_stream_set_flags(&(mixer->con), &s, ROAR_FLAG_MUTE, ROAR_SET_FLAG)); 366 366 } else { 367 _LIBROAR_IGNORE_RET(roar_stream_set_flags 2(&(mixer->con), &s, ROAR_FLAG_MUTE, ROAR_RESET_FLAG));367 _LIBROAR_IGNORE_RET(roar_stream_set_flags(&(mixer->con), &s, ROAR_FLAG_MUTE, ROAR_RESET_FLAG)); 368 368 } 369 369 } -
roarclients/.release-helper
r5226 r5238 2 2 @RM roarcatsendfile.c 3 3 @RM roarcat2sock.c 4 @RM roarcatad.c 4 5 #!END -
roarclients/Makefile
r5226 r5238 9 9 10 10 #TARGETS_TESTS=pinentrytest zcattest pgptest pipetest polytest roarfctest 11 #TARGETS_OLD=roarcat ad roarcatpassfh roarsocktypes11 #TARGETS_OLD=roarcatpassfh roarsocktypes 12 12 13 13 TARGETS=$(TARGETS_IO) $(TARGETS_CTL) $(TARGETS_DSP) $(TARGETS_MISC) $(TARGETS_DEVEL) $(TARGETS_EXAMPLE) $(TARGETS_M) $(TARGETS_VIO) -
roarclients/roarcat.c
r5202 r5238 187 187 } 188 188 189 if ( roar_stream_connect 2(&con, &s, dir, -1) == -1 ) {189 if ( roar_stream_connect(&con, &s, dir, -1) == -1 ) { 190 190 fprintf(stderr, "Error: can not connect stream to server\n"); 191 191 roar_disconnect(&con); -
roarclients/roarcatad.c
r5109 r5238 89 89 } 90 90 91 if ( roar_stream_connect 2(&con, &s, ROAR_DIR_PLAY, -1) == -1 ) {91 if ( roar_stream_connect(&con, &s, ROAR_DIR_PLAY, -1) == -1 ) { 92 92 roar_disconnect(&con); 93 93 return 1; -
roarclients/roarcatpassfh.c
r5109 r5238 91 91 } 92 92 93 if ( roar_stream_connect 2(&con, &s, ROAR_DIR_PLAY, -1) == -1 ) {93 if ( roar_stream_connect(&con, &s, ROAR_DIR_PLAY, -1) == -1 ) { 94 94 roar_disconnect(&con); 95 95 return 1; -
roarclients/roarctl.c
r5236 r5238 1059 1059 } 1060 1060 1061 return roar_stream_set_flags 2(con, s, f, action);1061 return roar_stream_set_flags(con, s, f, action); 1062 1062 } 1063 1063 -
roarclients/roarinterconnect.c
r5185 r5238 505 505 } 506 506 507 if ( roar_stream_connect 2(con, stream, localdir, -1) == -1 ) {507 if ( roar_stream_connect(con, stream, localdir, -1) == -1 ) { 508 508 roar_disconnect(con); 509 509 return 22; -
roarclients/roarmon.c
r5109 r5238 198 198 } 199 199 200 if ( roar_stream_connect 2(&con, &s, dir, -1) == -1 ) {200 if ( roar_stream_connect(&con, &s, dir, -1) == -1 ) { 201 201 fprintf(stderr, "Error: can not connect stream to server\n"); 202 202 roar_disconnect(&con); … … 205 205 206 206 if ( prethru ) { 207 if ( roar_stream_set_flags 2(&con, &s, ROAR_FLAG_PRETHRU, ROAR_SET_FLAG) == -1 ) {207 if ( roar_stream_set_flags(&con, &s, ROAR_FLAG_PRETHRU, ROAR_SET_FLAG) == -1 ) { 208 208 fprintf(stderr, "Error: can not set prethru flag on stream\n"); 209 209 roar_disconnect(&con); -
roarclients/roarmonhttp.c
r5109 r5238 331 331 } 332 332 333 if ( roar_stream_connect 2(&con, &s, dir, -1) == -1 ) {333 if ( roar_stream_connect(&con, &s, dir, -1) == -1 ) { 334 334 roar_disconnect(&con); 335 335 return 11; … … 337 337 338 338 if ( sflags != ROAR_FLAG_NONE ) { 339 if ( roar_stream_set_flags 2(&con, &s, sflags, ROAR_SET_FLAG) == -1 ) {339 if ( roar_stream_set_flags(&con, &s, sflags, ROAR_SET_FLAG) == -1 ) { 340 340 roar_disconnect(&con); 341 341 return 14; -
roarclients/roarradio.c
r5179 r5238 211 211 } 212 212 213 if ( roar_stream_connect 2(con, stream, ROAR_DIR_PLAY, -1) == -1 ) {213 if ( roar_stream_connect(con, stream, ROAR_DIR_PLAY, -1) == -1 ) { 214 214 roar_disconnect(con); 215 215 return 1;
Note: See TracChangeset
for help on using the changeset viewer.