forked from rdkcmf/rdk-aamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fragmentcollector_mpd.h
97 lines (87 loc) · 3.34 KB
/
fragmentcollector_mpd.h
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* If not stated otherwise in this file or this component's license file the
* following copyright and licenses apply:
*
* Copyright 2018 RDK Management
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file fragmentcollector_mpd.h
* @brief Fragment collector MPEG DASH declarations
*/
#ifndef FRAGMENTCOLLECTOR_MPD_H_
#define FRAGMENTCOLLECTOR_MPD_H_
#include "StreamAbstractionAAMP.h"
#include <string>
#include <stdint.h>
#include "libdash/IMPD.h"
#include "libdash/INode.h"
#include "libdash/IDASHManager.h"
#include "libdash/xml/Node.h"
#include "libdash/helpers/Time.h"
#include "libdash/xml/DOMParser.h"
#include <libxml/xmlreader.h>
using namespace dash;
using namespace std;
using namespace dash::mpd;
using namespace dash::xml;
using namespace dash::helpers;
#define MAX_MANIFEST_DOWNLOAD_RETRY_MPD 2
/*Common MPD util functions*/
uint64_t aamp_GetPeriodNewContentDuration(IPeriod * period, uint64_t &curEndNumber);
uint64_t aamp_GetPeriodDuration(dash::mpd::IMPD *mpd, int periodIndex, uint64_t mpdDownloadTime = 0);
Node* aamp_ProcessNode(xmlTextReaderPtr *reader, std::string url, bool isAd = false);
uint64_t aamp_GetDurationFromRepresentation(dash::mpd::IMPD *mpd);
/**
* @class StreamAbstractionAAMP_MPD
* @brief Fragment collector for MPEG DASH
*/
class StreamAbstractionAAMP_MPD : public StreamAbstractionAAMP
{
public:
StreamAbstractionAAMP_MPD(class PrivateInstanceAAMP *aamp,double seekpos, float rate);
~StreamAbstractionAAMP_MPD();
StreamAbstractionAAMP_MPD(const StreamAbstractionAAMP_MPD&) = delete;
StreamAbstractionAAMP_MPD& operator=(const StreamAbstractionAAMP_MPD&) = delete;
void DumpProfiles(void) override;
void Start() override;
void Stop(bool clearChannelData) override;
AAMPStatusType Init(TuneType tuneType) override;
void GetStreamFormat(StreamOutputFormat &primaryOutputFormat, StreamOutputFormat &audioOutputFormat) override;
double GetStreamPosition() override;
MediaTrack* GetMediaTrack(TrackType type) override;
double GetFirstPTS() override;
int GetBWIndex(long bitrate) override;
std::vector<long> GetVideoBitrates(void) override;
std::vector<long> GetAudioBitrates(void) override;
long GetMaxBitrate(void) override;
void StopInjection(void) override;
void StartInjection(void) override;
double GetBufferedDuration();
void SeekPosUpdate(double secondsRelativeToTuneTime) { };
void NotifyFirstVideoPTS(unsigned long long pts) { };
virtual void SetCDAIObject(CDAIObject *cdaiObj) override;
int GetProfileCount();
int GetProfileIndexForBandwidth(long mTsbBandwidth);
void SetAudioTrackInfo(const std::vector<AudioTrackInfo> &tracks, const std::string &trackIndex);
void SetTextTrackInfo(const std::vector<TextTrackInfo> &tracks, const std::string &trackIndex);
protected:
StreamInfo* GetStreamInfo(int idx) override;
private:
class PrivateStreamAbstractionMPD* mPriv;
};
#endif //FRAGMENTCOLLECTOR_MPD_H_
/**
* @}
*/