Combine pa_raop_client_new and pa_raop_client_connect (no point in having them separate)

Convert the iochannel to an fd and do not call a pa_iochannel_cb_t callback but rather trigger the callback on connection and pass the fd.
Change pa_raop_client_send_sample to pa_raop_client_encode_sample and work with memchunks.
Fix a subtle size bug in the bit writer that techincally isn't triggered in normal operation.
Clean up the _free function to actually free stuff.
Do the actual ALAC encoding.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2394 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Colin Guthrie 2008-05-10 23:01:37 +00:00
parent 41e31ab204
commit 1fb046536a
2 changed files with 102 additions and 90 deletions

View file

@ -26,18 +26,16 @@
#include <pulse/mainloop-api.h>
#include <pulsecore/iochannel.h>
#include <pulsecore/memchunk.h>
typedef struct pa_raop_client pa_raop_client;
pa_raop_client* pa_raop_client_new(void);
pa_raop_client* pa_raop_client_new(pa_mainloop_api *mainloop, const char* host);
void pa_raop_client_free(pa_raop_client* c);
int pa_raop_client_connect(pa_raop_client* c, pa_mainloop_api *mainloop, const char* host);
pa_memchunk pa_raop_client_encode_sample(pa_raop_client* c, pa_mempool* mempool, pa_memchunk* raw);
void pa_raop_client_disconnect(pa_raop_client* c);
void pa_raop_client_send_sample(pa_raop_client* c, const uint8_t* buffer, uint16_t count);
void pa_raop_client_set_callback(pa_raop_client* c, pa_iochannel_cb_t callback, void *userdata);
typedef void (*pa_raop_client_cb_t)(int fd, void *userdata);
void pa_raop_client_set_callback(pa_raop_client* c, pa_raop_client_cb_t callback, void *userdata);
#endif