summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-20 15:40:44 +0200
committerwm4 <wm4@nowhere>2016-09-20 15:44:26 +0200
commit89674854ceaae9c0a9d8f24b9a24fb2f24df6bb1 (patch)
tree62b82f937c1ff0d08f788ab26920f3ae10995aba /player/command.c
parent23639e5b0ea5d4af50a2d5aedef11cd240e2390c (diff)
downloadmpv-89674854ceaae9c0a9d8f24b9a24fb2f24df6bb1.tar.bz2
mpv-89674854ceaae9c0a9d8f24b9a24fb2f24df6bb1.tar.xz
command: add a video-dec-params property
This is the actual decoder output, with no overrides applied. (Maybe video-params shouldn't contain the overrides in the first place, but damage done.)
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/player/command.c b/player/command.c
index faa167228b..0d2847d4b4 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2615,6 +2615,19 @@ static int mp_property_vo_imgparams(void *ctx, struct m_property *prop,
return property_imgparams(get_video_out_params(ctx), action, arg);
}
+static int mp_property_dec_imgparams(void *ctx, struct m_property *prop,
+ int action, void *arg)
+{
+ MPContext *mpctx = ctx;
+ struct mp_image_params p = {0};
+ struct vo_chain *vo_c = mpctx->vo_chain;
+ if (vo_c && vo_c->video_src)
+ video_get_dec_params(vo_c->video_src, &p);
+ if (!p.imgfmt)
+ return M_PROPERTY_UNAVAILABLE;
+ return property_imgparams(p, action, arg);
+}
+
static int mp_property_vd_imgparams(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -3855,6 +3868,7 @@ static const struct m_property mp_properties_base[] = {
{"video-output-levels", mp_property_video_color,
.priv = (void *)"output-levels"},
{"video-out-params", mp_property_vo_imgparams},
+ {"video-dec-params", mp_property_dec_imgparams},
{"video-params", mp_property_vd_imgparams},
{"video-format", mp_property_video_format},
{"video-frame-info", mp_property_video_frame_info},
@@ -3992,7 +4006,8 @@ static const char *const *const mp_event_property_change[] = {
"video-format", "video-codec", "video-bitrate", "dwidth", "dheight",
"width", "height", "fps", "aspect", "vo-configured", "current-vo",
"detected-hwdec", "colormatrix", "colormatrix-input-range",
- "colormatrix-output-range", "colormatrix-primaries", "video-aspect"),
+ "colormatrix-output-range", "colormatrix-primaries", "video-aspect",
+ "video-dec-params"),
E(MPV_EVENT_AUDIO_RECONFIG, "audio-format", "audio-codec", "audio-bitrate",
"samplerate", "channels", "audio", "volume", "mute", "balance",
"current-ao", "audio-codec-name", "audio-params",