diff options
author | wm4 <wm4@nowhere> | 2016-01-14 00:18:36 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-01-14 00:18:36 +0100 |
commit | 5722f93a740e841cfe929980c7ac4d4f7896d9dc (patch) | |
tree | cf8c438e2a2fcec438d1a1ceb0816b138063e322 /video/decode | |
parent | bf13bd0d47e5fc6761c51c6ba7056968e60bf4cd (diff) |
video: refactor: shuffle code around
struct dec_video should have nothing to do with video filters or
outputs, and this huge chunk of code was somehow stuck directly in
dec_video.c.
Diffstat (limited to 'video/decode')
-rw-r--r-- | video/decode/dec_video.c | 71 | ||||
-rw-r--r-- | video/decode/dec_video.h | 6 |
2 files changed, 1 insertions, 76 deletions
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index 772bab2f16..b120a69957 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -79,41 +79,6 @@ int video_vd_control(struct dec_video *d_video, int cmd, void *arg) return CONTROL_UNKNOWN; } -int video_set_colors(struct dec_video *d_video, const char *item, int value) -{ - vf_equalizer_t data; - - data.item = item; - data.value = value; - - MP_VERBOSE(d_video, "set video colors %s=%d \n", item, value); - if (d_video->vfilter) { - int ret = video_vf_vo_control(d_video, VFCTRL_SET_EQUALIZER, &data); - if (ret == CONTROL_TRUE) - return 1; - } - MP_VERBOSE(d_video, "Video attribute '%s' is not supported by selected vo.\n", - item); - return 0; -} - -int video_get_colors(struct dec_video *d_video, const char *item, int *value) -{ - vf_equalizer_t data; - - data.item = item; - - MP_VERBOSE(d_video, "get video colors %s \n", item); - if (d_video->vfilter) { - int ret = video_vf_vo_control(d_video, VFCTRL_GET_EQUALIZER, &data); - if (ret == CONTROL_TRUE) { - *value = data.value; - return 1; - } - } - return 0; -} - void video_uninit(struct dec_video *d_video) { mp_image_unrefp(&d_video->waiting_decoded_mpi); @@ -398,39 +363,3 @@ struct mp_image *video_decode(struct dec_video *d_video, d_video->decoded_pts = pts; return mpi; } - -// Send a VCTRL, or if it doesn't work, translate it to a VOCTRL and try the VO. -int video_vf_vo_control(struct dec_video *d_video, int vf_cmd, void *data) -{ - if (d_video->vfilter && d_video->vfilter->initialized > 0) { - int r = vf_control_any(d_video->vfilter, vf_cmd, data); - if (r != CONTROL_UNKNOWN) - return r; - } - - switch (vf_cmd) { - case VFCTRL_GET_DEINTERLACE: - return vo_control(d_video->vo, VOCTRL_GET_DEINTERLACE, data) == VO_TRUE; - case VFCTRL_SET_DEINTERLACE: - return vo_control(d_video->vo, VOCTRL_SET_DEINTERLACE, data) == VO_TRUE; - case VFCTRL_SET_EQUALIZER: { - vf_equalizer_t *eq = data; - if (!d_video->vo->config_ok) - return CONTROL_FALSE; // vo not configured? - struct voctrl_set_equalizer_args param = { - eq->item, eq->value - }; - return vo_control(d_video->vo, VOCTRL_SET_EQUALIZER, ¶m) == VO_TRUE; - } - case VFCTRL_GET_EQUALIZER: { - vf_equalizer_t *eq = data; - if (!d_video->vo->config_ok) - return CONTROL_FALSE; // vo not configured? - struct voctrl_get_equalizer_args param = { - eq->item, &eq->value - }; - return vo_control(d_video->vo, VOCTRL_GET_EQUALIZER, ¶m) == VO_TRUE; - } - } - return CONTROL_UNKNOWN; -} diff --git a/video/decode/dec_video.h b/video/decode/dec_video.h index fe325806c6..7f59d6bd3b 100644 --- a/video/decode/dec_video.h +++ b/video/decode/dec_video.h @@ -87,11 +87,7 @@ struct mp_image *video_decode(struct dec_video *d_video, struct demux_packet *packet, int drop_frame); -int video_get_colors(struct dec_video *d_video, const char *item, int *value); -int video_set_colors(struct dec_video *d_video, const char *item, int value); -void video_reset_decoding(struct dec_video *d_video); int video_vd_control(struct dec_video *d_video, int cmd, void *arg); - -int video_vf_vo_control(struct dec_video *d_video, int vf_cmd, void *data); +void video_reset_decoding(struct dec_video *d_video); #endif /* MPLAYER_DEC_VIDEO_H */ |