summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h89
1 files changed, 0 insertions, 89 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h
deleted file mode 100644
index d37d24e..0000000
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h
+++ /dev/null
@@ -1,89 +0,0 @@
1/*
2 * Copyright (C) 2005-2016 Team XBMC
3 * http://www.xbmc.org
4 *
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#pragma once
22
23#include <string>
24#include <vector>
25#include <string.h>
26#include <stdlib.h>
27#include <stdio.h>
28
29#include "kodi_inputstream_types.h"
30#include "versions.h"
31
32#ifdef BUILD_KODI_ADDON
33#include "DVDDemuxPacket.h"
34#else
35#include "cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h"
36#endif
37
38class CHelper_libKODI_inputstream
39{
40public:
41 CHelper_libKODI_inputstream(void)
42 {
43 m_Handle = nullptr;
44 m_Callbacks = nullptr;
45 }
46
47 ~CHelper_libKODI_inputstream(void)
48 {
49 }
50
51 /*!
52 * @brief Resolve all callback methods
53 * @param handle Pointer to the add-on
54 * @return True when all methods were resolved, false otherwise.
55 */
56 bool RegisterMe(void* handle)
57 {
58 m_Handle = static_cast<AddonCB*>(handle);
59 if (m_Handle)
60 m_Callbacks = (AddonInstance_InputStream*)m_Handle->INPUTSTREAMLib_RegisterMe(m_Handle->addonData);
61 if (!m_Callbacks)
62 fprintf(stderr, "libKODI_inputstream-ERROR: InputStream_RegisterMe can't get callback table from Kodi !!!\n");
63
64 return m_Callbacks != nullptr;
65 }
66
67 /*!
68 * @brief Allocate a demux packet. Free with FreeDemuxPacket
69 * @param iDataSize The size of the data that will go into the packet
70 * @return The allocated packet
71 */
72 DemuxPacket* AllocateDemuxPacket(int iDataSize)
73 {
74 return m_Callbacks->toKodi.AllocateDemuxPacket(m_Callbacks->toKodi.kodiInstance, iDataSize);
75 }
76
77 /*!
78 * @brief Free a packet that was allocated with AllocateDemuxPacket
79 * @param pPacket The packet to free
80 */
81 void FreeDemuxPacket(DemuxPacket* pPacket)
82 {
83 return m_Callbacks->toKodi.FreeDemuxPacket(m_Callbacks->toKodi.kodiInstance, pPacket);
84 }
85
86private:
87 AddonCB* m_Handle;
88 AddonInstance_InputStream* m_Callbacks;
89};