[vlc-commits] dash: Removing factory another class instantiation.

Hugo Beauzée-Luyssen git at videolan.org
Thu Nov 24 18:00:54 CET 2011


vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Thu Nov 24 11:29:59 2011 +0100| [dd159d0811d89c2bb90408fc1fc63cff0791cda2] | committer: Rémi Denis-Courmont

dash: Removing factory another class instantiation.

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dd159d0811d89c2bb90408fc1fc63cff0791cda2
---

 modules/stream_filter/dash/DASHManager.cpp         |    4 +---
 modules/stream_filter/dash/DASHManager.h           |    1 -
 .../stream_filter/dash/mpd/MPDManagerFactory.cpp   |   14 ++------------
 modules/stream_filter/dash/mpd/MPDManagerFactory.h |    7 ++-----
 4 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/modules/stream_filter/dash/DASHManager.cpp b/modules/stream_filter/dash/DASHManager.cpp
index 9dfb333..aa4e8fb 100644
--- a/modules/stream_filter/dash/DASHManager.cpp
+++ b/modules/stream_filter/dash/DASHManager.cpp
@@ -40,8 +40,7 @@ DASHManager::DASHManager    (HTTPConnectionManager *conManager, Node *node, IAda
     this->node              = node;
     this->logicType         = type;
     this->profile           = profile;
-    this->mpdManagerFactory = new MPDManagerFactory();
-    this->mpdManager        = this->mpdManagerFactory->create(this->profile, this->node);
+    this->mpdManager        = mpd::MPDManagerFactory::create(this->profile, this->node);
     this->adaptationLogic   = AdaptationLogicFactory::create( this->logicType, this->mpdManager );
     this->currentChunk      = NULL;
 
@@ -50,7 +49,6 @@ DASHManager::DASHManager    (HTTPConnectionManager *conManager, Node *node, IAda
 DASHManager::~DASHManager   ()
 {
     delete(this->adaptationLogic);
-    delete(this->mpdManager);
 }
 
 int DASHManager::read   (void *p_buffer, size_t len)
diff --git a/modules/stream_filter/dash/DASHManager.h b/modules/stream_filter/dash/DASHManager.h
index e35d10b..a9affcb 100644
--- a/modules/stream_filter/dash/DASHManager.h
+++ b/modules/stream_filter/dash/DASHManager.h
@@ -51,7 +51,6 @@ namespace dash
             logic::IAdaptationLogic::LogicType  logicType;
             mpd::Profile                        profile;
             xml::Node                           *node;
-            mpd::MPDManagerFactory              *mpdManagerFactory;
             mpd::IMPDManager                    *mpdManager;
     };
 }
diff --git a/modules/stream_filter/dash/mpd/MPDManagerFactory.cpp b/modules/stream_filter/dash/mpd/MPDManagerFactory.cpp
index fdf3e2e..9412acf 100644
--- a/modules/stream_filter/dash/mpd/MPDManagerFactory.cpp
+++ b/modules/stream_filter/dash/mpd/MPDManagerFactory.cpp
@@ -30,29 +30,19 @@
 using namespace dash::mpd;
 using namespace dash::xml;
 
-MPDManagerFactory::MPDManagerFactory()
-{
-    // TODO Auto-generated constructor stub
-
-}
-
-MPDManagerFactory::~MPDManagerFactory()
-{
-    // TODO Auto-generated destructor stub
-}
-
 IMPDManager* MPDManagerFactory::create                  (Profile profile, Node *root)
 {
     switch(profile)
     {
         case mpd::Basic:    return new NullManager();
-        case mpd::BasicCM:  return this->createBasicCMManager(root);
+        case mpd::BasicCM:  return createBasicCMManager(root);
         case mpd::Full2011: return new NullManager();
         case mpd::NotValid: return new NullManager();
 
         default:            return new NullManager();
     }
 }
+
 IMPDManager* MPDManagerFactory::createBasicCMManager    (Node *root)
 {
     BasicCMParser *parser = new BasicCMParser(root);
diff --git a/modules/stream_filter/dash/mpd/MPDManagerFactory.h b/modules/stream_filter/dash/mpd/MPDManagerFactory.h
index 6741696..b5cf9b5 100644
--- a/modules/stream_filter/dash/mpd/MPDManagerFactory.h
+++ b/modules/stream_filter/dash/mpd/MPDManagerFactory.h
@@ -38,13 +38,10 @@ namespace dash
         class MPDManagerFactory
         {
             public:
-                MPDManagerFactory           ();
-                virtual ~MPDManagerFactory  ();
-
-                IMPDManager* create(Profile profile, dash::xml::Node *root);
+                static IMPDManager* create(Profile profile, dash::xml::Node *root);
 
             private:
-                IMPDManager* createBasicCMManager(dash::xml::Node *root);
+                static IMPDManager* createBasicCMManager(dash::xml::Node *root);
         };
     }
 }



More information about the vlc-commits mailing list