aboutsummaryrefslogtreecommitdiffstats
path: root/MPD/AbstractRepresentationStream.h
blob: 87400c0c11c31618e1a35c4431de8e524dc94226 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
 * AbstracRepresenationStream.h
 *****************************************************************************
 * Copyright (C) 2012, bitmovin Softwareentwicklung OG, All Rights Reserved
 *
 * Email: libdash-dev@vicky.bitmovin.net
 *
 * This source code and its use and distribution, is subject to the terms
 * and conditions of the applicable license agreement.
 *****************************************************************************/

#ifndef LIBDASH_FRAMEWORK_MPD_ABSTRACTREPRESENTATIONSTREAM_H_
#define LIBDASH_FRAMEWORK_MPD_ABSTRACTREPRESENTATIONSTREAM_H_

#include "../MPD/IMPDWrapper.h"
#include "IRepresentationStream.h"
#include "IBaseUrl.h"
#include "IRepresentation.h"
#include "IAdaptationSet.h"
#include "IPeriod.h"
#include "BaseUrlResolver.h"
#include "TimeResolver.h"

namespace viper
{
namespace managers
{
enum StreamType;
}
}
namespace libdash
{
namespace framework
{
namespace mpd
{
class AbstractRepresentationStream : public IRepresentationStream
{
public:
    AbstractRepresentationStream(viper::managers::StreamType type, libdash::framework::mpd::IMPDWrapper *mpdWrapper, dash::mpd::IPeriod *period, dash::mpd::IAdaptationSet *adaptationSet,
                                 dash::mpd::IRepresentation *representation);
    virtual ~AbstractRepresentationStream();

    virtual dash::mpd::ISegment* getInitializationSegment() = 0;
    virtual dash::mpd::ISegment* getIndexSegment(size_t segmentNumber) = 0;
    virtual dash::mpd::ISegment* getMediaSegment(size_t segmentNumber) = 0;
    virtual dash::mpd::ISegment* getBitstreamSwitchingSegment() = 0;
    virtual RepresentationStreamType getStreamType() = 0;

    virtual uint32_t getSize();
    virtual uint32_t getFirstSegmentNumber();
    virtual uint32_t getCurrentSegmentNumber();
    virtual uint32_t getLastSegmentNumber();
    virtual uint32_t getAverageSegmentDuration();

    virtual uint32_t getTimescale();
    virtual void     setSegmentOffset(uint32_t offset);
    virtual uint32_t getTime(size_t segmentNumber);
    virtual size_t getSegmentNumber(uint32_t time);

protected:
    virtual void setBaseUrls(const std::vector<dash::mpd::IBaseUrl *> baseurls);

    std::vector<dash::mpd::IBaseUrl *>  baseUrls;
    libdash::framework::mpd::IMPDWrapper *mpdWrapper;
    dash::mpd::IPeriod                  *period;
    dash::mpd::IAdaptationSet           *adaptationSet;
    dash::mpd::IRepresentation          *representation;
    uint32_t                            segmentOffset;
    viper::managers::StreamType		type;
};
}
}
}
#endif /* LIBDASH_FRAMEWORK_ADAPTATION_ABSTRACTADAPTATIONLOGIC_H_ */