summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h256
1 files changed, 0 insertions, 256 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h
deleted file mode 100644
index ab8475d..0000000
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h
+++ /dev/null
@@ -1,256 +0,0 @@
1#pragma once
2
3/*
4* Copyright (C) 2005-2016 Team Kodi
5* http://kodi.tv
6*
7* This Program is free software; you can redistribute it and/or modify
8* it under the terms of the GNU General Public License as published by
9* the Free Software Foundation; either version 2, or (at your option)
10* any later version.
11*
12* This Program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16*
17* You should have received a copy of the GNU General Public License
18* along with Kodi; see the file COPYING. If not, see
19* <http://www.gnu.org/licenses/>.
20*
21*/
22
23#include "kodi_inputstream_types.h"
24#include "xbmc_addon_dll.h"
25
26/*!
27* Functions that the InputStream client add-on must implement, but some can be empty.
28*
29* The 'remarks' field indicates which methods should be implemented, and which ones are optional.
30*/
31
32extern "C"
33{
34 /*!
35 * Open a stream.
36 * @param props
37 * @return True if the stream has been opened successfully, false otherwise.
38 * @remarks
39 */
40 bool Open(INPUTSTREAM& props);
41
42 /*!
43 * Close an open stream.
44 * @remarks
45 */
46 void Close(void);
47
48 /*!
49 * Get path/url for this addon.
50 * @remarks
51 */
52 const char* GetPathList(void);
53
54 /*!
55 * Get Capabilities of this addon.
56 * @remarks
57 */
58 struct INPUTSTREAM_CAPABILITIES GetCapabilities();
59
60
61 /*!
62 * Get IDs of available streams
63 * @remarks
64 */
65 INPUTSTREAM_IDS GetStreamIds();
66
67 /*!
68 * Get stream properties of a stream.
69 * @param streamId unique id of stream
70 * @return struc of stream properties
71 * @remarks
72 */
73 INPUTSTREAM_INFO GetStream(int streamid);
74
75 /*!
76 * Enable or disable a stream.
77 * A disabled stream does not send demux packets
78 * @param streamId unique id of stream
79 * @param enable true for enable, false for disable
80 * @remarks
81 */
82 void EnableStream(int streamid, bool enable);
83
84 /*!
85 * Reset the demultiplexer in the add-on.
86 * @remarks Required if bHandlesDemuxing is set to true.
87 */
88 void DemuxReset(void);
89
90 /*!
91 * Abort the demultiplexer thread in the add-on.
92 * @remarks Required if bHandlesDemuxing is set to true.
93 */
94 void DemuxAbort(void);
95
96 /*!
97 * Flush all data that's currently in the demultiplexer buffer in the add-on.
98 * @remarks Required if bHandlesDemuxing is set to true.
99 */
100 void DemuxFlush(void);
101
102 /*!
103 * Read the next packet from the demultiplexer, if there is one.
104 * @return The next packet.
105 * If there is no next packet, then the add-on should return the
106 * packet created by calling AllocateDemuxPacket(0) on the callback.
107 * If the stream changed and XBMC's player needs to be reinitialised,
108 * then, the add-on should call AllocateDemuxPacket(0) on the
109 * callback, and set the streamid to DMX_SPECIALID_STREAMCHANGE and
110 * return the value.
111 * The add-on should return NULL if an error occured.
112 * @remarks Return NULL if this add-on won't provide this function.
113 */
114 DemuxPacket* DemuxRead(void);
115
116 /*!
117 * Notify the InputStream addon/demuxer that XBMC wishes to seek the stream by time
118 * Demuxer is required to set stream to an IDR frame
119 * @param time The absolute time since stream start
120 * @param backwards True to seek to keyframe BEFORE time, else AFTER
121 * @param startpts can be updated to point to where display should start
122 * @return True if the seek operation was possible
123 * @remarks Optional, and only used if addon has its own demuxer.
124 */
125 bool DemuxSeekTime(double time, bool backwards, double *startpts);
126
127 /*!
128 * Notify the InputStream addon/demuxer that XBMC wishes to change playback speed
129 * @param speed The requested playback speed
130 * @remarks Optional, and only used if addon has its own demuxer.
131 */
132 void DemuxSetSpeed(int speed);
133
134 /*!
135 * Sets desired width / height
136 * @param width / hight
137 */
138 void SetVideoResolution(int width, int height);
139
140 /*!
141 * Totel time in ms
142 * @remarks
143 */
144 int GetTotalTime();
145
146 /*!
147 * Playing time in ms
148 * @remarks
149 */
150 int GetTime();
151
152 /*!
153 * Positions inputstream to playing time given in ms
154 * @remarks
155 */
156 bool PosTime(int ms);
157
158
159 /*!
160 * Check if the backend support pausing the currently playing stream
161 * This will enable/disable the pause button in XBMC based on the return value
162 * @return false if the InputStream addon/backend does not support pausing, true if possible
163 */
164 bool CanPauseStream();
165
166 /*!
167 * Check if the backend supports seeking for the currently playing stream
168 * This will enable/disable the rewind/forward buttons in XBMC based on the return value
169 * @return false if the InputStream addon/backend does not support seeking, true if possible
170 */
171 bool CanSeekStream();
172
173
174 /*!
175 * Read from an open stream.
176 * @param pBuffer The buffer to store the data in.
177 * @param iBufferSize The amount of bytes to read.
178 * @return The amount of bytes that were actually read from the stream.
179 * @remarks Return -1 if this add-on won't provide this function.
180 */
181 int ReadStream(uint8_t* pBuffer, unsigned int iBufferSize);
182
183 /*!
184 * Seek in a stream.
185 * @param iPosition The position to seek to.
186 * @param iWhence ?
187 * @return The new position.
188 * @remarks Return -1 if this add-on won't provide this function.
189 */
190 int64_t SeekStream(int64_t iPosition, int iWhence = SEEK_SET);
191
192 /*!
193 * @return The position in the stream that's currently being read.
194 * @remarks Return -1 if this add-on won't provide this function.
195 */
196 int64_t PositionStream(void);
197
198 /*!
199 * @return The total length of the stream that's currently being read.
200 * @remarks Return -1 if this add-on won't provide this function.
201 */
202 int64_t LengthStream(void);
203
204
205 /*!
206 * @brief Notify the InputStream addon that XBMC (un)paused the currently playing stream
207 */
208 void PauseStream(double time);
209
210
211 /*!
212 * Check for real-time streaming
213 * @return true if current stream is real-time
214 */
215 bool IsRealTimeStream();
216
217 /*!
218 * Called by XBMC to assign the function pointers of this add-on to pClient.
219 * @param pClient The struct to assign the function pointers to.
220 */
221 void __declspec(dllexport) get_addon(void* ptr)
222 {
223 AddonInstance_InputStream* pClient = static_cast<AddonInstance_InputStream*>(ptr);
224
225 pClient->toAddon.Open = Open;
226 pClient->toAddon.Close = Close;
227 pClient->toAddon.GetPathList = GetPathList;
228 pClient->toAddon.GetCapabilities = GetCapabilities;
229
230 pClient->toAddon.GetStreamIds = GetStreamIds;
231 pClient->toAddon.GetStream = GetStream;
232 pClient->toAddon.EnableStream = EnableStream;
233 pClient->toAddon.DemuxReset = DemuxReset;
234 pClient->toAddon.DemuxAbort = DemuxAbort;
235 pClient->toAddon.DemuxFlush = DemuxFlush;
236 pClient->toAddon.DemuxRead = DemuxRead;
237 pClient->toAddon.DemuxSeekTime = DemuxSeekTime;
238 pClient->toAddon.DemuxSetSpeed = DemuxSetSpeed;
239 pClient->toAddon.SetVideoResolution = SetVideoResolution;
240
241 pClient->toAddon.GetTotalTime = GetTotalTime;
242 pClient->toAddon.GetTime = GetTime;
243
244 pClient->toAddon.PosTime = PosTime;
245
246 pClient->toAddon.CanPauseStream = CanPauseStream;
247 pClient->toAddon.CanSeekStream = CanSeekStream;
248
249 pClient->toAddon.ReadStream = ReadStream;
250 pClient->toAddon.SeekStream = SeekStream;
251 pClient->toAddon.PositionStream = PositionStream;
252 pClient->toAddon.LengthStream = LengthStream;
253 pClient->toAddon.PauseStream = PauseStream;
254 pClient->toAddon.IsRealTimeStream = IsRealTimeStream;
255 };
256};