#include <StreamUtils.h>
|
| static int | CompareAudioPreference (const AudioCandidate &lh, const AudioCandidate &rh, const AudioPreferences &preferences) |
| | Compare two audio streams the way playback picks the stream it starts on.
|
| |
| static int | GetCodecPriority (const std::string &codec) |
| |
| static int | CompareAudioQuality (const std::string &codecA, int channelsA, const std::string &codecB, int channelsB) |
| | Compare two audio streams on the technical quality of what they carry.
|
| |
| static constexpr uint32_t | MakeFourCC (char c1, char c2, char c3, char c4) |
| | Make a FourCC code as unsigned integer value.
|
| |
| static std::string | GetCodecName (int codecId, int profile) |
| | Get the codec name translated from ffmpeg codec id and profile.
|
| |
| static std::string | NormalizeAudioCodecName (const std::string &codec) |
| | Normalise an externally supplied (eg. NFO) audio codec name to the name Kodi uses.
|
| |
| static std::string | GetDefaultLayout (unsigned int channels) |
| | Return a default channel layout in x.y.z form for a channel count.
|
| |
| static std::string | GetLayout (unsigned int channels) |
| | Return a default channel layout for a channel count or localized count of channels when no default exists.
|
| |
| static bool | IsCodecSupportForcedOverlay (int codecId) |
| | Determines if a codec support forced overlays (on image type subtitles).
|
| |
◆ CompareAudioPreference()
Compare two audio streams the way playback picks the stream it starts on.
The tiers, in order: the wanted language (or the original flag when that is the preference), the hearing and visual impaired flags, the default flag when the user asked for it, a stereo layout, technical quality, and finally the default flag as a tiebreak.
- Parameters
-
- Returns
- A positive value when the first stream is the better match, a negative value when the second is, and zero when these properties cannot separate the two
- Note
- This is a strict weak ordering, as CSelectionStreams::Get() hands it to std::stable_sort. Every tier is a property each stream decides for itself, never one that depends on the pair.
◆ CompareAudioQuality()
| int StreamUtils::CompareAudioQuality |
( |
const std::string & | codecA, |
|
|
int | channelsA, |
|
|
const std::string & | codecB, |
|
|
int | channelsB ) |
|
static |
Compare two audio streams on the technical quality of what they carry.
- Parameters
-
| codecA | The codec name of the first stream, as GetCodecPriority() expects it |
| channelsA | The channel count of the first stream, zero or negative when unknown |
| codecB | The codec name of the second stream |
| channelsB | The channel count of the second stream |
- Returns
- A positive value when the first stream is better, a negative value when the second is, and zero when the two are equally good (which is not the same as interchangeable, as equally ranked codecs are different presentations)
◆ GetCodecName()
| std::string StreamUtils::GetCodecName |
( |
int | codecId, |
|
|
int | profile ) |
|
static |
Get the codec name translated from ffmpeg codec id and profile.
- Parameters
-
| codecId | The ffmpeg codec id |
| profile | The ffmpeg codec profile |
- Returns
- The codec name
◆ GetCodecPriority()
| int StreamUtils::GetCodecPriority |
( |
const std::string & | codec | ) |
|
|
static |
◆ GetDefaultLayout()
| std::string StreamUtils::GetDefaultLayout |
( |
unsigned int | channels | ) |
|
|
static |
Return a default channel layout in x.y.z form for a channel count.
- Parameters
-
| [in] | channels | the count of channels |
- Returns
- the default layout
◆ GetLayout()
| std::string StreamUtils::GetLayout |
( |
unsigned int | channels | ) |
|
|
static |
Return a default channel layout for a channel count or localized count of channels when no default exists.
- Parameters
-
| [in] | channels | the count of channels |
- Returns
- the layout
◆ IsCodecSupportForcedOverlay()
| bool StreamUtils::IsCodecSupportForcedOverlay |
( |
int | codecId | ) |
|
|
static |
Determines if a codec support forced overlays (on image type subtitles).
- Parameters
-
| codecId | The ffmpeg codec id |
- Returns
- True when support forced overlay, otherwise false
◆ MakeFourCC()
| static constexpr uint32_t StreamUtils::MakeFourCC |
( |
char | c1, |
|
|
char | c2, |
|
|
char | c3, |
|
|
char | c4 ) |
|
inlinestaticconstexpr |
Make a FourCC code as unsigned integer value.
- Parameters
-
| c1 | The first FourCC char |
| c2 | The second FourCC char |
| c3 | The third FourCC char |
| c4 | The fourth FourCC char |
- Returns
- The FourCC as unsigned integer value
◆ NormalizeAudioCodecName()
| std::string StreamUtils::NormalizeAudioCodecName |
( |
const std::string & | codec | ) |
|
|
static |
Normalise an externally supplied (eg. NFO) audio codec name to the name Kodi uses.
- Parameters
-
| codec | The audio codec name, lowercased |
- Returns
- The equivalent Kodi codec name, or the codec name unchanged if nothing maps
The documentation for this class was generated from the following files: