Changeset 2921:d2fd1f7cdfa6 in roaraudio
- Timestamp:
- 10/16/09 17:47:00 (15 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroardsp/transcode.h
r2179 r2921 60 60 int (*encode)(struct roar_xcoder * state, void * buf, size_t len); 61 61 int (*decode)(struct roar_xcoder * state, void * buf, size_t len); 62 int (*proc_header)(struct roar_xcoder * state); 62 63 }; 63 64 … … 90 91 int roar_xcoder_packet_size(struct roar_xcoder * state, int samples); 91 92 int roar_xcoder_close (struct roar_xcoder * state); 93 int roar_xcoder_proc_header(struct roar_xcoder * state); 92 94 int roar_xcoder_proc_packet(struct roar_xcoder * state, void * buf, size_t len); 93 95 int roar_xcoder_proc (struct roar_xcoder * state, void * buf, size_t len); … … 96 98 int roar_bixcoder_packet_size (struct roar_bixcoder * state, int samples); 97 99 int roar_bixcoder_close (struct roar_bixcoder * state); 100 int roar_bixcoder_read_header (struct roar_bixcoder * state); 98 101 int roar_bixcoder_read_packet (struct roar_bixcoder * state, void * buf, size_t len); 99 102 int roar_bixcoder_read (struct roar_bixcoder * state, void * buf, size_t len); 103 int roar_bixcoder_write_header(struct roar_bixcoder * state); 100 104 int roar_bixcoder_write_packet(struct roar_bixcoder * state, void * buf, size_t len); 101 105 int roar_bixcoder_write (struct roar_bixcoder * state, void * buf, size_t len); -
libroardsp/transcode.c
r2643 r2921 33 33 static struct roar_xcoder_entry g_xcoders[] = { 34 34 {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}, 36 36 {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}, 38 38 #ifdef ROAR_HAVE_LIBCELT 39 39 {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}, 41 41 #endif 42 42 #ifdef ROAR_HAVE_LIBSPEEX 43 43 {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}, 45 45 #endif 46 {-1, NULL, NULL, NULL, NULL, NULL }46 {-1, NULL, NULL, NULL, NULL, NULL, NULL} 47 47 }; 48 48 … … 124 124 125 125 return _FUNC(uninit)(state); 126 } 127 128 int roar_xcoder_proc_header(struct roar_xcoder * state) { 129 _CHECK_BASIC(proc_header); 130 131 return _FUNC(proc_header)(state); 126 132 } 127 133 … … 367 373 } 368 374 375 int 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 369 382 int roar_bixcoder_read_packet (struct roar_bixcoder * state, void * buf, size_t len) { 370 383 … … 382 395 383 396 return roar_xcoder_proc(&(state->decoder), buf, len); 397 } 398 399 int roar_bixcoder_write_header(struct roar_bixcoder * state) { 400 if ( state == NULL ) 401 return -1; 402 403 return roar_xcoder_proc_header(&(state->decoder)); 384 404 } 385 405
Note: See TracChangeset
for help on using the changeset viewer.