[vlc-devel] [PATCH 02/10] libvlc: use the libvlc_video_marquee_option_t enum directly

Steve Lhomme robux4 at ycbcr.xyz
Mon May 27 15:38:14 CEST 2019


No need to use an unsigned if we have a clean enum.
We already use a lot enums in all the libvlc API's.
---
 include/vlc/libvlc_media_player.h | 16 ++++++++--------
 lib/video.c                       |  9 +++++----
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 1b7547cfb8..0d02a90dec 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -1758,19 +1758,19 @@ LIBVLC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
  * Get an integer marquee option value
  *
  * \param p_mi libvlc media player
- * \param option marq option to get \see libvlc_video_marquee_int_option_t
+ * \param option marq option to get
  */
 LIBVLC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
-                                                 unsigned option );
+                                             libvlc_video_marquee_option_t option );
 
 /**
  * Get a string marquee option value
  *
  * \param p_mi libvlc media player
- * \param option marq option to get \see libvlc_video_marquee_string_option_t
+ * \param option marq option to get
  */
 LIBVLC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
-                                                      unsigned option );
+                                                  libvlc_video_marquee_option_t option );
 
 /**
  * Enable, disable or set an integer marquee option
@@ -1779,21 +1779,21 @@ LIBVLC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
  * or disabling (arg 0) the marq filter.
  *
  * \param p_mi libvlc media player
- * \param option marq option to set \see libvlc_video_marquee_int_option_t
+ * \param option marq option to set
  * \param i_val marq option value
  */
 LIBVLC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
-                                                  unsigned option, int i_val );
+                                              libvlc_video_marquee_option_t option, int i_val );
 
 /**
  * Set a marquee string option
  *
  * \param p_mi libvlc media player
- * \param option marq option to set \see libvlc_video_marquee_string_option_t
+ * \param option marq option to set
  * \param psz_text marq option value
  */
 LIBVLC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
-                                                     unsigned option, const char *psz_text );
+                                                 libvlc_video_marquee_option_t option, const char *psz_text );
 
 /** option values for libvlc_video_{get,set}_logo_{int,string} */
 enum libvlc_video_logo_option_t {
diff --git a/lib/video.c b/lib/video.c
index a318df0098..c1b7955ccd 100644
--- a/lib/video.c
+++ b/lib/video.c
@@ -769,7 +769,7 @@ marq_option_bynumber(unsigned option)
  * libvlc_video_get_marquee_int : get a marq option value
  *****************************************************************************/
 int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
-                                  unsigned option )
+                                  libvlc_video_marquee_option_t option )
 {
     return get_int( p_mi, "marq", marq_option_bynumber(option) );
 }
@@ -778,7 +778,7 @@ int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
  * libvlc_video_get_marquee_string : get a marq option value
  *****************************************************************************/
 char * libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
-                                        unsigned option )
+                                        libvlc_video_marquee_option_t option )
 {
     return get_string( p_mi, "marq", marq_option_bynumber(option) );
 }
@@ -787,7 +787,7 @@ char * libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
  * libvlc_video_set_marquee_int: enable, disable or set an int option
  *****************************************************************************/
 void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
-                         unsigned option, int value )
+                                   libvlc_video_marquee_option_t option, int value )
 {
     set_value( p_mi, "marq", marq_option_bynumber(option), VLC_VAR_INTEGER,
                &(vlc_value_t) { .i_int = value }, true );
@@ -797,7 +797,8 @@ void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
  * libvlc_video_set_marquee_string: set a string option
  *****************************************************************************/
 void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
-                unsigned option, const char * value )
+                                      libvlc_video_marquee_option_t option,
+                                      const char * value )
 {
     set_value( p_mi, "marq", marq_option_bynumber(option), VLC_VAR_STRING,
                &(vlc_value_t){ .psz_string = (char *)value }, true );
-- 
2.17.1



More information about the vlc-devel mailing list