From 89674854ceaae9c0a9d8f24b9a24fb2f24df6bb1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 20 Sep 2016 15:40:44 +0200 Subject: 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.) --- video/decode/dec_video.c | 6 ++++++ video/decode/dec_video.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'video/decode') diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index 02fa334e2b..7e144a72bc 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -192,6 +192,7 @@ static void fix_image_params(struct dec_video *d_video, struct mp_codec_params *c = d_video->codec; MP_VERBOSE(d_video, "Decoder format: %s\n", mp_image_params_to_str(params)); + d_video->dec_format = *params; // While mp_image_params normally always have to have d_w/d_h set, the // decoder signals unknown bitstream aspect ratio with both set to 0. @@ -353,6 +354,11 @@ void video_reset_params(struct dec_video *d_video) d_video->last_format = (struct mp_image_params){0}; } +void video_get_dec_params(struct dec_video *d_video, struct mp_image_params *p) +{ + *p = d_video->dec_format; +} + void video_set_framedrop(struct dec_video *d_video, bool enabled) { d_video->framedrop_enabled = enabled; diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h index be82e4679a..f7bff61c9f 100644 --- a/video/decode/dec_video.h +++ b/video/decode/dec_video.h @@ -65,7 +65,7 @@ struct dec_video { // Final PTS of previously decoded image double decoded_pts; - struct mp_image_params last_format, fixed_format; + struct mp_image_params dec_format, last_format, fixed_format; float initial_decoder_aspect; double start_pts; @@ -92,5 +92,6 @@ void video_set_start(struct dec_video *d_video, double start_pts); int video_vd_control(struct dec_video *d_video, int cmd, void *arg); void video_reset(struct dec_video *d_video); void video_reset_params(struct dec_video *d_video); +void video_get_dec_params(struct dec_video *d_video, struct mp_image_params *p); #endif /* MPLAYER_DEC_VIDEO_H */ -- cgit v1.2.3