summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/Stream.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2020-07-02 23:09:26 +0200
committermanuel <manuel@mausz.at>2020-07-02 23:09:26 +0200
commit5f8335c1e49ce108ef3481863833c98efa00411b (patch)
treef02b5c1c9765bb6a14c8eb42bb4f81b9face0b55 /xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/Stream.h
parente317daf081a1048904fdf0b548946fa3ba6593a7 (diff)
downloadkodi-pvr-build-5f8335c1e49ce108ef3481863833c98efa00411b.tar.gz
kodi-pvr-build-5f8335c1e49ce108ef3481863833c98efa00411b.tar.bz2
kodi-pvr-build-5f8335c1e49ce108ef3481863833c98efa00411b.zip
sync with upstreamHEADmaster
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/Stream.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/Stream.h330
1 files changed, 330 insertions, 0 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/Stream.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/Stream.h
new file mode 100644
index 0000000..5613947
--- /dev/null
+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/addon-instance/pvr/Stream.h
@@ -0,0 +1,330 @@
1/*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#include "../../AddonBase.h"
12#include "../../c-api/addon-instance/pvr/pvr_stream.h"
13
14//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
15// "C++" Definitions group 9 - PVR stream definitions (NOTE: Becomes replaced
16// in future by inputstream addon instance way)
17
18#ifdef __cplusplus
19
20namespace kodi
21{
22namespace addon
23{
24
25//==============================================================================
26/// @defgroup cpp_kodi_addon_pvr_Defs_Stream_PVRCodec class PVRCodec
27/// @ingroup cpp_kodi_addon_pvr_Defs_Stream
28/// @brief **PVR codec identifier**\n
29/// Used to exchange the desired codec type between Kodi and addon.
30///
31/// @ref kodi::addon::CInstancePVRClient::GetCodecByName is used to get this data.
32///
33/// ----------------------------------------------------------------------------
34///
35/// @copydetails cpp_kodi_addon_pvr_Defs_Stream_PVRCodec_Help
36///
37///@{
38class PVRCodec : public CStructHdl<PVRCodec, PVR_CODEC>
39{
40 friend class CInstancePVRClient;
41
42public:
43 /*! \cond PRIVATE */
44 PVRCodec()
45 {
46 m_cStructure->codec_type = PVR_CODEC_TYPE_UNKNOWN;
47 m_cStructure->codec_id = PVR_INVALID_CODEC_ID;
48 }
49 PVRCodec(const PVRCodec& type) : CStructHdl(type) {}
50 /*! \endcond */
51
52 /// @defgroup cpp_kodi_addon_pvr_Defs_Stream_PVRCodec_Help Value Help
53 /// @ingroup cpp_kodi_addon_pvr_Defs_Stream_PVRCodec
54 ///
55 /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_pvr_Defs_Stream_PVRCodec :</b>
56 /// | Name | Type | Set call | Get call
57 /// |------|------|----------|----------
58 /// | **Codec type** | @ref PVR_CODEC_TYPE | @ref PVRCodec::SetCodecType "SetCodecType" | @ref PVRCodec::GetCodecType "GetCodecType"
59 /// | **Codec identifier** | `unsigned int` | @ref PVRCodec::SetCodecId "SetCodecId" | @ref PVRCodec::GetCodecId "GetCodecId"
60 ///
61
62 /// @addtogroup cpp_kodi_addon_pvr_Defs_Stream_PVRCodec
63 ///@{
64
65 /// @brief Codec type.
66 void SetCodecType(PVR_CODEC_TYPE codecType) { m_cStructure->codec_type = codecType; }
67
68 /// @brief To get with @ref SetCodecType() changed values.
69 PVR_CODEC_TYPE GetCodecType() const { return m_cStructure->codec_type; }
70
71 /// @brief Codec id.
72 ///
73 /// Related codec identifier, normally match the ffmpeg id's.
74 void SetCodecId(unsigned int codecId) { m_cStructure->codec_id = codecId; }
75
76 /// @brief To get with @ref SetCodecId() changed values.
77 unsigned int GetCodecId() const { return m_cStructure->codec_id; }
78 ///@}
79
80private:
81 PVRCodec(const PVR_CODEC& type) : CStructHdl(&type) {}
82 PVRCodec(const PVR_CODEC* type) : CStructHdl(type) {}
83 PVRCodec(PVR_CODEC* type) : CStructHdl(type) {}
84};
85///@}
86//------------------------------------------------------------------------------
87
88//==============================================================================
89/// @defgroup cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties class PVRStreamProperties
90/// @ingroup cpp_kodi_addon_pvr_Defs_Stream
91/// @brief **PVR stream properties**\n
92/// All information about a respective stream is stored in this, so that Kodi
93/// can process the data given by the addon after demux.
94///
95/// ----------------------------------------------------------------------------
96///
97/// @copydetails cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties_Help
98///
99///@{
100class PVRStreamProperties
101 : public CStructHdl<PVRStreamProperties, PVR_STREAM_PROPERTIES::PVR_STREAM>
102{
103 friend class CInstancePVRClient;
104
105public:
106 /*! \cond PRIVATE */
107 PVRStreamProperties() { memset(m_cStructure, 0, sizeof(PVR_STREAM_PROPERTIES::PVR_STREAM)); }
108 PVRStreamProperties(const PVRStreamProperties& type) : CStructHdl(type) {}
109 /*! \endcond */
110
111 /// @defgroup cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties_Help Value Help
112 /// @ingroup cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties
113 /// ----------------------------------------------------------------------------
114 ///
115 /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties :</b>
116 /// | Name | Type | Set call | Get call
117 /// |------|------|----------|----------
118 /// | **PID** | `unsigned int` | @ref PVRStreamProperties::SetPID "SetPID" | @ref PVRStreamProperties::GetPID "GetPID"
119 /// | **Codec type** | @ref PVR_CODEC_TYPE | @ref PVRStreamProperties::SetCodecType "SetCodecType" | @ref PVRStreamProperties::GetCodecType "GetCodecType"
120 /// | **Codec identifier** | `unsigned int` | @ref PVRStreamProperties::SetCodecId "SetCodecId" | @ref PVRStreamProperties::GetCodecId "GetCodecId"
121 /// | **Language** | `std::string` | @ref PVRStreamProperties::SetLanguage "SetLanguage" | @ref PVRStreamProperties::GetLanguage "GetLanguage"
122 /// | **Subtitle info** | `int` | @ref PVRStreamProperties::SetSubtitleInfo "SetSubtitleInfo" | @ref PVRStreamProperties::GetSubtitleInfo "GetSubtitleInfo"
123 /// | **FPS scale** | `int` | @ref PVRStreamProperties::SetFPSScale "SetFPSScale" | @ref PVRStreamProperties::GetFPSScale "GetFPSScale"
124 /// | **FPS rate** | `int` | @ref PVRStreamProperties::SetFPSRate "SetFPSRate" | @ref PVRStreamProperties::GetFPSRate "GetFPSRate"
125 /// | **Height** | `int` | @ref PVRStreamProperties::SetHeight "SetHeight" | @ref PVRStreamProperties::GetHeight "GetHeight"
126 /// | **Width** | `int` | @ref PVRStreamProperties::SetWidth "SetWidth" | @ref PVRStreamProperties::GetWidth "GetWidth"
127 /// | **Aspect ratio** | `float` | @ref PVRStreamProperties::SetAspect "SetAspect" | @ref PVRStreamProperties::GetAspect "GetAspect"
128 /// | **Channels** | `int` | @ref PVRStreamProperties::SetChannels "SetChannels" | @ref PVRStreamProperties::GetChannels "GetChannels"
129 /// | **Samplerate** | `int` | @ref PVRStreamProperties::SetSampleRate "SetSampleRate" | @ref PVRStreamProperties::GetSampleRate "GetSampleRate"
130 /// | **Block align** | `int` | @ref PVRStreamProperties::SetBlockAlign "SetBlockAlign" | @ref PVRStreamProperties::GetBlockAlign "GetBlockAlign"
131 /// | **Bit rate** | `int` | @ref PVRStreamProperties::SetBitRate "SetBitRate" | @ref PVRStreamProperties::GetBitRate "GetBitRate"
132 /// | **Bits per sample** | `int` | @ref PVRStreamProperties::SetBitsPerSample "SetBitsPerSample" | @ref PVRStreamProperties::GetBitsPerSample "GetBitsPerSample"
133 ///
134
135 /// @addtogroup cpp_kodi_addon_pvr_Defs_Stream_PVRStreamProperties
136 ///@{
137
138 /// @brief PID.
139 void SetPID(unsigned int pid) { m_cStructure->iPID = pid; }
140
141 /// @brief To get with @ref SetPID() changed values.
142 unsigned int GetPID() const { return m_cStructure->iPID; }
143
144 /// @brief Codec type this stream.
145 void SetCodecType(PVR_CODEC_TYPE codecType) { m_cStructure->iCodecType = codecType; }
146
147 /// @brief To get with @ref SetCodecType() changed values.
148 PVR_CODEC_TYPE GetCodecType() const { return m_cStructure->iCodecType; }
149
150 /// @brief Codec id of this stream.
151 void SetCodecId(unsigned int codecId) { m_cStructure->iCodecId = codecId; }
152
153 /// @brief To get with @ref SetCodecId() changed values.
154 unsigned int GetCodecId() const { return m_cStructure->iCodecId; }
155
156 /// @brief 3 letter language id.
157 void SetLanguage(const std::string& language)
158 {
159 if (language.size() > 3)
160 {
161 kodi::Log(ADDON_LOG_ERROR,
162 "PVRStreamProperties::%s: Language string size '%li' higher as needed 3", __func__,
163 language.size());
164 return;
165 }
166 m_cStructure->strLanguage[0] = language[0];
167 m_cStructure->strLanguage[1] = language[1];
168 m_cStructure->strLanguage[2] = language[2];
169 m_cStructure->strLanguage[2] = 0;
170 }
171
172 /// @brief To get with @ref SetLanguage() changed values.
173 std::string GetLanguage() const { return m_cStructure->strLanguage; }
174
175 /// @brief Subtitle Info
176 void SetSubtitleInfo(int subtitleInfo) { m_cStructure->iSubtitleInfo = subtitleInfo; }
177
178 /// @brief To get with @ref SetSubtitleInfo() changed values.
179 int GetSubtitleInfo() const { return m_cStructure->iSubtitleInfo; }
180
181 /// @brief To set scale of 1000 and a rate of 29970 will result in 29.97 fps.
182 void SetFPSScale(int fpsScale) { m_cStructure->iFPSScale = fpsScale; }
183
184 /// @brief To get with @ref SetFPSScale() changed values.
185 int GetFPSScale() const { return m_cStructure->iFPSScale; }
186
187 /// @brief FPS rate
188 void SetFPSRate(int fpsRate) { m_cStructure->iFPSRate = fpsRate; }
189
190 /// @brief To get with @ref SetFPSRate() changed values.
191 int GetFPSRate() const { return m_cStructure->iFPSRate; }
192
193 /// @brief Height of the stream reported by the demuxer
194 void SetHeight(int height) { m_cStructure->iHeight = height; }
195
196 /// @brief To get with @ref SetHeight() changed values.
197 int GetHeight() const { return m_cStructure->iHeight; }
198
199 /// @brief Width of the stream reported by the demuxer.
200 void SetWidth(int width) { m_cStructure->iWidth = width; }
201
202 /// @brief To get with @ref SetWidth() changed values.
203 int GetWidth() const { return m_cStructure->iWidth; }
204
205 /// @brief Display aspect ratio of the stream.
206 void SetAspect(float aspect) { m_cStructure->fAspect = aspect; }
207
208 /// @brief To get with @ref SetAspect() changed values.
209 float GetAspect() const { return m_cStructure->fAspect; }
210
211 /// @brief Amount of channels.
212 void SetChannels(int channels) { m_cStructure->iChannels = channels; }
213
214 /// @brief To get with @ref SetChannels() changed values.
215 int GetChannels() const { return m_cStructure->iChannels; }
216
217 /// @brief Sample rate.
218 void SetSampleRate(int sampleRate) { m_cStructure->iSampleRate = sampleRate; }
219
220 /// @brief To get with @ref SetSampleRate() changed values.
221 int GetSampleRate() const { return m_cStructure->iSampleRate; }
222
223 /// @brief Block alignment
224 void SetBlockAlign(int blockAlign) { m_cStructure->iBlockAlign = blockAlign; }
225
226 /// @brief To get with @ref SetBlockAlign() changed values.
227 int GetBlockAlign() const { return m_cStructure->iBlockAlign; }
228
229 /// @brief Bit rate.
230 void SetBitRate(int bitRate) { m_cStructure->iBitRate = bitRate; }
231
232 /// @brief To get with @ref SetBitRate() changed values.
233 int GetBitRate() const { return m_cStructure->iBitRate; }
234
235 /// @brief Bits per sample.
236 void SetBitsPerSample(int bitsPerSample) { m_cStructure->iBitsPerSample = bitsPerSample; }
237
238 /// @brief To get with @ref SetBitsPerSample() changed values.
239 int GetBitsPerSample() const { return m_cStructure->iBitsPerSample; }
240 ///@}
241
242private:
243 PVRStreamProperties(const PVR_STREAM_PROPERTIES::PVR_STREAM* type) : CStructHdl(type) {}
244 PVRStreamProperties(PVR_STREAM_PROPERTIES::PVR_STREAM* type) : CStructHdl(type) {}
245};
246///@}
247//------------------------------------------------------------------------------
248
249//==============================================================================
250/// @defgroup cpp_kodi_addon_pvr_Defs_Stream_PVRStreamTimes class PVRStreamTimes
251/// @ingroup cpp_kodi_addon_pvr_Defs_Stream
252/// @brief **Times of playing stream (Live TV and recordings)**\n
253/// This class is used to transfer the necessary data when
254/// @ref kodi::addon::PVRStreamProperties::GetStreamTimes is called.
255///
256/// ----------------------------------------------------------------------------
257///
258/// @copydetails cpp_kodi_addon_pvr_Defs_Stream_PVRStreamTimes_Help
259///
260///@{
261class PVRStreamTimes : public CStructHdl<PVRStreamTimes, PVR_STREAM_TIMES>
262{
263 friend class CInstancePVRClient;
264
265public:
266 /*! \cond PRIVATE */
267 PVRStreamTimes() { memset(m_cStructure, 0, sizeof(PVR_STREAM_TIMES)); }
268 PVRStreamTimes(const PVRStreamTimes& type) : CStructHdl(type) {}
269 /*! \endcond */
270
271 /// @defgroup cpp_kodi_addon_pvr_Defs_Stream_PVRStreamTimes_Help Value Help
272 /// @ingroup cpp_kodi_addon_pvr_Defs_Stream_PVRStreamTimes
273 /// ----------------------------------------------------------------------------
274 ///
275 /// <b>The following table contains values that can be set with @ref cpp_kodi_addon_pvr_Defs_Stream_PVRStreamTimes :</b>
276 /// | Name | Type | Set call | Get call
277 /// |------|------|----------|----------
278 /// | **Start time** | `time_t` | @ref PVRStreamTimes::SetStartTime "SetStartTime" | @ref PVRStreamTimes::GetStartTime "GetStartTime"
279 /// | **PTS start** | `int64_t` | @ref PVRStreamTimes::SetPTSStart "SetPTSStart" | @ref PVRStreamTimes::GetPTSStart "GetPTSStart"
280 /// | **PTS begin** | `int64_t` | @ref PVRStreamTimes::SetPTSBegin "SetPTSBegin" | @ref PVRStreamTimes::GetPTSBegin "GetPTSBegin"
281 /// | **PTS end** | `int64_t` | @ref PVRStreamTimes::SetPTSEnd "SetPTSEnd" | @ref PVRStreamTimes::GetPTSEnd "GetPTSEnd"
282 ///
283
284 /// @addtogroup cpp_kodi_addon_pvr_Defs_Stream_PVRStreamTimes
285 ///@{
286
287 /// @brief For recordings, this must be zero. For Live TV, this is a reference
288 /// time in units of time_t (UTC) from which time elapsed starts. Ideally start
289 /// of tv show, but can be any other value.
290 void SetStartTime(time_t startTime) { m_cStructure->startTime = startTime; }
291
292 /// @brief To get with @ref SetStartTime() changed values.
293 time_t GetStartTime() const { return m_cStructure->startTime; }
294
295 /// @brief The pts of startTime.
296 void SetPTSStart(int64_t ptsStart) { m_cStructure->ptsStart = ptsStart; }
297
298 /// @brief To get with @ref SetPTSStart() changed values.
299 int64_t GetPTSStart() const { return m_cStructure->ptsStart; }
300
301 /// @brief Earliest pts player can seek back. Value is in micro seconds,
302 /// relative to PTS start. For recordings, this must be zero. For Live TV, this
303 /// must be zero if not timeshifting and must point to begin of the timeshift
304 /// buffer, otherwise.
305 void SetPTSBegin(int64_t ptsBegin) { m_cStructure->ptsBegin = ptsBegin; }
306
307 /// @brief To get with @ref SetPTSBegin() changed values.
308 int64_t GetPTSBegin() const { return m_cStructure->ptsBegin; }
309
310 /// @brief Latest pts player can seek forward. Value is in micro seconds,
311 /// relative to PTS start. For recordings, this must be the total length. For
312 /// Live TV, this must be zero if not timeshifting and must point to end of
313 /// the timeshift buffer, otherwise.
314 void SetPTSEnd(int64_t ptsEnd) { m_cStructure->ptsEnd = ptsEnd; }
315
316 /// @brief To get with @ref SetPTSEnd() changed values.
317 int64_t GetPTSEnd() const { return m_cStructure->ptsEnd; }
318 ///@}
319
320private:
321 PVRStreamTimes(const PVR_STREAM_TIMES* type) : CStructHdl(type) {}
322 PVRStreamTimes(PVR_STREAM_TIMES* type) : CStructHdl(type) {}
323};
324///@}
325//------------------------------------------------------------------------------
326
327} /* namespace addon */
328} /* namespace kodi */
329
330#endif /* __cplusplus */