[vlc-devel] [PATCH 15/17] dash: added mpdfactory

Christopher at mailsrv.uni-klu.ac.at Christopher at mailsrv.uni-klu.ac.at
Mon Jan 30 14:48:33 CET 2012


From: Christopher Mueller <christopher.mueller at itec.aau.at>

---
 modules/stream_filter/dash/mpd/MPDFactory.cpp |   59 +++++++++++++++++++++++++
 modules/stream_filter/dash/mpd/MPDFactory.h   |   48 ++++++++++++++++++++
 2 files changed, 107 insertions(+), 0 deletions(-)
 create mode 100644 modules/stream_filter/dash/mpd/MPDFactory.cpp
 create mode 100644 modules/stream_filter/dash/mpd/MPDFactory.h

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_ */
-- 
1.7.0.4




More information about the vlc-devel mailing list