I'm interested on sending a video stream from a C++ server to a Java client. The C++ server is written with boost/asio.
I was thinking of using opencv in order to easily connect to a computer's usb camera. However, I'm having troubles with sending Mat object over socket.
The only way ,that I encountered, to do so is this way:
Mat frame;
...
int imgSize = frame.total()*frame.elemSize();
bytes = send(clientSock, frame.data, imgSize, 0))
but I cannot send it with boost this way, since it has to be in one of these forms: http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference/basic_raw_socket/send_to.html
So I thought of converting frame.data ,imgSize to string, and sending a container of these two buffers, but I don't think this is the right way. And even if it is, how can I "rebuild" the image in the Java client?
Any idea would be appreciated!