BasicCMParser.h 3.49 KB
Newer Older
Christopher Mueller's avatar
Christopher Mueller committed
1 2 3 4 5 6 7 8 9
/*
 * BasicCMParser.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>
 *
10 11
 * 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
Christopher Mueller's avatar
Christopher Mueller committed
12 13 14 15 16
 * 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
17 18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
Christopher Mueller's avatar
Christopher Mueller committed
19 20
 *
 * You should have received a copy of the GNU Lesser General Public License
21 22
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
Christopher Mueller's avatar
Christopher Mueller committed
23 24 25 26 27 28 29
 *****************************************************************************/

#ifndef BASICCMPARSER_H_
#define BASICCMPARSER_H_

#include "xml/Node.h"
#include "mpd/IMPDParser.h"
30
#include "mpd/AdaptationSet.h"
Christopher Mueller's avatar
Christopher Mueller committed
31 32 33 34
#include "mpd/BaseUrl.h"
#include "mpd/SegmentInfo.h"
#include "mpd/Segment.h"

35 36
struct stream_t;

Christopher Mueller's avatar
Christopher Mueller committed
37 38 39 40 41 42 43
namespace dash
{
    namespace mpd
    {
        class BasicCMParser : public IMPDParser
        {
            public:
44 45
                BasicCMParser( dash::xml::Node *root, stream_t *p_stream );
                virtual ~BasicCMParser();
Christopher Mueller's avatar
Christopher Mueller committed
46

47
                bool    parse  (Profile profile);
Christopher Mueller's avatar
Christopher Mueller committed
48

49
            private:
50
                void    handleDependencyId( Representation* rep, const AdaptationSet* adaptationSet, const std::string& dependencyId );
51

Christopher Mueller's avatar
Christopher Mueller committed
52
            private:
53 54
                void    parseSegmentTimeline( xml::Node* node, SegmentInfoCommon *segmentInfo );
                void    parseSegmentInfoCommon( xml::Node* node, SegmentInfoCommon *segmentInfo );
55
                void    parseSegmentInfoDefault( xml::Node* node, AdaptationSet* group );
56
                void    setAdaptationSets   (dash::xml::Node *root, Period *period);
57
                void    parseTrickMode( dash::xml::Node *node, Representation *repr );
58
                void    setRepresentations  (dash::xml::Node *root, AdaptationSet *group);
59
                bool    setSegmentInfo      (dash::xml::Node *root, Representation *rep);
60
                void    setInitSegment      (dash::xml::Node *root, SegmentInfoCommon *info);
61 62
                bool    setSegments         (dash::xml::Node *root, SegmentInfo *info );
                bool    resolveUrlTemplates( std::string &url, bool &containRuntimeToken );
63 64 65
                void    parseContentDescriptor( xml::Node *node, const std::string &name,
                                                void (CommonAttributesElements::*addPtr)(ContentDescription*),
                                                CommonAttributesElements *self ) const;
66 67 68
                bool    parseCommonAttributesElements( dash::xml::Node *node,
                                                       CommonAttributesElements *common,
                                                       CommonAttributesElements *parent ) const;
69
                Segment*    parseSegment( xml::Node* node, bool init = false );
70
                ProgramInformation*     parseProgramInformation();
71 72 73

            private:
                std::string     url;
Christopher Mueller's avatar
Christopher Mueller committed
74 75 76 77 78
        };
    }
}

#endif /* BASICCMPARSER_H_ */