[vlc-commits] demux: dash: remove useless subclass

Francois Cartegnie git at videolan.org
Tue Jan 5 20:25:34 UTC 2021


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan  5 09:16:00 2021 +0100| [a79c4f637dd2cd6c0f921696a646f85edc0b1a51] | committer: Francois Cartegnie

demux: dash: remove useless subclass

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a79c4f637dd2cd6c0f921696a646f85edc0b1a51
---

 modules/demux/Makefile.am                  |  2 --
 modules/demux/dash/mpd/AdaptationSet.cpp   |  7 +++--
 modules/demux/dash/mpd/AdaptationSet.h     |  2 +-
 modules/demux/dash/mpd/IsoffMainParser.cpp |  8 ++---
 modules/demux/dash/mpd/IsoffMainParser.h   |  4 +--
 modules/demux/dash/mpd/MPD.cpp             |  2 +-
 modules/demux/dash/mpd/Period.cpp          | 40 -------------------------
 modules/demux/dash/mpd/Period.h            | 47 ------------------------------
 8 files changed, 12 insertions(+), 100 deletions(-)

diff --git a/modules/demux/Makefile.am b/modules/demux/Makefile.am
index 2fbf70b481..a6e4d6d5f3 100644
--- a/modules/demux/Makefile.am
+++ b/modules/demux/Makefile.am
@@ -430,8 +430,6 @@ libadaptive_dash_SOURCES = \
     demux/dash/mpd/IsoffMainParser.h \
     demux/dash/mpd/MPD.cpp \
     demux/dash/mpd/MPD.h \
-    demux/dash/mpd/Period.cpp \
-    demux/dash/mpd/Period.h \
     demux/dash/mpd/Profile.cpp \
     demux/dash/mpd/Profile.hpp \
     demux/dash/mpd/ProgramInformation.cpp \
diff --git a/modules/demux/dash/mpd/AdaptationSet.cpp b/modules/demux/dash/mpd/AdaptationSet.cpp
index ece9592cd8..ed1d1f7094 100644
--- a/modules/demux/dash/mpd/AdaptationSet.cpp
+++ b/modules/demux/dash/mpd/AdaptationSet.cpp
@@ -27,13 +27,14 @@
 
 #include "AdaptationSet.h"
 #include "Representation.h"
-#include "Period.h"
+#include "../../adaptive/playlist/BasePeriod.h"
 #include "MPD.h"
 
 using namespace dash::mpd;
+using namespace adaptive::playlist;
 
