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

dash: removed EOFException

Signed-off-by: default avatarHugo Beauzée-Luyssen <beauze.h@gmail.com>
parent 96789285
......@@ -30,7 +30,6 @@
using namespace dash;
using namespace dash::http;
using namespace dash::logic;
using namespace dash::exception;
using namespace dash::buffer;
DASHDownloader::DASHDownloader (HTTPConnectionManager *conManager, IAdaptationLogic *adaptationLogic, BlockBuffer *buffer)
......@@ -67,11 +66,8 @@ void* DASHDownloader::download (void *thread_sys)
{
if(currentChunk == NULL)
{
try
{
currentChunk = adaptationLogic->getNextChunk();
}
catch(EOFException &e)
currentChunk = adaptationLogic->getNextChunk();
if(currentChunk == NULL)
{
buffer->setEOF(true);
}
......
......@@ -27,7 +27,6 @@
#include "http/HTTPConnectionManager.h"
#include "adaptationlogic/IAdaptationLogic.h"
#include "exceptions/EOFException.h"
#include "buffer/BlockBuffer.h"
#define BLOCKSIZE 32768
......
......@@ -33,7 +33,6 @@ using namespace dash::xml;
using namespace dash::logic;
using namespace dash::mpd;
using namespace dash::buffer;
using namespace dash::exception;
DASHManager::DASHManager ( HTTPConnectionManager *conManager, MPD *mpd,
IAdaptationLogic::LogicType type, stream_t *stream) :
......
......@@ -33,7 +33,6 @@
#include "mpd/MPDManagerFactory.h"
#include "buffer/BlockBuffer.h"
#include "DASHDownloader.h"
#include "exceptions/EOFException.h"
#include "mpd/MPD.h"
namespace dash
......
......@@ -12,7 +12,6 @@ SOURCES_stream_filter_dash = \
buffer/BlockBuffer.cpp \
buffer/BlockBuffer.h \
buffer/IBufferObserver.h \
exceptions/EOFException.h \
http/Chunk.cpp \
http/Chunk.h \
http/HTTPConnection.cpp \
......
......@@ -30,7 +30,6 @@
using namespace dash::logic;
using namespace dash::xml;
using namespace dash::mpd;
using namespace dash::exception;
AbstractAdaptationLogic::AbstractAdaptationLogic (IMPDManager *mpdManager, stream_t *stream) :
bpsAvg (0),
......
......@@ -33,7 +33,6 @@
#include "mpd/Period.h"
#include "mpd/Representation.h"
#include "mpd/Segment.h"
#include "exceptions/EOFException.h"
struct stream_t;
......
......@@ -31,7 +31,6 @@ using namespace dash::logic;
using namespace dash::xml;
using namespace dash::http;
using namespace dash::mpd;
using namespace dash::exception;
AlwaysBestAdaptationLogic::AlwaysBestAdaptationLogic (IMPDManager *mpdManager, stream_t *stream) :
AbstractAdaptationLogic (mpdManager, stream)
......@@ -44,13 +43,13 @@ AlwaysBestAdaptationLogic::~AlwaysBestAdaptationLogic ()
{
}
Chunk* AlwaysBestAdaptationLogic::getNextChunk() throw(EOFException)
Chunk* AlwaysBestAdaptationLogic::getNextChunk()
{
if(this->schedule.size() == 0)
throw EOFException();
return NULL;
if(this->count == this->schedule.size())
throw EOFException();
return NULL;
if ( this->count < this->schedule.size() )
{
......
......@@ -31,7 +31,6 @@
#include "mpd/IMPDManager.h"
#include "mpd/Period.h"
#include "mpd/Segment.h"
#include "exceptions/EOFException.h"
#include "mpd/BasicCMManager.h"
#include <vector>
......@@ -45,7 +44,7 @@ namespace dash
AlwaysBestAdaptationLogic (dash::mpd::IMPDManager *mpdManager, stream_t *stream);
virtual ~AlwaysBestAdaptationLogic ();
dash::http::Chunk* getNextChunk() throw(dash::exception::EOFException);
dash::http::Chunk* getNextChunk();
const mpd::Representation *getCurrentRepresentation() const;
private:
......
......@@ -27,7 +27,6 @@
#include <http/Chunk.h>
#include <adaptationlogic/IDownloadRateObserver.h>
#include <exceptions/EOFException.h>
#include "mpd/Representation.h"
#include "buffer/IBufferObserver.h"
......@@ -47,8 +46,8 @@ namespace dash
RateBased
};
virtual dash::http::Chunk* getNextChunk() throw(dash::exception::EOFException) = 0;
virtual const dash::mpd::Representation *getCurrentRepresentation() const = 0;
virtual dash::http::Chunk* getNextChunk () = 0;
virtual const dash::mpd::Representation* getCurrentRepresentation() const = 0;
/**
* \return The average bitrate in bits per second.
*/
......
......@@ -31,7 +31,6 @@ using namespace dash::logic;
using namespace dash::xml;
using namespace dash::http;
using namespace dash::mpd;
using namespace dash::exception;
RateBasedAdaptationLogic::RateBasedAdaptationLogic (IMPDManager *mpdManager, stream_t *stream) :
AbstractAdaptationLogic (mpdManager, stream),
......@@ -45,13 +44,13 @@ RateBasedAdaptationLogic::RateBasedAdaptationLogic (IMPDManager *mpdManager, st
this->height = var_InheritInteger(stream, "dash-prefheight");
}
Chunk* RateBasedAdaptationLogic::getNextChunk() throw(EOFException)
Chunk* RateBasedAdaptationLogic::getNextChunk()
{
if(this->mpdManager == NULL)
throw EOFException();
return NULL;
if(this->currentPeriod == NULL)
throw EOFException();
return NULL;
uint64_t bitrate = this->getBpsAvg();
......@@ -61,7 +60,7 @@ Chunk* RateBasedAdaptationLogic::getNextChunk() throw(EOFException)
Representation *rep = this->mpdManager->getRepresentation(this->currentPeriod, bitrate, this->width, this->height);
if ( rep == NULL )
throw EOFException();
return NULL;
std::vector<Segment *> segments = this->mpdManager->getSegments(rep);
......
......@@ -29,7 +29,6 @@
#include "xml/Node.h"
#include "mpd/IMPDManager.h"
#include "http/Chunk.h"
#include "exceptions/EOFException.h"
#include "mpd/BasicCMManager.h"
#include <vlc_common.h>
......@@ -46,7 +45,7 @@ namespace dash
public:
RateBasedAdaptationLogic (dash::mpd::IMPDManager *mpdManager, stream_t *stream);
dash::http::Chunk* getNextChunk() throw(dash::exception::EOFException);
dash::http::Chunk* getNextChunk();
const dash::mpd::Representation *getCurrentRepresentation() const;
private:
......
/*
* EOFException.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 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 EOFEXCEPTION_H_
#define EOFEXCEPTION_H_
#include <stdexcept>
namespace dash
{
namespace exception
{
class EOFException : public std::exception
{
public:
EOFException() : std::exception() {}
};
}
}
#endif /* EOFEXCEPTION_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