Changeset 5223:3326fb359ffe in roaraudio
- Timestamp:
- 11/12/11 12:44:52 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r5221 r5223 3 3 * Do not set errno to zero in ogg_vorbis codec filter (Closes: #191) 4 4 * Updated data types for struct roar_audio_info (Closes: #189) 5 * Removed old functions from API (Closes: #186) 5 * Removed old functions from API (Closes: #186, See: #130) 6 * Removed old roarclients (See: #130) 6 7 7 8 v. 0.4 - Fri Nov 11 2011 20:12 CET -
include/libroar/file.h
r5222 r5223 44 44 45 45 int roar_file_codecdetect(char * buf, int len); 46 ssize_t roar_file_send_raw (int out, int in) _LIBROAR_ATTR_DEPRECATED;47 46 48 47 char * roar_cdromdevice (void); -
libroar/file.c
r5222 r5223 35 35 36 36 #include "libroar.h" 37 38 #define BUFFERSIZE 819239 #define BUFMAX 6553640 41 #ifdef ROAR_HAVE_IO_POSIX42 #define _CAN_OPERATE43 #endif44 37 45 38 int roar_file_codecdetect(char * buf, int len) { … … 90 83 } 91 84 92 ssize_t roar_file_send_raw (int out, int in) {93 #ifdef _CAN_OPERATE94 ssize_t r = 0;95 #ifdef ROAR_HAVE_LINUX_SENDFILE96 ssize_t ret;97 #endif98 int len;99 char buf[BUFFERSIZE];100 #if defined(__linux__) && defined(ROAR_HAVE_IPV4)101 int cork_new = 1, cork_old;102 socklen_t cork_len = sizeof(int);103 104 if ( getsockopt(out, IPPROTO_TCP, TCP_CORK, &cork_old, &cork_len) == -1 ) {105 cork_old = -1;106 } else {107 setsockopt(out, IPPROTO_TCP, TCP_CORK, &cork_new, sizeof(int));108 }109 #endif110 111 roar_debug_warn_obsolete("roar_file_send_raw", "roar_vio_copy_data", NULL);112 113 #ifdef ROAR_HAVE_LINUX_SENDFILE114 while ((ret = sendfile(out, in, NULL, BUFMAX)) > 0)115 r += ret;116 #endif117 118 // TODO: try mmap here!119 120 while ((len = read(in, buf, BUFFERSIZE)) > 0)121 r += write(out, buf, len);122 123 #if defined(__linux__) && defined(ROAR_HAVE_IPV4)124 if ( cork_old != -1 )125 setsockopt(out, IPPROTO_TCP, TCP_CORK, &cork_old, cork_len);126 #endif127 return r;128 #else129 return -1;130 #endif131 }132 133 85 char * roar_cdromdevice (void) { 134 86 char * k; -
libroar/vio_ops.c
r4876 r5223 38 38 #define ROAR_VIO_COPY_BUFSIZE 1024 39 39 40 #define BUFMAX 65536 41 42 #ifdef ROAR_HAVE_IO_POSIX 43 #define _CAN_OPERATE 44 #endif 45 46 #ifdef _CAN_OPERATE 47 static inline ssize_t _send_file_raw (int out, int in) { 48 ssize_t r = 0; 49 #ifdef ROAR_HAVE_LINUX_SENDFILE 50 ssize_t ret; 51 #endif 52 #if defined(__linux__) && defined(ROAR_HAVE_IPV4) 53 int cork_new = 1, cork_old; 54 socklen_t cork_len = sizeof(int); 55 56 if ( getsockopt(out, IPPROTO_TCP, TCP_CORK, &cork_old, &cork_len) == -1 ) { 57 cork_old = -1; 58 } else { 59 setsockopt(out, IPPROTO_TCP, TCP_CORK, &cork_new, sizeof(int)); 60 } 61 #endif 62 63 roar_debug_warn_obsolete("roar_file_send_raw", "roar_vio_copy_data", NULL); 64 65 #ifdef ROAR_HAVE_LINUX_SENDFILE 66 while ((ret = sendfile(out, in, NULL, BUFMAX)) > 0) 67 r += ret; 68 #endif 69 70 // TODO: try mmap here! 71 72 #if defined(__linux__) && defined(ROAR_HAVE_IPV4) 73 if ( cork_old != -1 ) 74 setsockopt(out, IPPROTO_TCP, TCP_CORK, &cork_old, cork_len); 75 #endif 76 return r; 77 } 78 #endif 79 80 40 81 ssize_t roar_vio_copy_data (struct roar_vio_calls * out, struct roar_vio_calls * in) { 41 82 char buf[ROAR_VIO_COPY_BUFSIZE]; 42 83 ssize_t len; 43 84 ssize_t done = 0; 85 #ifdef _CAN_OPERATE 86 int in_fh, out_fh; 87 #endif 44 88 45 89 ROAR_DBG("roar_vio_copy_data(out=%p, in=%p) = ?", out, in); … … 49 93 return -1; 50 94 } 95 96 #ifdef _CAN_OPERATE 97 if ( roar_vio_ctl(in, ROAR_VIO_CTL_GET_READ_FH, &in_fh) == 0 ) 98 if ( roar_vio_ctl(out, ROAR_VIO_CTL_GET_WRITE_FH, &out_fh) == 0 ) 99 _send_file_raw(out_fh, in_fh); 100 #endif 51 101 52 102 roar_err_clear_all(); -
roarclients/Makefile
r5109 r5223 9 9 10 10 #TARGETS_TESTS=pinentrytest zcattest pgptest pipetest polytest roarfctest 11 #TARGETS_OLD=roarcatad roarcat2sock roarcat sendfile roarcatpassfh roarsocktypes11 #TARGETS_OLD=roarcatad roarcat2sock roarcatpassfh roarsocktypes 12 12 13 13 TARGETS=$(TARGETS_IO) $(TARGETS_CTL) $(TARGETS_DSP) $(TARGETS_MISC) $(TARGETS_DEVEL) $(TARGETS_EXAMPLE) $(TARGETS_M) $(TARGETS_VIO)
Note: See TracChangeset
for help on using the changeset viewer.