[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-02 17:05:38
Message-ID: 1217696738.876374.7495.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 841119 by casanova:
* Added README file for libNice an oRTP
* added some parts of media manager
A README.jingle
M +12 -11 jingle/jinglemediamanager.cpp
M +12 -8 jingle/jinglemediamanager.h
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jingle/jinglemediamanager.cpp \
#841118:841119 @@ -25,7 +25,8 @@
* JingleMediaSession
*********************/
-JingleMediaSession::JingleMediaSession()
+JingleMediaSession::JingleMediaSession(JingleMediaManager *parent)
+ : m_mediaManager(parent)
{
}
@@ -46,16 +47,16 @@
m_payload = payload;
}
-void JingleMediaSession::setInputDevice(const Solid::DeviceInterface* device)
+void JingleMediaSession::setInputDevice(Solid::Device& device)
{
- Q_UNUSED(device)
if (m_type == Audio)
{
-
+ audioInputDevice = device.as<Solid::AudioInterface>();
+ kDebug() << "Using" << audioInputDevice->name() << "audio card for INPUT";
}
}
-void JingleMediaSession::setOutputDevice(const Solid::DeviceInterface* device)
+void JingleMediaSession::setOutputDevice(Solid::Device& device)
{
Q_UNUSED(device)
}
@@ -87,19 +88,19 @@
if (device->deviceType() == Solid::AudioInterface::AudioInput)
{
kDebug() << "Microphone found. The driver used is " << device->driver();
- m_microphones << device;
+ m_microphones << deviceList[i];
}
if (device->deviceType() == Solid::AudioInterface::AudioOutput)
{
kDebug() << "Sound card found. The driver used is " << device->driver();
- m_audioOutputs << device;
+ m_audioOutputs << deviceList[i];
}
}
deviceList = Solid::Device::listFromType(Solid::DeviceInterface::Video, QString());
for (int i = 0; i < deviceList.count(); i++)
- m_videoInputs << deviceList[i].as<Solid::Video>();
+ m_videoInputs << deviceList[i];
}
void JingleMediaManager::startVideoStreaming()
@@ -107,7 +108,7 @@
}
-QList<Solid::Video*> JingleMediaManager::videoDevices()
+QList<Solid::Device> JingleMediaManager::videoDevices()
{
// TODO:returns a list with devices
// The content of each item should be the name of the device (/dev/video0)
@@ -140,12 +141,12 @@
return QByteArray("Data for 2000 ms, you should not try to play this !!");
}
-JingleMediaSession *JingleMediaManager::createNewSession(const QDomElement& payload, \
const Solid::DeviceInterface *inputDevice, const Solid::DeviceInterface \
*outputDevice) +JingleMediaSession *JingleMediaManager::createNewSession(const \
QDomElement& payload, Solid::Device inputDevice, Solid::Device outputDevice) {
if ((!payload.isNull()) || (payload.tagName() != "payload-type"))
return NULL;
- JingleMediaSession *mediaSession = new JingleMediaSession();
+ JingleMediaSession *mediaSession = new JingleMediaSession(this);
mediaSession->setPayloadType(payload);
mediaSession->setInputDevice(inputDevice);
--- branches/work/soc-kopete-jingle/kopete/protocols/jabber/jingle/jinglemediamanager.h \
#841118:841119 @@ -37,11 +37,12 @@
/*
* TODO:Move me in my own source file.
*/
+class JingleMediaManager;
class JingleMediaSession : public QObject
{
Q_OBJECT
public:
- JingleMediaSession();
+ JingleMediaSession(JingleMediaManager *parent);
~JingleMediaSession();
enum Type {
@@ -60,13 +61,13 @@
* @brief sets the output device to use to show remote data
* @param the device to used as one of the list returned by \
JingleMediaManager::[video|audio]Devices()
*/
- void setOutputDevice(const Solid::DeviceInterface* device);
+ void setOutputDevice(Solid::Device& device);
/**
* @brief sets the input device to use to take data from
* @param the device to used as one of the list returned by \
JingleMediaManager::[video|audio]Devices()
*/
- void setInputDevice(const Solid::DeviceInterface* device);
+ void setInputDevice(Solid::Device& device);
signals:
/**
@@ -75,6 +76,9 @@
void incomingData();
private:
QDomElement m_payload;
+ JingleMediaManager *m_mediaManager;
+ Solid::AudioInterface *audioInputDevice;
+ Solid::AudioInterface *audioOutputDevice;
};
class JingleMediaManager : public QObject
@@ -97,7 +101,7 @@
* @brief returns the list of available video devices
* @return a list of available devices.
*/
- QList<Solid::Video*> videoDevices();
+ QList<Solid::Device> videoDevices();
/**
* @brief creates a new media session
@@ -106,7 +110,7 @@
* @param outputDevice the device which wil be used to display video or play audio \
received from the othe peer
* @return returns a new JingleMediaSession
*/
- JingleMediaSession* createNewSession(const QDomElement& payload, const \
Solid::DeviceInterface* inputDevice = 0, const Solid::DeviceInterface* outputDevice = \
0); + JingleMediaSession* createNewSession(const QDomElement& payload, Solid::Device \
inputDevice = Solid::Device(), Solid::Device outputDevice = Solid::Device());
/**
* @brief switch on the multimedia device (webcam)
@@ -123,9 +127,9 @@
void slotSessionTerminated();
private:
- QList<Solid::AudioInterface*> m_microphones;
- QList<Solid::AudioInterface*> m_audioOutputs;
- QList<Solid::Video*> m_videoInputs;
+ QList<Solid::Device> m_microphones;
+ QList<Solid::Device> m_audioOutputs;
+ QList<Solid::Device> m_videoInputs;
QTimer *timer;
QList<JingleMediaSession*> m_sessions;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic