[hydra-commits] hydra/media_format_ulaw.git branch "master" updated.
Commits to the Hydra project code repositories
hydra-commits at lists.digium.com
Mon Aug 2 14:23:32 CDT 2010
branch "master" has been updated
via 6a750050b6182408a6c31a3193cdc3d19540c119 (commit)
from 77a09dac767cbba9243ab01bd4264e1292b60f6c (commit)
Summary of changes:
src/MediaFormatULAW.cpp | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
- Log -----------------------------------------------------------------
commit 6a750050b6182408a6c31a3193cdc3d19540c119
Author: Joshua Colp <jcolp at digium.com>
Date: Mon Aug 2 16:38:51 2010 -0300
Incorporate some on-the-fly feedback from kpfleming. Just call dynamicCast for each type
and let it fail, based on his previous experimentation it ends up being fast enough.
diff --git a/src/MediaFormatULAW.cpp b/src/MediaFormatULAW.cpp
index ad321f3..6ff3ca2 100644
--- a/src/MediaFormatULAW.cpp
+++ b/src/MediaFormatULAW.cpp
@@ -63,19 +63,19 @@ public:
*/
bool isSupported(const Hydra::Location::V1::ServiceLocatorParamsPtr& params, const Ice::Current&)
{
- if (params->ice_isA("::Hydra::Media::V1::FormatDiscoveryName"))
- {
- FormatDiscoveryNamePtr discoveryname = FormatDiscoveryNamePtr::dynamicCast(params);
+ FormatDiscoveryNamePtr discoveryname;
+ FormatDiscoverySDPPtr discoverysdp;
+ FormatDiscoveryGenericAudioPtr discoverygenericaudio;
+ if ((discoveryname = FormatDiscoveryNamePtr::dynamicCast(params)))
+ {
if (discoveryname->name == "ulaw8 at 20")
{
return true;
}
}
- else if (params->ice_isA("::Hydra::Media::V1::FormatDiscoverySDP"))
+ else if ((discoverysdp = FormatDiscoverySDPPtr::dynamicCast(params)))
{
- FormatDiscoverySDPPtr discoverysdp = FormatDiscoverySDPPtr::dynamicCast(params);
-
if (discoverysdp->payload == 0 &&
discoverysdp->type == "audio" &&
discoverysdp->subtype == "PCMU" &&
@@ -84,10 +84,8 @@ public:
return true;
}
}
- else if (params->ice_isA("::Hydra::Media::V1::FormatDiscoveryGenericAudio"))
+ else if ((discoverygenericaudio = FormatDiscoveryGenericAudioPtr::dynamicCast(params)))
{
- FormatDiscoveryGenericAudioPtr discoverygenericaudio = FormatDiscoveryGenericAudioPtr::dynamicCast(params);
-
if (discoverygenericaudio->name == "ulaw" &&
discoverygenericaudio->samplerate == 8000 &&
discoverygenericaudio->channels == 1)
-----------------------------------------------------------------------
--
hydra/media_format_ulaw.git
More information about the asterisk-scf-commits
mailing list