[vlc-commits] dash: added mpdfactory

Christopher Mueller git at videolan.org
Thu Feb 2 12:33:26 CET 2012


vlc | branch: master | Christopher Mueller <christopher.mueller at itec.aau.at> | Mon Jan 30 14:48:33 2012 +0100| [1def2aa77b4626c0e60f073ddb5ef010e682a9a1] | committer: Hugo Beauzée-Luyssen

dash: added mpdfactory

Signed-off-by: Hugo Beauzée-Luyssen <beauze.h at gmail.com>

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

 modules/stream_filter/dash/Modules.am         |    2 +
 modules/stream_filter/dash/mpd/MPDFactory.cpp |   59 +++++++++++++++++++++++++
 modules/stream_filter/dash/mpd/MPDFactory.h   |   48 ++++++++++++++++++++
 3 files changed, 109 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/dash/Modules.am b/modules/stream_filter/dash/Modules.am
index 5d10326..fdc1076 100644
--- a/modules/stream_filter/dash/Modules.am
+++ b/modules/stream_filter/dash/Modules.am
@@ -38,6 +38,8 @@ SOURCES_stream_filter_dash = \
     mpd/IsoffMainManager.h \
     mpd/MPD.cpp \
     mpd/MPD.h \
+    mpd/MPDFactory.cpp \
+    mpd/MPDFactory.h \
     mpd/MPDManagerFactory.cpp \
     mpd/MPDManagerFactory.h \
     mpd/Period.cpp \
diff --git a/modules/stream_filter/dash/mpd/MPDFactory.cpp b/modules/stream_filter/dash/mpd/MPDFactory.cpp
new file mode 100644
index 0000000..d6fdf72
--- /dev/null
+++ b/modules/stream_filter/dash/mpd/MPDFactory.cpp
@@ -0,0 +1,59 @@
+/*
+ * MPDFactory.cpp
+ *****************************************************************************
+ * Copyright (C) 2010 - 2012 Klagenfurt University
+ *
+ * Created on: Jan 27, 2012
+ * 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 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.
+ *****************************************************************************/
+
+#include "MPDFactory.h"
+
+using namespace dash::xml;
+using namespace dash::mpd;
+
+MPD* MPDFactory::create             (dash::xml::Node *root, stream_t *p_stream, Profile profile)
+{
+    switch(profile)
+    {
+        case dash::mpd::Full2011:
+        case dash::mpd::Basic:
+        case dash::mpd::BasicCM:    return MPDFactory::createBasicCMMPD(root, p_stream);
+        case dash::mpd::IsoffMain:  return MPDFactory::createIsoffMainMPD(root, p_stream);
+
+        default: return NULL;
+    }
+}
+MPD* MPDFactory::createBasicCMMPD    (dash::xml::Node *root, stream_t *p_stream)
+{
+    dash::mpd::BasicCMParser mpdParser(root, p_stream);
+
+    if(mpdParser.parse() == false || mpdParser.getMPD() == NULL)
+        return NULL;
+
+    return mpdParser.getMPD();
+}
+MPD* MPDFactory::createIsoffMainMPD  (dash::xml::Node *root, stream_t *p_stream)
+{
+    dash::mpd::IsoffMainParser mpdParser(root, p_stream);
+
+    if(mpdParser.parse() == false || mpdParser.getMPD() == NULL)
+        return NULL;
+
+    return mpdParser.getMPD();
+}
diff --git a/modules/stream_filter/dash/mpd/MPDFactory.h b/modules/stream_filter/dash/mpd/MPDFactory.h
new file mode 100644
index 0000000..43f6fc3
--- /dev/null
+++ b/modules/stream_filter/dash/mpd/MPDFactory.h
@@ -0,0 +1,48 @@
+/*
+ * MPDFactory.h
+ *****************************************************************************
+ * Copyright (C) 2010 - 2012 Klagenfurt University
+ *
+ * Created on: Jan 27, 2012
+ * 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 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 MPDFACTORY_H_
+#define MPDFACTORY_H_
+
+#include "mpd/MPD.h"
+#include "mpd/BasicCMParser.h"
+#include "mpd/IsoffMainParser.h"
+
+namespace dash
+{
+    namespace mpd
+    {
+        class MPDFactory
+        {
+            public:
+                static MPD* create(dash::xml::Node *root, stream_t *p_stream, Profile profile);
+
+            private:
+                static MPD* createBasicCMMPD    (dash::xml::Node *root, stream_t *p_stream);
+                static MPD* createIsoffMainMPD  (dash::xml::Node *root, stream_t *p_stream);
+        };
+    }
+}
+
+#endif /* MPDFACTORY_H_ */



More information about the vlc-commits mailing list