[vlc-devel] [PATCH] libvlc: deprecate old track API

Thomas Guillem thomas at gllm.fr
Thu Jul 16 15:06:25 CEST 2020


Use libvlc_media_player_get_tracklist() / libvlc_media_player_select_track()
instead.

Reminder: all deprecated APIs will be removed before the VLC 4.0 freeze.
---
 include/vlc/deprecated.h          | 145 ++++++++++++++++++++++++++++++
 include/vlc/libvlc_media_player.h | 124 -------------------------
 2 files changed, 145 insertions(+), 124 deletions(-)

diff --git a/include/vlc/deprecated.h b/include/vlc/deprecated.h
index 82ac660f949..547bb2f00d2 100644
--- a/include/vlc/deprecated.h
+++ b/include/vlc/deprecated.h
@@ -90,6 +90,151 @@ LIBVLC_DEPRECATED LIBVLC_API bool
 
 /** @}*/
 
+/**
+ * \ingroup libvlc libvlc_media_player
+ * @{
+ */
+
+/**
+ * Description for video, audio tracks and subtitles. It contains
+ * id, name (description string) and pointer to next record.
+ */
+typedef struct libvlc_track_description_t
+{
+    int   i_id;
+    char *psz_name;
+    struct libvlc_track_description_t *p_next;
+
+} libvlc_track_description_t;
+
+/**
+ * Release (free) libvlc_track_description_t
+ *
+ * \param p_track_description the structure to release
+ */
+LIBVLC_DEPRECATED LIBVLC_API void libvlc_track_description_list_release( libvlc_track_description_t *p_track_description );
+
+/** @}*/
+
+/**
+ * \ingroup libvlc libvlc_audio
+ * @{
+ */
+
+/**
+ * Get number of available audio tracks.
+ *
+ * \param p_mi media player
+ * \return the number of available audio tracks (int), or -1 if unavailable
+ */
+LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
+
+/**
+ * Get the description of available audio tracks.
+ *
+ * \param p_mi media player
+ * \return list with description of available audio tracks, or NULL.
+ * It must be freed with libvlc_track_description_list_release()
+ */
+LIBVLC_DEPRECATED LIBVLC_API libvlc_track_description_t *
+        libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
+
+/**
+ * Get current audio track.
+ *
+ * \param p_mi media player
+ * \return the audio track ID or -1 if no active input.
+ */
+LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
+
+/**
+ * Set current audio track.
+ *
+ * \param p_mi media player
+ * \param i_track the track ID (i_id field from track description)
+ * \return 0 on success, -1 on error
+ */
+LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
+
+/** @}*/
+
+/**
+ * \ingroup libvlc libvlc_video
+ * @{
+ */
+
+/**
+ * Get number of available video tracks.
+ *
+ * \param p_mi media player
+ * \return the number of available video tracks (int)
+ */
+LIBVLC_DEPRECATED LIBVLC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
+
+/**
+ * Get the description of available video tracks.
+ *
+ * \param p_mi media player
+ * \return list with description of available video tracks, or NULL on error.
+ * It must be freed with libvlc_track_description_list_release()
+ */
+LIBVLC_DEPRECATED LIBVLC_API libvlc_track_description_t *
+        libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
+
+/**
+ * Get current video track.
+ *
+ * \param p_mi media player
+ * \return the video track ID (int) or -1 if no active input
+ */
+LIBVLC_DEPRECATED LIBVLC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
+
+/**
+ * Set video track.
+ *
+ * \param p_mi media player
+ * \param i_track the track ID (i_id field from track description)
+ * \return 0 on success, -1 if out of range
+ */
+LIBVLC_DEPRECATED LIBVLC_API
+int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
+
+/**
+ * Get current video subtitle.
+ *
+ * \param p_mi the media player
+ * \return the video subtitle selected, or -1 if none
+ */
+LIBVLC_DEPRECATED LIBVLC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
+
+/**
+ * Get the number of available video subtitles.
+ *
+ * \param p_mi the media player
+ * \return the number of available video subtitles
+ */
+LIBVLC_DEPRECATED LIBVLC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
+
+/**
+ * Get the description of available video subtitles.
+ *
+ * \param p_mi the media player
+ * \return list containing description of available video subtitles.
+ * It must be freed with libvlc_track_description_list_release()
+ */
+LIBVLC_DEPRECATED LIBVLC_API libvlc_track_description_t *
+        libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
+
+/**
+ * Set new video subtitle.
+ *
+ * \param p_mi the media player
+ * \param i_spu video subtitle track to select (i_id from track description)
+ * \return 0 on success, -1 if out of range
+ */
+LIBVLC_DEPRECATED LIBVLC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu );
+
+
 /**
  * \ingroup libvlc
  * \defgroup libvlc_playlist LibVLC playlist (legacy)
diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index dc5942afd06..96d76839658 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -41,18 +41,6 @@ extern "C" {
 
 typedef struct libvlc_media_player_t libvlc_media_player_t;
 
-/**
- * Description for video, audio tracks and subtitles. It contains
- * id, name (description string) and pointer to next record.
- */
-typedef struct libvlc_track_description_t
-{
-    int   i_id;
-    char *psz_name;
-    struct libvlc_track_description_t *p_next;
-
-} libvlc_track_description_t;
-
 /**
  * Description for titles
  */
