[ekiga] Port ekiga code to ptlib/opal v14
- From: Eugen Dedu <ededu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Port ekiga code to ptlib/opal v14
- Date: Sun, 3 Aug 2014 23:21:28 +0000 (UTC)
commit 6f0a71b4df8093dbaa2335b70a4ea36ce3f5ed0d
Author: Eugen Dedu <eugen dedu univ-fcomte fr>
Date: Mon Aug 4 01:19:36 2014 +0200
Port ekiga code to ptlib/opal v14
It remains to port:
- audio/video ptlib plugins
- chat
- statistics during call
Windows version does not yet work.
configure.ac | 4 +-
lib/engine/components/opal/h323-endpoint.cpp | 6 +-
lib/engine/components/opal/opal-account.cpp | 90 ++++++++------------
lib/engine/components/opal/opal-audio.cpp | 27 +++----
lib/engine/components/opal/opal-audio.h | 6 +-
lib/engine/components/opal/opal-call-manager.cpp | 31 ++++---
lib/engine/components/opal/opal-call.cpp | 21 ++---
lib/engine/components/opal/opal-call.h | 3 +-
lib/engine/components/opal/opal-plugins-hook.cpp | 2 +
lib/engine/components/opal/opal-videoinput.cpp | 3 +-
lib/engine/components/opal/opal-videoinput.h | 4 +-
lib/engine/components/opal/pcss-endpoint.h | 2 +-
lib/engine/components/opal/sip-endpoint.cpp | 26 ++----
lib/engine/components/opal/sip-endpoint.h | 3 +-
.../components/ptlib/videoinput-manager-ptlib.cpp | 44 +++++++---
src/main.cpp | 2 +-
win32/plugin-gconst.cpp | 4 +-
17 files changed, 131 insertions(+), 147 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 41d2fb3..a997ca0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,8 +23,8 @@ MINOR_VERSION=1
BUILD_TYPE=ReleaseCode
BUILD_NUMBER=0
-PTLIB_REC_VERSION="2.10.10"
-OPAL_REC_VERSION="3.10.10"
+PTLIB_REC_VERSION="2.14.3"
+OPAL_REC_VERSION="3.14.3"
AC_DEFINE_UNQUOTED(MAJOR_VERSION, $MAJOR_VERSION,[fix])
AC_DEFINE_UNQUOTED(MINOR_VERSION, $MINOR_VERSION,[fix])
diff --git a/lib/engine/components/opal/h323-endpoint.cpp b/lib/engine/components/opal/h323-endpoint.cpp
index 6108211..32ed608 100644
--- a/lib/engine/components/opal/h323-endpoint.cpp
+++ b/lib/engine/components/opal/h323-endpoint.cpp
@@ -217,8 +217,8 @@ Opal::H323::EndPoint::set_listen_port (unsigned port)
void
Opal::H323::EndPoint::set_initial_bandwidth (unsigned bitrate)
{
- SetInitialBandwidth (bitrate > 0 ? bitrate : 100000);
- PTRACE (4, "Opal::H323::EndPoint\tSet maximum bandwidth to " << bitrate);
+ SetInitialBandwidth (OpalBandwidth::Tx, bitrate > 0 ? bitrate : 100000);
+ PTRACE (4, "Opal::H323::EndPoint\tSet maximum/initial tx bandwidth to " << bitrate);
}
@@ -296,7 +296,7 @@ Opal::H323::EndPoint::Register (const Opal::Account& account)
// Registering failed
if (GetGatekeeper () != NULL) {
- switch (gatekeeper->GetRegistrationFailReason ()) {
+ switch (GetGatekeeper()->GetRegistrationFailReason ()) {
case H323Gatekeeper::DuplicateAlias :
// Translators : The alias we are registering already exists : failure
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index d64b5f9..d3e38f7 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -862,22 +862,14 @@ Opal::Account::publish (const Ekiga::PersonalDetails& details)
{
std::string presence = details.get_presence ();
- if (presence == "available")
- personal_state = OpalPresenceInfo::Available;
- else if (presence == "away")
- personal_state = OpalPresenceInfo::Away;
- else if (presence == "busy")
- personal_state = OpalPresenceInfo::Busy;
- else { // ekiga knows only these three presence types
- std::string s = "Warning: Unknown presence type ";
- s.append (presence);
- g_warning ("%s",s.data());
- }
-
+ personal_state = OpalPresenceInfo::Available;
presence_status = details.get_status ();
if (presentity) {
- presentity->SetLocalPresence (personal_state, presence_status);
+ OpalPresenceInfo opi = OpalPresenceInfo (OpalPresenceInfo::Available);
+ opi.m_activities = PString (presence);
+ opi.m_note = presence_status;
+ presentity->SetLocalPresence (opi);
PTRACE (4, "Ekiga\tSent its own presence (publish) for " << get_aor() << ": " << presence << ", note "
<< presence_status);
}
}
@@ -929,10 +921,10 @@ Opal::Account::handle_registration_event (RegistrationState state_,
failed_registration_already_notified = false;
if (presentity) {
- for (const_iterator iter = begin ();
- iter != end ();
- ++iter)
- fetch ((*iter)->get_uri());
+ for (const_iterator iter = begin ();
+ iter != end ();
+ ++iter)
+ fetch ((*iter)->get_uri());
presentity->SetLocalPresence (personal_state, presence_status);
if (type != Account::H323) {
@@ -941,7 +933,7 @@ Opal::Account::handle_registration_event (RegistrationState state_,
}
boost::shared_ptr<Ekiga::PersonalDetails> details = personal_details.lock ();
if (details)
- const_cast<Account*>(this)->publish (*details);
+ const_cast<Account*>(this)->publish (*details);
updated ();
}
@@ -1092,52 +1084,46 @@ Opal::Account::setup_presentity ()
void
Opal::Account::OnPresenceChange (OpalPresentity& /*presentity*/,
- const OpalPresenceInfo& info)
+ const std::auto_ptr<OpalPresenceInfo> info)
{
std::string new_presence;
std::string new_status = "";
- SIPURL sip_uri = SIPURL (info.m_entity);
+ SIPURL sip_uri = SIPURL (info->m_entity);
sip_uri.Sanitise (SIPURL::ExternalURI);
std::string uri = sip_uri.AsString ();
- PCaselessString note = info.m_note;
-
- PTRACE (4, "Ekiga\tReceived a presence change (notify) for " << info.m_entity << ": state " <<
info.m_state << ", note " << info.m_note);
+ PCaselessString note = info->m_note;
- if (info.m_state == OpalPresenceInfo::Unchanged)
- return;
+ PTRACE (4, "Ekiga\tReceived a presence change (notify) for " << info->m_entity << ": state " <<
info->m_state << ", activities " << info->m_activities << ", note " << info->m_note);
if (!uri.compare (0, 5, "pres:"))
uri.replace (0, 5, "sip:"); // replace "pres:" sith "sip:" FIXME
- new_status = (const char*) info.m_note;
- switch (info.m_state) {
+ new_status = (const char*) info->m_note;
+ switch (info->m_state) {
case OpalPresenceInfo::Unchanged:
// do not change presence
break;
case OpalPresenceInfo::Available:
new_presence = "available";
- if (!note.IsEmpty ()) {
- if (note.Find ("dnd") != P_MAX_INDEX
- || note.Find ("meeting") != P_MAX_INDEX
- || note.Find ("do not disturb") != P_MAX_INDEX
- || note.Find ("busy") != P_MAX_INDEX) {
- new_presence = "busy";
- }
- else if (note.Find ("away") != P_MAX_INDEX
- || note.Find ("out") != P_MAX_INDEX
- || note.Find ("vacation") != P_MAX_INDEX
- || note.Find ("holiday") != P_MAX_INDEX
- || note.Find ("lunch") != P_MAX_INDEX) {
- new_presence = "away";
- }
- else if (note.Find ("phone") != P_MAX_INDEX
- || note.Find ("ringing") != P_MAX_INDEX
- || note.Find ("call") != P_MAX_INDEX) {
- new_presence = "inacall";
- }
- }
+ if (note.Find ("dnd") != P_MAX_INDEX
+ || note.Find ("meeting") != P_MAX_INDEX
+ || note.Find ("do not disturb") != P_MAX_INDEX
+ || note.Find ("busy") != P_MAX_INDEX
+ || info->m_activities.Contains ("busy"))
+ new_presence = "busy";
+ else if (note.Find ("away") != P_MAX_INDEX
+ || note.Find ("out") != P_MAX_INDEX
+ || note.Find ("vacation") != P_MAX_INDEX
+ || note.Find ("holiday") != P_MAX_INDEX
+ || note.Find ("lunch") != P_MAX_INDEX
+ || info->m_activities.Contains ("away"))
+ new_presence = "away";
+ else if (note.Find ("phone") != P_MAX_INDEX
+ || note.Find ("ringing") != P_MAX_INDEX
+ || note.Find ("call") != P_MAX_INDEX)
+ new_presence = "inacall";
break;
case OpalPresenceInfo::NoPresence:
new_presence = "offline";
@@ -1145,15 +1131,10 @@ Opal::Account::OnPresenceChange (OpalPresentity& /*presentity*/,
case OpalPresenceInfo::InternalError:
case OpalPresenceInfo::Forbidden:
case OpalPresenceInfo::Unavailable:
- case OpalPresenceInfo::UnknownExtended:
+ //case OpalPresenceInfo::UnknownExtended:
new_presence = "unknown";
break;
- case OpalPresenceInfo::Away:
- new_presence = "away";
- break;
- case OpalPresenceInfo::Busy:
- new_presence = "busy";
- break;
+ /* for reference purposes:
case OpalPresenceInfo::Appointment:
new_presence = "away";
// Translators: see RFC 4480 for more information about activities
@@ -1237,6 +1218,7 @@ Opal::Account::OnPresenceChange (OpalPresentity& /*presentity*/,
case OpalPresenceInfo::Worship:
new_presence = "away";
break;
+ */
default:
break;
}
diff --git a/lib/engine/components/opal/opal-audio.cpp b/lib/engine/components/opal/opal-audio.cpp
index 9042e6d..c3125da 100644
--- a/lib/engine/components/opal/opal-audio.cpp
+++ b/lib/engine/components/opal/opal-audio.cpp
@@ -60,7 +60,8 @@ PSoundChannel_EKIGA::PSoundChannel_EKIGA (const PString & /*_device*/,
audiooutput_core (_audiooutput_core)
{
opened = false;
- Open (device, dir, numChannels, sampleRate, bitsPerSample);
+ Params params (dir, device, PString::Empty(), numChannels, sampleRate, bitsPerSample);
+ Open (params);
}
@@ -79,24 +80,18 @@ PString PSoundChannel_EKIGA::GetDefaultDevice(Directions dir)
}
-bool PSoundChannel_EKIGA::Open (const PString & /*_device*/,
- Directions _dir,
- unsigned _numChannels,
- unsigned _sampleRate,
- unsigned _bitsPerSample)
+bool PSoundChannel_EKIGA::Open (const Params & params)
{
- direction = _dir;
+ direction = params.m_direction;
- if (_dir == Recorder) {
- audioinput_core->start_stream(_numChannels, _sampleRate, _bitsPerSample);
- }
- else {
- audiooutput_core->start (_numChannels, _sampleRate, _bitsPerSample);
- }
+ if (params.m_direction == Recorder)
+ audioinput_core->start_stream (params.m_channels, params.m_sampleRate, params.m_bitsPerSample);
+ else
+ audiooutput_core->start (params.m_channels, params.m_sampleRate, params.m_bitsPerSample);
- mNumChannels = _numChannels;
- mSampleRate = _sampleRate;
- mBitsPerSample = _bitsPerSample;
+ mNumChannels = params.m_channels;
+ mSampleRate = params.m_sampleRate;
+ mBitsPerSample = params.m_bitsPerSample;
opened = true;
return true;
diff --git a/lib/engine/components/opal/opal-audio.h b/lib/engine/components/opal/opal-audio.h
index cefaa6d..62dc17e 100644
--- a/lib/engine/components/opal/opal-audio.h
+++ b/lib/engine/components/opal/opal-audio.h
@@ -59,11 +59,7 @@ public:
boost::shared_ptr<Ekiga::AudioOutputCore> audiooutput_core);
~PSoundChannel_EKIGA();
static PString GetDefaultDevice(PSoundChannel::Directions);
- bool Open(const PString & _device,
- Directions _dir,
- unsigned _numChannels,
- unsigned _sampleRate,
- unsigned _bitsPerSample);
+ bool Open(const Params & params);
bool Close();
bool Write(const void * buf, PINDEX len);
bool Read(void * buf, PINDEX len);
diff --git a/lib/engine/components/opal/opal-call-manager.cpp
b/lib/engine/components/opal/opal-call-manager.cpp
index 2e0ba0a..1ed7ebc 100644
--- a/lib/engine/components/opal/opal-call-manager.cpp
+++ b/lib/engine/components/opal/opal-call-manager.cpp
@@ -53,6 +53,8 @@
#include "h323-endpoint.h"
#endif
+#include <opal/transcoders.h>
+
#include <stdlib.h>
// opal manages its endpoints itself, so we must be wary
@@ -268,10 +270,7 @@ void CallManager::set_echo_cancellation (bool enabled)
// General settings
ec = GetEchoCancelParams ();
- if (enabled)
- ec.m_mode = OpalEchoCanceler::Cancelation;
- else
- ec.m_mode = OpalEchoCanceler::NoCancelation;
+ ec.m_enabled = enabled;
SetEchoCancelParams (ec);
// Adjust setting for all connections of all calls
@@ -302,13 +301,13 @@ bool CallManager::get_echo_cancellation () const
{
OpalEchoCanceler::Params ec = GetEchoCancelParams ();
- return (ec.m_mode == OpalEchoCanceler::Cancelation);
+ return ec.m_enabled;
}
void CallManager::set_maximum_jitter (unsigned max_val)
{
- unsigned val = PMIN (PMAX (max_val, 20), 1000);
+ unsigned val = std::min (std::max (max_val, (unsigned) 20), (unsigned) 1000);
SetAudioJitterDelay (20, val);
@@ -327,11 +326,15 @@ void CallManager::set_maximum_jitter (unsigned max_val)
OpalMediaStreamPtr stream = connection->GetMediaStream (OpalMediaType::Audio (), false);
if (stream != NULL) {
- RTP_Session *session = connection->GetSession (stream->GetSessionID ());
+ OpalRTPSession *session = (OpalRTPSession*)connection->GetMediaSession (stream->GetSessionID ());
if (session != NULL) {
unsigned units = session->GetJitterTimeUnits ();
- session->SetJitterBufferSize (20 * units, val * units, units);
+ OpalJitterBuffer::Init init;
+ init.m_minJitterDelay = 20 * units;
+ init.m_maxJitterDelay = val * units;
+ init.m_timeUnits = units;
+ session->SetJitterBufferSize (init);
}
}
}
@@ -396,7 +399,7 @@ bool CallManager::get_silence_detection () const
void CallManager::set_reject_delay (unsigned delay)
{
- reject_delay = PMAX (5, delay);
+ reject_delay = std::max ((unsigned) 5, delay);
}
@@ -496,7 +499,7 @@ void CallManager::set_codecs (Ekiga::CodecList & _codecs)
&& (rate == all_media_formats [j].GetClockRate () || name == "G722")) {
// Found something
- order += all_media_formats [j];
+ order = order + all_media_formats [j];
}
}
}
@@ -508,7 +511,7 @@ void CallManager::set_codecs (Ekiga::CodecList & _codecs)
for (int j = 0 ;
j < all_media_formats.GetSize () ;
j++)
- order += all_media_formats [j];
+ order = order + all_media_formats [j];
// Build the mask
@@ -518,7 +521,7 @@ void CallManager::set_codecs (Ekiga::CodecList & _codecs)
for (int i = 0 ;
i < all_media_formats.GetSize () ;
i++)
- mask += all_media_formats [i];
+ mask = mask + all_media_formats [i];
// Blacklist IM protocols for now
mask += "T.140";
@@ -652,7 +655,7 @@ void CallManager::set_video_options (const CallManager::VideoOptions & options)
OpalMediaFormatList media_formats_list;
OpalMediaFormat::GetAllRegisteredMediaFormats (media_formats_list);
- int maximum_frame_rate = PMIN (PMAX (options.maximum_frame_rate, 1), 30);
+ int maximum_frame_rate = std::min (std::max ((signed) options.maximum_frame_rate, 1), 30);
int maximum_received_bitrate = (options.maximum_received_bitrate > 0 ? options.maximum_received_bitrate :
4096);
int maximum_transmitted_bitrate = (options.maximum_transmitted_bitrate > 0 ?
options.maximum_transmitted_bitrate : 48);
int temporal_spatial_tradeoff = (options.temporal_spatial_tradeoff > 0 ? options.temporal_spatial_tradeoff
: 31);
@@ -913,7 +916,7 @@ CallManager::HandleSTUNResult ()
if (result == PSTUNClient::SymmetricNat
|| result == PSTUNClient::BlockedNat
- || result == PSTUNClient::PartialBlockedNat) {
+ || result == PSTUNClient::PartiallyBlocked) {
error = true;
} else {
diff --git a/lib/engine/components/opal/opal-call.cpp b/lib/engine/components/opal/opal-call.cpp
index d565e75..dc7eb2a 100644
--- a/lib/engine/components/opal/opal-call.cpp
+++ b/lib/engine/components/opal/opal-call.cpp
@@ -40,7 +40,7 @@
#include <glib/gi18n.h>
#include <opal/opal.h>
-#include <opal/pcss.h>
+#include <ep/pcss.h>
#include <sip/sippdu.h>
#include "call.h"
@@ -163,10 +163,7 @@ Opal::Call::toggle_hold ()
if (connection != NULL) {
on_hold = connection->IsOnHold (false);
- if (!on_hold)
- connection->Hold (false, true);
- else
- connection->Hold (false, false);
+ connection->HoldRemote (!on_hold);
}
}
@@ -214,13 +211,13 @@ void Opal::Call::set_no_answer_forward (unsigned delay, const std::string & uri)
{
forward_uri = uri;
- NoAnswerTimer.SetInterval (0, PMIN (delay, 299));
+ NoAnswerTimer.SetInterval (0, std::min (delay, (unsigned) 299));
}
void Opal::Call::set_reject_delay (unsigned delay)
{
- NoAnswerTimer.SetInterval (0, PMIN (delay, 299));
+ NoAnswerTimer.SetInterval (0, std::min (delay, (unsigned) 299));
}
@@ -349,7 +346,7 @@ Opal::Call::parse_info (OpalConnection & connection)
PBoolean
Opal::Call::OnEstablished (OpalConnection & connection)
{
- RTP_Session *session = NULL;
+ OpalRTPSession *session = NULL;
OpalMediaStreamPtr stream;
NoAnswerTimer.Stop (false);
@@ -365,7 +362,7 @@ Opal::Call::OnEstablished (OpalConnection & connection)
stream = connection.GetMediaStream (OpalMediaType::Audio (), false);
if (stream != NULL) {
- session = PDownCast (OpalRTPConnection, &connection)->GetSession (stream->GetSessionID ());
+ session = (OpalRTPSession*)PDownCast (OpalRTPConnection, &connection)->GetMediaSession
(stream->GetSessionID ());
if (session) {
session->SetIgnorePayloadTypeChanges (TRUE);
@@ -377,7 +374,7 @@ Opal::Call::OnEstablished (OpalConnection & connection)
stream = connection.GetMediaStream (OpalMediaType::Video (), false);
if (stream != NULL) {
- session = PDownCast (OpalRTPConnection, &connection)->GetSession (stream->GetSessionID ());
+ session = (OpalRTPSession*)PDownCast (OpalRTPConnection, &connection)->GetMediaSession
(stream->GetSessionID ());
if (session) {
session->SetIgnorePayloadTypeChanges (TRUE);
@@ -587,8 +584,8 @@ Opal::Call::OnClosedMediaStream (OpalMediaStream & stream)
void
-Opal::Call::OnRTPStatistics (const OpalConnection & /* connection */,
- const RTP_Session & session)
+Opal::Call::OnRTPStatistics2 (const OpalConnection & /* connection */,
+ const OpalRTPSession & session)
{
PWaitAndSignal m(stats_mutex); // The stats are computed from two different threads
diff --git a/lib/engine/components/opal/opal-call.h b/lib/engine/components/opal/opal-call.h
index 3c4c8f0..cd05cdb 100644
--- a/lib/engine/components/opal/opal-call.h
+++ b/lib/engine/components/opal/opal-call.h
@@ -37,6 +37,7 @@
#include <opal/opal.h>
#include <opal/call.h>
+#include <ep/pcss.h>
#include "call.h"
@@ -177,7 +178,7 @@ public:
void OnClosedMediaStream (OpalMediaStream & stream);
- void OnRTPStatistics (const OpalConnection & connection, const RTP_Session & session);
+ void OnRTPStatistics2 (const OpalConnection & connection, const OpalRTPSession & session);
void DoSetUp (OpalConnection & connection);
diff --git a/lib/engine/components/opal/opal-plugins-hook.cpp
b/lib/engine/components/opal/opal-plugins-hook.cpp
index 3c4953a..e543169 100644
--- a/lib/engine/components/opal/opal-plugins-hook.cpp
+++ b/lib/engine/components/opal/opal-plugins-hook.cpp
@@ -145,6 +145,7 @@ static boost::shared_ptr<PVideoOutputDevice_EKIGA_PluginServiceDescriptor> video
void
hook_ekiga_plugins_to_opal (Ekiga::ServiceCore& core)
{
+ /*
audio = boost::shared_ptr<PSoundChannel_EKIGA_PluginServiceDescriptor> (new
PSoundChannel_EKIGA_PluginServiceDescriptor (core));
videoinput = boost::shared_ptr<PVideoInputDevice_EKIGA_PluginServiceDescriptor> (new
PVideoInputDevice_EKIGA_PluginServiceDescriptor (core));
videooutput = boost::shared_ptr<PVideoOutputDevice_EKIGA_PluginServiceDescriptor> (new
PVideoOutputDevice_EKIGA_PluginServiceDescriptor (core));
@@ -155,4 +156,5 @@ hook_ekiga_plugins_to_opal (Ekiga::ServiceCore& core)
videoinput.get ());
PPluginManager::GetPluginManager().RegisterService ("EKIGA", "PVideoOutputDevice",
videooutput.get ());
+ */
}
diff --git a/lib/engine/components/opal/opal-videoinput.cpp b/lib/engine/components/opal/opal-videoinput.cpp
index 66e0e40..685c502 100644
--- a/lib/engine/components/opal/opal-videoinput.cpp
+++ b/lib/engine/components/opal/opal-videoinput.cpp
@@ -236,7 +236,7 @@ PVideoInputDevice_EKIGA::GetFrameSizeLimits (unsigned & minWidth,
return true;
}
-
+/*
bool PVideoInputDevice_EKIGA::GetParameters (int *whiteness,
int *brightness,
int *colour,
@@ -251,3 +251,4 @@ bool PVideoInputDevice_EKIGA::GetParameters (int *whiteness,
return true;
}
+*/
\ No newline at end of file
diff --git a/lib/engine/components/opal/opal-videoinput.h b/lib/engine/components/opal/opal-videoinput.h
index 6e3d9b2..9ed26e4 100644
--- a/lib/engine/components/opal/opal-videoinput.h
+++ b/lib/engine/components/opal/opal-videoinput.h
@@ -169,12 +169,12 @@ class PVideoInputDevice_EKIGA : public PVideoInputDevice
unsigned &maxWidth,
unsigned &maxHeight);
- virtual bool GetParameters (int *whiteness,
+ /*virtual bool GetParameters (int *whiteness,
int *brightness,
int *colour,
int *contrast,
int *hue);
-
+ */
virtual PStringArray GetDeviceNames() const;
diff --git a/lib/engine/components/opal/pcss-endpoint.h b/lib/engine/components/opal/pcss-endpoint.h
index a4660d1..8d2d0fb 100644
--- a/lib/engine/components/opal/pcss-endpoint.h
+++ b/lib/engine/components/opal/pcss-endpoint.h
@@ -42,7 +42,7 @@
#include "services.h"
#include <opal/opal.h>
-#include <opal/pcss.h>
+#include <ep/pcss.h>
namespace Opal {
class CallManager;
diff --git a/lib/engine/components/opal/sip-endpoint.cpp b/lib/engine/components/opal/sip-endpoint.cpp
index 9b485d9..179c072 100644
--- a/lib/engine/components/opal/sip-endpoint.cpp
+++ b/lib/engine/components/opal/sip-endpoint.cpp
@@ -142,7 +142,7 @@ Opal::Sip::EndPoint::EndPoint (Opal::CallManager & _manager,
manager.AddRouteEntry("pc:.* = sip:<da>");
/* NAT Binding */
- SetNATBindingRefreshMethod (SIPEndPoint::Options);
+ SetNATBindingRefreshMethod (KeepAliveByOPTION);
settings = boost::shared_ptr<Ekiga::Settings> (new Ekiga::Settings (SIP_SCHEMA));
settings->changed.connect (boost::bind (&EndPoint::setup, this, _1));
@@ -201,8 +201,7 @@ Opal::Sip::EndPoint::send_message (const std::string & _uri,
if (!_uri.empty () && (_uri.find ("sip:") == 0 || _uri.find (':') == string::npos) && iter != payload.end
()) {
OpalIM im;
im.m_to = PURL (_uri);
- im.m_mimeType = "text/plain;charset=UTF-8";
- im.m_body = iter->second;
+ im.m_bodies.SetAt (PMIMEInfo::TextPlain(), iter->second);
Message (im);
return true;
}
@@ -445,19 +444,13 @@ Opal::Sip::EndPoint::Register (const std::string username,
unsigned timeout)
{
PString _aor;
- std::stringstream aor;
std::string host(host_);
std::string::size_type loc = host.find (":", 0);
if (loc != std::string::npos)
host = host.substr (0, loc);
- if (username.find ("@") == std::string::npos)
- aor << username << "@" << host;
- else
- aor << username;
-
SIPRegister::Params params;
- params.m_addressOfRecord = PString (aor.str ());
+ params.m_addressOfRecord = PString (username);
params.m_registrarAddress = PString (host_);
params.m_compatibility = compat_mode;
params.m_authID = auth_username;
@@ -466,14 +459,14 @@ Opal::Sip::EndPoint::Register (const std::string username,
params.m_minRetryTime = PMaxTimeInterval; // use default value
params.m_maxRetryTime = PMaxTimeInterval; // use default value
- // Register the given aor to the give registrar
+ // Register the given aor to the given registrar
if (!SIPEndPoint::Register (params, _aor)) {
SIPEndPoint::RegistrationStatus status;
status.m_wasRegistering = true;
status.m_reRegistering = false;
status.m_userData = NULL;
status.m_reason = SIP_PDU::Local_TransportError;
- status.m_addressofRecord = PString (aor.str ());
+ status.m_addressofRecord = PString (username);
OnRegistrationStatus (status);
}
@@ -795,8 +788,7 @@ Opal::Sip::EndPoint::OnIncomingConnection (OpalConnection &connection,
bool
-Opal::Sip::EndPoint::OnReceivedMESSAGE (OpalTransport & transport,
- SIP_PDU & pdu)
+Opal::Sip::EndPoint::OnReceivedMESSAGE (SIP_PDU & pdu)
{
if (pdu.GetMIME().GetContentType(false) != "text/plain")
return false; // Ignore what we do not handle.
@@ -825,7 +817,7 @@ Opal::Sip::EndPoint::OnReceivedMESSAGE (OpalTransport & transport,
Ekiga::Runtime::run_in_main (boost::bind (&Opal::Sip::EndPoint::push_message_in_main, this, message_uri,
msg));
- return SIPEndPoint::OnReceivedMESSAGE (transport, pdu);
+ return SIPEndPoint::OnReceivedMESSAGE (pdu);
}
@@ -848,7 +840,7 @@ Opal::Sip::EndPoint::OnMESSAGECompleted (const SIPMessage::Params & params,
if (reason == SIP_PDU::Failure_TemporarilyUnavailable)
reason_shown += _("user offline");
else
- reason_shown += SIP_PDU::GetStatusCodeDescription (reason); // too many to translate them with _()...
+ reason_shown += SIP_PDU::GetStatusCodeDescription (reason).operator std::string (); // too many to
translate them with _()...
Ekiga::Message::payload_type payload;
// FIXME: we push as 'text/plain' without really knowing...
payload.insert (std::make_pair ("text/plain", reason_shown));
@@ -873,7 +865,7 @@ Opal::Sip::EndPoint::GetRegisteredPartyName (const SIPURL & aor,
return local_aor.c_str ();
// as a last resort, use the local address
- return GetDefaultRegisteredPartyName (transport);
+ return GetDefaultLocalURL (transport);
}
diff --git a/lib/engine/components/opal/sip-endpoint.h b/lib/engine/components/opal/sip-endpoint.h
index 2850260..a25745b 100644
--- a/lib/engine/components/opal/sip-endpoint.h
+++ b/lib/engine/components/opal/sip-endpoint.h
@@ -157,8 +157,7 @@ namespace Opal {
void OnDialogInfoReceived (const SIPDialogNotification & info);
- bool OnReceivedMESSAGE (OpalTransport & transport,
- SIP_PDU & pdu);
+ bool OnReceivedMESSAGE (SIP_PDU & pdu);
void OnMESSAGECompleted (const SIPMessage::Params & params,
SIP_PDU::StatusCodes reason);
diff --git a/lib/engine/components/ptlib/videoinput-manager-ptlib.cpp
b/lib/engine/components/ptlib/videoinput-manager-ptlib.cpp
index 2e7200a..24520f4 100644
--- a/lib/engine/components/ptlib/videoinput-manager-ptlib.cpp
+++ b/lib/engine/components/ptlib/videoinput-manager-ptlib.cpp
@@ -141,15 +141,15 @@ bool GMVideoInputManager_ptlib::open (unsigned width, unsigned height, unsigned
return false;
}
- int whiteness, brightness, colour, contrast, hue;
- input_device->GetParameters (&whiteness, &brightness, &colour, &contrast, &hue);
+ struct PVideoDevice::Attributes attr;
+ input_device->GetAttributes (attr);
current_state.opened = true;
Ekiga::VideoInputSettings settings;
- settings.whiteness = whiteness >> 8;
- settings.brightness = brightness >> 8;
- settings.colour = colour >> 8;
- settings.contrast = contrast >> 8;
+ settings.whiteness = attr.m_gamma >> 8;
+ settings.brightness = attr.m_brightness >> 8;
+ settings.colour = attr.m_saturation >> 8;
+ settings.contrast = attr.m_contrast >> 8;
settings.modifyable = true;
Ekiga::Runtime::run_in_main (boost::bind (&GMVideoInputManager_ptlib::device_opened_in_main, this,
current_state.device, settings));
@@ -190,29 +190,45 @@ bool GMVideoInputManager_ptlib::get_frame_data (char *data)
void GMVideoInputManager_ptlib::set_colour (unsigned colour)
{
PTRACE(4, "GMVideoInputManager_ptlib\tSetting colour to " << colour);
- if (input_device)
- input_device->SetColour(colour << 8);
+ if (input_device) {
+ struct PVideoDevice::Attributes attr;
+ input_device->GetAttributes (attr);
+ attr.m_saturation = colour << 8;
+ input_device->SetAttributes (attr);
+ }
}
void GMVideoInputManager_ptlib::set_brightness (unsigned brightness)
{
PTRACE(4, "GMVideoInputManager_ptlib\tSetting brightness to " << brightness);
- if (input_device)
- input_device->SetBrightness(brightness << 8);
+ if (input_device) {
+ struct PVideoDevice::Attributes attr;
+ input_device->GetAttributes (attr);
+ attr.m_brightness = brightness << 8;
+ input_device->SetAttributes (attr);
+ }
}
void GMVideoInputManager_ptlib::set_whiteness (unsigned whiteness)
{
PTRACE(4, "GMVideoInputManager_ptlib\tSetting whiteness to " << whiteness);
- if (input_device)
- input_device->SetWhiteness(whiteness << 8);
+ if (input_device) {
+ struct PVideoDevice::Attributes attr;
+ input_device->GetAttributes (attr);
+ attr.m_gamma = whiteness << 8;
+ input_device->SetAttributes (attr);
+ }
}
void GMVideoInputManager_ptlib::set_contrast (unsigned contrast)
{
PTRACE(4, "GMVideoInputManager_ptlib\tSetting contrast to " << contrast);
- if (input_device)
- input_device->SetContrast(contrast << 8);
+ if (input_device) {
+ struct PVideoDevice::Attributes attr;
+ input_device->GetAttributes (attr);
+ attr.m_contrast = contrast << 8;
+ input_device->SetAttributes (attr);
+ }
}
bool GMVideoInputManager_ptlib::has_device(const std::string & source, const std::string & device_name,
unsigned capabilities, Ekiga::VideoInputDevice & device)
diff --git a/src/main.cpp b/src/main.cpp
index 8ea6409..cf3ffb7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -41,7 +41,7 @@
#include <glib/gi18n.h>
-#include <opal/buildopts.h> // only for OPAL_VERSION!
+#include <opal/opal_config.h> // only for OPAL_VERSION!
#ifdef HAVE_DBUS
#include "dbus-helper/dbus.h"
diff --git a/win32/plugin-gconst.cpp b/win32/plugin-gconst.cpp
index 4063ca8..9bffc1c 100644
--- a/win32/plugin-gconst.cpp
+++ b/win32/plugin-gconst.cpp
@@ -3,5 +3,5 @@
extern PPlugin_##serviceType##_##serviceName##_Registration
PPlugin_##serviceType##_##serviceName##_Registration_Instance; \
PPlugin_##serviceType##_##serviceName##_Registration const
*PPlugin_##serviceType##_##serviceName##_Registration_Static_Library_Loader =
&PPlugin_##serviceType##_##serviceName##_Registration_Instance;
-PPLUGIN_STATIC_LOAD(WindowsMultimedia, PSoundChannel);
-PPLUGIN_STATIC_LOAD(DirectShow, PVideoInputDevice);
+//PPLUGIN_STATIC_LOAD(WindowsMultimedia, PSoundChannel);
+//PPLUGIN_STATIC_LOAD(DirectShow, PVideoInputDevice);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]