VLC 4.0.0-dev
libvlc_media_track.h
Go to the documentation of this file.
1/*****************************************************************************
2 * libvlc_media_track.h: libvlc external API
3 *****************************************************************************
4 * Copyright (C) 1998-2020 VLC authors and VideoLAN
5 *
6 * Authors: Clément Stenac <zorglub@videolan.org>
7 * Jean-Paul Saman <jpsaman@videolan.org>
8 * Pierre d'Herbemont <pdherbemont@videolan.org>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
24
25#ifndef VLC_LIBVLC_MEDIA_TRACK_H
26#define VLC_LIBVLC_MEDIA_TRACK_H 1
27
28# ifdef __cplusplus
29extern "C" {
30# else
31# include <stdbool.h>
32# endif
33
34/** \defgroup libvlc_media_track LibVLC media track
35 * \ingroup libvlc
36 * @ref libvlc_media_track_t is an abstract representation of a media track.
37 * @{
38 * \file
39 * LibVLC media track
40 */
41
43{
49
51{
52 unsigned i_channels;
53 unsigned i_rate;
55
57{
58 libvlc_video_orient_top_left, /**< Normal. Top line represents top, left column left. */
59 libvlc_video_orient_top_right, /**< Flipped horizontally */
60 libvlc_video_orient_bottom_left, /**< Flipped vertically */
61 libvlc_video_orient_bottom_right, /**< Rotated 180 degrees */
62 libvlc_video_orient_left_top, /**< Transposed */
63 libvlc_video_orient_left_bottom, /**< Rotated 90 degrees clockwise (or 270 anti-clockwise) */
64 libvlc_video_orient_right_top, /**< Rotated 90 degrees anti-clockwise */
65 libvlc_video_orient_right_bottom /**< Anti-transposed */
67
69{
72
75
76/**
77 * Viewpoint
78 *
79 * \warning allocate using libvlc_video_new_viewpoint()
80 */
82{
83 float f_yaw; /**< view point yaw in degrees ]-180;180] */
84 float f_pitch; /**< view point pitch in degrees ]-90;90] */
85 float f_roll; /**< view point roll in degrees ]-180;180] */
86 float f_field_of_view; /**< field of view in degrees ]0;180[ (default 80.)*/
88
90{
91 libvlc_video_multiview_2d, /**< No stereoscopy: 2D picture. */
94 libvlc_video_multiview_stereo_row, /**< Row sequential */
95 libvlc_video_multiview_stereo_col, /**< Column sequential */
96 libvlc_video_multiview_stereo_frame, /**< Frame sequential */
97 libvlc_video_multiview_stereo_checkerboard, /**< Checkerboard pattern */
99
101{
102 unsigned i_height;
103 unsigned i_width;
104 unsigned i_sar_num;
105 unsigned i_sar_den;
108
111 libvlc_video_viewpoint_t pose; /**< Initial view point */
114
116{
119
121{
122 /* Codec fourcc */
123 uint32_t i_codec;
125 int i_id; /* DEPRECATED: use psz_id */
127
128 /* Codec specific */
131
132 union {
136 };
137
138 unsigned int i_bitrate;
141
142 /** String identifier of track, can be used to save the track preference
143 * from an other LibVLC run, only valid when the track is fetch from a
144 * media_player */
145 const char *psz_id;
146 /** A string identifier is stable when it is certified to be the same
147 * across different playback instances for the same track, only valid when
148 * the track is fetch from a media_player */
150 /** Name of the track, only valid when the track is fetch from a
151 * media_player */
152 char *psz_name;
153 /** true if the track is selected, only valid when the track is fetch from
154 * a media_player */
156
158
159/**
160 * Opaque struct containing a list of tracks
161 */
163
164/**
165 * Get the number of tracks in a tracklist
166 *
167 * \version LibVLC 4.0.0 and later.
168 *
169 * \param list valid tracklist
170 *
171 * \return number of tracks, or 0 if the list is empty
172 */
173LIBVLC_API size_t
175
176/**
177 * Get a track at a specific index
178 *
179 * \warning The behaviour is undefined if the index is not valid.
180 *
181 * \version LibVLC 4.0.0 and later.
182 *
183 * \param list valid tracklist
184 * \param index valid index in the range [0; count[
185 *
186 * \return a valid track (can't be NULL if libvlc_media_tracklist_count()
187 * returned a valid count)
188 */
191
192/**
193 * Release a tracklist
194 *
195 * \version LibVLC 4.0.0 and later.
196 *
197 * \see libvlc_media_get_tracklist
198 * \see libvlc_media_player_get_tracklist
199 *
200 * \param list valid tracklist
201 */
202LIBVLC_API void
204
205
206/**
207 * Hold a single track reference
208 *
209 * \version LibVLC 4.0.0 and later.
210 *
211 * This function can be used to hold a track from a tracklist. In that case,
212 * the track can outlive its tracklist.
213 *
214 * \param track valid track
215 * \return the same track, need to be released with libvlc_media_track_release()
216 */
219
220/**
221 * Release a single track
222 *
223 * \version LibVLC 4.0.0 and later.
224 *
225 * \warning Tracks from a tracklist are released alongside the list with
226 * libvlc_media_tracklist_delete().
227 *
228 * \note You only need to release tracks previously held with
229 * libvlc_media_track_hold() or returned by
230 * libvlc_media_player_get_selected_track() and
231 * libvlc_media_player_get_track_from_id()
232 *
233 * \param track valid track
234 */
235LIBVLC_API void
237/** @}*/
238
239# ifdef __cplusplus
240}
241# endif
242
243#endif /* VLC_LIBVLC_MEDIA_TRACK_H */
struct vlc_param ** list
Definition: core.c:402
libvlc_video_orient_t
Definition: libvlc_media_track.h:57
struct libvlc_video_track_t libvlc_video_track_t
libvlc_track_type_t
Definition: libvlc_media_track.h:43
LIBVLC_API void libvlc_media_tracklist_delete(libvlc_media_tracklist_t *list)
Release a tracklist.
libvlc_video_projection_t
Definition: libvlc_media_track.h:69
struct libvlc_audio_track_t libvlc_audio_track_t
LIBVLC_API void libvlc_media_track_release(libvlc_media_track_t *track)
Release a single track.
struct libvlc_video_viewpoint_t libvlc_video_viewpoint_t
Viewpoint.
libvlc_video_multiview_t
Definition: libvlc_media_track.h:90
struct libvlc_media_track_t libvlc_media_track_t
struct libvlc_media_tracklist_t libvlc_media_tracklist_t
Opaque struct containing a list of tracks.
Definition: libvlc_media_track.h:162
LIBVLC_API size_t libvlc_media_tracklist_count(const libvlc_media_tracklist_t *list)
Get the number of tracks in a tracklist.
LIBVLC_API libvlc_media_track_t * libvlc_media_tracklist_at(libvlc_media_tracklist_t *list, size_t index)
Get a track at a specific index.
LIBVLC_API libvlc_media_track_t * libvlc_media_track_hold(libvlc_media_track_t *track)
Hold a single track reference.
struct libvlc_subtitle_track_t libvlc_subtitle_track_t
@ libvlc_video_orient_right_top
Rotated 90 degrees anti-clockwise.
Definition: libvlc_media_track.h:64
@ libvlc_video_orient_left_bottom
Rotated 90 degrees clockwise (or 270 anti-clockwise)
Definition: libvlc_media_track.h:63
@ libvlc_video_orient_top_right
Flipped horizontally.
Definition: libvlc_media_track.h:59
@ libvlc_video_orient_top_left
Normal.
Definition: libvlc_media_track.h:58
@ libvlc_video_orient_left_top
Transposed.
Definition: libvlc_media_track.h:62
@ libvlc_video_orient_bottom_left
Flipped vertically.
Definition: libvlc_media_track.h:60
@ libvlc_video_orient_right_bottom
Anti-transposed.
Definition: libvlc_media_track.h:65
@ libvlc_video_orient_bottom_right
Rotated 180 degrees.
Definition: libvlc_media_track.h:61
@ libvlc_track_video
Definition: libvlc_media_track.h:46
@ libvlc_track_unknown
Definition: libvlc_media_track.h:44
@ libvlc_track_text
Definition: libvlc_media_track.h:47
@ libvlc_track_audio
Definition: libvlc_media_track.h:45
@ libvlc_video_projection_rectangular
Definition: libvlc_media_track.h:70
@ libvlc_video_projection_equirectangular
360 spherical
Definition: libvlc_media_track.h:71
@ libvlc_video_projection_cubemap_layout_standard
Definition: libvlc_media_track.h:73
@ libvlc_video_multiview_stereo_col
Column sequential.
Definition: libvlc_media_track.h:95
@ libvlc_video_multiview_stereo_frame
Frame sequential.
Definition: libvlc_media_track.h:96
@ libvlc_video_multiview_stereo_tb
Top-bottom.
Definition: libvlc_media_track.h:93
@ libvlc_video_multiview_stereo_checkerboard
Checkerboard pattern.
Definition: libvlc_media_track.h:97
@ libvlc_video_multiview_2d
No stereoscopy: 2D picture.
Definition: libvlc_media_track.h:91
@ libvlc_video_multiview_stereo_row
Row sequential.
Definition: libvlc_media_track.h:94
@ libvlc_video_multiview_stereo_sbs
Side-by-side.
Definition: libvlc_media_track.h:92
#define LIBVLC_API
Definition: libvlc.h:42
Definition: libvlc_media_track.h:51
unsigned i_rate
Definition: libvlc_media_track.h:53
unsigned i_channels
Definition: libvlc_media_track.h:52
Definition: libvlc_media_track.h:121
unsigned int i_bitrate
Definition: libvlc_media_track.h:138
int i_profile
Definition: libvlc_media_track.h:129
uint32_t i_original_fourcc
Definition: libvlc_media_track.h:124
libvlc_video_track_t * video
Definition: libvlc_media_track.h:134
char * psz_description
Definition: libvlc_media_track.h:140
char * psz_language
Definition: libvlc_media_track.h:139
char * psz_name
Name of the track, only valid when the track is fetch from a media_player.
Definition: libvlc_media_track.h:152
bool id_stable
A string identifier is stable when it is certified to be the same across different playback instances...
Definition: libvlc_media_track.h:149
libvlc_audio_track_t * audio
Definition: libvlc_media_track.h:133
bool selected
true if the track is selected, only valid when the track is fetch from a media_player
Definition: libvlc_media_track.h:155
libvlc_track_type_t i_type
Definition: libvlc_media_track.h:126
uint32_t i_codec
Definition: libvlc_media_track.h:123
const char * psz_id
String identifier of track, can be used to save the track preference from an other LibVLC run,...
Definition: libvlc_media_track.h:145
int i_id
Definition: libvlc_media_track.h:125
int i_level
Definition: libvlc_media_track.h:130
libvlc_subtitle_track_t * subtitle
Definition: libvlc_media_track.h:135
Definition: libvlc_media_track.h:116
char * psz_encoding
Definition: libvlc_media_track.h:117
Definition: libvlc_media_track.h:101
libvlc_video_orient_t i_orientation
Definition: libvlc_media_track.h:109
unsigned i_width
Definition: libvlc_media_track.h:103
unsigned i_height
Definition: libvlc_media_track.h:102
libvlc_video_projection_t i_projection
Definition: libvlc_media_track.h:110
unsigned i_frame_rate_num
Definition: libvlc_media_track.h:106
unsigned i_sar_num
Definition: libvlc_media_track.h:104
libvlc_video_viewpoint_t pose
Initial view point.
Definition: libvlc_media_track.h:111
unsigned i_frame_rate_den
Definition: libvlc_media_track.h:107
libvlc_video_multiview_t i_multiview
Definition: libvlc_media_track.h:112
unsigned i_sar_den
Definition: libvlc_media_track.h:105
Viewpoint.
Definition: libvlc_media_track.h:82
float f_yaw
view point yaw in degrees ]-180;180]
Definition: libvlc_media_track.h:83
float f_field_of_view
field of view in degrees ]0;180[ (default 80.)
Definition: libvlc_media_track.h:86
float f_roll
view point roll in degrees ]-180;180]
Definition: libvlc_media_track.h:85
float f_pitch
view point pitch in degrees ]-90;90]
Definition: libvlc_media_track.h:84