vlc | branch: master | Hugo Beauzée-Luyssen <beauz...@gmail.com> | Thu Dec 29 12:09:57 2011 +0100| [45827b28fe75c1afeb09732b2cab6723adf4bf02] | committer: Jean-Baptiste Kempf
dash: Removing now unused ElementNotPresentException Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=45827b28fe75c1afeb09732b2cab6723adf4bf02 --- modules/stream_filter/dash/Modules.am | 1 - .../dash/exceptions/ElementNotPresentException.h | 43 -------------------- modules/stream_filter/dash/mpd/BasicCMManager.cpp | 26 ++++-------- modules/stream_filter/dash/mpd/BasicCMManager.h | 15 +++---- modules/stream_filter/dash/mpd/BasicCMParser.cpp | 2 +- modules/stream_filter/dash/mpd/MPD.h | 1 - .../stream_filter/dash/mpd/ProgramInformation.h | 1 - modules/stream_filter/dash/mpd/Representation.cpp | 1 - modules/stream_filter/dash/mpd/Representation.h | 6 ++- modules/stream_filter/dash/mpd/SegmentInfo.cpp | 1 - modules/stream_filter/dash/mpd/SegmentInfo.h | 1 - 11 files changed, 21 insertions(+), 77 deletions(-) diff --git a/modules/stream_filter/dash/Modules.am b/modules/stream_filter/dash/Modules.am index 3003089..b0431c3 100644 --- a/modules/stream_filter/dash/Modules.am +++ b/modules/stream_filter/dash/Modules.am @@ -11,7 +11,6 @@ SOURCES_stream_filter_dash = \ adaptationlogic/RateBasedAdaptationLogic.h \ adaptationlogic/RateBasedAdaptationLogic.cpp \ exceptions/AttributeNotPresentException.h \ - exceptions/ElementNotPresentException.h \ exceptions/EOFException.h \ http/Chunk.cpp \ http/Chunk.h \ diff --git a/modules/stream_filter/dash/exceptions/ElementNotPresentException.h b/modules/stream_filter/dash/exceptions/ElementNotPresentException.h deleted file mode 100644 index 7e2fc0f..0000000 --- a/modules/stream_filter/dash/exceptions/ElementNotPresentException.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * ElementNotPresentException.h - ***************************************************************************** - * Copyright (C) 2010 - 2011 Klagenfurt University - * - * Created on: Aug 10, 2010 - * Authors: Christopher Mueller <christopher.muel...@itec.uni-klu.ac.at> - * Christian Timmerer <christian.timme...@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 ELEMENTNOTPRESENTEXCEPTION_H_ -#define ELEMENTNOTPRESENTEXCEPTION_H_ - -#include <stdexcept> - -namespace dash -{ - namespace exception - { - class ElementNotPresentException : public std::exception - { - public: - ElementNotPresentException() : std::exception() {} - - }; - } -} - -#endif /* ELEMENTNOTPRESENTEXCEPTION_H_ */ diff --git a/modules/stream_filter/dash/mpd/BasicCMManager.cpp b/modules/stream_filter/dash/mpd/BasicCMManager.cpp index 43519ab..90d65db 100644 --- a/modules/stream_filter/dash/mpd/BasicCMManager.cpp +++ b/modules/stream_filter/dash/mpd/BasicCMManager.cpp @@ -41,24 +41,14 @@ BasicCMManager::~BasicCMManager () std::vector<Segment*> BasicCMManager::getSegments (Representation *rep) { - std::vector<Segment *> retSegments; - try - { - SegmentInfo* info = rep->getSegmentInfo(); - Segment* initSegment = info->getInitSegment(); - - retSegments.push_back(initSegment); - - std::vector<Segment *> segments = info->getSegments(); - - for(size_t i = 0; i < segments.size(); i++) - retSegments.push_back(segments.at(i)); - } - catch(ElementNotPresentException &e) - { - /*TODO Debug */ - } - + std::vector<Segment *> retSegments; + SegmentInfo* info = rep->getSegmentInfo(); + Segment* initSegment = info->getInitSegment(); + + if ( initSegment ) + retSegments.push_back( initSegment ); + retSegments.insert( retSegments.end(), info->getSegments().begin(), + info->getSegments().end() ); return retSegments; } const std::vector<Period*>& BasicCMManager::getPeriods () const diff --git a/modules/stream_filter/dash/mpd/BasicCMManager.h b/modules/stream_filter/dash/mpd/BasicCMManager.h index cf2ea05..ccde64d 100644 --- a/modules/stream_filter/dash/mpd/BasicCMManager.h +++ b/modules/stream_filter/dash/mpd/BasicCMManager.h @@ -37,7 +37,6 @@ #include "mpd/Segment.h" #include "mpd/IMPDManager.h" #include "exceptions/AttributeNotPresentException.h" -#include "exceptions/ElementNotPresentException.h" namespace dash { @@ -49,13 +48,13 @@ namespace dash BasicCMManager (MPD *mpd); virtual ~BasicCMManager (); - const std::vector<Period *>& getPeriods () const; - Period* getFirstPeriod (); - Period* getNextPeriod (Period *period); - Representation* getBestRepresentation (Period *period); - std::vector<Segment *> getSegments (Representation *rep); - Representation* getRepresentation (Period *period, long bitrate); - const MPD* getMPD () const; + const std::vector<Period *>& getPeriods() const; + Period* getFirstPeriod(); + Period* getNextPeriod( Period *period ); + Representation* getBestRepresentation( Period *period ); + std::vector<Segment *> getSegments( Representation *rep ); + Representation* getRepresentation( Period *period, long bitrate ); + const MPD* getMPD() const; private: MPD *mpd; diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp b/modules/stream_filter/dash/mpd/BasicCMParser.cpp index 9b8655c..6c40828 100644 --- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp +++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp @@ -258,7 +258,7 @@ bool BasicCMParser::setSegmentInfo (Node *root, Representation *rep) //Init segment is not mandatory. this->setInitSegment( segmentInfo, info ); //If we don't have any segment, there's no point keeping this SegmentInfo. - if ( this->setSegments(segmentInfo, info ) == false ) + if ( this->setSegments( segmentInfo, info ) == false ) { delete info; return false; diff --git a/modules/stream_filter/dash/mpd/MPD.h b/modules/stream_filter/dash/mpd/MPD.h index 4acd9bc..8461784 100644 --- a/modules/stream_filter/dash/mpd/MPD.h +++ b/modules/stream_filter/dash/mpd/MPD.h @@ -33,7 +33,6 @@ #include "mpd/BaseUrl.h" #include "mpd/ProgramInformation.h" #include "exceptions/AttributeNotPresentException.h" -#include "exceptions/ElementNotPresentException.h" #include "mpd/IMPDManager.h" namespace dash diff --git a/modules/stream_filter/dash/mpd/ProgramInformation.h b/modules/stream_filter/dash/mpd/ProgramInformation.h index 04df8aa..c263084 100644 --- a/modules/stream_filter/dash/mpd/ProgramInformation.h +++ b/modules/stream_filter/dash/mpd/ProgramInformation.h @@ -29,7 +29,6 @@ #include <map> #include "exceptions/AttributeNotPresentException.h" -#include "exceptions/ElementNotPresentException.h" namespace dash { diff --git a/modules/stream_filter/dash/mpd/Representation.cpp b/modules/stream_filter/dash/mpd/Representation.cpp index 535599c..079323b 100644 --- a/modules/stream_filter/dash/mpd/Representation.cpp +++ b/modules/stream_filter/dash/mpd/Representation.cpp @@ -30,7 +30,6 @@ #include "Representation.h" using namespace dash::mpd; -using namespace dash::exception; Representation::Representation (const std::map<std::string, std::string>& attributes) : qualityRanking( -1 ), diff --git a/modules/stream_filter/dash/mpd/Representation.h b/modules/stream_filter/dash/mpd/Representation.h index 9b44a8c..4cb418f 100644 --- a/modules/stream_filter/dash/mpd/Representation.h +++ b/modules/stream_filter/dash/mpd/Representation.h @@ -30,7 +30,6 @@ #include "mpd/CommonAttributesElements.h" #include "mpd/SegmentInfo.h" #include "mpd/TrickModeType.h" -#include "exceptions/ElementNotPresentException.h" namespace dash { @@ -55,6 +54,11 @@ namespace dash void setQualityRanking ( int qualityRanking ); const std::list<const Representation*>& getDependencies() const; void addDependency ( const Representation* dep ); + /** + * @return This SegmentInfo for this Representation. + * It cannot be NULL, or without any Segments in it. + * It can however have a NULL InitSegment + */ SegmentInfo* getSegmentInfo () const; TrickModeType* getTrickModeType () const; diff --git a/modules/stream_filter/dash/mpd/SegmentInfo.cpp b/modules/stream_filter/dash/mpd/SegmentInfo.cpp index 17e5d32..1b6ec9c 100644 --- a/modules/stream_filter/dash/mpd/SegmentInfo.cpp +++ b/modules/stream_filter/dash/mpd/SegmentInfo.cpp @@ -28,7 +28,6 @@ #include "SegmentInfo.h" using namespace dash::mpd; -using namespace dash::exception; SegmentInfo::SegmentInfo() : initSeg( NULL ), diff --git a/modules/stream_filter/dash/mpd/SegmentInfo.h b/modules/stream_filter/dash/mpd/SegmentInfo.h index 15bcdde..fd778b7 100644 --- a/modules/stream_filter/dash/mpd/SegmentInfo.h +++ b/modules/stream_filter/dash/mpd/SegmentInfo.h @@ -30,7 +30,6 @@ #include <map> #include "mpd/Segment.h" -#include "exceptions/ElementNotPresentException.h" namespace dash { _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org http://mailman.videolan.org/listinfo/vlc-commits