|
StormByte C++ Library: Multimedia module 0.0.9999
StormByte-Multimedia is a StormByte library module for parsing configuration files
|
Pair {num, den} matching libavutil AVRational.
More...
#include <StormByte/multimedia/property/av_rational.hxx>
Public Member Functions | |
| constexpr | AVRational () noexcept=default |
{0, 1} — unknown / unset. | |
| constexpr | AVRational (int num, int den) noexcept |
{num, den} like the C aggregate. | |
| constexpr bool | Valid () const noexcept |
| True when both sides are positive. | |
| constexpr double | ToDouble () const noexcept |
av_q2d — num / den as double. | |
| std::int64_t | Rescale (std::int64_t ticks, const AVRational &dst) const noexcept |
av_rescale_q(ticks, *this, dst). | |
| constexpr bool | operator== (const AVRational &other) const noexcept |
| Equality. | |
| constexpr bool | operator!= (const AVRational &other) const noexcept |
| Inequality. | |
Public Attributes | |
| int | num = 0 |
Numerator (AVRational.num) | |
| int | den = 1 |
Denominator (AVRational.den) | |
Pair {num, den} matching libavutil AVRational.
Public fields so fps.num, fps.den and AVRational{24000, 1001} read like the C API. This is not libav's header: plugins that include libavutil/rational.h still use AVRational for the C struct. Convert with {r.num, r.den}.
23.976 fps is {24000, 1001}. 24 fps is {24, 1}. A time base of 1 ms is {1, 1000}.
|
constexprdefaultnoexcept |
{0, 1} — unknown / unset.
|
inlineconstexprnoexcept |
{num, den} like the C aggregate.
| num | Numerator. |
| den | Denominator. |
|
inlineconstexprnoexcept |
Inequality.
| other | Other rational. |
|
inlineconstexprnoexcept |
Equality.
| other | Other rational. |
|
noexcept |
av_rescale_q(ticks, *this, dst).
| ticks | Source ticks. |
| dst | Destination time base. |
AV_NOPTS_VALUE when either side is invalid.
|
inlineconstexprnoexcept |
av_q2d — num / den as double.
den == 0.
|
inlineconstexprnoexcept |
True when both sides are positive.
num > 0 && den > 0. | int StormByte::Multimedia::Property::AVRational::den = 1 |
Denominator (AVRational.den)
| int StormByte::Multimedia::Property::AVRational::num = 0 |
Numerator (AVRational.num)