-AdaptationSet::AdaptationSet(Period *period) :
-    adaptive::playlist::BaseAdaptationSet( period ),
+AdaptationSet::AdaptationSet(BasePeriod *period) :
+    BaseAdaptationSet( period ),
     DASHCommonAttributesElements(),
     subsegmentAlignmentFlag( false )
 {
diff --git a/modules/demux/dash/mpd/AdaptationSet.h b/modules/demux/dash/mpd/AdaptationSet.h
index dbfa03bb2e..0f7059a8bb 100644
--- a/modules/demux/dash/mpd/AdaptationSet.h
+++ b/modules/demux/dash/mpd/AdaptationSet.h
@@ -45,7 +45,7 @@ namespace dash
                               public DASHCommonAttributesElements
         {
             public:
-                AdaptationSet(Period *);
+                AdaptationSet(playlist::BasePeriod *);
                 virtual ~AdaptationSet();
 
                 virtual StreamFormat            getStreamFormat() const; /* reimpl */
diff --git a/modules/demux/dash/mpd/IsoffMainParser.cpp b/modules/demux/dash/mpd/IsoffMainParser.cpp
index c3553657ea..4fc22457c6 100644
--- a/modules/demux/dash/mpd/IsoffMainParser.cpp
+++ b/modules/demux/dash/mpd/IsoffMainParser.cpp
@@ -33,9 +33,9 @@
 #include "../../adaptive/playlist/SegmentList.h"
 #include "../../adaptive/playlist/SegmentTimeline.h"
 #include "../../adaptive/playlist/SegmentInformation.hpp"
+#include "../../adaptive/playlist/BasePeriod.h"
 #include "MPD.h"
 #include "Representation.h"
-#include "Period.h"
 #include "AdaptationSet.h"
 #include "ProgramInformation.h"
 #include "DASHSegment.h"
@@ -162,7 +162,7 @@ void IsoffMainParser::parsePeriods(MPD *mpd, Node *root)
 
     for(it = periods.begin(); it != periods.end(); ++it)
     {
-        Period *period = new (std::nothrow) Period(mpd);
+        BasePeriod *period = new (std::nothrow) BasePeriod(mpd);
         if (!period)
             continue;
         parseSegmentInformation(mpd, *it, period, &nextid);
@@ -174,7 +174,7 @@ void IsoffMainParser::parsePeriods(MPD *mpd, Node *root)
         if(!baseUrls.empty())
         {
             period->baseUrl.Set( new Url( baseUrls.front()->getText() ) );
-            parseAvailability<Period>(mpd, baseUrls.front(), period);
+            parseAvailability<BasePeriod>(mpd, baseUrls.front(), period);
         }
 
         parseAdaptationSets(mpd, *it, period);
@@ -283,7 +283,7 @@ size_t IsoffMainParser::parseSegmentInformation(MPD *mpd, Node *node,
     return total;
 }
 
-void    IsoffMainParser::parseAdaptationSets  (MPD *mpd, Node *periodNode, Period *period)
+void    IsoffMainParser::parseAdaptationSets  (MPD *mpd, Node *periodNode, BasePeriod *period)
 {
     std::vector<Node *> adaptationSets = DOMHelper::getElementByTagName(periodNode, "AdaptationSet", false);
     std::vector<Node *>::const_iterator it;
diff --git a/modules/demux/dash/mpd/IsoffMainParser.h b/modules/demux/dash/mpd/IsoffMainParser.h
index 88a6e253f8..df40796604 100644
--- a/modules/demux/dash/mpd/IsoffMainParser.h
+++ b/modules/demux/dash/mpd/IsoffMainParser.h
@@ -42,6 +42,7 @@ namespace adaptive
     {
         class SegmentInformation;
         class SegmentTemplate;
+        class BasePeriod;
     }
     namespace xml
     {
@@ -53,7 +54,6 @@ namespace dash
 {
     namespace mpd
     {
-        class Period;
         class AdaptationSet;
         class MPD;
 
@@ -72,7 +72,7 @@ namespace dash
                 mpd::Profile getProfile     () const;
                 void    parseMPDBaseUrl     (MPD *, xml::Node *);
                 void    parseMPDAttributes  (MPD *, xml::Node *);
-                void    parseAdaptationSets (MPD *, xml::Node *periodNode, Period *period);
+                void    parseAdaptationSets (MPD *, xml::Node *periodNode, BasePeriod *period);
                 void    parseRepresentations(MPD *, xml::Node *adaptationSetNode, AdaptationSet *adaptationSet);
                 void    parseInitSegment    (xml::Node *, Initializable<InitSegment> *, SegmentInformation *);
                 void    parseTimeline       (xml::Node *, AbstractMultipleSegmentBaseType *);
diff --git a/modules/demux/dash/mpd/MPD.cpp b/modules/demux/dash/mpd/MPD.cpp
index 2b5d868eb6..ae95452008 100644
--- a/modules/demux/dash/mpd/MPD.cpp
+++ b/modules/demux/dash/mpd/MPD.cpp
@@ -30,7 +30,7 @@
 
 #include "MPD.h"
 #include "ProgramInformation.h"
-#include "Period.h"
+#include "../../adaptive/playlist/BasePeriod.h"
 
 #include <vlc_common.h>
 #include <vlc_stream.h>
diff --git a/modules/demux/dash/mpd/Period.cpp b/modules/demux/dash/mpd/Period.cpp
deleted file mode 100644
index 905b9eb6d2..0000000000
--- a/modules/demux/dash/mpd/Period.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Period.cpp
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller at itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer at 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 "Period.h"
-#include "MPD.h"
-
-using namespace dash::mpd;
-
-Period::Period(MPD *mpd) :
-    BasePeriod( mpd )
-{
-}
-
-Period::~Period ()
-{
-}
diff --git a/modules/demux/dash/mpd/Period.h b/modules/demux/dash/mpd/Period.h
deleted file mode 100644
index 25bf93d3ab..0000000000
--- a/modules/demux/dash/mpd/Period.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Period.h
- *****************************************************************************
- * Copyright (C) 2010 - 2011 Klagenfurt University
- *
- * Created on: Aug 10, 2010
- * Authors: Christopher Mueller <christopher.mueller at itec.uni-klu.ac.at>
- *          Christian Timmerer  <christian.timmerer at 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 PERIOD_H_
-#define PERIOD_H_
-
-#include "../../adaptive/playlist/BasePeriod.h"
-#include "../../adaptive/playlist/SegmentInformation.hpp"
-
-namespace dash
-{
-    namespace mpd
-    {
-        class MPD;
-        using namespace adaptive;
-        using namespace adaptive::playlist;
-
-        class Period : public BasePeriod
-        {
-            public:
-                Period(MPD *);
-                virtual ~Period ();
-        };
-    }
-}
-
-#endif /* PERIOD_H_ */



More information about the vlc-commits mailing list