|
25 | 25 | #include <math.h> |
26 | 26 | #include <sys/types.h> |
27 | 27 |
|
| 28 | +#include "config.h" // for HAVE_SUBRANDR |
| 29 | + |
28 | 30 | #include <ass/ass.h> |
| 31 | +#if HAVE_SUBRANDR |
| 32 | +#include <subrandr/subrandr.h> |
| 33 | +#endif |
29 | 34 | #include <libavutil/avstring.h> |
30 | 35 | #include <libavutil/common.h> |
31 | 36 | #include <libavutil/timecode.h> |
@@ -3665,6 +3670,19 @@ static int mp_property_libass_version(void *ctx, struct m_property *prop, |
3665 | 3670 | return m_property_int64_ro(action, arg, ass_library_version()); |
3666 | 3671 | } |
3667 | 3672 |
|
| 3673 | +static int mp_property_subrandr_version(void *ctx, struct m_property *prop, |
| 3674 | + int action, void *arg) |
| 3675 | +{ |
| 3676 | +#if HAVE_SUBRANDR |
| 3677 | + uint32_t major, minor, patch; |
| 3678 | + sbr_library_version(&major, &minor, &patch); |
| 3679 | + const char *result = mp_tprintf(32, "%" PRIu32 ".%" PRIu32 ".%" PRIu32, major, minor, patch); |
| 3680 | + return m_property_strdup_ro(action, arg, result); |
| 3681 | +#else |
| 3682 | + return M_PROPERTY_UNAVAILABLE; |
| 3683 | +#endif |
| 3684 | +} |
| 3685 | + |
3668 | 3686 | static int mp_property_platform(void *ctx, struct m_property *prop, |
3669 | 3687 | int action, void *arg) |
3670 | 3688 | { |
@@ -4446,6 +4464,7 @@ static const struct m_property mp_properties_base[] = { |
4446 | 4464 | {"mpv-configuration", mp_property_configuration}, |
4447 | 4465 | {"ffmpeg-version", mp_property_ffmpeg}, |
4448 | 4466 | {"libass-version", mp_property_libass_version}, |
| 4467 | + {"subrandr-version", mp_property_subrandr_version}, |
4449 | 4468 | {"platform", mp_property_platform}, |
4450 | 4469 |
|
4451 | 4470 | {"options", mp_property_options}, |
|
0 commit comments