This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
fragmentcollector_progressive.h
209 lines (200 loc) · 5.9 KB
/
fragmentcollector_progressive.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
/*
* 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_progressive.h
* @brief Streamer for progressive mp3/mp4 playback
*/
#ifndef FRAGMENTCOLLECTOR_PROGRESSIVE_H_
#define FRAGMENTCOLLECTOR_PROGRESSIVE_H_
#include "StreamAbstractionAAMP.h"
#include <string>
#include <stdint.h>
using namespace std;
/**
* @class StreamAbstractionAAMP_PROGRESSIVE
* @brief Streamer for progressive mp3/mp4 playback
*/
class StreamAbstractionAAMP_PROGRESSIVE : public StreamAbstractionAAMP
{
public:
/**
* @fn StreamAbstractionAAMP_PROGRESSIVE
* @param aamp pointer to PrivateInstanceAAMP object associated with player
* @param seekpos Seek position
* @param rate playback rate
*/
StreamAbstractionAAMP_PROGRESSIVE(AampLogManager *logObj, class PrivateInstanceAAMP *aamp,double seekpos, float rate);
/**
* @fn ~StreamAbstractionAAMP_PROGRESSIVE
*/
~StreamAbstractionAAMP_PROGRESSIVE();
/**
* @brief Copy constructor disabled
*
*/
StreamAbstractionAAMP_PROGRESSIVE(const StreamAbstractionAAMP_PROGRESSIVE&) = delete;
/**
* @brief assignment operator disabled
*
*/
StreamAbstractionAAMP_PROGRESSIVE& operator=(const StreamAbstractionAAMP_PROGRESSIVE&) = delete;
double seekPosition;
void DumpProfiles(void) override;
/**
* @fn Start
* @return void
*/
void Start() override;
/**
* @fn Stop
* @return void
*/
void Stop(bool clearChannelData) override;
/**
* @fn Init
* @note To be implemented by sub classes
* @param tuneType to set type of object.
* @retval true on success
* @retval false on failure
*/
AAMPStatusType Init(TuneType tuneType) override;
/**
* @fn GetStreamFormat
* @param[out] primaryOutputFormat - format of primary track
* @param[out] audioOutputFormat - format of audio track
* @param[out] auxOutputFormat - format of aux audio track
* @param[out] subtitleOutputFormat - format of sutbtile track
*/
void GetStreamFormat(StreamOutputFormat &primaryOutputFormat, StreamOutputFormat &audioOutputFormat, StreamOutputFormat &auxOutputFormat, StreamOutputFormat &subtitleOutputFormat) override;
/**
* @fn GetStreamPosition
*
* @retval current position of stream.
*/
double GetStreamPosition() override;
/**
* @fn GetMediaTrack
*
* @param[in] type - track type
* @retval MediaTrack pointer.
*/
MediaTrack* GetMediaTrack(TrackType type) override;
/**
* @fn GetFirstPTS
*
* @retval PTS of first sample
*/
double GetFirstPTS() override;
/**
* @fn GetStartTimeOfFirstPTS
*
* @retval start time of first sample
*/
double GetStartTimeOfFirstPTS() override;
/**
* @fn GetBufferedDuration
*
*/
double GetBufferedDuration() override;
/**
* @fn IsInitialCachingSupported
*
*/
bool IsInitialCachingSupported() override;
/**
* @param[in] bitrate Bitrate to lookup profile
* @retval profile index
*/
int GetBWIndex(long bitrate) override;
/**
* @fn GetVideoBitrates
* @return available video bitrates
*/
std::vector<long> GetVideoBitrates(void) override;
/**
* @fn GetAudioBitrates
* @return available audio bitrates
*/
std::vector<long> GetAudioBitrates(void) override;
/**
* @fn GetMaxBitrate
* @return long MAX video bitrates
*/
long GetMaxBitrate(void) override;
/**
* @fn StopInjection
*/
void StopInjection(void) override;
/**
* @fn StartInjection
*/
void StartInjection(void) override;
void SeekPosUpdate(double) { };
/**
* @fn FetcherLoop
* @return void
*/
void FetcherLoop();
/**
* @fn GetAvailableVideoTracks
* @return available video tracks.
*/
std::vector<StreamInfo*> GetAvailableVideoTracks(void) override;
/**
* @fn GetAvailableThumbnailTracks
* @return available thumbnail tracks.
*/
std::vector<StreamInfo*> GetAvailableThumbnailTracks(void) override;
/**
* @fn SetThumbnailTrack
*
* @param thumbnailIndex thumbnail index value indicating the track to select
* @return bool true on success.
*/
bool SetThumbnailTrack(int) override;
/**
* @fn GetThumbnailRangeData
* @return Updated vector of available thumbnail data.
*/
std::vector<ThumbnailData> GetThumbnailRangeData(double,double, std::string*, int*, int*, int*, int*) override;
/**
* @fn Is4KStream
* @brief check if current stream have 4K content
* @param height - resolution of 4K stream if found
* @param bandwidth - bandwidth of 4K stream if foudd
* @return true on success
*/
bool Is4KStream(int &height, long &bandwidth) override { return false; };
protected:
/**
* @fn GetStreamInfo
*
* @param[in] idx - profile index.
* @retval stream information corresponding to index.
*/
StreamInfo* GetStreamInfo(int idx) override;
private:
void StreamFile( const char *uri, long *http_error );
bool fragmentCollectorThreadStarted;
pthread_t fragmentCollectorThreadID;
};
#endif //FRAGMENTCOLLECTOR_PROGRESSIVE_H_
/**
* @}
*/