@@ -1446,12 +1434,6 @@ int libvlc_media_player_add_slave( libvlc_media_player_t *p_mi,
                                    libvlc_media_slave_type_t i_type,
                                    const char *psz_uri, bool b_select );
 
-/**
- * Release (free) libvlc_track_description_t
- *
- * \param p_track_description the structure to release
- */
-LIBVLC_API void libvlc_track_description_list_release( libvlc_track_description_t *p_track_description );
 
 /** \defgroup libvlc_video LibVLC video controls
  * @{
@@ -1639,41 +1621,6 @@ LIBVLC_API int libvlc_video_update_viewpoint( libvlc_media_player_t *p_mi,
                                               const libvlc_video_viewpoint_t *p_viewpoint,
                                               bool b_absolute);
 
-/**
- * Get current video subtitle.
- *
- * \param p_mi the media player
- * \return the video subtitle selected, or -1 if none
- */
-LIBVLC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
-
-/**
- * Get the number of available video subtitles.
- *
- * \param p_mi the media player
- * \return the number of available video subtitles
- */
-LIBVLC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
-
-/**
- * Get the description of available video subtitles.
- *
- * \param p_mi the media player
- * \return list containing description of available video subtitles.
- * It must be freed with libvlc_track_description_list_release()
- */
-LIBVLC_API libvlc_track_description_t *
-        libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
-
-/**
- * Set new video subtitle.
- *
- * \param p_mi the media player
- * \param i_spu video subtitle track to select (i_id from track description)
- * \return 0 on success, -1 if out of range
- */
-LIBVLC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu );
-
 /**
  * Get the current subtitle delay. Positive values means subtitles are being
  * displayed later, negative values earlier.
@@ -1874,42 +1821,6 @@ LIBVLC_API int libvlc_video_get_teletext( libvlc_media_player_t *p_mi );
  */
 LIBVLC_API void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page );
 
-/**
- * Get number of available video tracks.
- *
- * \param p_mi media player
- * \return the number of available video tracks (int)
- */
-LIBVLC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
-
-/**
- * Get the description of available video tracks.
- *
- * \param p_mi media player
- * \return list with description of available video tracks, or NULL on error.
- * It must be freed with libvlc_track_description_list_release()
- */
-LIBVLC_API libvlc_track_description_t *
-        libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
-
-/**
- * Get current video track.
- *
- * \param p_mi media player
- * \return the video track ID (int) or -1 if no active input
- */
-LIBVLC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
-
-/**
- * Set video track.
- *
- * \param p_mi media player
- * \param i_track the track ID (i_id field from track description)
- * \return 0 on success, -1 if out of range
- */
-LIBVLC_API
-int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
-
 /**
  * Take a snapshot of the current video window.
  *
@@ -2296,41 +2207,6 @@ LIBVLC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
  */
 LIBVLC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
 
-/**
- * Get number of available audio tracks.
- *
- * \param p_mi media player
- * \return the number of available audio tracks (int), or -1 if unavailable
- */
-LIBVLC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
-
-/**
- * Get the description of available audio tracks.
- *
- * \param p_mi media player
- * \return list with description of available audio tracks, or NULL.
- * It must be freed with libvlc_track_description_list_release()
- */
-LIBVLC_API libvlc_track_description_t *
-        libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
-
-/**
- * Get current audio track.
- *
- * \param p_mi media player
- * \return the audio track ID or -1 if no active input.
- */
-LIBVLC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
-
-/**
- * Set current audio track.
- *
- * \param p_mi media player
- * \param i_track the track ID (i_id field from track description)
- * \return 0 on success, -1 on error
- */
-LIBVLC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
-
 /**
  * Get current audio channel.
  *
-- 
2.20.1



More information about the vlc-devel mailing list