diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h index 2c34509094..7e28aeda59 100644 --- a/include/vlc/libvlc_media_player.h +++ b/include/vlc/libvlc_media_player.h @@ -2386,6 +2386,24 @@ int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num, const char *psz_filepath, unsigned int i_width, unsigned int i_height ); +/** + * Gets the deinterlacing parameters. + * + * If \p modep is not NULL, it will be set to a heap-allocated nul-terminated + * character string indicating the current deinterlacing algorithm name. + * If no algorithm is selected or if allocation fails, it be set to NULL. + * The value should be freed with the C run-time's free() function to avoid + * leaking. + * + * \param mpi media player instance + * \param modep storage space for hold the mode name (or NULL) [OUT] + * \retval -1 deinterlacing is selected automatically + * \retval 0 deinterlacing is forcefully disabled + * \retval 1 deinterlacing is forcefully enabled + */ +LIBVLC_API int libvlc_video_get_deinterlace(libvlc_media_player_t *mp, + char **modep); + /** * Enable or disable deinterlace filter * diff --git a/lib/libvlc.sym b/lib/libvlc.sym index 707447e1bd..f92df6b013 100644 --- a/lib/libvlc.sym +++ b/lib/libvlc.sym @@ -243,6 +243,7 @@ libvlc_video_get_adjust_int libvlc_video_get_aspect_ratio libvlc_video_get_size libvlc_video_get_cursor +libvlc_video_get_deinterlace libvlc_video_get_logo_int libvlc_video_get_marquee_int libvlc_video_get_scale diff --git a/lib/video.c b/lib/video.c index 5ae5d42af9..a02289ead9 100644 --- a/lib/video.c +++ b/lib/video.c @@ -536,6 +536,20 @@ int libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi, int deinterlace, return 0; } +int libvlc_video_get_deinterlace(libvlc_media_player_t *mp, char **modep) +{ + int tristate = var_GetInteger(mp, "deinterlace"); + + if (modep != NULL) { + if (tristate != 0) + *modep = var_GetString(mp, "deinterlace-mode"); + else + *modep = NULL; + } + + return tristate; +} + /* ************** */ /* module helpers */ /* ************** */