mirror of https://github.com/mpv-player/mpv
command: add filtered-metadata property
Goes in hand with the previous commit; the main purpose is to easily show on OSD what is shown on terminal.
This commit is contained in:
parent
8048374a5c
commit
97ab40290e
|
@ -903,6 +903,10 @@ Property list
|
||||||
MPV_FORMAT_NODE_MAP
|
MPV_FORMAT_NODE_MAP
|
||||||
(key and string value for each metadata entry)
|
(key and string value for each metadata entry)
|
||||||
|
|
||||||
|
``filtered-metadata``
|
||||||
|
Like ``metadata``, but includes only fields listed in the ``--display-tags``
|
||||||
|
option. This is the same set of tags that is printed to the terminal.
|
||||||
|
|
||||||
``chapter-metadata``
|
``chapter-metadata``
|
||||||
Metadata of current chapter. Works similar to ``metadata`` property. It
|
Metadata of current chapter. Works similar to ``metadata`` property. It
|
||||||
also allows the same access methods (using sub-properties).
|
also allows the same access methods (using sub-properties).
|
||||||
|
|
|
@ -1122,6 +1122,16 @@ static int mp_property_metadata(void *ctx, struct m_property *prop,
|
||||||
return tag_property(action, arg, demuxer->metadata);
|
return tag_property(action, arg, demuxer->metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int mp_property_filtered_metadata(void *ctx, struct m_property *prop,
|
||||||
|
int action, void *arg)
|
||||||
|
{
|
||||||
|
MPContext *mpctx = ctx;
|
||||||
|
if (!mpctx->filtered_tags)
|
||||||
|
return M_PROPERTY_UNAVAILABLE;
|
||||||
|
|
||||||
|
return tag_property(action, arg, mpctx->filtered_tags);
|
||||||
|
}
|
||||||
|
|
||||||
static int mp_property_chapter_metadata(void *ctx, struct m_property *prop,
|
static int mp_property_chapter_metadata(void *ctx, struct m_property *prop,
|
||||||
int action, void *arg)
|
int action, void *arg)
|
||||||
{
|
{
|
||||||
|
@ -3246,6 +3256,7 @@ static const struct m_property mp_properties[] = {
|
||||||
{"editions", mp_property_editions},
|
{"editions", mp_property_editions},
|
||||||
{"angle", mp_property_angle},
|
{"angle", mp_property_angle},
|
||||||
{"metadata", mp_property_metadata},
|
{"metadata", mp_property_metadata},
|
||||||
|
{"filtered-metadata", mp_property_filtered_metadata},
|
||||||
{"chapter-metadata", mp_property_chapter_metadata},
|
{"chapter-metadata", mp_property_chapter_metadata},
|
||||||
{"vf-metadata", mp_property_vf_metadata},
|
{"vf-metadata", mp_property_vf_metadata},
|
||||||
{"pause", mp_property_pause},
|
{"pause", mp_property_pause},
|
||||||
|
@ -3429,7 +3440,7 @@ static const char *const *const mp_event_property_change[] = {
|
||||||
"samplerate", "channels", "audio"),
|
"samplerate", "channels", "audio"),
|
||||||
E(MPV_EVENT_SEEK, "seeking"),
|
E(MPV_EVENT_SEEK, "seeking"),
|
||||||
E(MPV_EVENT_PLAYBACK_RESTART, "seeking"),
|
E(MPV_EVENT_PLAYBACK_RESTART, "seeking"),
|
||||||
E(MPV_EVENT_METADATA_UPDATE, "metadata"),
|
E(MPV_EVENT_METADATA_UPDATE, "metadata", "filtered-metadata"),
|
||||||
E(MPV_EVENT_CHAPTER_CHANGE, "chapter", "chapter-metadata"),
|
E(MPV_EVENT_CHAPTER_CHANGE, "chapter", "chapter-metadata"),
|
||||||
E(MP_EVENT_CACHE_UPDATE, "cache", "cache-free", "cache-used", "cache-idle",
|
E(MP_EVENT_CACHE_UPDATE, "cache", "cache-free", "cache-used", "cache-idle",
|
||||||
"demuxer-cache-duration", "demuxer-cache-idle"),
|
"demuxer-cache-duration", "demuxer-cache-idle"),
|
||||||
|
|
Loading…
Reference in New Issue