Qt Data transfer
Omri last edited by
hello! I have 2 unrelated questions:
Is there a way to hold the main in a wait mode?
meaning the main will pass the return a.exec(); (a is a Qapplication) and enter a wait mode until his subprocesses will end(the gui for example).
I'm streaming a video through netcat to a socket. from that socket I need to stream the data to an mplayer process.
I've managed to do that through this code:
socket = new QTcpSocket(this);
args1 += "-fps";
args1 += "60";
args1 += "-cache";
args1 += "1024";
args1 += "-slave";
args1 += "-wid";
args1 += QString::number((int)ui->widget->winId());
args1 += "-";
process1 = new QProcess(0);
process1->start("C:\Program Files (x86)\MPlayer for Windows\mplayer.exe",args1);
qDebug() << "Connecting...";
qDebug() << "Error:" << socket->errorString();
Data = socket->readAll(); //Data is a QByteArray qDebug() << " Data in: " << Data; process1->write(Data);
simply when ready read is emitted the socket is read and then writing to the process.
The problem is that the video is really slow with a lot of lag.
What is the best and fastest way in transferring data into a process?
What is the difference between read/write to readdata/writedata functions, and how to use them(they're virtual protected)?
Thanks for the helpers.