[asterisk-scf-commits] asterisk-scf/release/media_rtp_pjmedia.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Mon Jan 24 18:21:49 CST 2011
branch "master" has been updated
via 10846d9c15bc3a12ee211d00616d9c55e2a09a38 (commit)
via dcf83d9551f609836ba0cce86bd5dbb07e371541 (commit)
via a36a1c558a7d563e4ac69db343103cf2ebb29cda (commit)
via 486c8f5bec883c8f01a3a933aa5cdce1aff12bdd (commit)
via c6c8e75f37eaecb2e1dceb97c21b6d58b6af4463 (commit)
via 4fa74bfce6ca302972f471447269c56e6075d660 (commit)
via 0e966793b9a8f559cb960257496c8f55d541184e (commit)
via 4db1e9d8314a3ad95c24446a99133cd005f2362f (commit)
via c42bb2fae80b489275b969b2a7f14151866b0edb (commit)
via a49aa9de79867fc8af7c3e979b390937fb33f2c4 (commit)
via 8053dab526443105e44d902ab795a8252834d1fe (commit)
via c3f55bb7a358def51806d8bb5b06e9eefbd58500 (commit)
via 2dfff43d9914d8a460f57a4b863dcf6fe6d844aa (commit)
via 52c0c047c82d57d96aef6cfc702cd0188eb3e3b3 (commit)
via d5c54a40116c2aaaae4e7e64dacc3e87b195caf7 (commit)
via c0149a1e38ae531627f2cea10694b56aad2b3101 (commit)
via ae2059616aaddb371357469ea953584c38ff2290 (commit)
via 42664ea659fed952baa5968da29d8da5cbe51eef (commit)
via 59bd7af369b179b4c6135d92ac7876d992402571 (commit)
via 346b63d3c7a0621691dd6dcb33c0d9e6067b4845 (commit)
via 6534181ea193e0e6c614ea14a71f10c84cbeed5a (commit)
via 160856a3f0f05b6f23580f7f591d638510012775 (commit)
via e16ddb6f9a4951516501ab16aa305f8d09dc88aa (commit)
via 3780d6e57b210e6aac21c29de3b77ea757c416a3 (commit)
via f7c52d1d025e2d08634d593567ef72c21effa69e (commit)
via c19ee91ad54021f1842572f83640587604aa4266 (commit)
via c4eeea22d39f6cd45aec0390d8c80b30f82cf21e (commit)
via 290ce3eb5f17c72163efaed78152213c9a5473f6 (commit)
via 32737285dafb66a5e9040f883204da51017d2498 (commit)
via fa399cca8fa1687c155e2513a27cffffe435192a (commit)
via 1d3fefe487649815ea6ee8893a5069bf53f06193 (commit)
via 7eacee9b505a41ed7e853abb2649e36edb5f75b8 (commit)
via dfff07e4c5f76afe413a808f40a7a75b05849a63 (commit)
via 06d305056bfc53aaecc01ea3d65227ad2f124733 (commit)
via dea398070f3c13f96d6cffac05552b01e0314fc2 (commit)
from 7a004be53942d4c1880a49076eb03db0a0b24a90 (commit)
Summary of changes:
config/test_component.config.in | 18 ++-
config/test_media_rtp_pjmedia.conf | 4 +-
local-slice/RtpStateReplicationIf.ice | 106 ++++++++++++++
src/CMakeLists.txt | 31 ++++
src/MediaRTPpjmedia.cpp | 229 +++++++++++++++++++++++++++----
src/RTPSession.cpp | 191 ++++++++++++++++++++++++--
src/RTPSession.h | 28 ++++-
src/RTPSink.cpp | 60 ++++++---
src/RTPSink.h | 3 +-
src/RTPSource.cpp | 41 +++++-
src/RTPSource.h | 8 +-
src/RtpStateReplicator.h | 40 ++++++
src/RtpStateReplicatorApp.cpp | 232 +++++++++++++++++++++++++++++++
src/RtpStateReplicatorListener.cpp | 151 ++++++++++++++++++++
test/CMakeLists.txt | 3 +
test/TestRTPpjmedia.cpp | 244 ++++++++++++++++++++++++++++++++-
16 files changed, 1301 insertions(+), 88 deletions(-)
create mode 100644 local-slice/RtpStateReplicationIf.ice
create mode 100644 src/RtpStateReplicator.h
create mode 100644 src/RtpStateReplicatorApp.cpp
create mode 100644 src/RtpStateReplicatorListener.cpp
- Log -----------------------------------------------------------------
commit 10846d9c15bc3a12ee211d00616d9c55e2a09a38
Merge: 7a004be dcf83d9
Author: Joshua Colp <jcolp at digium.com>
Date: Mon Jan 24 20:18:34 2011 -0400
Add support for RTP component replication.
diff --cc src/CMakeLists.txt
index c0244c5,fa8662e..ccabce8
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@@ -29,5 -38,25 +38,27 @@@ pjproject_link(media_rtp_pjmedia pjlib
pjproject_link(media_rtp_pjmedia pjlib-util)
pjproject_link(media_rtp_pjmedia pjmedia)
pjproject_link(media_rtp_pjmedia pjnath)
-#asterisk_scf_component_install(media_rtp_pjmedia RUNTIME bin "pjmedia RTP Media." Media)
+
+asterisk_scf_component_install(media_rtp_pjmedia)
+
+ asterisk_scf_component_init(RtpStateReplicator CXX)
+
+ #This line allows us to use the templated state replicator
+ #code. This statement is not the most permanent of changes
+ #and assumes the directories are structured in the way that
+ #gitall structures them.
+ include_directories(${utils_dir}/StateReplicator/include)
+ include_directories(${utils_dir}/SmartProxy/include)
+ include_directories(${API_INCLUDE_DIR})
+
+ asterisk_scf_component_add_file(RtpStateReplicator RtpStateReplicatorApp.cpp)
+ asterisk_scf_component_add_file(RtpStateReplicator RtpStateReplicator.h)
+ asterisk_scf_component_add_slice(RtpStateReplicator ../local-slice/RtpStateReplicationIf.ice)
+
+ asterisk_scf_component_add_ice_libraries(RtpStateReplicator IceStorm)
+
+ asterisk_scf_component_add_boost_libraries(RtpStateReplicator thread date_time)
+
+ asterisk_scf_component_build_icebox(RtpStateReplicator)
-target_link_libraries(RtpStateReplicator logging-client)
++
++asterisk_scf_component_install(RtpStateReplicator)
commit dcf83d9551f609836ba0cce86bd5dbb07e371541
Author: Joshua Colp <jcolp at digium.com>
Date: Sun Jan 23 18:00:01 2011 -0400
Instead of using a sleep use a boost mutex lock and condition for signaling.
diff --git a/test/TestRTPpjmedia.cpp b/test/TestRTPpjmedia.cpp
index 2d87f8c..3b7cb2a 100644
--- a/test/TestRTPpjmedia.cpp
+++ b/test/TestRTPpjmedia.cpp
@@ -19,6 +19,8 @@
#include <boost/test/unit_test.hpp>
#include <boost/test/debug.hpp>
#include <boost/thread/thread.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/condition.hpp>
#include <Ice/Ice.h>
#include <IceBox/IceBox.h>
@@ -69,49 +71,6 @@ public:
typedef IceUtil::Handle<TestRtpReplicatorListener> TestRtpReplicatorListenerPtr;
-void TestRtpReplicatorListener::stateRemoved(const Ice::StringSeq& items, const Ice::Current&)
-{
-}
-
-void TestRtpReplicatorListener::stateSet(const RtpStateItemSeq& items, const Ice::Current&)
-{
- class visitor : public AsteriskSCF::Media::RTP::V1::RtpStateItemVisitor
- {
- public:
- visitor(TestRtpReplicatorListener *listener) : listener(listener)
- {
- }
-
- private:
- TestRtpReplicatorListener *listener;
-
- void visitGeneral(const RtpGeneralStateItemPtr &item, const Ice::Current &)
- {
- listener->mGeneral = item;
- }
-
- void visitSession(const RtpSessionStateItemPtr &item, const Ice::Current &)
- {
- listener->mSession = item;
- }
-
- void visitStreamSink(const RtpStreamSinkStateItemPtr &item, const Ice::Current &)
- {
- listener->mSink = item;
- }
-
- void visitStreamSource(const RtpStreamSourceStateItemPtr &item, const Ice::Current &)
- {
- listener->mSource = item;
- }
- } v(this);
-
- for (RtpStateItemSeq::const_iterator item = items.begin(); item != items.end(); ++item)
- {
- (*item)->visit(&v);
- }
-}
-
/**
* It seems odd that boost doesn't provide an easy way to access the GLOBAL_FIXTURE members.
* But it doesn't seem to, so I'm sharing global setup stuff here.
@@ -163,9 +122,71 @@ public:
* A sequence containing frames received via RTP.
*/
FrameSeq frames;
+
+ /**
+ * Lock to be used with the below condition, for when we get state information.
+ */
+ boost::mutex mLock;
+
+ /**
+ * Condition used to signal test thread that state was set.
+ */
+ boost::condition mCondition;
};
static SharedTestData Testbed;
+void TestRtpReplicatorListener::stateRemoved(const Ice::StringSeq& items, const Ice::Current&)
+{
+}
+
+void TestRtpReplicatorListener::stateSet(const RtpStateItemSeq& items, const Ice::Current&)
+{
+ class visitor : public AsteriskSCF::Media::RTP::V1::RtpStateItemVisitor
+ {
+ public:
+ visitor(TestRtpReplicatorListener *listener) : listener(listener)
+ {
+ }
+
+ private:
+ TestRtpReplicatorListener *listener;
+
+ void visitGeneral(const RtpGeneralStateItemPtr &item, const Ice::Current &)
+ {
+ listener->mGeneral = item;
+ boost::mutex::scoped_lock lock(Testbed.mLock);
+ Testbed.mCondition.notify_one();
+ }
+
+ void visitSession(const RtpSessionStateItemPtr &item, const Ice::Current &)
+ {
+ listener->mSession = item;
+ boost::mutex::scoped_lock lock(Testbed.mLock);
+ Testbed.mCondition.notify_one();
+ }
+
+ void visitStreamSink(const RtpStreamSinkStateItemPtr &item, const Ice::Current &)
+ {
+ listener->mSink = item;
+ boost::mutex::scoped_lock lock(Testbed.mLock);
+ Testbed.mCondition.notify_one();
+ }
+
+ void visitStreamSource(const RtpStreamSourceStateItemPtr &item, const Ice::Current &)
+ {
+ listener->mSource = item;
+ boost::mutex::scoped_lock lock(Testbed.mLock);
+ Testbed.mCondition.notify_one();
+ }
+ } v(this);
+
+ for (RtpStateItemSeq::const_iterator item = items.begin(); item != items.end(); ++item)
+ {
+ (*item)->visit(&v);
+ }
+}
+
+
class TestStreamSink : public StreamSink
{
public:
@@ -175,6 +196,8 @@ public:
void write(const AsteriskSCF::Media::V1::FrameSeq& frames, const Ice::Current&)
{
Testbed.frames = frames;
+ boost::mutex::scoped_lock lock(Testbed.mLock);
+ Testbed.mCondition.notify_one();
}
/**
@@ -363,7 +386,8 @@ BOOST_AUTO_TEST_CASE(AddListenertoStateReplicator)
BOOST_AUTO_TEST_CASE(CheckReplicatedGeneralStateItem)
{
// Since the RTP component is using a oneway invocation we wait here to ensure that the packet has been sent and processed
- boost::this_thread::sleep(boost::posix_time::seconds(1));
+ boost::mutex::scoped_lock lock(Testbed.mLock);
+ Testbed.mCondition.wait(lock);
BOOST_CHECK(Testbed.mListener->mGeneral);
}
@@ -392,7 +416,8 @@ BOOST_AUTO_TEST_CASE(AllocateRTPSession)
Testbed.session = service->allocate(formats);
// Give the RTP component time to replicate this session
- boost::this_thread::sleep(boost::posix_time::seconds(1));
+ boost::mutex::scoped_lock lock(Testbed.mLock);
+ Testbed.mCondition.wait(lock);
allocated = true;
}
@@ -753,7 +778,8 @@ BOOST_AUTO_TEST_CASE(SetupLoopback)
looped = true;
- boost::this_thread::sleep(boost::posix_time::seconds(1));
+ boost::mutex::scoped_lock lock(Testbed.mLock);
+ Testbed.mCondition.wait(lock);
}
catch (const Ice::Exception &e)
{
@@ -823,10 +849,10 @@ BOOST_AUTO_TEST_CASE(TransmitandReceiveFrame)
StreamSinkRTPPrx sink = StreamSinkRTPPrx::uncheckedCast(sinks.front());
sink->write(frames);
- /* In order to have the packet get sent and received we need to introduce a delay here, thus
- * why it exists.
+ /* It takes time for the packet to get sent and received so we wait until we get it here.
*/
- boost::this_thread::sleep(boost::posix_time::seconds(1));
+ boost::mutex::scoped_lock lock(Testbed.mLock);
+ Testbed.mCondition.wait(lock);
/* We only sent a single frame, so we should only get a single frame. */
AudioFramePtr received_frame;
commit a36a1c558a7d563e4ac69db343103cf2ebb29cda
Merge: c6c8e75 486c8f5
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Wed Jan 19 16:53:21 2011 -0600
Merge branch 'replication' into replication-visitor
Conflicts:
local-slice/CMakeLists.txt
commit 486c8f5bec883c8f01a3a933aa5cdce1aff12bdd
Merge: 4fa74bf 68adbce
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Wed Jan 19 16:48:56 2011 -0600
Merge branch 'master' into replication
Conflicts:
src/CMakeLists.txt
src/MediaRTPpjmedia.cpp
src/RTPSession.cpp
src/RTPSink.cpp
src/RTPSource.cpp
test/CMakeLists.txt
test/TestRTPpjmedia.cpp
diff --cc local-slice/RtpStateReplicationIf.ice
index b449ee5,0000000..bd04de3
mode 100644,000000..100644
--- a/local-slice/RtpStateReplicationIf.ice
+++ b/local-slice/RtpStateReplicationIf.ice
@@@ -1,102 -1,0 +1,103 @@@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+#include <Ice/BuiltinSequences.ice>
+#include <Ice/Identity.ice>
- #include "Media/MediaIf.ice"
- #include "Media/RTP/MediaRTPIf.ice"
- #include "Core/Discovery/ServiceLocatorIf.ice"
++
++#include <AsteriskSCF/Media/MediaIf.ice>
++#include <AsteriskSCF/Media/RTP/MediaRTPIf.ice>
++#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.ice>
+
+module AsteriskSCF
+{
+
+module Media
+{
+
+module RTP
+{
+
+["suppress"]
+module V1
+{
+ const string StateReplicatorComponentCategory = "RtpStateReplicatorComponent";
+ const string StateReplicatorDiscoveryCategory = "RtpStateReplicator";
+
+ class RtpStateReplicatorParams extends AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams
+ {
+ string mName;
+ };
+
+ class RtpStateItem
+ {
+ string key;
+ string mSessionId;
+ };
+
+ sequence<RtpStateItem> RtpStateItemSeq;
+
+ interface RtpStateReplicatorListener
+ {
+ void stateRemoved(Ice::StringSeq itemKeys);
+ void stateSet(RtpStateItemSeq items);
+ };
+
+ interface RtpStateReplicator
+ {
+ void addListener(RtpStateReplicatorListener *listener);
+ void removeListener(RtpStateReplicatorListener *listener);
+ void setState (RtpStateItemSeq items);
+ void removeState(Ice::StringSeq items);
+ idempotent RtpStateItemSeq getState(Ice::StringSeq itemKeys);
+ idempotent RtpStateItemSeq getAllState();
+ };
+
+ class RtpGeneralStateItem extends RtpStateItem
+ {
+ AsteriskSCF::Core::Discovery::V1::ServiceManagement *mServiceManagement;
+ };
+
+ class RtpSessionStateItem extends RtpStateItem
+ {
+ Ice::Identity mSessionIdentity;
+ int mPort;
+ Ice::Identity mSinkIdentity;
+ Ice::Identity mSourceIdentity;
+ AsteriskSCF::Media::V1::FormatSeq mFormats;
+ PayloadMap mPayloadstoFormats;
+ };
+
+ class RtpStreamSinkStateItem extends RtpStateItem
+ {
+ AsteriskSCF::Media::V1::StreamSource *mSource;
+ string mRemoteAddress;
+ int mRemotePort;
+ };
+
+ class RtpStreamSourceStateItem extends RtpStateItem
+ {
+ AsteriskSCF::Media::V1::StreamSink *mSink;
+ };
+
+}; //module V1
+
+}; //module RTP
+
+}; //module Media
+
+}; //module Asterisk SCF
diff --cc src/CMakeLists.txt
index f30e2bc,0c7dd07..fa8662e
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@@ -6,17 -6,7 +6,13 @@@
# All rights reserved.
#
+
+include_directories(${utils_dir}/StateReplicator/src)
+include_directories(${utils_dir}/SmartProxy/src)
+
++asterisk_scf_slice_include_directories(${API_SLICE_DIR})
++
asterisk_scf_component_init(media_rtp_pjmedia CXX)
- asterisk_scf_component_add_slice(media_rtp_pjmedia ServiceLocatorIf)
- asterisk_scf_component_add_slice(media_rtp_pjmedia MediaIf)
- asterisk_scf_component_add_slice(media_rtp_pjmedia MediaRTPIf)
- asterisk_scf_component_add_slice(media_rtp_pjmedia ComponentServiceIf)
- asterisk_scf_component_add_slice(media_rtp_pjmedia ReplicaIf)
- asterisk_scf_component_add_slice(media_rtp_pjmedia RtpStateReplicationIf)
asterisk_scf_component_add_file(media_rtp_pjmedia MediaRTPpjmedia.cpp)
asterisk_scf_component_add_file(media_rtp_pjmedia RTPSession.cpp)
asterisk_scf_component_add_file(media_rtp_pjmedia RTPSource.cpp)
@@@ -24,8 -14,6 +20,9 @@@ asterisk_scf_component_add_file(media_r
asterisk_scf_component_add_file(media_rtp_pjmedia RTPSession.h)
asterisk_scf_component_add_file(media_rtp_pjmedia RTPSource.h)
asterisk_scf_component_add_file(media_rtp_pjmedia RTPSink.h)
+asterisk_scf_component_add_file(media_rtp_pjmedia RtpStateReplicatorListener.cpp)
+asterisk_scf_component_add_file(media_rtp_pjmedia RtpStateReplicator.h)
++asterisk_scf_component_add_slice(media_rtp_pjmedia ../local-slice/RtpStateReplicationIf.ice)
asterisk_scf_component_add_boost_libraries(media_rtp_pjmedia core thread)
if(NOT logger_dir)
@@@ -41,21 -30,3 +39,24 @@@ pjproject_link(media_rtp_pjmedia pjlib-
pjproject_link(media_rtp_pjmedia pjmedia)
pjproject_link(media_rtp_pjmedia pjnath)
#asterisk_scf_component_install(media_rtp_pjmedia RUNTIME bin "pjmedia RTP Media." Media)
+
+asterisk_scf_component_init(RtpStateReplicator CXX)
+
- asterisk_scf_component_add_slice(RtpStateReplicator ServiceLocatorIf)
- asterisk_scf_component_add_slice(RtpStateReplicator ComponentServiceIf)
- asterisk_scf_component_add_slice(RtpStateReplicator RtpStateReplicationIf)
- asterisk_scf_component_add_slice(RtpStateReplicator RoutingIf)
- asterisk_scf_component_add_slice(RtpStateReplicator MediaRTPIf)
++#This line allows us to use the templated state replicator
++#code. This statement is not the most permanent of changes
++#and assumes the directories are structured in the way that
++#gitall structures them.
++include_directories(${utils_dir}/StateReplicator/include)
++include_directories(${utils_dir}/SmartProxy/include)
++include_directories(${API_INCLUDE_DIR})
+
+asterisk_scf_component_add_file(RtpStateReplicator RtpStateReplicatorApp.cpp)
+asterisk_scf_component_add_file(RtpStateReplicator RtpStateReplicator.h)
++asterisk_scf_component_add_slice(RtpStateReplicator ../local-slice/RtpStateReplicationIf.ice)
+
+asterisk_scf_component_add_ice_libraries(RtpStateReplicator IceStorm)
+
+asterisk_scf_component_add_boost_libraries(RtpStateReplicator thread date_time)
+
+asterisk_scf_component_build_icebox(RtpStateReplicator)
+target_link_libraries(RtpStateReplicator logging-client)
diff --cc src/MediaRTPpjmedia.cpp
index f770788,6fb92b3..4a1d0ee
--- a/src/MediaRTPpjmedia.cpp
+++ b/src/MediaRTPpjmedia.cpp
@@@ -23,18 -22,14 +23,19 @@@
#include <boost/shared_ptr.hpp>
- #include "Core/Discovery/ServiceLocatorIf.h"
- #include "Media/MediaIf.h"
- #include "Media/RTP/MediaRTPIf.h"
- #include "System/Component/ComponentServiceIf.h"
- #include "IceLogger.h"
- #include "logger.h"
+ #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
+ #include <AsteriskSCF/Media/MediaIf.h>
+ #include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
+ #include <AsteriskSCF/System/Component/ComponentServiceIf.h>
++#include <AsteriskSCF/System/Component/ReplicaIf.h>
+ #include <AsteriskSCF/Logger/IceLogger.h>
+ #include <AsteriskSCF/logger.h>
++#include <AsteriskSCF/SmartProxy.h>
++
+#include "RtpStateReplicationIf.h"
- #include "ReplicaIf.h"
- #include "SmartProxy.h"
#include "RTPSession.h"
+#include "RtpStateReplicator.h"
using namespace std;
using namespace AsteriskSCF::Core::Discovery::V1;
diff --cc src/RTPSession.cpp
index 15633ef,fa6fbf7..5e7f33e
--- a/src/RTPSession.cpp
+++ b/src/RTPSession.cpp
@@@ -20,11 -19,8 +20,12 @@@
#include <pjlib.h>
#include <pjmedia.h>
- #include "Media/MediaIf.h"
- #include "Media/RTP/MediaRTPIf.h"
+ #include <AsteriskSCF/Media/MediaIf.h>
+ #include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
++#include <AsteriskSCF/System/Component/ReplicaIf.h>
++#include <AsteriskSCF/SmartProxy.h>
++
+#include "RtpStateReplicationIf.h"
- #include "ReplicaIf.h"
- #include "SmartProxy.h"
#include "RTPSession.h"
#include "RTPSource.h"
diff --cc src/RTPSink.cpp
index ed63b32,23d7bdd..e20f86d
--- a/src/RTPSink.cpp
+++ b/src/RTPSink.cpp
@@@ -20,11 -19,8 +20,12 @@@
#include <pjlib.h>
#include <pjmedia.h>
- #include "Media/MediaIf.h"
- #include "Media/RTP/MediaRTPIf.h"
+ #include <AsteriskSCF/Media/MediaIf.h>
+ #include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
++#include <AsteriskSCF/System/Component/ReplicaIf.h>
++#include <AsteriskSCF/SmartProxy.h>
++
+#include "RtpStateReplicationIf.h"
- #include "ReplicaIf.h"
- #include "SmartProxy.h"
#include "RTPSession.h"
#include "RTPSink.h"
diff --cc src/RTPSource.cpp
index 9590b6d,7125fb4..39c52e2
--- a/src/RTPSource.cpp
+++ b/src/RTPSource.cpp
@@@ -20,11 -19,9 +20,13 @@@
#include <pjlib.h>
#include <pjmedia.h>
- #include "Media/MediaIf.h"
- #include "Media/RTP/MediaRTPIf.h"
+ #include <AsteriskSCF/Media/MediaIf.h>
+ #include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
+ #include <AsteriskSCF/logger.h>
++#include <AsteriskSCF/System/Component/ReplicaIf.h>
++#include <AsteriskSCF/SmartProxy.h>
++
+#include "RtpStateReplicationIf.h"
- #include "ReplicaIf.h"
- #include "SmartProxy.h"
#include "RTPSession.h"
#include "RTPSource.h"
diff --cc src/RtpStateReplicator.h
index d3bc6c9,0000000..34dc017
mode 100644,000000..100644
--- a/src/RtpStateReplicator.h
+++ b/src/RtpStateReplicator.h
@@@ -1,38 -1,0 +1,40 @@@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+#include <Ice/Ice.h>
++
++#include <AsteriskSCF/StateReplicator.h>
++
+#include "RtpStateReplicationIf.h"
- #include "StateReplicator.h"
+
+using namespace AsteriskSCF::Media::RTP::V1;
+
+typedef AsteriskSCF::StateReplication::StateReplicator<RtpStateReplicator, RtpStateItemPtr, std::string, RtpStateReplicatorListenerPrx> RtpStateReplicatorI;
+typedef IceUtil::Handle<RtpStateReplicatorI> RtpStateReplicatorIPtr;
+
+class RtpStateReplicatorListenerI : public RtpStateReplicatorListener
+{
+public:
+ RtpStateReplicatorListenerI(Ice::ObjectAdapterPtr, pj_pool_factory*, RtpGeneralStateItemPtr);
+ ~RtpStateReplicatorListenerI();
+ void stateRemoved(const Ice::StringSeq&, const Ice::Current&);
+ void stateSet(const RtpStateItemSeq&, const Ice::Current&);
+ bool operator==(RtpStateReplicatorListenerI &rhs);
+private:
+ struct RtpStateReplicatorListenerImpl *mImpl;
+};
diff --cc src/RtpStateReplicatorApp.cpp
index 2b49c1b,0000000..6fa76d9
mode 100644,000000..100644
--- a/src/RtpStateReplicatorApp.cpp
+++ b/src/RtpStateReplicatorApp.cpp
@@@ -1,231 -1,0 +1,232 @@@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#include <Ice/Ice.h>
+#include <IceUtil/UUID.h>
+#include <IceStorm/IceStorm.h>
+#include <IceBox/IceBox.h>
+
+#include <pjlib.h>
+
- #include "ServiceLocatorIf.h"
- #include "ComponentServiceIf.h"
++#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
++#include <AsteriskSCF/System/Component/ComponentServiceIf.h>
++#include <AsteriskSCF/Logger/IceLogger.h>
++#include <AsteriskSCF/logger.h>
++
+#include "RtpStateReplicator.h"
- #include "IceLogger.h"
- #include "logger.h"
+
+using namespace std;
+using namespace AsteriskSCF::Core;
+using namespace AsteriskSCF::Core::Discovery::V1;
+using namespace AsteriskSCF::System::Component::V1;
+using namespace AsteriskSCF::System::Logging;
+using namespace AsteriskSCF::Media::RTP::V1;
+
+namespace
+{
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.MediaRTP");
+}
+
+class RtpStateReplicatorService : public IceBox::Service
+{
+public:
+ RtpStateReplicatorService() { };
+ ~RtpStateReplicatorService()
+ {
+ mComponentService = 0;
+ mAdapter = 0;
+ mStateReplicator = 0;
+ };
+ virtual void start(const string &name, const Ice::CommunicatorPtr& ic, const Ice::StringSeq& args);
+ virtual void stop();
+private:
+ void initialize(std::string appName, const Ice::CommunicatorPtr& ic);
+ void registerWithServiceLocator(const Ice::CommunicatorPtr& ic);
+ void deregisterFromServiceLocator();
+ std::string mAppName;
+ Ice::ObjectAdapterPtr mAdapter;
+ ServiceLocatorManagementPrx mServiceLocatorManagement;
+ Discovery::V1::ServiceManagementPrx mComponentServiceManagement;
+ Discovery::V1::ServiceManagementPrx mStateReplicationManagement;
+ ConfiguredIceLoggerPtr mIceLogger;
+ ComponentServicePtr mComponentService;
+ RtpStateReplicatorIPtr mStateReplicator;
+};
+
+static const string ComponentServiceId("RtpStateReplicatorComponent");
+static const string ServiceDiscoveryId("RtpStateReplicatorService");
+
+/**
+ * This class provides implementation for the ComponentService interface, which
+ * every Asterisk SCF component is expected to publish.
+ */
+class ComponentServiceImpl : public ComponentService
+{
+public:
+ ComponentServiceImpl(RtpStateReplicatorService &service) : mService(service) {}
+
+public: // Overrides of the ComponentService interface.
+ virtual void suspend(const ::Ice::Current& = ::Ice::Current())
+ {
+ // TBD
+ }
+
+ virtual void resume(const ::Ice::Current& = ::Ice::Current())
+ {
+ // TBD
+ }
+
+ virtual void shutdown(const ::Ice::Current& = ::Ice::Current())
+ {
+ // TBD
+ }
+
+private:
+ RtpStateReplicatorService& mService;
+};
+
+class RtpStateReplicatorCompare : public ServiceLocatorParamsCompare
+{
+public:
+ RtpStateReplicatorCompare(string name) : mName(name) {}
+ bool isSupported(const ServiceLocatorParamsPtr ¶ms, const Ice::Current &)
+ {
+ RtpStateReplicatorParamsPtr sipParams = RtpStateReplicatorParamsPtr::dynamicCast(params);
+ if (sipParams->mName == mName)
+ {
+ return true;
+ }
+ return false;
+ }
+private:
+ string mName;
+};
+
+typedef IceUtil::Handle<RtpStateReplicatorCompare> RtpStateReplicatorComparePtr;
+
+/**
+ * Register this component's primary public interfaces with the Service Locator.
+ * This enables other Asterisk SCF components to locate our interfaces.
+ */
+void RtpStateReplicatorService::registerWithServiceLocator(const Ice::CommunicatorPtr& ic)
+{
+ try
+ {
+ // Get a proxy to the management interface for the Service Locator, so we can add ourselves into the system discovery mechanisms.
+ mServiceLocatorManagement = ServiceLocatorManagementPrx::checkedCast(ic->propertyToProxy("LocatorServiceManagement.Proxy"));
+
+ if (mServiceLocatorManagement == 0)
+ {
+ lg(Error) << "Unable to obtain proxy to ServiceLocatorManagement interface. Check config file. This component can't be found until this is corrected." << endl;
+ return;
+ }
+
+ // Get a proxy to our ComponentService interface and add it to the Service Locator.
+ Ice::ObjectPrx componentServiceObjectPrx = mAdapter->createDirectProxy(ic->stringToIdentity(ComponentServiceId));
+ ComponentServicePrx componentServicePrx = ComponentServicePrx::checkedCast(componentServiceObjectPrx);
+
+ // The GUID passed in to add service needs to be unique for reporting.
+ string componentServiceGuid(AsteriskSCF::Media::RTP::V1::StateReplicatorComponentCategory);
+ mComponentServiceManagement = ServiceManagementPrx::uncheckedCast(mServiceLocatorManagement->addService(componentServicePrx, componentServiceGuid));
+
+ // Add category as a parameter to enable other components look this component up.
+ ServiceLocatorParamsPtr genericparams = new ServiceLocatorParams();
+ genericparams->category = AsteriskSCF::Media::RTP::V1::StateReplicatorComponentCategory;
+
+ mComponentServiceManagement->addLocatorParams(genericparams, "");
+
+ Ice::ObjectPrx stateReplicatorObjectPrx = mAdapter->createDirectProxy(ic->stringToIdentity(ServiceDiscoveryId));
+ RtpStateReplicatorPrx stateReplicatorPrx = RtpStateReplicatorPrx::checkedCast(stateReplicatorObjectPrx);
+
+ string stateReplicationGuid(AsteriskSCF::Media::RTP::V1::StateReplicatorDiscoveryCategory);
+ mStateReplicationManagement = ServiceManagementPrx::uncheckedCast(mServiceLocatorManagement->addService(stateReplicatorPrx, stateReplicationGuid));
+
+ ServiceLocatorParamsPtr discoveryParams = new ServiceLocatorParams();
+ discoveryParams->category = AsteriskSCF::Media::RTP::V1::StateReplicatorDiscoveryCategory;
+
+ string replicatorName = ic->getProperties()->getPropertyWithDefault("RtpStateReplicator.Name", "default");
+ RtpStateReplicatorCompare* nameCompare = new RtpStateReplicatorCompare(replicatorName);
+ ServiceLocatorParamsComparePrx compareProxy = ServiceLocatorParamsComparePrx::uncheckedCast(mAdapter->addWithUUID(nameCompare));
+
+ string compareGuid = IceUtil::generateUUID();
+ mServiceLocatorManagement->addCompare(compareGuid, compareProxy);
+ mStateReplicationManagement->addLocatorParams(discoveryParams, compareGuid);
+
+ // TBD... We may have other interfaces to publish to the Service Locator.
+ }
+ catch(...)
+ {
+ lg(Error) << "Exception in " << mAppName << " registerWithServiceLocator()" << endl;
+ }
+}
+
+/**
+ * Deregister this component's primary public interfaces from the Service Locator.
+ * This is done at shutdown, and whenever we want to keep other services from locating
+ * our interfaces.
+ */
+void RtpStateReplicatorService::deregisterFromServiceLocator()
+{
+ try
+ {
+ mComponentServiceManagement->unregister();
+ }
+ catch(...)
+ {
+ lg(Error) << "Had trouble in deregisterFromServiceLocator()." << endl;
+ }
+}
+
+void RtpStateReplicatorService::initialize(const std::string appName, const Ice::CommunicatorPtr& ic)
+{
+ mAdapter = ic->createObjectAdapter("RtpStateReplicator");
+
+ // setup logging client
+ mIceLogger = createIceLogger(mAdapter);
+ getLoggerFactory().setLogOutput(mIceLogger->getLogger());
+
+ mAppName = appName;
+ // Create and publish our ComponentService interface support.
+ mComponentService = new ComponentServiceImpl(*this);
+ mAdapter->add(mComponentService, ic->stringToIdentity(ComponentServiceId));
+ mStateReplicator = new RtpStateReplicatorI();
+ mAdapter->add(mStateReplicator, ic->stringToIdentity(ServiceDiscoveryId));
+
+ mAdapter->activate();
+}
+
+void RtpStateReplicatorService::start(const string &name, const Ice::CommunicatorPtr& ic, const Ice::StringSeq& args)
+{
+ initialize(name, ic);
+ // Plug into the Asterisk SCF discovery system so that the interfaces we provide
+ // can be located.
+ registerWithServiceLocator(ic);
+}
+
+void RtpStateReplicatorService::stop()
+{
+ // Remove our interfaces from the service locator.
+ deregisterFromServiceLocator();
+}
+
+extern "C"
+{
+ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr communicator)
+{
+ return new RtpStateReplicatorService;
+}
+}
+
diff --cc src/RtpStateReplicatorListener.cpp
index f11b9d7,0000000..58da256
mode 100644,000000..100644
--- a/src/RtpStateReplicatorListener.cpp
+++ b/src/RtpStateReplicatorListener.cpp
@@@ -1,151 -1,0 +1,151 @@@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#include <IceUtil/UUID.h>
+
+#include <boost/thread.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include <pjlib.h>
+#include <pjmedia.h>
+
- #include "ReplicaIf.h"
- #include "SmartProxy.h"
++#include <AsteriskSCF/System/Component/ReplicaIf.h>
++#include <AsteriskSCF/SmartProxy.h>
+
+#include "RtpStateReplicator.h"
+#include "RTPSession.h"
+#include "RTPSink.h"
+#include "RTPSource.h"
+
+using namespace AsteriskSCF::Media::RTP::V1;
+
+class RtpStateReplicatorItem
+{
+public:
+ RtpStateReplicatorItem() { }
+ ~RtpStateReplicatorItem()
+ {
+ mSession->release(Ice::Current());
+ }
+
+ // Helper function which sets the session on this replicator item
+ void setSession(RTPSessionImplPtr session) { mSession = session; };
+
+ // Helper function which gets the session
+ RTPSessionImplPtr getSession() { return mSession; };
+
+private:
+ // Pointer to the session that we are managing
+ RTPSessionImplPtr mSession;
+};
+
+struct RtpStateReplicatorListenerImpl
+{
+public:
+ RtpStateReplicatorListenerImpl(Ice::ObjectAdapterPtr adapter, pj_pool_factory *poolFactory, RtpGeneralStateItemPtr generalState)
+ : mId(IceUtil::generateUUID()), mAdapter(adapter), mPoolFactory(poolFactory), mGeneralState(generalState) {}
+ void removeStateNoticeImpl(const Ice::StringSeq& itemKeys)
+ {
+ for (Ice::StringSeq::const_iterator key = itemKeys.begin(); key != itemKeys.end(); ++key)
+ {
+ // Just erasing this from the map will cause the destructor to actually shut things down
+ mStateItems.erase((*key));
+ }
+ }
+ void setStateNoticeImpl(const RtpStateItemSeq& items)
+ {
+ for (RtpStateItemSeq::const_iterator item = items.begin(); item != items.end(); ++item)
+ {
+ std::map<std::string, boost::shared_ptr<RtpStateReplicatorItem> >::iterator i = mStateItems.find((*item)->mSessionId);
+ RtpGeneralStateItemPtr general;
+ RtpSessionStateItemPtr session;
+ RtpStreamSinkStateItemPtr sink;
+ RtpStreamSourceStateItemPtr source;
+ boost::shared_ptr<RtpStateReplicatorItem> localitem;
+
+ if ((general = RtpGeneralStateItemPtr::dynamicCast((*item))))
+ {
+ mGeneralState->mServiceManagement = general->mServiceManagement;
+ }
+ else if ((session = RtpSessionStateItemPtr::dynamicCast((*item))))
+ {
+ if (i == mStateItems.end())
+ {
+ boost::shared_ptr<RtpStateReplicatorItem> newitem(new RtpStateReplicatorItem());
+ localitem = newitem;
+ mStateItems.insert(std::make_pair<std::string, boost::shared_ptr<RtpStateReplicatorItem> >((*item)->mSessionId, newitem));
+
+ RTPSessionImplPtr localSession = new RTPSessionImpl(mAdapter, mPoolFactory, session->mSessionIdentity, session->mSinkIdentity,
+ session->mSourceIdentity, session->mPort, session->mFormats);
+ localitem->setSession(localSession);
+ }
+ else
+ {
+ localitem = i->second;
+ }
+
+ localitem->getSession()->associatePayloads(session->mPayloadstoFormats, Ice::Current());
+ }
+ else if ((sink = RtpStreamSinkStateItemPtr::dynamicCast((*item))))
+ {
+ if (i == mStateItems.end())
+ {
+ continue;
+ }
+
+ i->second->getSession()->getSink()->setSource(sink->mSource, Ice::Current());
+ i->second->getSession()->getSink()->setRemoteDetails(sink->mRemoteAddress, sink->mRemotePort, Ice::Current());
+ }
+ else if ((source = RtpStreamSourceStateItemPtr::dynamicCast((*item))))
+ {
+ if (i == mStateItems.end())
+ {
+ continue;
+ }
+
+ i->second->getSession()->getSource()->setSink(source->mSink, Ice::Current());
+ }
+ }
+ }
+ std::string mId;
+ std::map<std::string, boost::shared_ptr<RtpStateReplicatorItem> > mStateItems;
+ Ice::ObjectAdapterPtr mAdapter;
+ pj_pool_factory *mPoolFactory;
+ RtpGeneralStateItemPtr mGeneralState;
+};
+
+RtpStateReplicatorListenerI::RtpStateReplicatorListenerI(Ice::ObjectAdapterPtr adapter, pj_pool_factory *poolFactory, RtpGeneralStateItemPtr generalState)
+ : mImpl(new RtpStateReplicatorListenerImpl(adapter, poolFactory, generalState)) {}
+
+RtpStateReplicatorListenerI::~RtpStateReplicatorListenerI()
+{
+ delete mImpl;
+}
+
+void RtpStateReplicatorListenerI::stateRemoved(const Ice::StringSeq& itemKeys, const Ice::Current&)
+{
+ mImpl->removeStateNoticeImpl(itemKeys);
+}
+
+void RtpStateReplicatorListenerI::stateSet(const RtpStateItemSeq& items, const Ice::Current&)
+{
+ mImpl->setStateNoticeImpl(items);
+}
+
+bool RtpStateReplicatorListenerI::operator==(RtpStateReplicatorListenerI &rhs)
+{
+ return mImpl->mId == rhs.mImpl->mId;
+}
diff --cc test/CMakeLists.txt
index b36ae1b,6876f33..5ca2576
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@@ -6,14 -6,12 +6,15 @@@
# All rights reserved.
#
++asterisk_scf_slice_include_directories(${API_SLICE_DIR})
++
asterisk_scf_component_init(media_rtp_pjmedia_test CXX)
asterisk_scf_component_add_file(media_rtp_pjmedia_test TestRTPpjmedia.cpp)
- asterisk_scf_component_add_slice(media_rtp_pjmedia_test MediaIf)
- asterisk_scf_component_add_slice(media_rtp_pjmedia_test MediaRTPIf)
- asterisk_scf_component_add_slice(media_rtp_pjmedia_test RtpStateReplicationIf)
++asterisk_scf_component_add_slice(media_rtp_pjmedia_test ../local-slice/RtpStateReplicationIf.ice)
asterisk_scf_component_add_boost_libraries(media_rtp_pjmedia_test unit_test_framework thread date_time)
+ include_directories(${API_INCLUDE_DIR})
asterisk_scf_component_build_icebox(media_rtp_pjmedia_test)
- #asterisk_scf_component_install(media_rtp_pjmedia_test RUNTIME bin "PJmedia RTP Media Test Driver." Core)
+ target_link_libraries(media_rtp_pjmedia_test asterisk-scf-api)
# integration test
if(integrated_build STREQUAL "true")
diff --cc test/TestRTPpjmedia.cpp
index 4b6c2ed,e71ffc6..a21b3c0
--- a/test/TestRTPpjmedia.cpp
+++ b/test/TestRTPpjmedia.cpp
@@@ -23,11 -23,10 +23,12 @@@
#include <Ice/Ice.h>
#include <IceBox/IceBox.h>
- #include "Core/Discovery/ServiceLocatorIf.h"
- #include "Media/MediaIf.h"
- #include "Media/RTP/MediaRTPIf.h"
+ #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
+ #include <AsteriskSCF/Media/MediaIf.h>
+ #include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
+
+#include "RtpStateReplicationIf.h"
+
using namespace std;
using namespace AsteriskSCF::Core::Discovery::V1;
using namespace AsteriskSCF::Media::V1;
commit c6c8e75f37eaecb2e1dceb97c21b6d58b6af4463
Merge: 4db1e9d 4fa74bf
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 4 15:56:42 2011 -0600
Merge branch 'replication' into replication-visitor
commit 4fa74bfce6ca302972f471447269c56e6075d660
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 4 15:56:25 2011 -0600
Update to be compatible with recent logger changes.
diff --git a/src/RtpStateReplicatorApp.cpp b/src/RtpStateReplicatorApp.cpp
index 8fffef6..2b49c1b 100644
--- a/src/RtpStateReplicatorApp.cpp
+++ b/src/RtpStateReplicatorApp.cpp
@@ -36,7 +36,7 @@ using namespace AsteriskSCF::Media::RTP::V1;
namespace
{
-Logger &lg = getLoggerFactory().getLogger("AsteriskSCF.MediaRTP");
+Logger lg = getLoggerFactory().getLogger("AsteriskSCF.MediaRTP");
}
class RtpStateReplicatorService : public IceBox::Service
commit 0e966793b9a8f559cb960257496c8f55d541184e
Merge: 52c0c04 7de9901
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 4 15:54:04 2011 -0600
Merge branch 'master' into replication
diff --cc src/MediaRTPpjmedia.cpp
index 1e7c30b,ddd847e..f770788
--- a/src/MediaRTPpjmedia.cpp
+++ b/src/MediaRTPpjmedia.cpp
@@@ -46,12 -40,9 +46,12 @@@ using namespace AsteriskSCF::SmartProxy
namespace
{
- Logger &lg = getLoggerFactory().getLogger("AsteriskSCF.MediaRTP");
+ Logger lg = getLoggerFactory().getLogger("AsteriskSCF.MediaRTP");
}
+static const string ReplicaServiceId("MediaRtpReplica");
+static const string MediaServiceId("RTPMediaService");
+
/**
* Implementation of the RTPMediaService interface as defined in MediaRTPIf.ice
*/
commit 4db1e9d8314a3ad95c24446a99133cd005f2362f
Merge: c42bb2f 7de9901
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 4 15:51:16 2011 -0600
Merge branch 'master' into replication-visitor
diff --cc src/MediaRTPpjmedia.cpp
index 1e7c30b,ddd847e..f770788
--- a/src/MediaRTPpjmedia.cpp
+++ b/src/MediaRTPpjmedia.cpp
@@@ -46,12 -40,9 +46,12 @@@ using namespace AsteriskSCF::SmartProxy
namespace
{
- Logger &lg = getLoggerFactory().getLogger("AsteriskSCF.MediaRTP");
+ Logger lg = getLoggerFactory().getLogger("AsteriskSCF.MediaRTP");
}
+static const string ReplicaServiceId("MediaRtpReplica");
+static const string MediaServiceId("RTPMediaService");
+
/**
* Implementation of the RTPMediaService interface as defined in MediaRTPIf.ice
*/
commit c42bb2fae80b489275b969b2a7f14151866b0edb
Merge: a49aa9d dda37f6
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 4 15:50:17 2011 -0600
Merge branch 'master' into replication-visitor
commit a49aa9de79867fc8af7c3e979b390937fb33f2c4
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 4 09:09:25 2011 -0600
Avoid MCPP bug by using C-style comments.
diff --git a/local-slice/RtpStateReplicationIf.ice b/local-slice/RtpStateReplicationIf.ice
index 2dbbeed..d7a52c5 100644
--- a/local-slice/RtpStateReplicationIf.ice
+++ b/local-slice/RtpStateReplicationIf.ice
@@ -96,10 +96,10 @@ module V1
{
AsteriskSCF::Media::V1::StreamSink *mSink;
};
-}; // module V1
+}; /* module V1 */
-}; // module RTP
+}; /* module RTP */
-}; // module Media
+}; /* module Media */
-}; // module Asterisk SCF
+}; /* module Asterisk SCF */
commit 8053dab526443105e44d902ab795a8252834d1fe
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Thu Dec 30 16:47:34 2010 -0600
Use new translator support for visitors
diff --git a/local-slice/CMakeLists.txt b/local-slice/CMakeLists.txt
index 4f25cf4..bc354ab 100644
--- a/local-slice/CMakeLists.txt
+++ b/local-slice/CMakeLists.txt
@@ -1,2 +1,2 @@
asterisk_scf_slice_include_directories("${CMAKE_SOURCE_DIR}/slice")
-asterisk_scf_compile_slice(RtpStateReplicationIf lib "RTP State Replicator" media_rtp_pjmedia SOURCES RtpStateReplicationIf.ice RtpStateItemHelpers.ice RtpStateItemHelpersImpl.h RtpStateItemHelpersImpl.cpp)
+asterisk_scf_compile_slice(RtpStateReplicationIf.ice lib "RTP State Replicator" media_rtp_pjmedia)
diff --git a/local-slice/RtpStateItemHelpers.ice b/local-slice/RtpStateItemHelpers.ice
deleted file mode 100644
index 455869c..0000000
--- a/local-slice/RtpStateItemHelpers.ice
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2010, Digium, Inc.
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk SCF project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE.txt file
- * at the top of the source tree.
- */
-
-#pragma once
-
-#include "RtpStateReplicationIf.ice"
-
-[["cpp:include:RtpStateItemHelpersImpl.h"]]
-
-module AsteriskSCF
-{
-
-module Media
-{
-
-module RTP
-{
-
-["suppress"]
-module V1
-{
-
-module StateItemHelpers
-{
- // This module is intentionally left empty, as its contents
- // cannot be defined in the Slice language. However, its
- // contents should be provided to all users of the RTPStateItem
- // mechanism, written in each language that is supported. Those
- // implementations will be available in companion files in the
- // same directory as this one. For C++, the helpers will be
- // automatically brought into the program by the inclusion
- // of the RtpStateItemHelpers.h file above.
-}; // module StateItemHelpers
-
-}; // module V1
-
-}; // module RTP
-
-}; // module Media
-
-}; // module Asterisk SCF
diff --git a/local-slice/RtpStateItemHelpersImpl.cpp b/local-slice/RtpStateItemHelpersImpl.cpp
deleted file mode 100644
index 5acc233..0000000
--- a/local-slice/RtpStateItemHelpersImpl.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2010, Digium, Inc.
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk SCF project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE.txt file
- * at the top of the source tree.
- */
-
-#include <Ice/Ice.h>
-
-#include "RtpStateReplicationIf.h"
-#include "RtpStateItemHelpers.h"
-
-using namespace AsteriskSCF::Media::RTP::V1;
-
-namespace AsteriskSCF
-{
-
-namespace Media
-{
-
-namespace RTP
-{
-
-namespace V1
-{
-
-namespace StateItemHelpers
-{
-
-template <typename T>
-class factory : public Ice::ObjectFactory
-{
-public:
- virtual Ice::ObjectPtr create(const std::string &)
- {
- return new T();
- }
-
- virtual void destroy()
- {
- }
-};
-
-void registerObjectFactory(const Ice::CommunicatorPtr &communicator)
-{
- communicator->addObjectFactory(new factory<RtpStateItemImpl>(), RtpStateItem::ice_staticId());
- communicator->addObjectFactory(new factory<RtpGeneralStateItemImpl>(), RtpGeneralStateItem::ice_staticId());
- communicator->addObjectFactory(new factory<RtpSessionStateItemImpl>(), RtpSessionStateItem::ice_staticId());
- communicator->addObjectFactory(new factory<RtpStreamSourceStateItemImpl>(), RtpStreamSourceStateItem::ice_staticId());
- communicator->addObjectFactory(new factory<RtpStreamSinkStateItemImpl>(), RtpStreamSinkStateItem::ice_staticId());
-}
-
-void RtpStateItemImpl::visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &)
-{
-}
-
-RtpStateItemPtr newRtpStateItem(void)
-{
- return new RtpStateItemImpl();
-}
-
-void RtpGeneralStateItemImpl::visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &)
-{
- visitor->visitGeneral(this);
-}
-
-RtpGeneralStateItemPtr newRtpGeneralStateItem(void)
-{
- return new RtpGeneralStateItemImpl();
-}
-
-void RtpSessionStateItemImpl::visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &)
-{
- visitor->visitSession(this);
-}
-
-RtpSessionStateItemPtr newRtpSessionStateItem(void)
-{
- return new RtpSessionStateItemImpl();
-}
-
-void RtpStreamSourceStateItemImpl::visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &)
-{
- visitor->visitStreamSource(this);
-}
-
-RtpStreamSourceStateItemPtr newRtpStreamSourceStateItem(void)
-{
- return new RtpStreamSourceStateItemImpl();
-}
-
-void RtpStreamSinkStateItemImpl::visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &)
-{
- visitor->visitStreamSink(this);
-}
-
-RtpStreamSinkStateItemPtr newRtpStreamSinkStateItem(void)
-{
- return new RtpStreamSinkStateItemImpl();
-}
-
-} // namespace StateItemHelpers
-
-} // namespace V1
-
-} // namespace RTP
-
-} // namespace Media
-
-} // namespace AsteriskSCF
diff --git a/local-slice/RtpStateItemHelpersImpl.h b/local-slice/RtpStateItemHelpersImpl.h
deleted file mode 100644
index 5621760..0000000
--- a/local-slice/RtpStateItemHelpersImpl.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2010, Digium, Inc.
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk SCF project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE.txt file
- * at the top of the source tree.
- */
-
-#pragma once
-
-namespace AsteriskSCF
-{
-
-namespace Media
-{
-
-namespace RTP
-{
-
-namespace V1
-{
-
-namespace StateItemHelpers
-{
-
-void registerObjectFactory(const Ice::CommunicatorPtr &communicator);
-
-class RtpStateItemImpl : public RtpStateItem
-{
-public:
- void visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &);
-};
-
-RtpStateItemPtr newRtpStateItem(void);
-
-class RtpGeneralStateItemImpl : public RtpGeneralStateItem
-{
-public:
- void visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &);
-};
-
-RtpGeneralStateItemPtr newRtpGeneralStateItem(void);
-
-class RtpSessionStateItemImpl : public RtpSessionStateItem
-{
-public:
- void visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &);
-};
-
-RtpSessionStateItemPtr newRtpSessionStateItem(void);
-
-class RtpStreamSourceStateItemImpl : public RtpStreamSourceStateItem
-{
-public:
- void visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &);
-};
-
-RtpStreamSourceStateItemPtr newRtpStreamSourceStateItem(void);
-
-class RtpStreamSinkStateItemImpl : public RtpStreamSinkStateItem
-{
-public:
- void visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &);
-};
-
-RtpStreamSinkStateItemPtr newRtpStreamSinkStateItem(void);
-
-} // namespace StateItemHelpers
-
-} // namespace V1
-
-} // namespace RTP
-
-} // namespace Media
-
-} // namespace AsteriskSCF
diff --git a/local-slice/RtpStateReplicationIf.ice b/local-slice/RtpStateReplicationIf.ice
index 49d2dc5..2dbbeed 100644
--- a/local-slice/RtpStateReplicationIf.ice
+++ b/local-slice/RtpStateReplicationIf.ice
@@ -34,75 +34,68 @@ module RTP
["suppress"]
module V1
{
- const string StateReplicatorComponentCategory = "RtpStateReplicatorComponent";
- const string StateReplicatorDiscoveryCategory = "RtpStateReplicator";
-
- class RtpStateReplicatorParams extends AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams
- {
- string mName;
- };
-
- interface RtpStateItemVisitor;
-
- class RtpStateItem
- {
- string key;
- string mSessionId;
- void visit(RtpStateItemVisitor visitor);
- };
-
- sequence<RtpStateItem> RtpStateItemSeq;
-
- interface RtpStateReplicatorListener
- {
- void stateRemoved(Ice::StringSeq itemKeys);
- void stateSet(RtpStateItemSeq items);
- };
-
- interface RtpStateReplicator
- {
- void addListener(RtpStateReplicatorListener *listener);
- void removeListener(RtpStateReplicatorListener *listener);
- void setState (RtpStateItemSeq items);
- void removeState(Ice::StringSeq items);
- idempotent RtpStateItemSeq getState(Ice::StringSeq itemKeys);
- idempotent RtpStateItemSeq getAllState();
- };
-
- class RtpGeneralStateItem extends RtpStateItem
- {
- AsteriskSCF::Core::Discovery::V1::ServiceManagement *mServiceManagement;
- };
-
- class RtpSessionStateItem extends RtpStateItem
- {
- Ice::Identity mSessionIdentity;
- int mPort;
- Ice::Identity mSinkIdentity;
- Ice::Identity mSourceIdentity;
- AsteriskSCF::Media::V1::FormatSeq mFormats;
- PayloadMap mPayloadstoFormats;
- };
-
- class RtpStreamSinkStateItem extends RtpStateItem
- {
- AsteriskSCF::Media::V1::StreamSource *mSource;
- string mRemoteAddress;
- int mRemotePort;
- };
-
- class RtpStreamSourceStateItem extends RtpStateItem
- {
- AsteriskSCF::Media::V1::StreamSink *mSink;
- };
-
- interface RtpStateItemVisitor
- {
- void visitGeneral(RtpGeneralStateItem item);
- void visitSession(RtpSessionStateItem item);
- void visitStreamSink(RtpStreamSinkStateItem item);
- void visitStreamSource(RtpStreamSourceStateItem item);
- };
+ const string StateReplicatorComponentCategory = "RtpStateReplicatorComponent";
+ const string StateReplicatorDiscoveryCategory = "RtpStateReplicator";
+
+ class RtpStateReplicatorParams extends AsteriskSCF::Core::Discovery::V1::ServiceLocatorParams
+ {
+ string mName;
+ };
+
+ ["visitor"] local class RtpStateItemVisitor
+ {
+ };
+
+ ["visitor:::AsteriskSCF::Media::RTP::V1::RtpStateItemVisitor"] class RtpStateItem
+ {
+ string key;
+ string mSessionId;
+ };
+
+ sequence<RtpStateItem> RtpStateItemSeq;
+
+ interface RtpStateReplicatorListener
+ {
+ void stateRemoved(Ice::StringSeq itemKeys);
+ void stateSet(RtpStateItemSeq items);
+ };
+
+ interface RtpStateReplicator
+ {
+ void addListener(RtpStateReplicatorListener *listener);
+ void removeListener(RtpStateReplicatorListener *listener);
+ void setState (RtpStateItemSeq items);
+ void removeState(Ice::StringSeq items);
+ idempotent RtpStateItemSeq getState(Ice::StringSeq itemKeys);
+ idempotent RtpStateItemSeq getAllState();
+ };
+
+ class RtpGeneralStateItem extends RtpStateItem
+ {
+ AsteriskSCF::Core::Discovery::V1::ServiceManagement *mServiceManagement;
+ };
+
+ class RtpSessionStateItem extends RtpStateItem
+ {
+ Ice::Identity mSessionIdentity;
+ int mPort;
+ Ice::Identity mSinkIdentity;
+ Ice::Identity mSourceIdentity;
+ AsteriskSCF::Media::V1::FormatSeq mFormats;
+ PayloadMap mPayloadstoFormats;
+ };
+
+ class RtpStreamSinkStateItem extends RtpStateItem
+ {
+ AsteriskSCF::Media::V1::StreamSource *mSource;
+ string mRemoteAddress;
+ int mRemotePort;
+ };
+
+ class RtpStreamSourceStateItem extends RtpStateItem
+ {
+ AsteriskSCF::Media::V1::StreamSink *mSink;
+ };
}; // module V1
}; // module RTP
diff --git a/src/MediaRTPpjmedia.cpp b/src/MediaRTPpjmedia.cpp
index 1af4b00..1e7c30b 100644
--- a/src/MediaRTPpjmedia.cpp
+++ b/src/MediaRTPpjmedia.cpp
@@ -30,7 +30,6 @@
#include "IceLogger.h"
#include "logger.h"
#include "RtpStateReplicationIf.h"
-#include "RtpStateItemHelpers.h"
#include "ReplicaIf.h"
#include "SmartProxy.h"
@@ -161,7 +160,7 @@ private:
class MediaRTPpjmediaApp : public IceBox::Service
{
public:
- MediaRTPpjmediaApp() : mGeneralState(StateItemHelpers::newRtpGeneralStateItem()) { mGeneralState->key = IceUtil::generateUUID(); };
+ MediaRTPpjmediaApp() : mGeneralState(new RtpGeneralStateItem()) { mGeneralState->key = IceUtil::generateUUID(); };
void start(const std::string&, const Ice::CommunicatorPtr&, const Ice::StringSeq&);
void stop();
diff --git a/src/RTPSession.cpp b/src/RTPSession.cpp
index e91824d..15633ef 100644
--- a/src/RTPSession.cpp
+++ b/src/RTPSession.cpp
@@ -23,7 +23,6 @@
#include "Media/MediaIf.h"
#include "Media/RTP/MediaRTPIf.h"
#include "RtpStateReplicationIf.h"
-#include "RtpStateItemHelpers.h"
#include "ReplicaIf.h"
#include "SmartProxy.h"
@@ -55,7 +54,7 @@ class RTPSessionImplPriv
{
public:
RTPSessionImplPriv(Ice::ObjectAdapterPtr adapter, const FormatSeq& formats, ReplicaPtr replicaService, AsteriskSCF::SmartProxy::SmartProxy<RtpStateReplicatorPrx> stateReplicator) :
- mAdapter(adapter), mFormats(formats), mSessionStateItem(StateItemHelpers::newRtpSessionStateItem()), mReplicaService(replicaService), mStateReplicator(stateReplicator) { };
+ mAdapter(adapter), mFormats(formats), mSessionStateItem(new RtpSessionStateItem()), mReplicaService(replicaService), mStateReplicator(stateReplicator) { };
~RTPSessionImplPriv();
/**
diff --git a/src/RTPSink.cpp b/src/RTPSink.cpp
index a14b87d..ed63b32 100644
--- a/src/RTPSink.cpp
+++ b/src/RTPSink.cpp
@@ -23,7 +23,6 @@
#include "Media/MediaIf.h"
#include "Media/RTP/MediaRTPIf.h"
#include "RtpStateReplicationIf.h"
-#include "RtpStateItemHelpers.h"
#include "ReplicaIf.h"
#include "SmartProxy.h"
@@ -65,7 +64,7 @@ public:
/**
* Constructor for the StreamSinkRTPImplPriv class.
*/
-StreamSinkRTPImplPriv::StreamSinkRTPImplPriv(RTPSessionImplPtr session, std::string sessionId) : mSession(session), mSinkStateItem(StateItemHelpers::newRtpStreamSinkStateItem())
+StreamSinkRTPImplPriv::StreamSinkRTPImplPriv(RTPSessionImplPtr session, std::string sessionId) : mSession(session), mSinkStateItem(new RtpStreamSinkStateItem())
{
pjmedia_rtp_session_init(&mOutgoingSession, 0, pj_rand());
mSinkStateItem->mSessionId = sessionId;
diff --git a/src/RTPSource.cpp b/src/RTPSource.cpp
index bbc3ab1..3747677 100644
--- a/src/RTPSource.cpp
+++ b/src/RTPSource.cpp
@@ -23,7 +23,6 @@
#include "Media/MediaIf.h"
#include "Media/RTP/MediaRTPIf.h"
#include "RtpStateReplicationIf.h"
-#include "RtpStateItemHelpers.h"
#include "ReplicaIf.h"
#include "SmartProxy.h"
@@ -72,7 +71,7 @@ public:
/**
* Constructor for the StreamSourceRTPImplPriv class.
*/
-StreamSourceRTPImplPriv::StreamSourceRTPImplPriv(RTPSessionImplPtr session, std::string sessionId) : mSession(session), mSourceStateItem(StateItemHelpers::newRtpStreamSourceStateItem())
+StreamSourceRTPImplPriv::StreamSourceRTPImplPriv(RTPSessionImplPtr session, std::string sessionId) : mSession(session), mSourceStateItem(new RtpStreamSourceStateItem())
{
pjmedia_rtp_session_init(&mIncomingSession, 0, 0);
mSourceStateItem->mSessionId = sessionId;
diff --git a/test/TestRTPpjmedia.cpp b/test/TestRTPpjmedia.cpp
index 1c71863..1efa138 100644
--- a/test/TestRTPpjmedia.cpp
+++ b/test/TestRTPpjmedia.cpp
@@ -27,7 +27,6 @@
#include "Media/MediaIf.h"
#include "Media/RTP/MediaRTPIf.h"
#include "RtpStateReplicationIf.h"
-#include "RtpStateItemHelpers.h"
using namespace std;
using namespace AsteriskSCF::Core::Discovery::V1;
commit c3f55bb7a358def51806d8bb5b06e9eefbd58500
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Wed Dec 29 18:34:52 2010 -0600
Not quite finished, but functional.
This version of the Visitor pattern for RTPStateItem objects contains a
number of improvements over the previous one, primarily that it no longer
requires any Slice translator modifications. In addition, it now includes
the 'boilerplate' stuff, that all users would have to write, in the library
produced by compiling the Slice definitions.
There are still a few rough edges that need some polishing... but it's
almost there.
diff --git a/local-slice/CMakeLists.txt b/local-slice/CMakeLists.txt
index b348049..4f25cf4 100644
--- a/local-slice/CMakeLists.txt
+++ b/local-slice/CMakeLists.txt
@@ -1,3 +1,2 @@
asterisk_scf_slice_include_directories("${CMAKE_SOURCE_DIR}/slice")
-asterisk_scf_compile_slice(RtpStateReplicationIf.ice lib "RTP State Replicator" media_rtp_pjmedia)
-
+asterisk_scf_compile_slice(RtpStateReplicationIf lib "RTP State Replicator" media_rtp_pjmedia SOURCES RtpStateReplicationIf.ice RtpStateItemHelpers.ice RtpStateItemHelpersImpl.h RtpStateItemHelpersImpl.cpp)
diff --git a/local-slice/RtpStateItemHelpers.ice b/local-slice/RtpStateItemHelpers.ice
new file mode 100644
index 0000000..455869c
--- /dev/null
+++ b/local-slice/RtpStateItemHelpers.ice
@@ -0,0 +1,54 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+#include "RtpStateReplicationIf.ice"
+
+[["cpp:include:RtpStateItemHelpersImpl.h"]]
+
+module AsteriskSCF
+{
+
+module Media
+{
+
+module RTP
+{
+
+["suppress"]
+module V1
+{
+
+module StateItemHelpers
+{
+ // This module is intentionally left empty, as its contents
+ // cannot be defined in the Slice language. However, its
+ // contents should be provided to all users of the RTPStateItem
+ // mechanism, written in each language that is supported. Those
+ // implementations will be available in companion files in the
+ // same directory as this one. For C++, the helpers will be
+ // automatically brought into the program by the inclusion
+ // of the RtpStateItemHelpers.h file above.
+}; // module StateItemHelpers
+
+}; // module V1
+
+}; // module RTP
+
+}; // module Media
+
+}; // module Asterisk SCF
diff --git a/local-slice/RtpStateItemHelpersImpl.cpp b/local-slice/RtpStateItemHelpersImpl.cpp
new file mode 100644
index 0000000..5acc233
--- /dev/null
+++ b/local-slice/RtpStateItemHelpersImpl.cpp
@@ -0,0 +1,119 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#include <Ice/Ice.h>
+
+#include "RtpStateReplicationIf.h"
+#include "RtpStateItemHelpers.h"
+
+using namespace AsteriskSCF::Media::RTP::V1;
+
+namespace AsteriskSCF
+{
+
+namespace Media
+{
+
+namespace RTP
+{
+
+namespace V1
+{
+
+namespace StateItemHelpers
+{
+
+template <typename T>
+class factory : public Ice::ObjectFactory
+{
+public:
+ virtual Ice::ObjectPtr create(const std::string &)
+ {
+ return new T();
+ }
+
+ virtual void destroy()
+ {
+ }
+};
+
+void registerObjectFactory(const Ice::CommunicatorPtr &communicator)
+{
+ communicator->addObjectFactory(new factory<RtpStateItemImpl>(), RtpStateItem::ice_staticId());
+ communicator->addObjectFactory(new factory<RtpGeneralStateItemImpl>(), RtpGeneralStateItem::ice_staticId());
+ communicator->addObjectFactory(new factory<RtpSessionStateItemImpl>(), RtpSessionStateItem::ice_staticId());
+ communicator->addObjectFactory(new factory<RtpStreamSourceStateItemImpl>(), RtpStreamSourceStateItem::ice_staticId());
+ communicator->addObjectFactory(new factory<RtpStreamSinkStateItemImpl>(), RtpStreamSinkStateItem::ice_staticId());
+}
+
+void RtpStateItemImpl::visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &)
+{
+}
+
+RtpStateItemPtr newRtpStateItem(void)
+{
+ return new RtpStateItemImpl();
+}
+
+void RtpGeneralStateItemImpl::visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &)
+{
+ visitor->visitGeneral(this);
+}
+
+RtpGeneralStateItemPtr newRtpGeneralStateItem(void)
+{
+ return new RtpGeneralStateItemImpl();
+}
+
+void RtpSessionStateItemImpl::visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &)
+{
+ visitor->visitSession(this);
+}
+
+RtpSessionStateItemPtr newRtpSessionStateItem(void)
+{
+ return new RtpSessionStateItemImpl();
+}
+
+void RtpStreamSourceStateItemImpl::visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &)
+{
+ visitor->visitStreamSource(this);
+}
+
+RtpStreamSourceStateItemPtr newRtpStreamSourceStateItem(void)
+{
+ return new RtpStreamSourceStateItemImpl();
+}
+
+void RtpStreamSinkStateItemImpl::visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &)
+{
+ visitor->visitStreamSink(this);
+}
+
+RtpStreamSinkStateItemPtr newRtpStreamSinkStateItem(void)
+{
+ return new RtpStreamSinkStateItemImpl();
+}
+
+} // namespace StateItemHelpers
+
+} // namespace V1
+
+} // namespace RTP
+
+} // namespace Media
+
+} // namespace AsteriskSCF
diff --git a/local-slice/RtpStateItemHelpersImpl.h b/local-slice/RtpStateItemHelpersImpl.h
new file mode 100644
index 0000000..5621760
--- /dev/null
+++ b/local-slice/RtpStateItemHelpersImpl.h
@@ -0,0 +1,84 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+namespace AsteriskSCF
+{
+
+namespace Media
+{
+
+namespace RTP
+{
+
+namespace V1
+{
+
+namespace StateItemHelpers
+{
+
+void registerObjectFactory(const Ice::CommunicatorPtr &communicator);
+
+class RtpStateItemImpl : public RtpStateItem
+{
+public:
+ void visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &);
+};
+
+RtpStateItemPtr newRtpStateItem(void);
+
+class RtpGeneralStateItemImpl : public RtpGeneralStateItem
+{
+public:
+ void visit(const RtpStateItemVisitorPtr &visitor, const Ice::Current &);
+};
+
+RtpGeneralStateItemPtr newRtpGeneralStateItem(void);
+
+class RtpSessionStateItemImpl : public RtpSessionStateItem
... 3277 lines suppressed ...
--
asterisk-scf/release/media_rtp_pjmedia.git
More information about the asterisk-scf-commits
mailing list