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

dash: No need to instantiate a factory.

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent b67634af
...@@ -42,15 +42,13 @@ DASHManager::DASHManager (HTTPConnectionManager *conManager, Node *node, IAda ...@@ -42,15 +42,13 @@ DASHManager::DASHManager (HTTPConnectionManager *conManager, Node *node, IAda
this->profile = profile; this->profile = profile;
this->mpdManagerFactory = new MPDManagerFactory(); this->mpdManagerFactory = new MPDManagerFactory();
this->mpdManager = this->mpdManagerFactory->create(this->profile, this->node); this->mpdManager = this->mpdManagerFactory->create(this->profile, this->node);
this->logicFactory = new AdaptationLogicFactory(); this->adaptationLogic = AdaptationLogicFactory::create( this->logicType, this->mpdManager );
this->adaptationLogic = this->logicFactory->create(this->logicType, this->mpdManager);
this->currentChunk = NULL; this->currentChunk = NULL;
this->conManager->attach(this->adaptationLogic); this->conManager->attach(this->adaptationLogic);
} }
DASHManager::~DASHManager () DASHManager::~DASHManager ()
{ {
delete(this->logicFactory);
delete(this->adaptationLogic); delete(this->adaptationLogic);
delete(this->mpdManager); delete(this->mpdManager);
} }
......
...@@ -47,7 +47,6 @@ namespace dash ...@@ -47,7 +47,6 @@ namespace dash
private: private:
http::HTTPConnectionManager *conManager; http::HTTPConnectionManager *conManager;
http::Chunk *currentChunk; http::Chunk *currentChunk;
logic::AdaptationLogicFactory *logicFactory;
logic::IAdaptationLogic *adaptationLogic; logic::IAdaptationLogic *adaptationLogic;
logic::IAdaptationLogic::LogicType logicType; logic::IAdaptationLogic::LogicType logicType;
mpd::Profile profile; mpd::Profile profile;
......
...@@ -31,15 +31,6 @@ using namespace dash::logic; ...@@ -31,15 +31,6 @@ using namespace dash::logic;
using namespace dash::xml; using namespace dash::xml;
using namespace dash::mpd; using namespace dash::mpd;
AdaptationLogicFactory::AdaptationLogicFactory ()
{
}
AdaptationLogicFactory::~AdaptationLogicFactory ()
{
}
IAdaptationLogic* AdaptationLogicFactory::create (IAdaptationLogic::LogicType logic, IMPDManager *mpdManager) IAdaptationLogic* AdaptationLogicFactory::create (IAdaptationLogic::LogicType logic, IMPDManager *mpdManager)
{ {
switch(logic) switch(logic)
......
...@@ -39,10 +39,7 @@ namespace dash ...@@ -39,10 +39,7 @@ namespace dash
class AdaptationLogicFactory class AdaptationLogicFactory
{ {
public: public:
AdaptationLogicFactory (); static IAdaptationLogic* create (IAdaptationLogic::LogicType logic, dash::mpd::IMPDManager *mpdManager);
virtual ~AdaptationLogicFactory ();
IAdaptationLogic* create (IAdaptationLogic::LogicType logic, dash::mpd::IMPDManager *mpdManager);
}; };
} }
} }
......
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