[asterisk-commits] pcadach: branch pcadach/chan_h323-live r41988 -
in /team/pcadach/chan_h323-li...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Mon Sep 4 04:03:21 MST 2006
Author: pcadach
Date: Mon Sep 4 06:03:21 2006
New Revision: 41988
URL: http://svn.digium.com/view/asterisk?rev=41988&view=rev
Log:
1) Export AssertFunc to OpenH323/PWLib to handle its assertions by chan_h323;
2) Critical patches for openh323/pwlib is placed to channels/h323/patches directory.
Added:
team/pcadach/chan_h323-live/channels/h323/noexport.map
- copied, changed from r41987, team/pcadach/chan_h323-live/channels/noexport.map
team/pcadach/chan_h323-live/channels/h323/patches/
team/pcadach/chan_h323-live/channels/h323/patches/openh323_v1_18_0.diff (with props)
team/pcadach/chan_h323-live/channels/h323/patches/pwlib_v1_10_0.diff (with props)
Removed:
team/pcadach/chan_h323-live/channels/noexport.map
Modified:
team/pcadach/chan_h323-live/channels/Makefile
Modified: team/pcadach/chan_h323-live/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channels/Makefile?rev=41988&r1=41987&r2=41988&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/Makefile (original)
+++ team/pcadach/chan_h323-live/channels/Makefile Mon Sep 4 06:03:21 2006
@@ -65,7 +65,7 @@
ifneq ($(wildcard h323/Makefile.ast),)
include h323/Makefile.ast
-H323LDFLAGS += -Wl,--version-script=noexport.map
+H323LDFLAGS += -Wl,--version-script=h323/noexport.map
else
h323/libchanh323.a:
$(CMD_PREFIX) $(MAKE) -C h323
Copied: team/pcadach/chan_h323-live/channels/h323/noexport.map (from r41987, team/pcadach/chan_h323-live/channels/noexport.map)
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channels/h323/noexport.map?p2=team/pcadach/chan_h323-live/channels/h323/noexport.map&p1=team/pcadach/chan_h323-live/channels/noexport.map&r1=41987&r2=41988&rev=41988&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/noexport.map (original)
+++ team/pcadach/chan_h323-live/channels/h323/noexport.map Mon Sep 4 06:03:21 2006
@@ -1,3 +1,5 @@
{
+ global:
+ _Z11PAssertFuncPKc;
local: *;
};
Added: team/pcadach/chan_h323-live/channels/h323/patches/openh323_v1_18_0.diff
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channels/h323/patches/openh323_v1_18_0.diff?rev=41988&view=auto
==============================================================================
--- team/pcadach/chan_h323-live/channels/h323/patches/openh323_v1_18_0.diff (added)
+++ team/pcadach/chan_h323-live/channels/h323/patches/openh323_v1_18_0.diff Mon Sep 4 06:03:21 2006
@@ -1,0 +1,142 @@
+diff -u --recursive openh323_v1_18_0-std/src/h323pluginmgr.cxx openh323_v1_18_0/src/h323pluginmgr.cxx
+--- openh323_v1_18_0-std/src/h323pluginmgr.cxx 2005-08-05 23:11:03.000000000 +0600
++++ openh323_v1_18_0/src/h323pluginmgr.cxx 2006-09-03 21:39:54.000000000 +0600
+@@ -358,14 +358,18 @@
+ {
+ public:
+ Worker(const PString & key, PluginCodec_Definition * _codecDefn)
+- : PFactory<OpalFactoryCodec>::WorkerBase(TRUE), codecDefn(_codecDefn)
++ : PFactory<OpalFactoryCodec>::WorkerBase(TRUE), codecDefn(_codecDefn), _key(key)
+ { PFactory<OpalFactoryCodec>::Register(key, this); }
++
++ ~Worker()
++ { PFactory<OpalFactoryCodec>::Unregister(_key); }
+
+ protected:
+ virtual OpalFactoryCodec * Create(const PString &) const
+ { return new OpalPluginCodec(codecDefn); }
+
+ PluginCodec_Definition * codecDefn;
++ PString _key;
+ };
+ };
+
+@@ -505,12 +509,17 @@
+ {
+ public:
+ Worker(const PString & key)
+- : PFactory<OpalFactoryCodec>::WorkerBase()
++ : PFactory<OpalFactoryCodec>::WorkerBase(),
++ _key(key)
+ { PFactory<OpalFactoryCodec>::Register(key, this); }
+
++ ~Worker()
++ { PFactory<OpalFactoryCodec>::Unregister(_key); }
++
+ protected:
+ virtual OpalFactoryCodec * Create(const PString &) const
+ { return new CodecClass(); }
++ PString _key;
+ };
+ };
+
+@@ -1277,6 +1286,7 @@
+ virtual PluginCodec_GetCodecFunction Get_GetCodecFn() = 0;
+ };
+
++static std::vector<OpalPluginCodecFactory::Worker *> workerlist;
+
+ H323PluginCodecManager::H323PluginCodecManager(PPluginManager * _pluginMgr)
+ : PPluginModuleManager(PLUGIN_CODEC_GET_CODEC_FN_STR, _pluginMgr)
+@@ -1306,6 +1316,7 @@
+ } else {
+ PTRACE(4, "H323PLUGIN\tLoading static codec plugin " << *r);
+ RegisterStaticCodec(*r, instance->Get_GetAPIFn(), instance->Get_GetCodecFn());
++ delete instance;
+ }
+ }
+ }
+@@ -1314,8 +1325,33 @@
+ pluginMgr->AddNotifier(PCREATE_NOTIFIER(OnLoadModule), TRUE);
+ }
+
++static OpalFixedCodecFactory<OpalG711ALaw64k_Encoder>::Worker *g711a_encoder = NULL;
++static OpalFixedCodecFactory<OpalG711ALaw64k_Decoder>::Worker *g711a_decoder = NULL;
++static OpalFixedCodecFactory<OpalG711uLaw64k_Encoder>::Worker *g711u_encoder = NULL;
++static OpalFixedCodecFactory<OpalG711uLaw64k_Decoder>::Worker *g711u_decoder = NULL;
++
+ H323PluginCodecManager::~H323PluginCodecManager()
+ {
++ if (g711a_encoder)
++ {
++ delete g711a_encoder;
++ g711a_encoder = NULL;
++ }
++ if (g711a_decoder)
++ {
++ delete g711a_decoder;
++ g711a_decoder = NULL;
++ }
++ if (g711u_encoder)
++ {
++ delete g711u_encoder;
++ g711u_encoder = NULL;
++ }
++ if (g711u_decoder)
++ {
++ delete g711u_decoder;
++ g711u_decoder = NULL;
++ }
+ }
+
+ void H323PluginCodecManager::OnShutdown()
+@@ -1325,6 +1361,22 @@
+
+ // unregister the plugin capabilities
+ H323CapabilityFactory::UnregisterAll();
++
++ OpalMediaFormat::List & list = H323PluginCodecManager::GetMediaFormatList();
++ while (list.GetSize() > 0)
++ {
++ OpalMediaFormat *item = (OpalMediaFormat *)list.GetAt(0);
++ list.RemoveAt(0);
++// delete item;
++ }
++
++ while (workerlist.begin() != workerlist.end())
++ {
++ std::vector<OpalPluginCodecFactory::Worker *>::iterator r = workerlist.begin();
++ OpalPluginCodecFactory::Worker *worker = *r;
++ delete worker;
++ workerlist.erase(r);
++ }
+ }
+
+ void H323PluginCodecManager::OnLoadPlugin(PDynaLink & dll, INT code)
+@@ -1597,8 +1649,8 @@
+ }
+
+ // create the factories for the codecs
+- new OpalPluginCodecFactory::Worker(PString(encoderCodec->sourceFormat) + "|" + encoderCodec->destFormat, encoderCodec);
+- new OpalPluginCodecFactory::Worker(PString(decoderCodec->sourceFormat) + "|" + decoderCodec->destFormat, decoderCodec);
++ workerlist.push_back(new OpalPluginCodecFactory::Worker(PString(encoderCodec->sourceFormat) + "|" + encoderCodec->destFormat, encoderCodec));
++ workerlist.push_back(new OpalPluginCodecFactory::Worker(PString(decoderCodec->sourceFormat) + "|" + decoderCodec->destFormat, decoderCodec));
+ }
+
+ H323Capability * H323PluginCodecManager::CreateCapability(
+@@ -2096,11 +2148,11 @@
+ mediaFormatList.Append(new OpalMediaFormat(OpalG711uLaw));
+ mediaFormatList.Append(new OpalMediaFormat(OpalG711ALaw));
+
+- new OpalFixedCodecFactory<OpalG711ALaw64k_Encoder>::Worker(OpalG711ALaw64k_Encoder::GetFactoryName());
+- new OpalFixedCodecFactory<OpalG711ALaw64k_Decoder>::Worker(OpalG711ALaw64k_Decoder::GetFactoryName());
++ g711a_encoder = new OpalFixedCodecFactory<OpalG711ALaw64k_Encoder>::Worker(OpalG711ALaw64k_Encoder::GetFactoryName());
++ g711a_decoder = new OpalFixedCodecFactory<OpalG711ALaw64k_Decoder>::Worker(OpalG711ALaw64k_Decoder::GetFactoryName());
+
+- new OpalFixedCodecFactory<OpalG711uLaw64k_Encoder>::Worker(OpalG711uLaw64k_Encoder::GetFactoryName());
+- new OpalFixedCodecFactory<OpalG711uLaw64k_Decoder>::Worker(OpalG711uLaw64k_Decoder::GetFactoryName());
++ g711u_encoder = new OpalFixedCodecFactory<OpalG711uLaw64k_Encoder>::Worker(OpalG711uLaw64k_Encoder::GetFactoryName());
++ g711u_decoder = new OpalFixedCodecFactory<OpalG711uLaw64k_Decoder>::Worker(OpalG711uLaw64k_Decoder::GetFactoryName());
+ #endif
+
+ #ifndef NO_H323_VIDEO
Propchange: team/pcadach/chan_h323-live/channels/h323/patches/openh323_v1_18_0.diff
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/pcadach/chan_h323-live/channels/h323/patches/openh323_v1_18_0.diff
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Propchange: team/pcadach/chan_h323-live/channels/h323/patches/openh323_v1_18_0.diff
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: team/pcadach/chan_h323-live/channels/h323/patches/pwlib_v1_10_0.diff
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channels/h323/patches/pwlib_v1_10_0.diff?rev=41988&view=auto
==============================================================================
--- team/pcadach/chan_h323-live/channels/h323/patches/pwlib_v1_10_0.diff (added)
+++ team/pcadach/chan_h323-live/channels/h323/patches/pwlib_v1_10_0.diff Mon Sep 4 06:03:21 2006
@@ -1,0 +1,53 @@
+diff -u --recursive pwlib_v1_10_0-std/include/ptlib/pfactory.h pwlib_v1_10_0/include/ptlib/pfactory.h
+--- pwlib_v1_10_0-std/include/ptlib/pfactory.h 2005-09-18 19:01:40.000000000 +0600
++++ pwlib_v1_10_0/include/ptlib/pfactory.h 2006-09-03 21:43:06.000000000 +0600
+@@ -258,12 +258,18 @@
+ {
+ public:
+ Worker(const Key_T & key, bool singleton = false)
+- : WorkerBase(singleton)
++ : WorkerBase(singleton), _key(key)
+ {
+ PFactory<_Abstract_T, _Key_T>::Register(key, this); // here
+ }
++ ~Worker()
++ {
++ PFactory<_Abstract_T, _Key_T>::Unregister(_key);
++ deleteSingleton = true;
++ }
+
+ protected:
++ const Key_T _key;
+ virtual Abstract_T * Create(const Key_T & /*key*/) const { return new _Concrete_T; }
+ };
+
+@@ -331,6 +337,7 @@
+ if (entry->second->isDynamic)
+ delete entry->second;
+ }
++ keyMap.erase(keyMap.begin(), keyMap.end());
+ }
+
+ static PFactory & GetInstance()
+@@ -358,6 +365,8 @@
+ PWaitAndSignal m(mutex);
+ if (keyMap.find(key) == keyMap.end())
+ keyMap[key] = worker;
++ else if (worker->isDynamic)
++ delete worker;
+ }
+
+ void Unregister_Internal(const _Key_T & key)
+diff -u --recursive pwlib_v1_10_0-std/src/ptlib/common/pluginmgr.cxx pwlib_v1_10_0/src/ptlib/common/pluginmgr.cxx
+--- pwlib_v1_10_0-std/src/ptlib/common/pluginmgr.cxx 2005-11-30 18:47:42.000000000 +0600
++++ pwlib_v1_10_0/src/ptlib/common/pluginmgr.cxx 2006-09-03 21:43:58.000000000 +0600
+@@ -479,8 +479,8 @@
+ while (managers.begin() != managers.end()) {
+ std::vector<PPluginModuleManager *>::iterator r = managers.begin();
+ PPluginModuleManager * mgr = *r;
+- managers.erase(r);
+ mgr->OnShutdown();
++ managers.erase(r);
+ }
+ }
+
Propchange: team/pcadach/chan_h323-live/channels/h323/patches/pwlib_v1_10_0.diff
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/pcadach/chan_h323-live/channels/h323/patches/pwlib_v1_10_0.diff
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Propchange: team/pcadach/chan_h323-live/channels/h323/patches/pwlib_v1_10_0.diff
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-commits
mailing list