11#include "../AddonBase.h"
12#include "../c-api/addon-instance/video_codec.h"
13#include "inputstream/DemuxPacket.h"
14#include "inputstream/StreamCodec.h"
15#include "inputstream/StreamCrypto.h"
24class CInstanceVideoCodec;
77 std::vector<VIDEOCODEC_FORMAT> formats;
81 formats.emplace_back(m_cStructure->videoFormats[i++]);
88 uint32_t
GetWidth()
const {
return m_cStructure->width; }
91 uint32_t
GetHeight()
const {
return m_cStructure->height; }
94 const uint8_t*
GetExtraData()
const {
return m_cStructure->extraData; }
262 if (CPrivateBase::m_interface->globalSingleInstance !=
nullptr)
263 throw std::logic_error(
"kodi::addon::CInstanceVideoCodec: Creation of multiple together with "
264 "single instance way is not allowed!");
266 SetAddonStruct(instance);
339 virtual const char*
GetName() {
return nullptr; }
369 return m_instanceData->toKodi->get_frame_buffer(m_instanceData->toKodi->kodiInstance, &picture);
384 return m_instanceData->toKodi->release_frame_buffer(m_instanceData->toKodi->kodiInstance,
392 instance->hdl =
this;
393 instance->videocodec->toAddon->open = ADDON_Open;
394 instance->videocodec->toAddon->reconfigure = ADDON_Reconfigure;
395 instance->videocodec->toAddon->add_data = ADDON_AddData;
396 instance->videocodec->toAddon->get_picture = ADDON_GetPicture;
397 instance->videocodec->toAddon->get_name = ADDON_GetName;
398 instance->videocodec->toAddon->reset = ADDON_Reset;
400 m_instanceData = instance->videocodec;
401 m_instanceData->toAddon->addonInstance =
this;
407 return static_cast<CInstanceVideoCodec*
>(instance->toAddon->addonInstance)->Open(initData);
413 return static_cast<CInstanceVideoCodec*
>(instance->toAddon->addonInstance)
414 ->Reconfigure(initData);
420 return static_cast<CInstanceVideoCodec*
>(instance->toAddon->addonInstance)->AddData(*packet);
426 return static_cast<CInstanceVideoCodec*
>(instance->toAddon->addonInstance)
427 ->GetPicture(*picture);
432 return static_cast<CInstanceVideoCodec*
>(instance->toAddon->addonInstance)->GetName();
437 return static_cast<CInstanceVideoCodec*
>(instance->toAddon->addonInstance)->Reset();
Definition VideoCodec.h:248
Definition AddonBase.h:206
Definition AddonBase.h:565
Definition AddonBase.h:498
Definition StreamCrypto.h:43
Definition VideoCodec.h:37
Definition video_codec.h:165
uint32_t GetWidth() const
Picture width.
Definition VideoCodec.h:88
const uint8_t * GetExtraData() const
Depending on the required decoding, additional data given by the stream.
Definition VideoCodec.h:94
VIDEOCODEC_TYPE GetCodecType() const
The codec type required by Kodi to process the stream.
Definition VideoCodec.h:65
VIDEOCODEC_TYPE
Video codec types that can be requested from Kodi.
Definition video_codec.h:81
STREAMCODEC_PROFILE GetCodecProfile() const
Used profiles for non-scalable 2D video.
Definition VideoCodec.h:68
std::vector< VIDEOCODEC_FORMAT > GetVideoFormats() const
The video stream representations requested by Kodi.
Definition VideoCodec.h:75
uint32_t GetHeight() const
Picture height.
Definition VideoCodec.h:91
kodi::addon::StreamCryptoSession GetCryptoSession() const
Data to manage stream cryptography To get class structure manages any encryption values required in o...
Definition VideoCodec.h:107
unsigned int GetExtraDataSize() const
Size of the data given with extraData.
Definition VideoCodec.h:97
@ VIDEOCODEC_FORMAT_MAXFORMATS
The maximum value to use in a list.
Definition video_codec.h:72
@ 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_ERROR
An error occurred, no other messages will be returned.
Definition video_codec.h:31
~CInstanceVideoCodec() override=default
Destructor.
virtual bool Open(const kodi::addon::VideoCodecInitdata &initData)
Open the decoder, returns true on success.
Definition VideoCodec.h:292
virtual VIDEOCODEC_RETVAL GetPicture(VIDEOCODEC_PICTURE &picture)
GetPicture controls decoding.
Definition VideoCodec.h:330
virtual void Reset()
Reset the decoder.
Definition VideoCodec.h:346
bool GetFrameBuffer(VIDEOCODEC_PICTURE &picture)
AddonToKodi interface.
Definition VideoCodec.h:367
void ReleaseFrameBuffer(void *buffer)
Release the with GetFrameBuffer() given framebuffer.
Definition VideoCodec.h:382
virtual bool Reconfigure(const kodi::addon::VideoCodecInitdata &initData)
Reconfigure the decoder, returns true on success.
Definition VideoCodec.h:306
virtual const char * GetName()
should return codecs name
Definition VideoCodec.h:339
CInstanceVideoCodec(const IInstanceInfo &instance)
Video codec class constructor used to support multiple instance types.
Definition VideoCodec.h:260
virtual bool AddData(const DEMUX_PACKET &packet)
add data, decoder has to consume the entire packet
Definition VideoCodec.h:316
Definition video_codec.h:268
Definition addon_base.h:268
Definition video_codec.h:214