Commit 077312c6 authored by Francois Cartegnie's avatar Francois Cartegnie

stream_filter: dash: merge managers

parent cd12fedb
......@@ -36,22 +36,18 @@ libdash_plugin_la_SOURCES = \
stream_filter/dash/mpd/AdaptationSet.cpp \
stream_filter/dash/mpd/AdaptationSet.h \
stream_filter/dash/mpd/BaseUrl.h \
stream_filter/dash/mpd/BasicCMManager.cpp \
stream_filter/dash/mpd/BasicCMManager.h \
stream_filter/dash/mpd/BasicCMParser.cpp \
stream_filter/dash/mpd/BasicCMParser.h \
stream_filter/dash/mpd/CommonAttributesElements.cpp \
stream_filter/dash/mpd/CommonAttributesElements.h \
stream_filter/dash/mpd/ContentDescription.cpp \
stream_filter/dash/mpd/ContentDescription.h \
stream_filter/dash/mpd/IMPDManager.h \
stream_filter/dash/mpd/IMPDManager.cpp \
stream_filter/dash/mpd/MPDManager.hpp \
stream_filter/dash/mpd/MPDManager.cpp \
stream_filter/dash/mpd/IMPDParser.cpp \
stream_filter/dash/mpd/IMPDParser.h \
stream_filter/dash/mpd/IsoffMainParser.cpp \
stream_filter/dash/mpd/IsoffMainParser.h \
stream_filter/dash/mpd/IsoffMainManager.cpp \
stream_filter/dash/mpd/IsoffMainManager.h \
stream_filter/dash/mpd/MPD.cpp \
stream_filter/dash/mpd/MPD.h \
stream_filter/dash/mpd/MPDFactory.cpp \
......
......@@ -92,7 +92,7 @@ int DASHManager::peek( const uint8_t **pp_peek, size_t i_peek )
return this->buffer->peek(pp_peek, i_peek);
}
const mpd::IMPDManager* DASHManager::getMpdManager() const
const mpd::MPDManager* DASHManager::getMpdManager() const
{
return this->mpdManager;
}
......
......@@ -29,7 +29,7 @@
#include "xml/Node.h"
#include "adaptationlogic/IAdaptationLogic.h"
#include "adaptationlogic/AdaptationLogicFactory.h"
#include "mpd/IMPDManager.h"
#include "mpd/MPDManager.hpp"
#include "mpd/MPDManagerFactory.h"
#include "buffer/BlockBuffer.h"
#include "DASHDownloader.h"
......@@ -49,7 +49,7 @@ namespace dash
int peek ( const uint8_t **pp_peek, size_t i_peek );
int seekBackwards ( unsigned len );
const mpd::IMPDManager* getMpdManager () const;
const mpd::MPDManager* getMpdManager () const;
const logic::IAdaptationLogic* getAdaptionLogic() const;
const http::Chunk *getCurrentChunk() const;
......@@ -58,7 +58,7 @@ namespace dash
http::Chunk *currentChunk;
logic::IAdaptationLogic *adaptationLogic;
logic::IAdaptationLogic::LogicType logicType;
mpd::IMPDManager *mpdManager;
mpd::MPDManager *mpdManager;
mpd::MPD *mpd;
stream_t *stream;
DASHDownloader *downloader;
......
......@@ -31,7 +31,7 @@ using namespace dash::logic;
using namespace dash::xml;
using namespace dash::mpd;
AbstractAdaptationLogic::AbstractAdaptationLogic (IMPDManager *mpdManager, stream_t *stream) :
AbstractAdaptationLogic::AbstractAdaptationLogic (MPDManager *mpdManager, stream_t *stream) :
bpsAvg (0),
bpsLastChunk (0),
mpdManager (mpdManager),
......
......@@ -29,7 +29,7 @@
#include "xml/Node.h"
#include "http/Chunk.h"
#include "mpd/MPD.h"
#include "mpd/IMPDManager.h"
#include "mpd/MPDManager.hpp"
#include "mpd/Period.h"
#include "mpd/Representation.h"
#include "mpd/Segment.h"
......@@ -43,7 +43,7 @@ namespace dash
class AbstractAdaptationLogic : public IAdaptationLogic
{
public:
AbstractAdaptationLogic (dash::mpd::IMPDManager *mpdManager, stream_t *stream);
AbstractAdaptationLogic (dash::mpd::MPDManager *mpdManager, stream_t *stream);
virtual ~AbstractAdaptationLogic ();
virtual void downloadRateChanged (uint64_t bpsAvg, uint64_t bpsLastChunk);
......@@ -56,7 +56,7 @@ namespace dash
private:
int bpsAvg;
long bpsLastChunk;
dash::mpd::IMPDManager *mpdManager;
dash::mpd::MPDManager *mpdManager;
stream_t *stream;
mtime_t bufferedMicroSec;
int bufferedPercent;
......
......@@ -32,7 +32,7 @@ using namespace dash::xml;
using namespace dash::mpd;
IAdaptationLogic* AdaptationLogicFactory::create ( IAdaptationLogic::LogicType logic,
IMPDManager *mpdManager, stream_t *stream)
MPDManager *mpdManager, stream_t *stream)
{
switch(logic)
{
......
......@@ -27,7 +27,7 @@
#include "adaptationlogic/IAdaptationLogic.h"
#include "xml/Node.h"
#include "mpd/IMPDManager.h"
#include "mpd/MPDManager.hpp"
#include "adaptationlogic/AlwaysBestAdaptationLogic.h"
#include "adaptationlogic/RateBasedAdaptationLogic.h"
......@@ -40,7 +40,7 @@ namespace dash
class AdaptationLogicFactory
{
public:
static IAdaptationLogic* create (IAdaptationLogic::LogicType logic, dash::mpd::IMPDManager *mpdManager, stream_t *stream);
static IAdaptationLogic* create (IAdaptationLogic::LogicType logic, dash::mpd::MPDManager *mpdManager, stream_t *stream);
};
}
}
......
......@@ -32,7 +32,7 @@ using namespace dash::xml;
using namespace dash::http;
using namespace dash::mpd;
AlwaysBestAdaptationLogic::AlwaysBestAdaptationLogic (IMPDManager *mpdManager, stream_t *stream) :
AlwaysBestAdaptationLogic::AlwaysBestAdaptationLogic (MPDManager *mpdManager, stream_t *stream) :
AbstractAdaptationLogic (mpdManager, stream)
{
this->mpdManager = mpdManager;
......
......@@ -29,10 +29,9 @@
#include "Representationselectors.hpp"
#include "http/Chunk.h"
#include "xml/Node.h"
#include "mpd/IMPDManager.h"
#include "mpd/MPDManager.hpp"
#include "mpd/Period.h"
#include "mpd/Segment.h"
#include "mpd/BasicCMManager.h"
#include <vector>
namespace dash
......@@ -42,7 +41,7 @@ namespace dash
class AlwaysBestAdaptationLogic : public AbstractAdaptationLogic
{
public:
AlwaysBestAdaptationLogic (dash::mpd::IMPDManager *mpdManager, stream_t *stream);
AlwaysBestAdaptationLogic (dash::mpd::MPDManager *mpdManager, stream_t *stream);
virtual ~AlwaysBestAdaptationLogic ();
dash::http::Chunk* getNextChunk();
......@@ -50,7 +49,7 @@ namespace dash
private:
std::vector<mpd::Segment *> schedule;
dash::mpd::IMPDManager *mpdManager;
dash::mpd::MPDManager *mpdManager;
size_t count;
dash::mpd::Representation *bestRepresentation;
......
......@@ -33,7 +33,7 @@ using namespace dash::xml;
using namespace dash::http;
using namespace dash::mpd;
RateBasedAdaptationLogic::RateBasedAdaptationLogic (IMPDManager *mpdManager, stream_t *stream) :
RateBasedAdaptationLogic::RateBasedAdaptationLogic (MPDManager *mpdManager, stream_t *stream) :
AbstractAdaptationLogic (mpdManager, stream),
mpdManager (mpdManager),
count (0),
......
......@@ -27,9 +27,8 @@
#include "adaptationlogic/AbstractAdaptationLogic.h"
#include "xml/Node.h"
#include "mpd/IMPDManager.h"
#include "mpd/MPDManager.hpp"
#include "http/Chunk.h"
#include "mpd/BasicCMManager.h"
#include <vlc_common.h>
#include <vlc_stream.h>
......@@ -43,13 +42,13 @@ namespace dash
class RateBasedAdaptationLogic : public AbstractAdaptationLogic
{
public:
RateBasedAdaptationLogic (dash::mpd::IMPDManager *mpdManager, stream_t *stream);
RateBasedAdaptationLogic (dash::mpd::MPDManager *mpdManager, stream_t *stream);
dash::http::Chunk* getNextChunk();
const dash::mpd::Representation *getCurrentRepresentation() const;
private:
dash::mpd::IMPDManager *mpdManager;
dash::mpd::MPDManager *mpdManager;
size_t count;
dash::mpd::Period *currentPeriod;
int width;
......
/*
* BasicCMManager.cpp
*****************************************************************************
* 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.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "BasicCMManager.h"
using namespace dash::mpd;
BasicCMManager::BasicCMManager(MPD *mpd) :
IMPDManager(mpd)
{
}
/*
* BasicCMManager.h
*****************************************************************************
* 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 BASICCMMANAGER_H_
#define BASICCMMANAGER_H_
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "mpd/IMPDManager.h"
#include "mpd/SegmentInfo.h"
#include "mpd/Segment.h"
namespace dash
{
namespace mpd
{
class BasicCMManager : public IMPDManager
{
public:
BasicCMManager (MPD *mpd);
};
}
}
#endif /* BASICCMMANAGER_H_ */
/*
* IsoffMainManager.cpp
*****************************************************************************
* Copyright (C) 2010 - 2012 Klagenfurt University
*
* Created on: Jan 27, 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.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "IsoffMainManager.h"
#include "../adaptationlogic/Representationselectors.hpp"
using namespace dash::mpd;
using namespace dash::logic;
IsoffMainManager::IsoffMainManager(MPD *mpd) :
IMPDManager( mpd )
{
}
/*
* IsoffMainManager.h
*****************************************************************************
* Copyright (C) 2010 - 2012 Klagenfurt University
*
* Created on: Jan 27, 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 ISOFFMAINMANAGER_H_
#define ISOFFMAINMANAGER_H_
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "mpd/IMPDManager.h"
#include "mpd/AdaptationSet.h"
#include "mpd/SegmentInfo.h"
#include "mpd/Segment.h"
namespace dash
{
namespace mpd
{
class IsoffMainManager : public IMPDManager
{
public:
IsoffMainManager (MPD *mpd);
};
}
}
#endif /* ISOFFMAINMANAGER_H_ */
/*
* IMPDManager.cpp
* MPDManager.cpp
*****************************************************************************
* Copyright (C) 2014 - VideoLAN Authors
*
......@@ -21,28 +21,28 @@
# include "config.h"
#endif
#include "IMPDManager.h"
#include "MPDManager.hpp"
#include <limits>
using namespace dash::mpd;
IMPDManager::IMPDManager(MPD *mpd_) :
MPDManager::MPDManager(MPD *mpd_) :
mpd(mpd_)
{
}
IMPDManager::~IMPDManager()
MPDManager::~MPDManager()
{
delete mpd;
}
const std::vector<Period*>& IMPDManager::getPeriods() const
const std::vector<Period*>& MPDManager::getPeriods() const
{
return mpd->getPeriods();
}
Period* IMPDManager::getFirstPeriod() const
Period* MPDManager::getFirstPeriod() const
{
std::vector<Period *> periods = getPeriods();
......@@ -52,7 +52,7 @@ Period* IMPDManager::getFirstPeriod() const
return NULL;
}
Period* IMPDManager::getNextPeriod(Period *period)
Period* MPDManager::getNextPeriod(Period *period)
{
std::vector<Period *> periods = getPeriods();
......@@ -65,7 +65,7 @@ Period* IMPDManager::getNextPeriod(Period *period)
return NULL;
}
const MPD* IMPDManager::getMPD() const
const MPD* MPDManager::getMPD() const
{
return mpd;
}
/*
* IMPDManager.h
* MPDManager.hpp
*****************************************************************************
* Copyright (C) 2010 - 2011 Klagenfurt University
*
......@@ -22,8 +22,8 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef IMPDMANAGER_H_
#define IMPDMANAGER_H_
#ifndef MPDMANAGER_H_
#define MPDMANAGER_H_
#include "mpd/MPD.h"
#include "mpd/Period.h"
......@@ -33,11 +33,11 @@ namespace dash
{
namespace mpd
{
class IMPDManager
class MPDManager
{
public:
IMPDManager( MPD *mpd );
virtual ~IMPDManager();
MPDManager( MPD *mpd );
virtual ~MPDManager();
virtual const std::vector<Period *>& getPeriods () const;
virtual Period* getFirstPeriod () const;
......@@ -49,4 +49,4 @@ namespace dash
};
}
}
#endif /* IMPDMANAGER_H_ */
#endif /* MPDMANAGER_H_ */
......@@ -29,15 +29,14 @@
using namespace dash::mpd;
IMPDManager* MPDManagerFactory::create( MPD *mpd )
MPDManager* MPDManagerFactory::create( MPD *mpd )
{
switch( mpd->getProfile() )
{
case mpd::Profile::ISOOnDemand:
case mpd::Profile::Full:
return new BasicCMManager (mpd);
case mpd::Profile::ISOMain:
return new IsoffMainManager (mpd);
return new MPDManager(mpd);
default:
return NULL;
}
......
......@@ -25,9 +25,7 @@
#ifndef MPDMANAGERFACTORY_H_
#define MPDMANAGERFACTORY_H_
#include "mpd/IMPDManager.h"
#include "mpd/BasicCMManager.h"
#include "mpd/IsoffMainManager.h"
#include "mpd/MPDManager.hpp"
namespace dash
{
......@@ -36,7 +34,7 @@ namespace dash
class MPDManagerFactory
{
public:
static IMPDManager* create( MPD *mpd );
static MPDManager* create( MPD *mpd );
};
}
}
......
......@@ -33,7 +33,7 @@
#include <vlc_stream.h>
#include <vlc_xml.h>
#include "mpd/IMPDManager.h"
#include "mpd/MPDManager.hpp"
#include "xml/Node.h"
namespace dash
......
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