Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
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 //============================================================================
42 //----------------------------------------------------------------------------
43
44 //============================================================================
49 {
53
56
60
61 VIDEOCODEC_FORMAT_YUV420P9,
62 VIDEOCODEC_FORMAT_YUV420P10,
63 VIDEOCODEC_FORMAT_YUV420P12,
64 VIDEOCODEC_FORMAT_YUV422P9,
65 VIDEOCODEC_FORMAT_YUV422P10,
66 VIDEOCODEC_FORMAT_YUV422P12,
67 VIDEOCODEC_FORMAT_YUV444P9,
68 VIDEOCODEC_FORMAT_YUV444P10,
69 VIDEOCODEC_FORMAT_YUV444P12,
70
73 };
74 //----------------------------------------------------------------------------
75
76 //============================================================================
109 //----------------------------------------------------------------------------
110
111 //============================================================================
134 //----------------------------------------------------------------------------
135
136 //============================================================================
156 //----------------------------------------------------------------------------
157
158 //============================================================================
165 {
169
174 uint32_t flags;
175
177 uint32_t width;
178
180 uint32_t height;
181
183 uint8_t* decodedData;
184
187
193
199
201 int64_t pts;
202
208 KODI_HANDLE videoBufferHandle;
209 };
211 //----------------------------------------------------------------------------
212
214 {
215 enum VIDEOCODEC_TYPE codec;
216 enum STREAMCODEC_PROFILE codecProfile;
217 enum VIDEOCODEC_FORMAT* videoFormats;
218 uint32_t width;
219 uint32_t height;
220 const uint8_t* extraData;
221 unsigned int extraDataSize;
222 struct STREAM_CRYPTO_SESSION cryptoSession;
223 };
224
225 // this are properties given to the addon on create
226 // at this time we have no parameters for the addon
228 {
229 int dummy;
231
234 {
235 KODI_HANDLE addonInstance;
236
238 bool(__cdecl* open)(const struct AddonInstance_VideoCodec* instance,
239 struct VIDEOCODEC_INITDATA* initData);
240
242 bool(__cdecl* reconfigure)(const struct AddonInstance_VideoCodec* instance,
243 struct VIDEOCODEC_INITDATA* initData);
244
246 bool(__cdecl* add_data)(const struct AddonInstance_VideoCodec* instance,
247 const struct DEMUX_PACKET* packet);
248
250 enum VIDEOCODEC_RETVAL(__cdecl* get_picture)(const struct AddonInstance_VideoCodec* instance,
251 struct VIDEOCODEC_PICTURE* picture);
252
254 const char*(__cdecl* get_name)(const struct AddonInstance_VideoCodec* instance);
255
257 void(__cdecl* reset)(const struct AddonInstance_VideoCodec* instance);
259
261 {
262 KODI_HANDLE kodiInstance;
263 bool (*get_frame_buffer)(void* kodiInstance, struct VIDEOCODEC_PICTURE* picture);
264 void (*release_frame_buffer)(void* kodiInstance, void* buffer);
266
268 {
269 struct AddonProps_VideoCodec* props;
270 struct AddonToKodiFuncTable_VideoCodec* toKodi;
271 struct KodiToAddonFuncTable_VideoCodec* toAddon;
273
274#ifdef __cplusplus
275} /* extern "C" */
276#endif /* __cplusplus */
277
278#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:198
uint32_t width
Picture width.
Definition video_codec.h:177
int64_t pts
Picture presentation time stamp (PTS).
Definition video_codec.h:201
size_t decodedDataSize
Size of the data given with decodedData.
Definition video_codec.h:186
uint32_t height
Picture height.
Definition video_codec.h:180
uint32_t flags
Video coded process flags, used to perform special operations in stream calls.
Definition video_codec.h:174
uint32_t planeOffsets[VIDEOCODEC_PICTURE_MAXPLANES]
YUV color plane calculation array.
Definition video_codec.h:192
enum VIDEOCODEC_FORMAT videoFormat
The video format declared with VIDEOCODEC_FORMAT and to be used on the addon.
Definition video_codec.h:168
KODI_HANDLE videoBufferHandle
This is used to save the related handle from Kodi.
Definition video_codec.h:208
uint8_t * decodedData
Data to be decoded in the addon.
Definition video_codec.h:183
VIDEOCODEC_PICTURE_FLAG
Video coded process flags, used to perform special operations in stream calls.
Definition video_codec.h:146
VIDEOCODEC_PLANE
YUV Plane identification pointers.
Definition video_codec.h:121
@ VIDEOCODEC_PICTURE_FLAG_DRAIN
Squeeze out pictured without feeding new packets.
Definition video_codec.h:154
@ VIDEOCODEC_PICTURE_FLAG_DROP
Drop in decoder.
Definition video_codec.h:151
@ VIDEOCODEC_PICTURE_FLAG_NONE
Empty and nothing defined.
Definition video_codec.h:148
@ VIDEOCODEC_PICTURE_V_PLANE
"chrominance" component V (red projection)
Definition video_codec.h:129
@ VIDEOCODEC_PICTURE_U_PLANE
"chrominance" component U (blue projection)
Definition video_codec.h:126
@ VIDEOCODEC_PICTURE_Y_PLANE
"luminance" component Y (equivalent to grey scale)
Definition video_codec.h:123
@ VIDEOCODEC_PICTURE_MAXPLANES
The maximum value to use in a list.
Definition video_codec.h:132
Definition video_codec.h:165
VIDEOCODEC_TYPE
Video codec types that can be requested from Kodi.
Definition video_codec.h:81
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:93
@ VIDEOCODEC_AV1
AV1 video coding format AV1 is the successor to VP9 and competes mainly with MPEG's High Efficiency ...
Definition video_codec.h:107
@ VIDEOCODEC_VP8
VP8 video coding format
Definition video_codec.h:88
@ VIDEOCODEC_UNKNOWN
Unknown or other type requested.
Definition video_codec.h:84
@ VIDEOCODEC_VP9
VP9 video coding format VP9 is the successor to VP8 and competes mainly with MPEG's High Efficiency ...
Definition video_codec.h:100
@ 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:72
@ 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 occurred, 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:268
Definition video_codec.h:228
Definition video_codec.h:261
Definition video_codec.h:234
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.
Definition stream_crypto.h:121
Definition video_codec.h:214