Changeset 2921:d2fd1f7cdfa6 in roaraudio


Ignore:
Timestamp:
10/16/09 17:47:00 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added roar_xcoder_proc_header(), roar_bixcoder_read_header() and roar_bixcoder_write_header()

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroardsp/transcode.h

    r2179 r2921  
    6060 int (*encode)(struct roar_xcoder * state, void * buf, size_t len); 
    6161 int (*decode)(struct roar_xcoder * state, void * buf, size_t len); 
     62 int (*proc_header)(struct roar_xcoder * state); 
    6263}; 
    6364 
     
    9091int roar_xcoder_packet_size(struct roar_xcoder * state, int samples); 
    9192int roar_xcoder_close      (struct roar_xcoder * state); 
     93int roar_xcoder_proc_header(struct roar_xcoder * state); 
    9294int roar_xcoder_proc_packet(struct roar_xcoder * state, void * buf, size_t len); 
    9395int roar_xcoder_proc       (struct roar_xcoder * state, void * buf, size_t len); 
     
    9698int roar_bixcoder_packet_size (struct roar_bixcoder * state, int samples); 
    9799int roar_bixcoder_close       (struct roar_bixcoder * state); 
     100int roar_bixcoder_read_header (struct roar_bixcoder * state); 
    98101int roar_bixcoder_read_packet (struct roar_bixcoder * state, void * buf, size_t len); 
    99102int roar_bixcoder_read        (struct roar_bixcoder * state, void * buf, size_t len); 
     103int roar_bixcoder_write_header(struct roar_bixcoder * state); 
    100104int roar_bixcoder_write_packet(struct roar_bixcoder * state, void * buf, size_t len); 
    101105int roar_bixcoder_write       (struct roar_bixcoder * state, void * buf, size_t len); 
  • libroardsp/transcode.c

    r2643 r2921  
    3333static struct roar_xcoder_entry g_xcoders[] = { 
    3434 {ROAR_CODEC_ALAW,  roar_xcoder_dummy_inituninit, roar_xcoder_dummy_inituninit, roar_xcoder_dummy_packet_size_any, 
    35                      roar_xcoder_alaw_encode,  roar_xcoder_alaw_decode}, 
     35                     roar_xcoder_alaw_encode,  roar_xcoder_alaw_decode, NULL}, 
    3636 {ROAR_CODEC_MULAW, roar_xcoder_dummy_inituninit, roar_xcoder_dummy_inituninit, roar_xcoder_dummy_packet_size_any, 
    37                      roar_xcoder_mulaw_encode, roar_xcoder_mulaw_decode}, 
     37                     roar_xcoder_mulaw_encode, roar_xcoder_mulaw_decode, NULL}, 
    3838#ifdef ROAR_HAVE_LIBCELT 
    3939 {ROAR_CODEC_ROAR_CELT, roar_xcoder_celt_init, roar_xcoder_celt_uninit, roar_xcoder_celt_packet_size, 
    40                      roar_xcoder_celt_encode,  roar_xcoder_celt_decode}, 
     40                     roar_xcoder_celt_encode,  roar_xcoder_celt_decode, NULL}, 
    4141#endif 
    4242#ifdef ROAR_HAVE_LIBSPEEX 
    4343 {ROAR_CODEC_ROAR_SPEEX, roar_xcoder_speex_init, roar_xcoder_speex_uninit, roar_xcoder_speex_packet_size, 
    44                      roar_xcoder_speex_encode, roar_xcoder_speex_decode}, 
     44                     roar_xcoder_speex_encode, roar_xcoder_speex_decode, NULL}, 
    4545#endif 
    46  {-1, NULL, NULL, NULL, NULL, NULL} 
     46 {-1, NULL, NULL, NULL, NULL, NULL, NULL} 
    4747}; 
    4848 
     
    124124 
    125125 return _FUNC(uninit)(state); 
     126} 
     127 
     128int roar_xcoder_proc_header(struct roar_xcoder * state) { 
     129 _CHECK_BASIC(proc_header); 
     130 
     131 return _FUNC(proc_header)(state); 
    126132} 
    127133 
     
    367373} 
    368374 
     375int roar_bixcoder_read_header (struct roar_bixcoder * state) { 
     376 if ( state == NULL ) 
     377  return -1; 
     378 
     379 return roar_xcoder_proc_header(&(state->decoder)); 
     380} 
     381 
    369382int roar_bixcoder_read_packet (struct roar_bixcoder * state, void * buf, size_t len) { 
    370383 
     
    382395 
    383396 return roar_xcoder_proc(&(state->decoder), buf, len); 
     397} 
     398 
     399int roar_bixcoder_write_header(struct roar_bixcoder * state) { 
     400 if ( state == NULL ) 
     401  return -1; 
     402 
     403 return roar_xcoder_proc_header(&(state->decoder)); 
    384404} 
    385405 
Note: See TracChangeset for help on using the changeset viewer.