Commit dd159d08 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Rémi Denis-Courmont

dash: Removing factory another class instantiation.

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent c1a6296e
...@@ -40,8 +40,7 @@ DASHManager::DASHManager (HTTPConnectionManager *conManager, Node *node, IAda ...@@ -40,8 +40,7 @@ DASHManager::DASHManager (HTTPConnectionManager *conManager, Node *node, IAda
this->node = node; this->node = node;
this->logicType = type; this->logicType = type;
this->profile = profile; this->profile = profile;
this->mpdManagerFactory = new MPDManagerFactory(); this->mpdManager = mpd::MPDManagerFactory::create(this->profile, this->node);
this->mpdManager = this->mpdManagerFactory->create(this->profile, this->node);
this->adaptationLogic = AdaptationLogicFactory::create( this->logicType, this->mpdManager ); this->adaptationLogic = AdaptationLogicFactory::create( this->logicType, this->mpdManager );
this->currentChunk = NULL; this->currentChunk = NULL;
...@@ -50,7 +49,6 @@ DASHManager::DASHManager (HTTPConnectionManager *conManager, Node *node, IAda ...@@ -50,7 +49,6 @@ DASHManager::DASHManager (HTTPConnectionManager *conManager, Node *node, IAda
DASHManager::~DASHManager () DASHManager::~DASHManager ()
{ {
delete(this->adaptationLogic); delete(this->adaptationLogic);
delete(this->mpdManager);
} }
int DASHManager::read (void *p_buffer, size_t len) int DASHManager::read (void *p_buffer, size_t len)
......
...@@ -51,7 +51,6 @@ namespace dash ...@@ -51,7 +51,6 @@ namespace dash
logic::IAdaptationLogic::LogicType logicType; logic::IAdaptationLogic::LogicType logicType;
mpd::Profile profile; mpd::Profile profile;
xml::Node *node; xml::Node *node;
mpd::MPDManagerFactory *mpdManagerFactory;
mpd::IMPDManager *mpdManager; mpd::IMPDManager *mpdManager;
}; };
} }
......
...@@ -30,29 +30,19 @@ ...@@ -30,29 +30,19 @@
using namespace dash::mpd; using namespace dash::mpd;
using namespace dash::xml; 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) IMPDManager* MPDManagerFactory::create (Profile profile, Node *root)
{ {
switch(profile) switch(profile)
{ {
case mpd::Basic: return new NullManager(); 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::Full2011: return new NullManager();
case mpd::NotValid: return new NullManager(); case mpd::NotValid: return new NullManager();
default: return new NullManager(); default: return new NullManager();
} }
} }
IMPDManager* MPDManagerFactory::createBasicCMManager (Node *root) IMPDManager* MPDManagerFactory::createBasicCMManager (Node *root)
{ {
BasicCMParser *parser = new BasicCMParser(root); BasicCMParser *parser = new BasicCMParser(root);
......
...@@ -38,13 +38,10 @@ namespace dash ...@@ -38,13 +38,10 @@ namespace dash
class MPDManagerFactory class MPDManagerFactory
{ {
public: public:
MPDManagerFactory (); static IMPDManager* create(Profile profile, dash::xml::Node *root);
virtual ~MPDManagerFactory ();
IMPDManager* create(Profile profile, dash::xml::Node *root);
private: private:
IMPDManager* createBasicCMManager(dash::xml::Node *root); static IMPDManager* createBasicCMManager(dash::xml::Node *root);
}; };
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment