lib: deprecate the old track API
[vlc.git] / include / vlc / deprecated.h
blob017bba79572a750ab27a7281920a5437e235588e
1 /*****************************************************************************
2 * deprecated.h: libvlc deprecated API
3 *****************************************************************************
4 * Copyright (C) 1998-2008 VLC authors and VideoLAN
6 * Authors: Clément Stenac <zorglub@videolan.org>
7 * Jean-Paul Saman <jpsaman@videolan.org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef LIBVLC_DEPRECATED_H
25 #define LIBVLC_DEPRECATED_H 1
27 # ifdef __cplusplus
28 extern "C" {
29 # endif
31 /**
32 * \ingroup libvlc libvlc_media
33 * @{
36 /**
37 * Parse a media.
39 * This fetches (local) art, meta data and tracks information.
40 * The method is synchronous.
42 * \deprecated This function could block indefinitely.
43 * Use libvlc_media_parse_with_options() instead
45 * \see libvlc_media_parse_with_options
46 * \see libvlc_media_get_meta
48 * \param p_md media descriptor object
50 LIBVLC_DEPRECATED LIBVLC_API void
51 libvlc_media_parse( libvlc_media_t *p_md );
53 /**
54 * Parse a media.
56 * This fetches (local) art, meta data and tracks information.
57 * The method is the asynchronous of libvlc_media_parse().
59 * To track when this is over you can listen to libvlc_MediaParsedChanged
60 * event. However if the media was already parsed you will not receive this
61 * event.
63 * \deprecated You can't be sure to receive the libvlc_MediaParsedChanged
64 * event (you can wait indefinitely for this event).
65 * Use libvlc_media_parse_with_options() instead
67 * \see libvlc_media_parse
68 * \see libvlc_MediaParsedChanged
69 * \see libvlc_media_get_meta
71 * \param p_md media descriptor object
73 LIBVLC_DEPRECATED LIBVLC_API void
74 libvlc_media_parse_async( libvlc_media_t *p_md );
76 /**
77 * Return true is the media descriptor object is parsed
79 * \deprecated This can return true in case of failure.
80 * Use libvlc_media_get_parsed_status() instead
82 * \see libvlc_MediaParsedChanged
84 * \param p_md media descriptor object
85 * \retval true media object has been parsed
86 * \retval false otherwise
88 LIBVLC_DEPRECATED LIBVLC_API bool
89 libvlc_media_is_parsed( libvlc_media_t *p_md );
91 /**
92 * Get media descriptor's elementary streams description
94 * Note, you need to call libvlc_media_parse_with_options() or play the media
95 * at least once before calling this function.
96 * Not doing this will result in an empty array.
98 * \version LibVLC 2.1.0 and later.
99 * \see libvlc_media_parse_with_options
101 * \param p_md media descriptor object
102 * \param tracks address to store an allocated array of Elementary Streams
103 * descriptions (must be freed with libvlc_media_tracks_release
104 by the caller) [OUT]
106 * \return the number of Elementary Streams (zero on error)
108 LIBVLC_DEPRECATED LIBVLC_API
109 unsigned libvlc_media_tracks_get( libvlc_media_t *p_md,
110 libvlc_media_track_t ***tracks );
113 * Release media descriptor's elementary streams description array
115 * \version LibVLC 2.1.0 and later.
117 * \param p_tracks tracks info array to release
118 * \param i_count number of elements in the array
120 LIBVLC_DEPRECATED LIBVLC_API
121 void libvlc_media_tracks_release( libvlc_media_track_t **p_tracks,
122 unsigned i_count );
124 /** @}*/
127 * \ingroup libvlc libvlc_media_player
128 * @{
132 * Description for video, audio tracks and subtitles. It contains
133 * id, name (description string) and pointer to next record.
135 typedef struct libvlc_track_description_t
137 int i_id;
138 char *psz_name;
139 struct libvlc_track_description_t *p_next;
141 } libvlc_track_description_t;
144 * Release (free) libvlc_track_description_t
146 * \param p_track_description the structure to release
148 LIBVLC_DEPRECATED LIBVLC_API void libvlc_track_description_list_release( libvlc_track_description_t *p_track_description );
151 /** @}*/
154 * \ingroup libvlc libvlc_video
155 * @{
159 * Get number of available video tracks.
161 * \param p_mi media player
162 * \return the number of available video tracks (int)
164 LIBVLC_DEPRECATED LIBVLC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
167 * Get the description of available video tracks.
169 * \param p_mi media player
170 * \return list with description of available video tracks, or NULL on error.
171 * It must be freed with libvlc_track_description_list_release()
173 LIBVLC_DEPRECATED LIBVLC_API libvlc_track_description_t *
174 libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
177 * Get current video track.
179 * \param p_mi media player
180 * \return the video track ID (int) or -1 if no active input
182 LIBVLC_DEPRECATED LIBVLC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
185 * Set video track.
187 * \param p_mi media player
188 * \param i_track the track ID (i_id field from track description)
189 * \return 0 on success, -1 if out of range
191 LIBVLC_DEPRECATED LIBVLC_API
192 int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
195 * Get current video subtitle.
197 * \param p_mi the media player
198 * \return the video subtitle selected, or -1 if none
200 LIBVLC_DEPRECATED LIBVLC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
203 * Get the number of available video subtitles.
205 * \param p_mi the media player
206 * \return the number of available video subtitles
208 LIBVLC_DEPRECATED LIBVLC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
211 * Get the description of available video subtitles.
213 * \param p_mi the media player
214 * \return list containing description of available video subtitles.
215 * It must be freed with libvlc_track_description_list_release()
217 LIBVLC_DEPRECATED LIBVLC_API libvlc_track_description_t *
218 libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
221 * Set new video subtitle.
223 * \param p_mi the media player
224 * \param i_spu video subtitle track to select (i_id from track description)
225 * \return 0 on success, -1 if out of range
227 LIBVLC_DEPRECATED LIBVLC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu );
229 /** @}*/
232 * \ingroup libvlc libvlc_audio
233 * @{
237 * Get number of available audio tracks.
239 * \param p_mi media player
240 * \return the number of available audio tracks (int), or -1 if unavailable
242 LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
245 * Get the description of available audio tracks.
247 * \param p_mi media player
248 * \return list with description of available audio tracks, or NULL.
249 * It must be freed with libvlc_track_description_list_release()
251 LIBVLC_DEPRECATED LIBVLC_API libvlc_track_description_t *
252 libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
255 * Get current audio track.
257 * \param p_mi media player
258 * \return the audio track ID or -1 if no active input.
260 LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
263 * Set current audio track.
265 * \param p_mi media player
266 * \param i_track the track ID (i_id field from track description)
267 * \return 0 on success, -1 on error
269 LIBVLC_DEPRECATED LIBVLC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
271 /** @}*/
274 * \ingroup libvlc
275 * \defgroup libvlc_playlist LibVLC playlist (legacy)
276 * @deprecated Use @ref libvlc_media_list instead.
277 * @{
278 * \file
279 * LibVLC deprecated playlist API
283 * Start playing (if there is any item in the playlist).
285 * Additionnal playlist item options can be specified for addition to the
286 * item before it is played.
288 * \param p_instance the playlist instance
290 LIBVLC_DEPRECATED LIBVLC_API
291 void libvlc_playlist_play( libvlc_instance_t *p_instance );
293 /** @}*/
295 # ifdef __cplusplus
297 # endif
299 #endif /* _LIBVLC_DEPRECATED_H */