26 changed files with 66 additions and 275 deletions
@ -1,71 +0,0 @@ |
|||
/*
|
|||
* MPDManager.cpp |
|||
***************************************************************************** |
|||
* Copyright (C) 2014 - VideoLAN Authors |
|||
* |
|||
* 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 Lesser 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. |
|||
*****************************************************************************/ |
|||
#ifdef HAVE_CONFIG_H |
|||
# include "config.h" |
|||
#endif |
|||
|
|||
#include "MPDManager.hpp" |
|||
#include <limits> |
|||
|
|||
using namespace dash::mpd; |
|||
|
|||
MPDManager::MPDManager(MPD *mpd_) : |
|||
mpd(mpd_) |
|||
{ |
|||
|
|||
} |
|||
|
|||
MPDManager::~MPDManager() |
|||
{ |
|||
delete mpd; |
|||
} |
|||
|
|||
const std::vector<Period*>& MPDManager::getPeriods() const |
|||
{ |
|||
return mpd->getPeriods(); |
|||
} |
|||
|
|||
Period* MPDManager::getFirstPeriod() const |
|||
{ |
|||
std::vector<Period *> periods = getPeriods(); |
|||
|
|||
if( !periods.empty() ) |
|||
return periods.front(); |
|||
else |
|||
return NULL; |
|||
} |
|||
|
|||
Period* MPDManager::getNextPeriod(Period *period) |
|||
{ |
|||
std::vector<Period *> periods = getPeriods(); |
|||
|
|||
for(size_t i = 0; i < periods.size(); i++) |
|||
{ |
|||
if(periods.at(i) == period && (i + 1) < periods.size()) |
|||
return periods.at(i + 1); |
|||
} |
|||
|
|||
return NULL; |
|||
} |
|||
|
|||
const MPD* MPDManager::getMPD() const |
|||
{ |
|||
return mpd; |
|||
} |
|||
@ -1,52 +0,0 @@ |
|||
/*
|
|||
* MPDManager.hpp |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 - 2011 Klagenfurt University |
|||
* |
|||
* Created on: Aug 10, 2010 |
|||
* 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 Lesser 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 MPDMANAGER_H_ |
|||
#define MPDMANAGER_H_ |
|||
|
|||
#include "mpd/MPD.h" |
|||
#include "mpd/Period.h" |
|||
#include "mpd/Representation.h" |
|||
|
|||
namespace dash |
|||
{ |
|||
namespace mpd |
|||
{ |
|||
class MPDManager |
|||
{ |
|||
public: |
|||
MPDManager( MPD *mpd ); |
|||
virtual ~MPDManager(); |
|||
|
|||
virtual const std::vector<Period *>& getPeriods () const; |
|||
virtual Period* getFirstPeriod () const; |
|||
virtual Period* getNextPeriod (Period *period); |
|||
virtual const MPD* getMPD () const; |
|||
|
|||
protected: |
|||
MPD *mpd; |
|||
}; |
|||
} |
|||
} |
|||
#endif /* MPDMANAGER_H_ */ |
|||
@ -1,43 +0,0 @@ |
|||
/*
|
|||
* MPDManagerFactory.cpp |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 - 2011 Klagenfurt University |
|||
* |
|||
* Created on: Apr 20, 2011 |
|||
* 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 Lesser 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. |
|||
*****************************************************************************/ |
|||
#ifdef HAVE_CONFIG_H |
|||
# include "config.h" |
|||
#endif |
|||
|
|||
#include "mpd/MPDManagerFactory.h" |
|||
|
|||
using namespace dash::mpd; |
|||
|
|||
MPDManager* MPDManagerFactory::create( MPD *mpd ) |
|||
{ |
|||
switch( mpd->getProfile() ) |
|||
{ |
|||
case mpd::Profile::ISOOnDemand: |
|||
case mpd::Profile::Full: |
|||
case mpd::Profile::ISOMain: |
|||
return new MPDManager(mpd); |
|||
default: |
|||
return NULL; |
|||
} |
|||
} |
|||
@ -1,42 +0,0 @@ |
|||
/*
|
|||
* MPDManagerFactory.h |
|||
***************************************************************************** |
|||
* Copyright (C) 2010 - 2011 Klagenfurt University |
|||
* |
|||
* Created on: Apr 20, 2011 |
|||
* 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 Lesser 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 MPDMANAGERFACTORY_H_ |
|||
#define MPDMANAGERFACTORY_H_ |
|||
|
|||
#include "mpd/MPDManager.hpp" |
|||
|
|||
namespace dash |
|||
{ |
|||
namespace mpd |
|||
{ |
|||
class MPDManagerFactory |
|||
{ |
|||
public: |
|||
static MPDManager* create( MPD *mpd ); |
|||
}; |
|||
} |
|||
} |
|||
|
|||
#endif /* MPDMANAGERFACTORY_H_ */ |
|||
Loading…
Reference in new issue