<div>Hi VLC developers,</div>
<div>I'm a newbie to VLC source code compilation. I'm tring to add some <strong>additional functionalites</strong> to the existing VLC source code of version 1.0.2 .My aim is to display the PSNR values to the OSD using marquee string. </div>

<div> </div>
<div>Current work flow:</div>
<div>*)with a funtion i'm calculating  PSNR values in X264.c module of existing vlc source code and  that calculated value i need to send to OSD using marq marquee string command. I'm opening a socket in my program and in vlc GUI i enabled RC interface,set the IP and port number. </div>

<div>*) now i'm writing below a  function to take the PSNR value which i was calculating earlier as an argument to this function and by making use of marq command i'm trying to send to OSD.This function i'm writing in the same X264.c module. (both PSNR  calculation function and the below function both i'm writing in the same X264.c module.) </div>

<div> </div>
<div>//write_psnr_to_rc()  to write PSNR into OSD</div>
<div> </div>
<div>
<div>#include <sys/socket.h> //these are the header files required for my function<br>#include <sys/types.h><br>#include <netinet/in.h><br>#include <netdb.h><br>#include <stdio.h><br>#include <string.h><br>
#include <stdlib.h><br>#include <unistd.h><br>#include <errno.h><br>#include<unistd.h></div>
<div> </div>
<div>void write_psnr_to_rc(int PSNR_val)<br>{<br> static int sock;<br> int i=0;  <br> char send_data[1024]="\0",*end;<br> static struct hostent *host;<br> addrinfo_sri server_addr;           <br> char line[128] = {0};<br>
 static int index = 1; <br> if(index == 1)<br> {</div>
<div>   </div>
<div>  host = gethostbyname("XXX.XXX.XXX.XXX");<br> <br>  if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) <br>  {<br>   perror("Socket");<br>   exit(1);<br>  }</div>
<div>  server_addr.sin_family = AF_INET;     <br>  server_addr.sin_port = htons(5555);   <br>  server_addr.sin_addr = *((struct in_addr *)host->h_addr);<br>  bzero(&(server_addr.sin_zero),8); </div>
<div>  if (connect(sock, (struct sockaddr *)&server_addr,<br>     sizeof(struct sockaddr)) == -1) <br>  {<br>   perror("Connect");<br>   exit(1);<br>  }<br> }</div>
<div><br> snprintf(line, 128, "%d",PSNR_val);<br> bzero(send_data, 1024);<br> strcpy(send_data,"@marq marq-marquee PSNR="); //only  marq-marquee for 0.9 below and @marq marq-marquee for above 0.9 versions<br>
 strcat(send_data,line);<br> write(sock,&send_data[0], sizeof(send_data));//for writing into the socket<br> sleep(1); <br> bzero(line,128);<br> ++index;<br>}<br></div></div>
<div> </div>
<div> </div>
<div> </div>
<div>Need suggestions for the below:</div>
<div> </div>
<div>*)Is there anything has to be changed in the above function so that my function can work smoothly ??</div>
<div>*)May be i'm asking you a silly things but go easy on me..i'm a newbie to this...:) i added the code and tried to compile but got the below errors. could you explain y these errors are occuring??To compile i'm using cygwin.</div>

<div> </div>
<div>x264.c: In function `write_psnr_to_rc':<br>x264.c:477: error: `SOCKET' undeclared (first use in this function)<br>x264.c:477: error: (Each undeclared identifier is reported only once<br>x264.c:477: error: for each function it appears in.)<br>
x264.c:477: error: parse error before "n"<br>x264.c:478: error: implicit declaration of function `socket'<br>x264.c:478: error: `AF_INET' undeclared (first use in this function)<br>x264.c:478: error: `SOCK_STREAM' undeclared (first use in this function)<br>
x264.c:484: error: structure has no member named `sin_family'<br>x264.c:485: error: structure has no member named `sin_port'<br>x264.c:485: error: implicit declaration of function `htons'<br>x264.c:486: error: structure has no member named `sin_addr'<br>
x264.c:486: error: dereferencing pointer to incomplete type<br>x264.c:487: error: implicit declaration of function `bzero'<br>x264.c:487: error: structure has no member named `sin_zero'<br>x264.c:489: error: implicit declaration of function `connect'<br>
x264.c:490: error: invalid application of `sizeof' to incomplete type `sockaddr'</div>
<div> </div>
<div> </div>
<div>thanking you in advance,</div>
<div> </div>
<div>with regards,</div>
<div>Srinidhi</div>