[asterisk-scf-commits] asterisk-scf/integration/media_operations_core.git branch "g722" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Thu Sep 1 11:27:48 CDT 2011
branch "g722" has been updated
via e0cd8fa5dd63fcbf8c291f66356ab565cd057cc9 (commit)
from dc1598b75cca6711f9bd233ac477031fb39dbca1 (commit)
Summary of changes:
src/MediaOperationStateReplicatorListener.cpp | 37 +++++++++++++++++++++++--
1 files changed, 34 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit e0cd8fa5dd63fcbf8c291f66356ab565cd057cc9
Author: Mark Michelson <mmichelson at digium.com>
Date: Thu Sep 1 11:29:07 2011 -0500
Place common code into common functions.
diff --git a/src/MediaOperationStateReplicatorListener.cpp b/src/MediaOperationStateReplicatorListener.cpp
index 7cfb0f0..2943d21 100644
--- a/src/MediaOperationStateReplicatorListener.cpp
+++ b/src/MediaOperationStateReplicatorListener.cpp
@@ -15,7 +15,10 @@
*/
#include "MediaOperationStateReplicator.h"
+#include "TranslatorOperationFactory.h"
#include "ulaw_alaw.h"
+#include "resample.h"
+#include "g722.h"
namespace AsteriskSCF
{
@@ -51,6 +54,14 @@ void MediaOperationStateReplicatorListenerImpl::stateRemovedForItems(
{
mAdapter->remove(mAdapter->getCommunicator()->stringToIdentity(ulawAlaw->operationId));
}
+ void visitResamplerMediaOperationStateItem(const ResamplerMediaOperationStateItemPtr& resample)
+ {
+ mAdapter->remove(mAdapter->getCommunicator()->stringToIdentity(resample->operationId));
+ }
+ void visitG722MediaOperationStateItem(const G722MediaOperationStateItemPtr& g722)
+ {
+ mAdapter->remove(mAdapter->getCommunicator()->stringToIdentity(g722->operationId));
+ }
Ice::ObjectAdapterPtr mAdapter;
};
@@ -77,15 +88,35 @@ void MediaOperationStateReplicatorListenerImpl::stateSet(
{
UlawAlawFactoryPtr factory = UlawAlawFactoryPtr::dynamicCast(mAdapter->find(ulawAlaw->factoryId));
+ createTranslationMediaOperation(factory, ulawAlaw);
+ }
+
+ void visitResamplerMediaOperationStateItem(const ResamplerMediaOperationStateItemPtr& resample)
+ {
+ ResampleFactoryPtr factory = ResampleFactoryPtr::dynamicCast(mAdapter->find(resample->factoryId));
+
+ createTranslationMediaOperation(factory, resample);
+ }
+
+ void visitG722MediaOperationStateItem(const G722MediaOperationStateItemPtr& g722)
+ {
+ G722FactoryPtr factory = G722FactoryPtr::dynamicCast(mAdapter->find(g722->factoryId));
+
+ createTranslationMediaOperation(factory, g722);
+ }
+
+ void createTranslationMediaOperation(const TranslatorOperationFactoryPtr& factory,
+ const TranslatorMediaOperationStateItemPtr& item)
+ {
if (!factory)
{
return;
}
factory->createMediaOperation(
- ulawAlaw->sourceFormat,
- ulawAlaw->sinkFormat,
- ulawAlaw->operationId);
+ item->sourceFormat,
+ item->sinkFormat,
+ item->operationId);
}
Ice::ObjectAdapterPtr mAdapter;
};
-----------------------------------------------------------------------
--
asterisk-scf/integration/media_operations_core.git
More information about the asterisk-scf-commits
mailing list