Changeset 5223:3326fb359ffe in roaraudio


Ignore:
Timestamp:
11/12/11 12:44:52 (8 years ago)
Author:
phi
Branch:
default
Message:

Removed roar_file_send_raw() and roarcatsendfile.

Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r5221 r5223  
    33        * Do not set errno to zero in ogg_vorbis codec filter (Closes: #191) 
    44        * 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) 
    67 
    78v. 0.4 - Fri Nov 11 2011 20:12 CET 
  • include/libroar/file.h

    r5222 r5223  
    4444 
    4545int     roar_file_codecdetect(char * buf, int len); 
    46 ssize_t roar_file_send_raw   (int out, int in) _LIBROAR_ATTR_DEPRECATED; 
    4746 
    4847char  * roar_cdromdevice     (void); 
  • libroar/file.c

    r5222 r5223  
    3535 
    3636#include "libroar.h" 
    37  
    38 #define BUFFERSIZE  8192 
    39 #define BUFMAX     65536 
    40  
    41 #ifdef ROAR_HAVE_IO_POSIX 
    42 #define _CAN_OPERATE 
    43 #endif 
    4437 
    4538int roar_file_codecdetect(char * buf, int len) { 
     
    9083} 
    9184 
    92 ssize_t roar_file_send_raw (int out, int in) { 
    93 #ifdef _CAN_OPERATE 
    94  ssize_t r = 0; 
    95 #ifdef ROAR_HAVE_LINUX_SENDFILE 
    96  ssize_t ret; 
    97 #endif 
    98  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 #endif 
    110  
    111  roar_debug_warn_obsolete("roar_file_send_raw", "roar_vio_copy_data", NULL); 
    112  
    113 #ifdef ROAR_HAVE_LINUX_SENDFILE 
    114  while ((ret = sendfile(out, in, NULL, BUFMAX)) > 0) 
    115   r += ret; 
    116 #endif 
    117  
    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 #endif 
    127  return r; 
    128 #else 
    129  return -1; 
    130 #endif 
    131 } 
    132  
    13385char  * roar_cdromdevice     (void) { 
    13486 char * k; 
  • libroar/vio_ops.c

    r4876 r5223  
    3838#define ROAR_VIO_COPY_BUFSIZE 1024 
    3939 
     40#define BUFMAX     65536 
     41 
     42#ifdef ROAR_HAVE_IO_POSIX 
     43#define _CAN_OPERATE 
     44#endif 
     45 
     46#ifdef _CAN_OPERATE 
     47static 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 
    4081ssize_t roar_vio_copy_data   (struct roar_vio_calls * out, struct roar_vio_calls * in) { 
    4182 char    buf[ROAR_VIO_COPY_BUFSIZE]; 
    4283 ssize_t len; 
    4384 ssize_t done = 0; 
     85#ifdef _CAN_OPERATE 
     86 int in_fh, out_fh; 
     87#endif 
    4488 
    4589 ROAR_DBG("roar_vio_copy_data(out=%p, in=%p) = ?", out, in); 
     
    4993  return -1; 
    5094 } 
     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 
    51101 
    52102 roar_err_clear_all(); 
  • roarclients/Makefile

    r5109 r5223  
    99 
    1010#TARGETS_TESTS=pinentrytest zcattest pgptest pipetest polytest roarfctest 
    11 #TARGETS_OLD=roarcatad roarcat2sock roarcatsendfile roarcatpassfh roarsocktypes 
     11#TARGETS_OLD=roarcatad roarcat2sock roarcatpassfh roarsocktypes 
    1212 
    1313TARGETS=$(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.