[ekiga] Opal: Create the Bank when the Manager is ready.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Opal: Create the Bank when the Manager is ready.
- Date: Sun, 25 Jan 2015 16:40:01 +0000 (UTC)
commit f74fdbc394151efea0abb8ea1c57b319e34e033e
Author: Damien Sandras <dsandras seconix com>
Date: Sun Jan 25 16:54:00 2015 +0100
Opal: Create the Bank when the Manager is ready.
lib/engine/components/opal/opal-process.cpp | 44 ++++++++++++++++++++++-----
lib/engine/components/opal/opal-process.h | 8 +++++
2 files changed, 44 insertions(+), 8 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-process.cpp b/lib/engine/components/opal/opal-process.cpp
index 841f814..5c7ccf3 100644
--- a/lib/engine/components/opal/opal-process.cpp
+++ b/lib/engine/components/opal/opal-process.cpp
@@ -57,6 +57,10 @@ GnomeMeeting::GnomeMeeting (Ekiga::ServiceCore& _core)
GnomeMeeting::~GnomeMeeting ()
{
+ std::cout << "PPROCESS END Start" << std::endl << std::flush;
+ std::cout << "bank use count" << bank.use_count () << std::endl << std::flush;
+ std::cout << "call manager use count" << call_manager.use_count () << std::endl << std::flush;
+
boost::shared_ptr<Ekiga::AccountCore> acore = account_core.lock ();
// First remove all Opal::Accounts from our Bank.
//
@@ -75,6 +79,11 @@ GnomeMeeting::~GnomeMeeting ()
boost::shared_ptr<Ekiga::CallCore> ccore = call_core.lock ();
ccore->remove_manager (call_manager);
+
+ std::cout << "bank use count" << bank.use_count () << std::endl << std::flush;
+ std::cout << "call manager use count" << call_manager.use_count () << std::endl << std::flush;
+
+ std::cout << "PPROCESS END END" << std::endl << std::flush;
}
GnomeMeeting *
@@ -92,21 +101,40 @@ void GnomeMeeting::Main ()
void GnomeMeeting::Start ()
{
call_core = boost::weak_ptr<Ekiga::CallCore> (core.get<Ekiga::CallCore> ("call-core"));
+
+ boost::shared_ptr<Ekiga::CallCore> ccore = call_core.lock ();
+ call_manager = boost::shared_ptr<Opal::CallManager> (new Opal::CallManager (core));
+ ccore->add_manager (call_manager);
+
+ call_manager->ready.connect (boost::bind (&GnomeMeeting::on_ready, this,
+#ifdef HAVE_H323
+ (Opal::H323::EndPoint*) call_manager->FindEndPoint ("h323"),
+#endif
+ (Opal::Sip::EndPoint*) call_manager->FindEndPoint ("sip")));
+
+ call_manager->setup ();
+}
+
+
+void GnomeMeeting::on_ready (
+#ifdef HAVE_H323
+ Opal::H323::EndPoint* h323_endpoint,
+#endif
+ Opal::Sip::EndPoint* sip_endpoint)
+{
presence_core = boost::weak_ptr<Ekiga::PresenceCore> (core.get<Ekiga::PresenceCore> ("presence-core"));
account_core = boost::weak_ptr<Ekiga::AccountCore> (core.get<Ekiga::AccountCore> ("account-core"));
+ bank = boost::shared_ptr<Opal::Bank> (new Opal::Bank (core,
+#ifdef HAVE_H323
+ h323_endpoint,
+#endif
+ sip_endpoint));
+
boost::shared_ptr<Ekiga::AccountCore> acore = account_core.lock ();
boost::shared_ptr<Ekiga::PresenceCore> pcore = presence_core.lock ();
- boost::shared_ptr<Ekiga::CallCore> ccore = call_core.lock ();
-
- call_manager = boost::shared_ptr<Opal::CallManager> (new Opal::CallManager (core));
- bank = boost::shared_ptr<Opal::Bank> (new Opal::Bank (core,
- (Opal::H323::EndPoint*) call_manager->FindEndPoint
("h323"),
- (Opal::Sip::EndPoint*) call_manager->FindEndPoint
("sip")));
acore->add_bank (bank);
pcore->add_cluster (bank);
core.add (bank);
- ccore->add_manager (call_manager);
- call_manager->setup ();
pcore->add_presence_publisher (bank);
}
diff --git a/lib/engine/components/opal/opal-process.h b/lib/engine/components/opal/opal-process.h
index 3b9cfb8..37d3831 100644
--- a/lib/engine/components/opal/opal-process.h
+++ b/lib/engine/components/opal/opal-process.h
@@ -40,6 +40,8 @@
#ifndef __EKIGA_H__
#define __EKIGA_H__
+#include "config.h"
+
#include <ptlib.h>
#include <ptlib/pprocess.h>
@@ -75,6 +77,12 @@ class GnomeMeeting : public PProcess
private:
+ void on_ready (
+#ifdef HAVE_H323
+ Opal::H323::EndPoint* h323_endpoint,
+#endif
+ Opal::Sip::EndPoint* sip_endpoint);
+
static GnomeMeeting *GM;
boost::shared_ptr<Opal::CallManager> call_manager;
boost::shared_ptr<Opal::Bank> bank;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]