i'm workin on client - server video capturing and displaying application.. .my client capture the video via webcam then send it to the server over WLAN via UDP, then the server display the captured video stream continously (real - time).. i have made a simple client - server application using QUdpsocket. but the problem now is to put the video stream into the socket.. any suggestion ?

here is the udp client - server code that i developed :
Qt Code:
  1. #include "jcxudp.h"
  2.  
  3. jcxUDP::jcxUDP(QObject *parent) :
  4. QObject(parent)
  5. {
  6. socket = new QUdpSocket(this);
  7. socket->bind(QHostAddress::LocalHost,5678);
  8. connect(socket,SIGNAL(readyRead()),this,SLOT(SiapBaca()));
  9. }
  10.  
  11. void jcxUDP::NulisHallo()
  12. {
  13. QByteArray Data;
  14. Data.append("halo dari jincheng");
  15. socket->writeDatagram(Data,QHostAddress::LocalHost,5678);
  16. }
  17.  
  18. void jcxUDP::SiapBaca()
  19. {
  20. QByteArray Buffer;
  21. Buffer.resize(socket->pendingDatagramSize());
  22.  
  23. QHostAddress sender;
  24. quint16 senderPort;
  25. socket->readDatagram(Buffer.data(),Buffer.size(),&sender,&senderPort);
  26.  
  27. qDebug() << "Pesan Dari :" << sender.toString();
  28. qDebug() << "Port Pesan :" << senderPort;
  29. qDebug() << "Pesan :" << Buffer;
  30. }
To copy to clipboard, switch view to plain text mode