Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CStreamDetails Class Referencefinal

#include <StreamDetails.h>

Inheritance diagram for CStreamDetails:
IArchivable ISerializable

Classes

struct  AspectRatio
 A common aspect ratio, and the label Kodi reports for content closest to it. More...
 
struct  Resolution
 An upper bound on coded dimensions, and the label Kodi reports for content fitting within it. More...
 

Public Member Functions

 CStreamDetails ()
 
 CStreamDetails (const CStreamDetails &that)
 
CStreamDetailsoperator= (const CStreamDetails &that)
 
bool operator== (const CStreamDetails &that) const
 
bool operator!= (const CStreamDetails &that) const
 
bool HasItems (void) const
 
int GetStreamCount (CStreamDetail::StreamType type) const
 
int GetVideoStreamCount (void) const
 
int GetAudioStreamCount (void) const
 
int GetSubtitleStreamCount (void) const
 
const CStreamDetailGetNthStream (CStreamDetail::StreamType type, int idx) const
 
std::string GetVideoCodec (int idx=0) const
 
float GetVideoAspect (int idx=0) const
 
int GetVideoWidth (int idx=0) const
 
int GetVideoHeight (int idx=0) const
 
std::string GetVideoHdrType (int idx=0, bool alt=false) const
 
std::string GetVideoHdrDetail (int idx=0) const
 
int GetVideoDuration (int idx=0) const
 
void SetVideoDuration (int idx, const int duration)
 
std::string GetStereoMode (int idx=0) const
 
std::string GetVideoLanguage (int idx=0) const
 
std::string GetAudioCodec (int idx=0) const
 
std::string GetAudioLanguage (int idx=0) const
 
int GetAudioChannels (int idx=0) const
 
std::string GetSubtitleLanguage (int idx=0) const
 
void AddStream (CStreamDetail *item)
 
void Reset (void)
 
void DetermineBestStreams (void)
 
void Archive (CArchive &ar) override
 
void Serialize (CVariant &value) const override
 
bool SetStreams (const VideoStreamInfo &videoInfo, int videoDuration, const AudioStreamInfo &audioInfo, const SubtitleStreamInfo &subtitleInfo, CStreamDetail::Source source)
 
CStreamDetail::Source GetSource (CStreamDetail::StreamType type, int idx) const
 
CStreamDetail::Source GetSources () const
 
void SetSources (CStreamDetail::Source source)
 
bool ShouldUpdateWithNewDetails (const CStreamDetails &newInfo) const
 
int GetVersion (CStreamDetail::StreamType type, int idx) const
 
- Public Member Functions inherited from IArchivable
- Public Member Functions inherited from ISerializable

Static Public Member Functions

static std::string VideoDimsToResolutionDescription (int iWidth, int iHeight)
 
static std::string VideoAspectToAspectDescription (float fAspect)
 
static std::string HdrTypeToString (StreamHdrType hdrType)
 

Static Public Attributes

static constexpr auto COMMON_RESOLUTIONS
 The vocabulary of resolution labels Kodi reports, in ascending order.
 
static constexpr auto COMMON_ASPECT_RATIOS
 The vocabulary of aspect ratio labels Kodi reports, in ascending order.
 

Additional Inherited Members

- Protected Member Functions inherited from IArchivable
virtual ~IArchivable ()=default
 
- Protected Member Functions inherited from ISerializable
 ~ISerializable ()=default
 

Constructor & Destructor Documentation

◆ CStreamDetails() [1/2]

CStreamDetails::CStreamDetails ( )
inline

◆ CStreamDetails() [2/2]

CStreamDetails::CStreamDetails ( const CStreamDetails & that)

Member Function Documentation

◆ AddStream()

void CStreamDetails::AddStream ( CStreamDetail * item)

◆ Archive()

void CStreamDetails::Archive ( CArchive & ar)
overridevirtual

Implements IArchivable.

◆ DetermineBestStreams()

void CStreamDetails::DetermineBestStreams ( void )

◆ GetAudioChannels()

int CStreamDetails::GetAudioChannels ( int idx = 0) const

◆ GetAudioCodec()

std::string CStreamDetails::GetAudioCodec ( int idx = 0) const

◆ GetAudioLanguage()

std::string CStreamDetails::GetAudioLanguage ( int idx = 0) const

◆ GetAudioStreamCount()

int CStreamDetails::GetAudioStreamCount ( void ) const

◆ GetNthStream()

const CStreamDetail * CStreamDetails::GetNthStream ( CStreamDetail::StreamType type,
int idx ) const

◆ GetSource()

CStreamDetail::Source CStreamDetails::GetSource ( CStreamDetail::StreamType type,
int idx ) const

◆ GetSources()

CStreamDetail::Source CStreamDetails::GetSources ( ) const

◆ GetStereoMode()

std::string CStreamDetails::GetStereoMode ( int idx = 0) const

◆ GetStreamCount()

int CStreamDetails::GetStreamCount ( CStreamDetail::StreamType type) const

