[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-27 14:33:28
Message-ID: 1219847608.228198.32244.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 853316 by casanova:
* delete buffer when written;
* uses external address when possible (retrieved via http, DMZ must be set...)
M +28 -0 jingle/alsaio.cpp
M +4 -0 jingle/alsaio.h
M +4 -0 jingle/jinglemediamanager.cpp
M +3 -3 libiris/iris/jabber/jinglesessionmanager.cpp
M +2 -2 libiris/iris/jabber/jingletasks.cpp
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jingle/alsaio.cpp \
#853315:853316 @@ -289,6 +289,7 @@
//written += buf.size();
//kDebug() << "Buffer size =" << buf.size();
+
if (buf.size() < pSize)
{
kDebug() << "No enough Data in the buffer.";
@@ -311,6 +312,8 @@
}
kDebug() << "Wrote" << size << "frames on the device.";// (" << written << "bytes \
since the beginning)"; +
+ buf.clear();
}
bool AlsaIO::prepare()
@@ -336,3 +339,28 @@
emit readyRead();
}
+void AlsaIO::incRef()
+{
+ ref++;
+}
+
+void AlsaIO::decRef()
+{
+ ref--;
+ if (ref == 0)
+ {
+ stop();
+ }
+}
+
+void AlsaIO::stop()
+{
+ if (notifier)
+ {
+ close(notifier->socket());
+ delete notifier;
+ }
+
+ if (timer)
+ delete timer;
+}
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jingle/alsaio.h \
#853315:853316 @@ -43,6 +43,8 @@
unsigned int timeStamp();
void writeData();
bool prepare();
+ void decRef();
+ void incRef();
public slots:
void slotActivated(int socket);
@@ -65,6 +67,8 @@
int fdCount;
struct pollfd *ufds;
unsigned int written;
+ int ref;
+ void stop();
};
#endif //ALSA_IO
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jingle/jinglemediamanager.cpp \
#853315:853316 @@ -37,6 +37,8 @@
JingleMediaSession::~JingleMediaSession()
{
+ playbackPlugin->decRef();
+ capturePlugin->decRef();
kDebug() << "deleted";
}
@@ -72,6 +74,7 @@
kDebug() << "Setting the capturePlugin";
//Here we should be able to configure the capturePlugin and tell it which souncard \
it should use. capturePlugin = p;
+ capturePlugin->incRef();
if (capturePlugin->isReady())
tsValue = capturePlugin->timeStamp();
@@ -86,6 +89,7 @@
{
kDebug() << "Setting playbackPlugin";
playbackPlugin = p;
+ playbackPlugin->incRef();
}
void JingleMediaSession::start()
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/libiris/iris/jabber/jinglesessionmanager.cpp \
#853315:853316 @@ -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");*///--> Deactivated
+ d->http->get("/~styma/REMOTE_ADDR.shtml");
}
void JingleSessionManager::slotExternalIPDone(bool err)
@@ -92,7 +92,7 @@
// Parse XML here...
// We know that the ip is on the 5th line.
d->ip = data.split('\n').at(4);
- qDebug() << "Received External IP :" << d->ip;
+ qDebug() << "Received External IP :" << d->ip << \
"-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_";
delete d->http;
}
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/libiris/iris/jabber/jingletasks.cpp \
#853315:853316 @@ -322,7 +322,7 @@
QString ip;
//Trying to get the address with the most chances to succeed.
- if (eip != "" && 0) //deos not seem to work...
+ if (eip != "") //deos not seem to work...
{
ip = eip;
}
@@ -523,7 +523,7 @@
QString ip;
//Trying to get the address with the most chances to succeed.
- if (eip != "" && 0) //does not seem to work.
+ if (eip != "") //does not seem to work.
{
ip = eip;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic