Kodi Development 19.0
for Binary and Script based Add-Ons
video_codec.h
1/*
2 * Copyright (C) 2017-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#ifndef C_API_ADDONINSTANCE_VIDEOCODEC_H
10#define C_API_ADDONINSTANCE_VIDEOCODEC_H
11
12#include "../addon_base.h"
13#include "inputstream/demux_packet.h"
14#include "inputstream/stream_codec.h"
15#include "inputstream/stream_crypto.h"
16
17#ifdef __cplusplus
18extern "C"
19{
20#endif /* __cplusplus */
21
22 //============================================================================
26 {
29
32
35
38
41 };
42 //----------------------------------------------------------------------------
43
44 //============================================================================
49 {
53
56
60
63 };
64 //----------------------------------------------------------------------------
65
66 //============================================================================
71 {
75
79
84
91 };
92 //----------------------------------------------------------------------------
93
94 //============================================================================
104 {
107
110
113
116 };
117 //----------------------------------------------------------------------------
118
119 //============================================================================
129 {
132
135
138 };
139 //----------------------------------------------------------------------------
140
141 //============================================================================
148 {
152
157 uint32_t flags;
158
160 uint32_t width;
161
163 uint32_t height;
164
166 uint8_t* decodedData;
167
170
176
182
184 int64_t pts;
185
191 KODI_HANDLE videoBufferHandle;
192 };
194 //----------------------------------------------------------------------------
195
197 {
198 enum VIDEOCODEC_TYPE codec;
199 enum STREAMCODEC_PROFILE codecProfile;
200 enum VIDEOCODEC_FORMAT* videoFormats;
201 uint32_t width;
202 uint32_t height;
203 const uint8_t* extraData;
204 unsigned int extraDataSize;
205 struct STREAM_CRYPTO_SESSION cryptoSession;
206 };
207
208 // this are properties given to the addon on create
209 // at this time we have no parameters for the addon
211 {
212 int dummy;
214
217 {
218 KODI_HANDLE addonInstance;
219
221 bool(__cdecl* open)(const struct AddonInstance_VideoCodec* instance,
222 struct VIDEOCODEC_INITDATA* initData);
223
225 bool(__cdecl* reconfigure)(const struct AddonInstance_VideoCodec* instance,
226 struct VIDEOCODEC_INITDATA* initData);
227
229 bool(__cdecl* add_data)(const struct AddonInstance_VideoCodec* instance,
230 const struct DEMUX_PACKET* packet);
231
233 enum VIDEOCODEC_RETVAL(__cdecl* get_picture)(const struct AddonInstance_VideoCodec* instance,
234 struct VIDEOCODEC_PICTURE* picture);
235
237 const char*(__cdecl* get_name)(const struct AddonInstance_VideoCodec* instance);
238
240 void(__cdecl* reset)(const struct AddonInstance_VideoCodec* instance);
242
244 {
245 KODI_HANDLE kodiInstance;
246 bool (*get_frame_buffer)(void* kodiInstance, struct VIDEOCODEC_PICTURE* picture);
247 void (*release_frame_buffer)(void* kodiInstance, void* buffer);
249
251 {
252 struct AddonProps_VideoCodec* props;
253 struct AddonToKodiFuncTable_VideoCodec* toKodi;
254 struct KodiToAddonFuncTable_VideoCodec* toAddon;
256
257#ifdef __cplusplus
258} /* extern "C" */
259#endif /* __cplusplus */
260
261#endif /* !C_API_ADDONINSTANCE_VIDEOCODEC_H */
Definition: demux_packet.h:46
STREAMCODEC_PROFILE
Definition: stream_codec.h:25
uint32_t stride[VIDEOCODEC_PICTURE_MAXPLANES]
YUV color stride calculation array.
Definition: video_codec.h:181
uint32_t width
Picture width.
Definition: video_codec.h:160
int64_t pts
Picture presentation time stamp (PTS).
Definition: video_codec.h:184
size_t decodedDataSize
Size of the data given with decodedData.
Definition: video_codec.h:169
uint32_t height
Picture height.
Definition: video_codec.h:163
uint32_t flags
Video coded process flags, used to perform special operations in stream calls.
Definition: video_codec.h:157
uint32_t planeOffsets[VIDEOCODEC_PICTURE_MAXPLANES]
YUV color plane calculation array.
Definition: video_codec.h:175
enum VIDEOCODEC_FORMAT videoFormat
The video format declared with VIDEOCODEC_FORMAT and to be used on the addon.
Definition: video_codec.h:151
KODI_HANDLE videoBufferHandle
This is used to save the related handle from Kodi.
Definition: video_codec.h:191
uint8_t * decodedData
Data to be decoded in the addon.
Definition: video_codec.h:166
VIDEOCODEC_PICTURE_FLAG
Video coded process flags, used to perform special operations in stream calls.
Definition: video_codec.h:129
VIDEOCODEC_PLANE
YUV Plane identification pointers.
Definition: video_codec.h:104
@ VIDEOCODEC_PICTURE_FLAG_DRAIN
Squeeze out pictured without feeding new packets.
Definition: video_codec.h:137
@ VIDEOCODEC_PICTURE_FLAG_DROP
Drop in decoder.
Definition: video_codec.h:134
@ VIDEOCODEC_PICTURE_FLAG_NONE
Empty and nothing defined.
Definition: video_codec.h:131
@ VIDEOCODEC_PICTURE_V_PLANE
"chrominance" component V (red projection)
Definition: video_codec.h:112
@ VIDEOCODEC_PICTURE_U_PLANE
"chrominance" component U (blue projection)
Definition: video_codec.h:109
@ VIDEOCODEC_PICTURE_Y_PLANE
"luminance" component Y (equivalent to grey scale)
Definition: video_codec.h:106
@ VIDEOCODEC_PICTURE_MAXPLANES
The maximum value to use in a list.
Definition: video_codec.h:115
Definition: video_codec.h:148
VIDEOCODEC_TYPE
Video codec types that can be requested from Kodi.
Definition: video_codec.h:71
VIDEOCODEC_FORMAT
The video stream representations requested by Kodi.
Definition: video_codec.h:49
@ VIDEOCODEC_H264
Advanced Video Coding (AVC), also referred to as H.264 or MPEG-4 Part 10, Advanced Video Coding (MPEG...
Definition: video_codec.h:83
@ VIDEOCODEC_VP8
VP8 video coding format
Definition: video_codec.h:78
@ VIDEOCODEC_UNKNOWN
Unknown or other type requested.
Definition: video_codec.h:74
@ VIDEOCODEC_VP9
VP9 video coding format VP9 is the successor to VP8 and competes mainly with MPEG's High Efficienc...
Definition: video_codec.h:90
@ VIDEOCODEC_FORMAT_I420
These formats are identical to YV12 except that the U and V plane order is reversed.
Definition: video_codec.h:59
@ VIDEOCODEC_FORMAT_MAXFORMATS
The maximum value to use in a list.
Definition: video_codec.h:62
@ VIDEOCODEC_FORMAT_YV12
YV12 4:2:0 YCrCb planar format.
Definition: video_codec.h:55
@ VIDEOCODEC_FORMAT_UNKNOWN
Unknown types, this is used to declare the end of a list of requested types.
Definition: video_codec.h:52
VIDEOCODEC_RETVAL
Return values used by video decoder interface.
Definition: video_codec.h:26
@ VC_EOF
The decoder signals EOF.
Definition: video_codec.h:40
@ VC_NONE
Noop.
Definition: video_codec.h:28
@ VC_ERROR
An error occured, no other messages will be returned.
Definition: video_codec.h:31
@ VC_PICTURE
The decoder got a picture.
Definition: video_codec.h:37
@ VC_BUFFER
The decoder needs more data.
Definition: video_codec.h:34
Definition: video_codec.h:251
Definition: video_codec.h:211
Definition: video_codec.h:244
Definition: video_codec.h:217
const char *__cdecl * get_name(const struct AddonInstance_VideoCodec *instance)
Get the name of this video decoder.
void(__cdecl *reset)(const struct AddonInstance_VideoCodec *instance)
Reset the codec.
bool(__cdecl *add_data)(const struct AddonInstance_VideoCodec *instance
Feed codec if requested from GetPicture() (return VC_BUFFER)
bool(__cdecl *open)(const struct AddonInstance_VideoCodec *instance
Opens a codec.
bool(__cdecl *reconfigure)(const struct AddonInstance_VideoCodec *instance
Reconfigures a codec.
enum VIDEOCODEC_RETVAL(__cdecl *get_picture)(const struct AddonInstance_VideoCodec *instance
Get a decoded picture / request new data.
Definition: stream_crypto.h:109
Definition: video_codec.h:197