|
From: | Teckinal Greek |
Subject: | [lwip-users] Error-"Incompatible Types" |
Date: | Fri, 26 Nov 2010 13:51:15 +0000 |
Hi all, I am planning to implement RTP on lwIP in that means I am compressing the PCM data using a self written audio codec. For this I am using this piece of code to convert the data from Analog to Digital i.e to PCM[some functions are inbuilt functions on my Board] int16_t pcm_buffer[1024] = {0}; void audio(void) { int i, j; audio = audio_open(AUDIO_1); while (1) { get_audio(pcm_buf, 1024); } } int get_audio(short *buffer, int n) { int s; do { s = audio_record(audio, buffer, n); n -= s; buffer += s; }while (n != 0); return s; } What I am assuming here is that the PCM data is stored in the buffer "pcm_buffer" and it is of int 16 bit. My encoder code goes like this .... unsigned char linear2alaw(int pcm_val) /*here we expect pcm_val to be 2's compliment which is of 16-bit-range */ { int sign, exponent, expMask, mantissa; unsigned char alaw; ....... ........ return (unsigned char)(alaw^0xD5); } In my RTP part of my code I need to put this compressed data on to a send buffer which is declared like this...... #define RTP_PACKET_SIZE = 1500 static uint8_t rtp_send_packet[RTP_PACKET_SIZE]; Now I call the linear2alaw function pass the pcm value and again again the returned value to rtp_send_packet[] buffer like this....... static uint8_t rtp_send_packet[RTP_PACKET_SIZE] = linear2alaw(stereo_buf); When I compile my code it throws an error saying "incompatible types". On the other hand if I assign this in another way like....... static uint8_t rtp_send_packet[RTP_PACKET_SIZE] ; rtp_send_packet[RTP_PACKET_SIZE] = linear2alaw(stereo_buf); then it throws another error like ........"rtp_send_packet" redeclared with a different type" Can anybody find out where am I making mistake. I am using lwIP TCP/IP stack for my implementation. Regards, Greek
|
[Prev in Thread] | Current Thread | [Next in Thread] |