[vlc-commits] [Git][videolan/vlc][master] 2 commits: video: return status from set_deinterlace()
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Sun Oct 5 17:18:14 UTC 2025
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
0642532f by Rémi Denis-Courmont at 2025-10-05T17:02:49+00:00
video: return status from set_deinterlace()
We don't care about breaking the ABI.
But this function didn't exist in previous releases anyway.
- - - - -
acad78c2 by Rémi Denis-Courmont at 2025-10-05T17:02:49+00:00
video: add libvlc_video_get_deinterlace()
Fixes #12884.
- - - - -
3 changed files:
- include/vlc/libvlc_media_player.h
- lib/libvlc.sym
- lib/video.c
Changes:
=====================================
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
*
@@ -2393,8 +2411,9 @@ int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
* \param deinterlace state -1: auto (default), 0: disabled, 1: enabled
* \param psz_mode type of deinterlace filter, NULL for current/default filter
* \version LibVLC 4.0.0 and later
+ * \return 0 on success, -1 if the mode was not recognised
*/
-LIBVLC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
+LIBVLC_API int libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
int deinterlace,
const char *psz_mode );
=====================================
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
=====================================
lib/video.c
=====================================
@@ -500,8 +500,8 @@ bool libvlc_video_get_teletext_transparency( libvlc_media_player_t *p_mi )
/******************************************************************************
* libvlc_video_set_deinterlace : enable/disable/auto deinterlace and filter
*****************************************************************************/
-void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi, int deinterlace,
- const char *psz_mode )
+int libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi, int deinterlace,
+ const char *psz_mode )
{
if (deinterlace != 0 && deinterlace != 1)
deinterlace = -1;
@@ -513,7 +513,7 @@ void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi, int deinterlace,
&& strcmp (psz_mode, "yadif") && strcmp (psz_mode, "yadif2x")
&& strcmp (psz_mode, "phosphor") && strcmp (psz_mode, "ivtc")
&& strcmp (psz_mode, "auto"))
- return;
+ return -1;
if (psz_mode && deinterlace != 0)
var_SetString (p_mi, "deinterlace-mode", psz_mode);
@@ -533,6 +533,21 @@ void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi, int deinterlace,
vout_Release(p_vout);
}
free (pp_vouts);
+ 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;
}
/* ************** */
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6958b2951940c387795b07028ad890d05e1f59d5...acad78c260ae47406f9862b64ea2a2922652a092
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6958b2951940c387795b07028ad890d05e1f59d5...acad78c260ae47406f9862b64ea2a2922652a092
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list