~thopiekar/+junk/vlc-2.0.8-github_community

« back to all changes in this revision

Viewing changes to modules/stream_filter/dash/mpd/Group.cpp

  • Committer: Thomas-Karl Pietrowski
  • Date: 2014-02-25 08:48:22 UTC
  • Revision ID: thopiekar@googlemail.com-20140225084822-52495jnrzv3qlei6
vlc to build against libva-emgd-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Group.cpp
 
3
 *****************************************************************************
 
4
 * Copyright (C) 2010 - 2011 Klagenfurt University
 
5
 *
 
6
 * Created on: Aug 10, 2010
 
7
 * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
 
8
 *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
 
9
 *
 
10
 * This program is free software; you can redistribute it and/or modify
 
11
 * it under the terms of the GNU Lesser General Public License as published
 
12
 * by the Free Software Foundation; either version 2.1 of the License, or
 
13
 * (at your option) any later version.
 
14
 *
 
15
 * This program is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 * GNU General Public License for more details.
 
19
 *
 
20
 * You should have received a copy of the GNU Lesser General Public License
 
21
 * along with this program; if not, write to the Free Software
 
22
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 
23
 *****************************************************************************/
 
24
 
 
25
#include "Group.h"
 
26
 
 
27
#include <vlc_common.h>
 
28
#include <vlc_arrays.h>
 
29
 
 
30
#include "SegmentInfoDefault.h"
 
31
 
 
32
using namespace dash::mpd;
 
33
 
 
34
Group::Group() :
 
35
    subsegmentAlignmentFlag( false ),
 
36
    segmentInfoDefault( NULL )
 
37
{
 
38
}
 
39
 
 
40
Group::~Group   ()
 
41
{
 
42
    delete this->segmentInfoDefault;
 
43
    vlc_delete_all( this->representations );
 
44
}
 
45
 
 
46
bool                Group::getSubsegmentAlignmentFlag() const
 
47
{
 
48
    return this->subsegmentAlignmentFlag;
 
49
}
 
50
 
 
51
void Group::setSubsegmentAlignmentFlag(bool alignment)
 
52
{
 
53
    this->subsegmentAlignmentFlag = alignment;
 
54
}
 
55
 
 
56
std::vector<Representation*>    Group::getRepresentations       ()
 
57
{
 
58
    return this->representations;
 
59
}
 
60
 
 
61
const Representation *Group::getRepresentationById(const std::string &id) const
 
62
{
 
63
    std::vector<Representation*>::const_iterator    it = this->representations.begin();
 
64
    std::vector<Representation*>::const_iterator    end = this->representations.end();
 
65
 
 
66
    while ( it != end )
 
67
    {
 
68
        if ( (*it)->getId() == id )
 
69
            return *it;
 
70
        ++it;
 
71
    }
 
72
    return NULL;
 
73
}
 
74
 
 
75
const SegmentInfoDefault *Group::getSegmentInfoDefault() const
 
76
{
 
77
    return this->segmentInfoDefault;
 
78
}
 
79
 
 
80
void Group::setSegmentInfoDefault(const SegmentInfoDefault *seg)
 
81
{
 
82
    if ( seg != NULL )
 
83
        this->segmentInfoDefault = seg;
 
84
}
 
85
 
 
86
void                            Group::addRepresentation        (Representation *rep)
 
87
{
 
88
    this->representations.push_back(rep);
 
89
}