[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/soc-kopete-jingle/kopete/protocols/jabber
From: Detlev Casanova <detlev.casanova () gmail ! com>
Date: 2008-08-18 8:05:41
Message-ID: 1219046741.716718.21934.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 848590 by casanova:
* Bind to ports only;
* Print a message when an object is destroyed;
* Set payload type for RTP out session.
M +3 -3 jingle/alsaio.cpp
M +9 -5 jingle/jabberjinglecontent.cpp
M +2 -0 jingle/jabberjinglesession.cpp
M +8 -9 jingle/jinglertpsession.cpp
M +5 -5 libiris/iris/jabber/jinglecontent.cpp
M +9 -3 libiris/iris/jabber/jinglesession.cpp
M +2 -2 libiris/iris/jabber/jinglesessionmanager.cpp
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jingle/alsaio.cpp \
#848589:848590 @@ -249,13 +249,13 @@
return ts;
}
-void AlsaIO::slotActivated(int socket)
+void AlsaIO::slotActivated(int)
{
//kDebug() << "Data arrived. (Alsa told me !)";
size_t size;
QByteArray tmpBuf;
- tmpBuf.resize(1024);
- size = read(socket, tmpBuf.data(), 1024); //Maybe use readi which is more \
adapted... + tmpBuf.resize(pSize);
+ size = snd_pcm_readi(handle, tmpBuf.data(), pSize); //Maybe use readi which is more \
adapted... tmpBuf.resize(size);
buf.append(tmpBuf);
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jingle/jabberjinglecontent.cpp \
#848589:848590 @@ -44,6 +44,7 @@
JabberJingleContent::~JabberJingleContent()
{
+ kDebug() << "destroyed";
delete m_content;
delete m_rtpInSession;
delete m_rtpOutSession;
@@ -52,7 +53,6 @@
void JabberJingleContent::setContent(XMPP::JingleContent* content)
{
m_content = content;
-// connect(m_content, SIGNAL(socketReady()), this, SLOT(slotPrepareRtpSession()));
}
void JabberJingleContent::prepareRtpInSession()
@@ -60,16 +60,19 @@
kDebug(KDE_DEFAULT_DEBUG_AREA) << "Prepare RTP IN session";
if (m_rtpInSession == 0)
{
- m_rtpInSession = new JingleRtpSession(JingleRtpSession::In);
if (!m_content->inSocket())
{
kDebug() << "Fatal : Invalid Socket !";
return;
}
+ m_rtpInSession = new JingleRtpSession(JingleRtpSession::In);
m_rtpInSession->setPayload(m_content->bestPayload());
m_rtpInSession->setRtpSocket(m_content->inSocket()); // This will set rtcp port = \
rtp port + 1. Maybe we don't want that for ice-udp. + kDebug() << "Connecting \
m_rtpInSession readyRead signal."; connect(m_rtpInSession, SIGNAL(readyRead(const \
QByteArray&)), this, SLOT(slotIncomingData(const QByteArray&))); }
+ else
+ kDebug() << "RTP IN session already set !";
}
void JabberJingleContent::prepareRtpOutSession()
@@ -77,14 +80,17 @@
kDebug(KDE_DEFAULT_DEBUG_AREA) << "Prepare RTP OUT session";
if (m_rtpOutSession == 0)
{
- m_rtpOutSession = new JingleRtpSession(JingleRtpSession::Out);
if (!m_content->outSocket())
{
kDebug() << "Fatal : Invalid Socket !";
return;
}
+ m_rtpOutSession = new JingleRtpSession(JingleRtpSession::Out);
+ m_rtpOutSession->setPayload(m_content->bestPayload());
m_rtpOutSession->setRtpSocket(m_content->outSocket()); // This will set rtcp port \
= rtp port + 1. Maybe we don't want that for ice-udp. }
+ else
+ kDebug() << "RTP OUT session already set !";
}
void JabberJingleContent::slotIncomingData(const QByteArray& data)
@@ -109,8 +115,6 @@
if (m_mediaSession == 0)
{
kDebug() << "Media Session is NULL!";
- kDebug() << "Number of payloads :" << m_content->payloadTypes().count();
- kDebug() << "Number of responder payloads :" << \
m_content->responderPayloads().count(); return;
}
connect(m_mediaSession, SIGNAL(readyRead(int)), this, SLOT(slotReadyRead(int)));
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jingle/jabberjinglesession.cpp \
#848589:848590 @@ -39,6 +39,7 @@
JabberJingleSession::~JabberJingleSession()
{
+ kDebug() << "destroyed";
for (int i = 0; i < jabberJingleContents.count(); i++)
delete jabberJingleContents[i];
delete m_jingleSession;
@@ -73,6 +74,7 @@
JabberJingleContent *jContent = \
contentWithName(m_jingleSession->contents()[i]->name()); if (jContent == 0)
{
+ qDebug() << "Create JabberJingleContent for content" << \
m_jingleSession->contents()[i]->name(); jContent = new JabberJingleContent(this, \
m_jingleSession->contents()[i]); jabberJingleContents << jContent;
}
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jingle/jinglertpsession.cpp \
#848589:848590 @@ -13,7 +13,7 @@
JingleRtpSession::JingleRtpSession(Direction d)
{
m_direction = d;
- kDebug(KDE_DEFAULT_DEBUG_AREA) << "Creating JingleRtpSession";
+ kDebug(KDE_DEFAULT_DEBUG_AREA) << "Creating" << (d == In ? "IN" : "OUT") << \
"JingleRtpSession"; /*
* The RtpSession objects represent a RTP session:
* once it is configured with local and remote network addresses and a payload type \
is given, @@ -46,6 +46,7 @@
JingleRtpSession::~JingleRtpSession()
{
+ kDebug() << "destroyed";
rtp_session_bye(m_rtpSession, "Ended");
rtp_session_destroy(m_rtpSession);
@@ -69,8 +70,7 @@
void JingleRtpSession::setRtpSocket(QAbstractSocket* socket, int rtcpPort)
{
kDebug() << (socket->isValid() ? "Socket ready" : "Socket not ready");
- // The socket has already been created but we set another one here.
- delete rtpSocket;
+ //delete rtpSocket;
rtpSocket = (QUdpSocket*) socket;
rtcpSocket = new QUdpSocket(this);
@@ -79,7 +79,7 @@
kDebug() << "Given socket is bound to :" << rtpSocket->localPort();
kDebug() << "RTCP socket will be bound to :" << (rtcpPort == 0 ? \
rtpSocket->localPort() + 1 : rtcpPort); connect(rtpSocket, SIGNAL(readyRead()), \
this, SLOT(rtpDataReady()));
- rtcpSocket->bind(rtcpPort == 0 ? rtpSocket->localPort() + 1 : rtcpPort);
+ rtcpSocket->bind(/*rtpSocket->localAddress(), */rtcpPort == 0 ? \
rtpSocket->localPort() + 1 : rtcpPort); }
else if (m_direction == Out)
{
@@ -169,9 +169,8 @@
void JingleRtpSession::slotBytesWritten(qint64 size)
{
- Q_UNUSED(size)
- //kDebug() << size << "bytes written";
- if (state != SendingData)
- return;
- emit dataSent();
+ kDebug() << size << "bytes written";
+ //if (state != SendingData)
+ // return;
+ //emit dataSent();
}
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/libiris/iris/jabber/jinglecontent.cpp \
#848589:848590 @@ -258,8 +258,8 @@
QHostAddress address(d->transport.firstChildElement().attribute("ip"));
int port = d->transport.firstChildElement().attribute("port").toInt();
qDebug() << "Bind socket to" << address << ":" << port;
- if (d->inSocket->bind(address, port))
- qDebug() << "Socket bound to" << address.toString() << ":" << port;
+ if (d->inSocket->bind(/*address, */port))
+ qDebug() << "Socket bound to" << /*address.toString() << ":" <<*/ port;
connect(d->inSocket, SIGNAL(readyRead()), this, SLOT(slotRawUdpDataReady()));
//emit inSocketReady(); --> also no need of this.
@@ -270,7 +270,7 @@
qDebug() << "Data arrived on the socket.";
emit dataReceived();
setReceiving(true);
- disconnect(sender(), 0, this, 0);
+ //disconnect(sender(), 0, this, 0);
}
QUdpSocket *JingleContent::inSocket()
@@ -378,8 +378,8 @@
qDebug() << "Trying to bind socket to" << address.toString() << ":" << port;
if (!d->inSocket)
d->inSocket = new QUdpSocket();
- if (d->inSocket->bind(address, port))
- qDebug() << "Socket bound to" << address.toString() << ":" << port;
+ if (d->inSocket->bind(/*address, */port))
+ qDebug() << "Socket bound to" << /*address.toString() << ":" << */port;
connect(d->inSocket, SIGNAL(readyRead()), this, SLOT(slotRawUdpDataReady()));
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/libiris/iris/jabber/jinglesession.cpp \
#848589:848590 @@ -75,7 +75,6 @@
JingleSession::~JingleSession()
{
- qDebug() << "still" << d->actions.count() << "actions in the list";
delete d;
}
@@ -150,14 +149,15 @@
void JingleSession::deleteAction(JT_JingleAction* a)
{
- for (int i = 0; i < d->actions.count(); i++)
+ //Don't delete tasks, iris will take care of it.
+ /*for (int i = 0; i < d->actions.count(); i++)
{
if (d->actions[i] == a)
{
delete d->actions.takeAt(i);
break;
}
- }
+ }*/
}
void JingleSession::slotContentConnected()
@@ -320,6 +320,10 @@
sAction->sessionAccept(contentList);
sAction->go(true);
}
+ else
+ {
+ qDebug() << "d->allContentsConnected is FALSE !!!";
+ }
d->userAcceptedSession = true;
}
@@ -663,4 +667,6 @@
connect(rAction, SIGNAL(finished()), this, SLOT(slotAcked()));
rAction->setSession(this);
rAction->received();
+ rAction->go(true);
}
+
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/libiris/iris/jabber/jinglesessionmanager.cpp \
#848589:848590 @@ -73,10 +73,10 @@
d->firstPort = 9000;
//Get External IP address, This is not Standard and might not work but let's try it \
before we have ICE support
- d->http = new QHttp(this);
+ /*d->http = new QHttp(this);
d->http->setHost("www.swlink.net");
connect(d->http, SIGNAL(done(bool)), this, SLOT(slotExternalIPDone(bool)));
- d->http->get("/~styma/REMOTE_ADDR.shtml");
+ d->http->get("/~styma/REMOTE_ADDR.shtml");*///--> Deactivated
}
void JingleSessionManager::slotExternalIPDone(bool err)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic