gorka_sm
24th April 2011, 20:51
Hello I have implemented a video streaming client based on a Qt MythUI client. There is a server implemented in JAVA for sending images an frames and threre is also other client developed in Qt for reveiving all the images and representing them . The code of the client is developed in a class called NetworkControl and it is the following :
void NetworkControl::aceptar_conexiones()
{
QTcpSocket *soket = new QTcpSocket(this);
const QString direc ="xxxxxxxxxx";
quint16 port = 4445;
soket->connectToHOst(direc,port)
connect(soket,SIGNAL(readyRead()),this,SLOT(leerca racter()))
}
void NetworkControl::leerCaracter()
{
QTcpSocket *socket (QTcpSocket *)sender();
QBYteArray *b1 = socket->readAll();
QImage ax= new QImage("xxxxxxxx");
ax->Load(b1);
}
I am working in a Mythtv system ( http://www.mythtv.org/wiki/User_Manual:Initial_Installation ) . I have the following doubts:
1 - How to obtain a QByteArray from a a QImage ( is ax->Load(b1) the correct way of obtaining it ?)
2 - I have to represent the QImage on a screen. I am working with the class MythImage ( http://www.cuymedia.net/mythtv-0.20/mythimage_8h-source.html ) y MythUIImage ( http://cuymedia.net/mythtv-trunk/myth
uiimage_8h-source.html ) .
How to convert from QImage to MythImage ? How to convert from MythImage to MythUIImage ?
3- Is there other way of representing images in Mythtv ?
Thanks
Gorka
void NetworkControl::aceptar_conexiones()
{
QTcpSocket *soket = new QTcpSocket(this);
const QString direc ="xxxxxxxxxx";
quint16 port = 4445;
soket->connectToHOst(direc,port)
connect(soket,SIGNAL(readyRead()),this,SLOT(leerca racter()))
}
void NetworkControl::leerCaracter()
{
QTcpSocket *socket (QTcpSocket *)sender();
QBYteArray *b1 = socket->readAll();
QImage ax= new QImage("xxxxxxxx");
ax->Load(b1);
}
I am working in a Mythtv system ( http://www.mythtv.org/wiki/User_Manual:Initial_Installation ) . I have the following doubts:
1 - How to obtain a QByteArray from a a QImage ( is ax->Load(b1) the correct way of obtaining it ?)
2 - I have to represent the QImage on a screen. I am working with the class MythImage ( http://www.cuymedia.net/mythtv-0.20/mythimage_8h-source.html ) y MythUIImage ( http://cuymedia.net/mythtv-trunk/myth
uiimage_8h-source.html ) .
How to convert from QImage to MythImage ? How to convert from MythImage to MythUIImage ?
3- Is there other way of representing images in Mythtv ?
Thanks
Gorka