Commit 1def2aa7 authored by Christopher Mueller's avatar Christopher Mueller Committed by Hugo Beauzée-Luyssen

dash: added mpdfactory

Signed-off-by: default avatarHugo Beauzée-Luyssen <beauze.h@gmail.com>
parent 13abea06
...@@ -38,6 +38,8 @@ SOURCES_stream_filter_dash = \ ...@@ -38,6 +38,8 @@ SOURCES_stream_filter_dash = \
mpd/IsoffMainManager.h \ mpd/IsoffMainManager.h \
mpd/MPD.cpp \ mpd/MPD.cpp \
mpd/MPD.h \ mpd/MPD.h \
mpd/MPDFactory.cpp \
mpd/MPDFactory.h \
mpd/MPDManagerFactory.cpp \ mpd/MPDManagerFactory.cpp \
mpd/MPDManagerFactory.h \ mpd/MPDManagerFactory.h \
mpd/Period.cpp \ mpd/Period.cpp \
......
/*
* MPDFactory.cpp
*****************************************************************************
* Copyright (C) 2010 - 2012 Klagenfurt University
*
* Created on: Jan 27, 2012
* Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
* Christian Timmerer <christian.timmerer@itec.uni-klu.ac.at>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "MPDFactory.h"
using namespace dash::xml;
using namespace dash::mpd;
MPD* MPDFactory::create (dash::xml::Node *root, stream_t *p_stream, Profile profile)
{
switch(profile)
{
case dash::mpd::Full2011:
case dash::mpd::Basic:
case dash::mpd::BasicCM: return MPDFactory::createBasicCMMPD(root, p_stream);
case dash::mpd::IsoffMain: return MPDFactory::createIsoffMainMPD(root, p_stream);
default: return NULL;
}
}
MPD* MPDFactory::createBasicCMMPD (dash::xml::Node *root, stream_t *p_stream)
{
dash::mpd::BasicCMParser mpdParser(root, p_stream);
if(mpdParser.parse() == false || mpdParser.getMPD() == NULL)
return NULL;
return mpdParser.getMPD();
}
MPD* MPDFactory::createIsoffMainMPD (dash::xml::Node *root, stream_t *p_stream)
{
dash::mpd::IsoffMainParser mpdParser(root, p_stream);
if(mpdParser.parse() == false || mpdParser.getMPD() == NULL)
return NULL;
return mpdParser.getMPD();
}
/*
* MPDFactory.h
*****************************************************************************
* Copyright (C) 2010 - 2012 Klagenfurt University
*
* Created on: Jan 27, 2012
* Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
* Christian Timmerer <christian.timmerer@itec.uni-klu.ac.at>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef MPDFACTORY_H_
#define MPDFACTORY_H_
#include "mpd/MPD.h"
#include "mpd/BasicCMParser.h"
#include "mpd/IsoffMainParser.h"
namespace dash
{
namespace mpd
{
class MPDFactory
{
public:
static MPD* create(dash::xml::Node *root, stream_t *p_stream, Profile profile);
private:
static MPD* createBasicCMMPD (dash::xml::Node *root, stream_t *p_stream);
static MPD* createIsoffMainMPD (dash::xml::Node *root, stream_t *p_stream);
};
}
}
#endif /* MPDFACTORY_H_ */
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