◆ GetSubtitleLanguage()

std::string CStreamDetails::GetSubtitleLanguage ( int idx = 0) const

◆ GetSubtitleStreamCount()

int CStreamDetails::GetSubtitleStreamCount ( void ) const

◆ GetVersion()

int CStreamDetails::GetVersion ( CStreamDetail::StreamType type,
int idx ) const

◆ GetVideoAspect()

float CStreamDetails::GetVideoAspect ( int idx = 0) const

◆ GetVideoCodec()

std::string CStreamDetails::GetVideoCodec ( int idx = 0) const

◆ GetVideoDuration()

int CStreamDetails::GetVideoDuration ( int idx = 0) const

◆ GetVideoHdrDetail()

std::string CStreamDetails::GetVideoHdrDetail ( int idx = 0) const

◆ GetVideoHdrType()

std::string CStreamDetails::GetVideoHdrType ( int idx = 0,
bool alt = false ) const

◆ GetVideoHeight()

int CStreamDetails::GetVideoHeight ( int idx = 0) const

◆ GetVideoLanguage()

std::string CStreamDetails::GetVideoLanguage ( int idx = 0) const

◆ GetVideoStreamCount()

int CStreamDetails::GetVideoStreamCount ( void ) const

◆ GetVideoWidth()

int CStreamDetails::GetVideoWidth ( int idx = 0) const

◆ HasItems()

bool CStreamDetails::HasItems ( void ) const
inline

◆ HdrTypeToString()

std::string CStreamDetails::HdrTypeToString ( StreamHdrType hdrType)
static

◆ operator!=()

bool CStreamDetails::operator!= ( const CStreamDetails & that) const

◆ operator=()

CStreamDetails & CStreamDetails::operator= ( const CStreamDetails & that)

◆ operator==()

bool CStreamDetails::operator== ( const CStreamDetails & that) const

◆ Reset()

void CStreamDetails::Reset ( void )

◆ Serialize()

void CStreamDetails::Serialize ( CVariant & value) const
overridevirtual

Implements ISerializable.

◆ SetSources()

void CStreamDetails::SetSources ( CStreamDetail::Source source)

◆ SetStreams()

bool CStreamDetails::SetStreams ( const VideoStreamInfo & videoInfo,
int videoDuration,
const AudioStreamInfo & audioInfo,
const SubtitleStreamInfo & subtitleInfo,
CStreamDetail::Source source )

◆ SetVideoDuration()

void CStreamDetails::SetVideoDuration ( int idx,
const int duration )

◆ ShouldUpdateWithNewDetails()

bool CStreamDetails::ShouldUpdateWithNewDetails ( const CStreamDetails & newInfo) const

◆ VideoAspectToAspectDescription()

std::string CStreamDetails::VideoAspectToAspectDescription ( float fAspect)
static

◆ VideoDimsToResolutionDescription()

std::string CStreamDetails::VideoDimsToResolutionDescription ( int iWidth,
int iHeight )
static

Member Data Documentation

◆ COMMON_ASPECT_RATIOS

auto CStreamDetails::COMMON_ASPECT_RATIOS
staticconstexpr
Initial value:
= std::to_array<AspectRatio>({
{1.00f, "1.00"},
{1.19f, "1.19"},
{1.33f, "1.33"},
{1.37f, "1.37"},
{1.43f, "1.43"},
{1.50f, "1.50"},
{1.66f, "1.66"},
{1.78f, "1.78"},
{1.85f, "1.85"},
{1.90f, "1.90"},
{2.00f, "2.00"},
{2.20f, "2.20"},
{2.35f, "2.35"},
{2.40f, "2.40"},
{2.55f, "2.55"},
{2.76f, "2.76"},
})

The vocabulary of aspect ratio labels Kodi reports, in ascending order.

Content is classified as the closest entry in log space, which means the cutoff between two adjacent entries is their geometric mean. See VideoAspectToAspectDescription().

This is the single source of truth for the aspect labels skins display. Anything else needing the same vocabulary - a selection list, a reported label, a plausibility check - must use this table rather than defining a parallel list, or the two will drift.

Note
The table classifies but never rejects. Any value wider than the last entry is reported as that entry, so this cannot be used as a validity check on its own.

◆ COMMON_RESOLUTIONS

auto CStreamDetails::COMMON_RESOLUTIONS
staticconstexpr
Initial value:
= std::to_array<Resolution>({
{854, 480, "480"},
{960, 544, "540"},
{1024, 576, "576"},
{1280, 962, "720"},
{1920, 1440, "1080"},
{4096, 3072, "4K"},
{8192, 6144, "8K"},
})

The vocabulary of resolution labels Kodi reports, in ascending order.

Content is described by the first entry it fits within on both axes. See VideoDimsToResolutionDescription().

Note
Bounding both axes means portrait content is described by whichever entry is tall enough to hold it, so 1080x1920 is "4K". Content larger than the last entry is not described at all rather than clamped to it.

The documentation for this class was generated from the following files: