Coverage Report

Created: 2025-07-11 07:16

/src/vlc/include/vlc_player.h
Line
Count
Source (jump to first uncovered line)
1
/*****************************************************************************
2
 * vlc_player.h: player interface
3
 *****************************************************************************
4
 * Copyright (C) 2018 VLC authors and VideoLAN
5
 *
6
 * This program is free software; you can redistribute it and/or modify it
7
 * under the terms of the GNU Lesser General Public License as published by
8
 * the Free Software Foundation; either version 2.1 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
 * GNU Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public License
17
 * along with this program; if not, write to the Free Software Foundation,
18
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19
 *****************************************************************************/
20
21
#ifndef VLC_PLAYER_H
22
#define VLC_PLAYER_H 1
23
24
#include <vlc_input.h>
25
#include <vlc_aout.h>
26
27
/**
28
 * @defgroup vlc_player Player
29
 * @ingroup input
30
 * VLC Player API
31
 * @brief
32
@dot
33
digraph player_states {
34
  label="Player state diagram";
35
  new [style="invis"];
36
  started [label="Started" URL="@ref VLC_PLAYER_STATE_STARTED"];
37
  playing [label="Playing" URL="@ref VLC_PLAYER_STATE_PLAYING"];
38
  paused [label="Paused" URL="@ref VLC_PLAYER_STATE_PAUSED"];
39
  stopping [label="Stopping" URL="@ref VLC_PLAYER_STATE_STOPPING"];
40
  stopped [label="Stopped" URL="@ref VLC_PLAYER_STATE_STOPPED"];
41
  new -> stopped [label="vlc_player_New()" URL="@ref vlc_player_New" fontcolor="green3"];
42
  started -> playing [style="dashed" label=<<i>internal transition</i>>];
43
  started -> stopping [label="vlc_player_Stop()" URL="@ref vlc_player_Stop" fontcolor="red"];
44
  playing -> paused [label="vlc_player_Pause()" URL="@ref vlc_player_Pause" fontcolor="blue"];
45
  paused -> playing [label="vlc_player_Resume()" URL="@ref vlc_player_Resume" fontcolor="blue3"];
46
  paused -> stopping [label="vlc_player_Stop()" URL="@ref vlc_player_Stop" fontcolor="red"];
47
  playing -> stopping [label="vlc_player_Stop()" URL="@ref vlc_player_Stop" fontcolor="red"];
48
  stopping -> stopped [style="dashed" label=<<i>internal transition</i>>];
49
  stopped -> started [label="vlc_player_Start()" URL="@ref vlc_player_Start" fontcolor="darkgreen"];
50
}
51
@enddot
52
 * @{
53
 * @file
54
 * VLC Player API
55
 */
56
57
/**
58
 * @defgroup vlc_player__instance Player instance
59
 * @{
60
 */
61
62
/**
63
 * Player opaque structure.
64
 */
65
typedef struct vlc_player_t vlc_player_t;
66
67
/**
68
 * Player lock type (normal or reentrant)
69
 */
70
enum vlc_player_lock_type
71
{
72
    /**
73
     * Normal lock
74
     *
75
     * If the player is already locked, subsequent calls to vlc_player_Lock()
76
     * will deadlock.
77
     */
78
    VLC_PLAYER_LOCK_NORMAL,
79
80
    /**
81
     * Reentrant lock
82
     *
83
     * If the player is already locked, subsequent calls to vlc_player_Lock()
84
     * will still succeed. To unlock the player, one call to
85
     * vlc_player_Unlock() per vlc_player_Lock() is necessary.
86
     */
87
    VLC_PLAYER_LOCK_REENTRANT,
88
};
89
90
/**
91
 * Create a new player instance
92
 *
93
 * @param parent parent VLC object
94
 * @param lock_type whether the player lock is reentrant or not
95
 * @param media_provider pointer to a media_provider structure or NULL, the
96
 * structure must be valid during the lifetime of the player
97
 * @param media_provider_data opaque data used by provider callbacks
98
 * @return a pointer to a valid player instance or NULL in case of error
99
 */
100
VLC_API vlc_player_t *
101
vlc_player_New(vlc_object_t *parent, enum vlc_player_lock_type lock_type);
102
103
/**
104
 * Delete a player instance
105
 *
106
 * This function stop any playback previously started and wait for their
107
 * termination.
108
 *
109
 * @warning Blocking function if the player state is not STOPPED, don't call it
110
 * from an UI thread in that case.
111
 *
112
 * @param player unlocked player instance created by vlc_player_New()
113
 */
114
VLC_API void
115
vlc_player_Delete(vlc_player_t *player);
116
117
/**
118
 * Lock the player.
119
 *
120
 * All player functions (except vlc_player_Delete()) need to be called while
121
 * the player lock is held.
122
 *
123
 * @param player unlocked player instance
124
 */
125
VLC_API void
126
vlc_player_Lock(vlc_player_t *player);
127
128
/**
129
 * Unlock the player
130
 *
131
 * @param player locked player instance
132
 */
133
VLC_API void
134
vlc_player_Unlock(vlc_player_t *player);
135
136
/**
137
 * Wait on a condition variable
138
 *
139
 * This call allow users to use their own condition with the player mutex.
140
 *
141
 * @param player locked player instance
142
 * @param cond external condition
143
 */
144
VLC_API void
145
vlc_player_CondWait(vlc_player_t *player, vlc_cond_t *cond);
146
147
/**
148
 * Ask to start in a paused state
149
 *
150
 * This function can be used before vlc_player_Start()
151
 *
152
 * @param player locked player instance
153
 * @param start_paused true to start in a paused state, false to cancel it
154
 */
155
VLC_API void
156
vlc_player_SetStartPaused(vlc_player_t *player, bool start_paused);
157
158
/**
159
 * Enable or disable pause on cork event
160
 *
161
 * If enabled, the player will automatically pause and resume on cork events.
162
 * In that case, cork events won't be propagated via callbacks.
163
 * @see vlc_player_cbs.on_cork_changed
164
 *
165
 * @param player locked player instance
166
 * @param enabled true to enable
167
 */
168
VLC_API void
169
vlc_player_SetPauseOnCork(vlc_player_t *player, bool enabled);
170
171
/** @} vlc_player__instance */
172
173
/**
174
 * @defgroup vlc_player__playback Playback control
175
 * @{
176
 */
177
178
/**
179
 * State of the player
180
 *
181
 * During a normal playback (no errors), the user is expected to receive all
182
 * events in the following order: STARTED, PLAYING, STOPPING, STOPPED.
183
 *
184
 * @note When playing more than one media in a row, the player stay at the
185
 * PLAYING state when doing the transition from the current media to the next
186
 * media (that can be gapless). This means that STOPPING, STOPPED states (for
187
 * the current media) and STARTED, PLAYING states (for the next one) won't be
188
 * sent. Nevertheless, the vlc_player_cbs.on_current_media_changed callback
189
 * will be called during this transition.
190
 */
191
enum vlc_player_state
192
{
193
    /**
194
     * The player is stopped
195
     *
196
     * Initial state, or triggered by an internal transition from the STOPPING
197
     * state.
198
     */
199
    VLC_PLAYER_STATE_STOPPED,
200
201
    /**
202
     * The player is started
203
     *
204
     * Triggered by vlc_player_Start()
205
     */
206
    VLC_PLAYER_STATE_STARTED,
207
208
    /**
209
     * The player is playing
210
     *
211
     * Triggered by vlc_player_Resume() or by an internal transition from the
212
     * STARTED state.
213
     */
214
    VLC_PLAYER_STATE_PLAYING,
215
216
    /**
217
     * The player is paused
218
     *
219
     * Triggered by vlc_player_Pause().
220
     */
221
    VLC_PLAYER_STATE_PAUSED,
222
223
    /**
224
     * The player is stopping
225
     *
226
     * Triggered by vlc_player_Stop(), vlc_player_SetCurrentMedia() or by an
227
     * internal transition (when the media reach the end of file for example).
228
     */
229
    VLC_PLAYER_STATE_STOPPING,
230
};
231
232
/**
233
 * Error of the player
234
 *
235
 * @see vlc_player_GetError()
236
 */
237
enum vlc_player_error
238
{
239
    VLC_PLAYER_ERROR_NONE,
240
    VLC_PLAYER_ERROR_GENERIC,
241
};
242
243
/**
244
 * Seek speed type
245
 *
246
 * @see vlc_player_SeekByPos()
247
 * @see vlc_player_SeekByTime()
248
 */
249
enum vlc_player_seek_speed
250
{
251
    /** Do a precise seek */
252
    VLC_PLAYER_SEEK_PRECISE,
253
    /** Do a fast seek */
254
    VLC_PLAYER_SEEK_FAST,
255
};
256
257
/**
258
 * Player seek/delay directive
259
 *
260
 * @see vlc_player_SeekByPos()
261
 * @see vlc_player_SeekByTime()
262
 * @see vlc_player_SetCategoryDelay()
263
 */
264
enum vlc_player_whence
265
{
266
    /** Given time/position */
267
    VLC_PLAYER_WHENCE_ABSOLUTE,
268
    /** The current position +/- the given time/position */
269
    VLC_PLAYER_WHENCE_RELATIVE,
270
};
271
272
/**
273
 * Menu (VCD/DVD/BD) and viewpoint navigations
274
 *
275
 * @see vlc_player_Navigate()
276
 */
277
enum vlc_player_nav
278
{
279
    /** Activate the navigation item selected */
280
    VLC_PLAYER_NAV_ACTIVATE,
281
    /** Select a navigation item above or move the viewpoint up */
282
    VLC_PLAYER_NAV_UP,
283
    /** Select a navigation item under or move the viewpoint down */
284
    VLC_PLAYER_NAV_DOWN,
285
    /** Select a navigation item on the left or move the viewpoint left */
286
    VLC_PLAYER_NAV_LEFT,
287
    /** Select a navigation item on the right or move the viewpoint right */
288
    VLC_PLAYER_NAV_RIGHT,
289
    /** Activate the popup Menu (for BD) */
290
    VLC_PLAYER_NAV_POPUP,
291
    /** Activate disc Root Menu */
292
    VLC_PLAYER_NAV_MENU,
293
};
294
295
/**
296
 * A to B loop state
297
 */
298
enum vlc_player_abloop
299
{
300
    VLC_PLAYER_ABLOOP_NONE,
301
    VLC_PLAYER_ABLOOP_A,
302
    VLC_PLAYER_ABLOOP_B,
303
};
304
305
/** Player capability: can seek */
306
0
#define VLC_PLAYER_CAP_SEEK (1<<0)
307
/** Player capability: can pause */
308
#define VLC_PLAYER_CAP_PAUSE (1<<1)
309
/** Player capability: can change the rate */
310
#define VLC_PLAYER_CAP_CHANGE_RATE (1<<2)
311
/** Player capability: can seek back */
312
#define VLC_PLAYER_CAP_REWIND (1<<3)
313
314
/** Player teletext key: Red */
315
#define VLC_PLAYER_TELETEXT_KEY_RED ('r' << 16)
316
/** Player teletext key: Green */
317
#define VLC_PLAYER_TELETEXT_KEY_GREEN ('g' << 16)
318
/** Player teletext key: Yellow */
319
#define VLC_PLAYER_TELETEXT_KEY_YELLOW ('y' << 16)
320
/** Player teletext key: Blue */
321
#define VLC_PLAYER_TELETEXT_KEY_BLUE ('b' << 16)
322
/** Player teletext key: Index */
323
#define VLC_PLAYER_TELETEXT_KEY_INDEX ('i' << 16)
324
325
enum vlc_player_restore_playback_pos
326
{
327
    VLC_PLAYER_RESTORE_PLAYBACK_POS_NEVER,
328
    VLC_PLAYER_RESTORE_PLAYBACK_POS_ASK,
329
    VLC_PLAYER_RESTORE_PLAYBACK_POS_ALWAYS,
330
};
331
332
/**
333
 * Set the current media
334
 *
335
 * This function replaces the current and next medias.
336
 *
337
 * @note A successful call will always result of
338
 * vlc_player_cbs.on_current_media_changed being called. This function is not
339
 * blocking. If a media is currently being played, this media will be stopped
340
 * and the requested media will be set after.
341
 *
342
 * @note The function will open the media, without starting it, allowing the
343
 * user to send controls (like seek requests) before Starting the player.
344
 *
345
 * @warning This function is either synchronous (if the player state is
346
 * STOPPED) or asynchronous. In the later case, vlc_player_GetCurrentMedia()
347
 * will return the old media, even after this call, and until the
348
 * vlc_player_cbs.on_current_media_changed is called.
349
 *
350
 * @param player locked player instance
351
 * @param media new media to play (will be held by the player)
352
 * @return VLC_SUCCESS or a VLC error code
353
 */
354
VLC_API int
355
vlc_player_SetCurrentMedia(vlc_player_t *player, input_item_t *media);
356
357
/**
358
 * Set the next media
359
 *
360
 * This function replaces the next media to be played.
361
 * The user should set the next media from the
362
 * vlc_player_cbs.current_media_changed callback or anytime before the current
363
 * media is stopped.
364
 *
365
 * @note The media won't be opened directly by this function. If there is no
366
 * current media, the next media will be opened from vlc_player_Start(). If
367
 * there is a current playing media, the next media will be opened and played
368
 * automatically.
369
 *
370
 * @param player locked player instance
371
 * @param media next media to play (will be held by the player)
372
 */
373
VLC_API void
374
vlc_player_SetNextMedia(vlc_player_t *player, input_item_t *media);
375
376
/**
377
 * Get the current played media.
378
 *
379
 * @see vlc_player_cbs.on_current_media_changed
380
 *
381
 * @param player locked player instance
382
 * @return a valid media or NULL (if no media is set)
383
 */
384
VLC_API input_item_t *
385
vlc_player_GetCurrentMedia(vlc_player_t *player);
386
387
/**
388
 * Get the next played media.
389
 *
390
 * This function return the media set by vlc_player_SetNextMedia()
391
 *
392
 * @param player locked player instance
393
 * @return a valid media or NULL (if no next media is set)
394
 */
395
VLC_API input_item_t *
396
vlc_player_GetNextMedia(vlc_player_t *player);
397
398
/**
399
 * Helper that hold the current media
400
 */
401
static inline input_item_t *
402
vlc_player_HoldCurrentMedia(vlc_player_t *player)
403
0
{
404
0
    input_item_t *item = vlc_player_GetCurrentMedia(player);
405
0
    return item ? input_item_Hold(item) : NULL;
406
0
}
Unexecuted instantiation: libvlc.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: content.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: control.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: notify.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: player.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: playlist.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: preparse.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: input.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: timer.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: track.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: title.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: aout.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: vout.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: osd.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: medialib.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: strings.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: vlm.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: vlm_event.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: vlmshell.c:vlc_player_HoldCurrentMedia
Unexecuted instantiation: libvlc-module.c:vlc_player_HoldCurrentMedia
407
408
/**
409
 * Start the playback of the current media.
410
 *
411
 * @param player locked player instance
412
 * @return VLC_SUCCESS or a VLC error code
413
 */
414
VLC_API int
415
vlc_player_Start(vlc_player_t *player);
416
417
/**
418
 * Stop the playback of the current media
419
 *
420
 * @note This function is asynchronous. In case of success, the user should wait
421
 * for the STOPPED state event to know when the stop is finished.
422
 *
423
 * @param player locked player instance
424
 * @return VLC_SUCCESS if the player is being stopped, VLC_EGENERIC otherwise
425
 * (no-op)
426
 */
427
VLC_API int
428
vlc_player_Stop(vlc_player_t *player);
429
430
/**
431
 * Pause the playback
432
 *
433
 * @param player locked player instance
434
 */
435
VLC_API void
436
vlc_player_Pause(vlc_player_t *player);
437
438
/**
439
 * Resume the playback from a pause
440
 *
441
 * @param player locked player instance
442
 */
443
VLC_API void
444
vlc_player_Resume(vlc_player_t *player);
445
446
/**
447
 * Pause and display the next video frame
448
 *
449
 * @param player locked player instance
450
 */
451
VLC_API void
452
vlc_player_NextVideoFrame(vlc_player_t *player);
453
454
/**
455
 * Get the state of the player
456
 *
457
 * @note Since all players actions are asynchronous, this function won't
458
 * reflect the new state immediately. Wait for the
459
 * vlc_players_cbs.on_state_changed event to be notified.
460
 *
461
 * @see vlc_player_state
462
 * @see vlc_player_cbs.on_state_changed
463
 *
464
 * @param player locked player instance
465
 * @return the current player state
466
 */
467
VLC_API enum vlc_player_state
468
vlc_player_GetState(vlc_player_t *player);
469
470
/**
471
 * Get the error state of the player
472
 *
473
 * @see vlc_player_cbs.on_capabilities_changed
474
 *
475
 * @param player locked player instance
476
 * @return the current error state
477
 */
478
VLC_API enum vlc_player_error
479
vlc_player_GetError(vlc_player_t *player);
480
481
/**
482
 * Helper to get the started state
483
 */
484
static inline bool
485
vlc_player_IsStarted(vlc_player_t *player)
486
0
{
487
0
    switch (vlc_player_GetState(player))
488
0
    {
489
0
        case VLC_PLAYER_STATE_STARTED:
490
0
        case VLC_PLAYER_STATE_PLAYING:
491
0
        case VLC_PLAYER_STATE_PAUSED:
492
0
            return true;
493
0
        default:
494
0
            return false;
495
0
    }
496
0
}
Unexecuted instantiation: libvlc.c:vlc_player_IsStarted
Unexecuted instantiation: content.c:vlc_player_IsStarted
Unexecuted instantiation: control.c:vlc_player_IsStarted
Unexecuted instantiation: notify.c:vlc_player_IsStarted
Unexecuted instantiation: player.c:vlc_player_IsStarted
Unexecuted instantiation: playlist.c:vlc_player_IsStarted
Unexecuted instantiation: preparse.c:vlc_player_IsStarted
Unexecuted instantiation: input.c:vlc_player_IsStarted
Unexecuted instantiation: timer.c:vlc_player_IsStarted
Unexecuted instantiation: track.c:vlc_player_IsStarted
Unexecuted instantiation: title.c:vlc_player_IsStarted
Unexecuted instantiation: aout.c:vlc_player_IsStarted
Unexecuted instantiation: vout.c:vlc_player_IsStarted
Unexecuted instantiation: osd.c:vlc_player_IsStarted
Unexecuted instantiation: medialib.c:vlc_player_IsStarted
Unexecuted instantiation: strings.c:vlc_player_IsStarted
Unexecuted instantiation: vlm.c:vlc_player_IsStarted
Unexecuted instantiation: vlm_event.c:vlc_player_IsStarted
Unexecuted instantiation: vlmshell.c:vlc_player_IsStarted
Unexecuted instantiation: libvlc-module.c:vlc_player_IsStarted
497
498
/**
499
 * Helper to get the paused state
500
 */
501
static inline bool
502
vlc_player_IsPaused(vlc_player_t *player)
503
0
{
504
0
    return vlc_player_GetState(player) == VLC_PLAYER_STATE_PAUSED;
505
0
}
Unexecuted instantiation: libvlc.c:vlc_player_IsPaused
Unexecuted instantiation: content.c:vlc_player_IsPaused
Unexecuted instantiation: control.c:vlc_player_IsPaused
Unexecuted instantiation: notify.c:vlc_player_IsPaused
Unexecuted instantiation: player.c:vlc_player_IsPaused
Unexecuted instantiation: playlist.c:vlc_player_IsPaused
Unexecuted instantiation: preparse.c:vlc_player_IsPaused
Unexecuted instantiation: input.c:vlc_player_IsPaused
Unexecuted instantiation: timer.c:vlc_player_IsPaused
Unexecuted instantiation: track.c:vlc_player_IsPaused
Unexecuted instantiation: title.c:vlc_player_IsPaused
Unexecuted instantiation: aout.c:vlc_player_IsPaused
Unexecuted instantiation: vout.c:vlc_player_IsPaused
Unexecuted instantiation: osd.c:vlc_player_IsPaused
Unexecuted instantiation: medialib.c:vlc_player_IsPaused
Unexecuted instantiation: strings.c:vlc_player_IsPaused
Unexecuted instantiation: vlm.c:vlc_player_IsPaused
Unexecuted instantiation: vlm_event.c:vlc_player_IsPaused
Unexecuted instantiation: vlmshell.c:vlc_player_IsPaused
Unexecuted instantiation: libvlc-module.c:vlc_player_IsPaused
506
507
/**
508
 * Helper to toggle the pause state
509
 */
510
static inline void
511
vlc_player_TogglePause(vlc_player_t *player)
512
0
{
513
0
    if (vlc_player_IsStarted(player))
514
0
    {
515
0
        if (vlc_player_IsPaused(player))
516
0
            vlc_player_Resume(player);
517
0
        else
518
0
            vlc_player_Pause(player);
519
0
    }
520
0
}
Unexecuted instantiation: libvlc.c:vlc_player_TogglePause
Unexecuted instantiation: content.c:vlc_player_TogglePause
Unexecuted instantiation: control.c:vlc_player_TogglePause
Unexecuted instantiation: notify.c:vlc_player_TogglePause
Unexecuted instantiation: player.c:vlc_player_TogglePause
Unexecuted instantiation: playlist.c:vlc_player_TogglePause
Unexecuted instantiation: preparse.c:vlc_player_TogglePause
Unexecuted instantiation: input.c:vlc_player_TogglePause
Unexecuted instantiation: timer.c:vlc_player_TogglePause
Unexecuted instantiation: track.c:vlc_player_TogglePause
Unexecuted instantiation: title.c:vlc_player_TogglePause
Unexecuted instantiation: aout.c:vlc_player_TogglePause
Unexecuted instantiation: vout.c:vlc_player_TogglePause
Unexecuted instantiation: osd.c:vlc_player_TogglePause
Unexecuted instantiation: medialib.c:vlc_player_TogglePause
Unexecuted instantiation: strings.c:vlc_player_TogglePause
Unexecuted instantiation: vlm.c:vlc_player_TogglePause
Unexecuted instantiation: vlm_event.c:vlc_player_TogglePause
Unexecuted instantiation: vlmshell.c:vlc_player_TogglePause
Unexecuted instantiation: libvlc-module.c:vlc_player_TogglePause
521
522
/**
523
 * Get the player capabilities
524
 *
525
 * @see vlc_player_cbs.on_capabilities_changed
526
 *
527
 * @param player locked player instance
528
 * @return the player capabilities, a bitwise mask of @ref VLC_PLAYER_CAP_SEEK,
529
 * @ref VLC_PLAYER_CAP_PAUSE, @ref VLC_PLAYER_CAP_CHANGE_RATE, @ref
530
 * VLC_PLAYER_CAP_REWIND
531
 */
532
VLC_API int
533
vlc_player_GetCapabilities(vlc_player_t *player);
534
535
/**
536
 * Helper to get the seek capability
537
 */
538
static inline bool
539
vlc_player_CanSeek(vlc_player_t *player)
540
0
{
541
0
    return vlc_player_GetCapabilities(player) & VLC_PLAYER_CAP_SEEK;
542
0
}
Unexecuted instantiation: libvlc.c:vlc_player_CanSeek
Unexecuted instantiation: content.c:vlc_player_CanSeek
Unexecuted instantiation: control.c:vlc_player_CanSeek
Unexecuted instantiation: notify.c:vlc_player_CanSeek
Unexecuted instantiation: player.c:vlc_player_CanSeek
Unexecuted instantiation: playlist.c:vlc_player_CanSeek
Unexecuted instantiation: preparse.c:vlc_player_CanSeek
Unexecuted instantiation: input.c:vlc_player_CanSeek
Unexecuted instantiation: timer.c:vlc_player_CanSeek
Unexecuted instantiation: track.c:vlc_player_CanSeek
Unexecuted instantiation: title.c:vlc_player_CanSeek
Unexecuted instantiation: aout.c:vlc_player_CanSeek
Unexecuted instantiation: vout.c:vlc_player_CanSeek
Unexecuted instantiation: osd.c:vlc_player_CanSeek
Unexecuted instantiation: medialib.c:vlc_player_CanSeek
Unexecuted instantiation: strings.c:vlc_player_CanSeek
Unexecuted instantiation: vlm.c:vlc_player_CanSeek
Unexecuted instantiation: vlm_event.c:vlc_player_CanSeek
Unexecuted instantiation: vlmshell.c:vlc_player_CanSeek
Unexecuted instantiation: libvlc-module.c:vlc_player_CanSeek
543
544
/**
545
 * Helper to get the pause capability
546
 */
547
static inline bool
548
vlc_player_CanPause(vlc_player_t *player)
549
0
{
550
0
    return vlc_player_GetCapabilities(player) & VLC_PLAYER_CAP_PAUSE;
551
0
}
Unexecuted instantiation: libvlc.c:vlc_player_CanPause
Unexecuted instantiation: content.c:vlc_player_CanPause
Unexecuted instantiation: control.c:vlc_player_CanPause
Unexecuted instantiation: notify.c:vlc_player_CanPause
Unexecuted instantiation: player.c:vlc_player_CanPause
Unexecuted instantiation: playlist.c:vlc_player_CanPause
Unexecuted instantiation: preparse.c:vlc_player_CanPause
Unexecuted instantiation: input.c:vlc_player_CanPause
Unexecuted instantiation: timer.c:vlc_player_CanPause
Unexecuted instantiation: track.c:vlc_player_CanPause
Unexecuted instantiation: title.c:vlc_player_CanPause
Unexecuted instantiation: aout.c:vlc_player_CanPause
Unexecuted instantiation: vout.c:vlc_player_CanPause
Unexecuted instantiation: osd.c:vlc_player_CanPause
Unexecuted instantiation: medialib.c:vlc_player_CanPause
Unexecuted instantiation: strings.c:vlc_player_CanPause
Unexecuted instantiation: vlm.c:vlc_player_CanPause
Unexecuted instantiation: vlm_event.c:vlc_player_CanPause
Unexecuted instantiation: vlmshell.c:vlc_player_CanPause
Unexecuted instantiation: libvlc-module.c:vlc_player_CanPause
552
553
/**
554
 * Helper to get the change-rate capability
555
 */
556
static inline bool
557
vlc_player_CanChangeRate(vlc_player_t *player)
558
0
{
559
0
    return vlc_player_GetCapabilities(player) & VLC_PLAYER_CAP_CHANGE_RATE;
560
0
}
Unexecuted instantiation: libvlc.c:vlc_player_CanChangeRate
Unexecuted instantiation: content.c:vlc_player_CanChangeRate
Unexecuted instantiation: control.c:vlc_player_CanChangeRate
Unexecuted instantiation: notify.c:vlc_player_CanChangeRate
Unexecuted instantiation: player.c:vlc_player_CanChangeRate
Unexecuted instantiation: playlist.c:vlc_player_CanChangeRate
Unexecuted instantiation: preparse.c:vlc_player_CanChangeRate
Unexecuted instantiation: input.c:vlc_player_CanChangeRate
Unexecuted instantiation: timer.c:vlc_player_CanChangeRate
Unexecuted instantiation: track.c:vlc_player_CanChangeRate
Unexecuted instantiation: title.c:vlc_player_CanChangeRate
Unexecuted instantiation: aout.c:vlc_player_CanChangeRate
Unexecuted instantiation: vout.c:vlc_player_CanChangeRate
Unexecuted instantiation: osd.c:vlc_player_CanChangeRate
Unexecuted instantiation: medialib.c:vlc_player_CanChangeRate
Unexecuted instantiation: strings.c:vlc_player_CanChangeRate
Unexecuted instantiation: vlm.c:vlc_player_CanChangeRate
Unexecuted instantiation: vlm_event.c:vlc_player_CanChangeRate
Unexecuted instantiation: vlmshell.c:vlc_player_CanChangeRate
Unexecuted instantiation: libvlc-module.c:vlc_player_CanChangeRate
561
562
/**
563
 * Helper to get the rewindable capability
564
 */
565
static inline bool
566
vlc_player_CanRewind(vlc_player_t *player)
567
0
{
568
0
    return vlc_player_GetCapabilities(player) & VLC_PLAYER_CAP_REWIND;
569
0
}
Unexecuted instantiation: libvlc.c:vlc_player_CanRewind
Unexecuted instantiation: content.c:vlc_player_CanRewind
Unexecuted instantiation: control.c:vlc_player_CanRewind
Unexecuted instantiation: notify.c:vlc_player_CanRewind
Unexecuted instantiation: player.c:vlc_player_CanRewind
Unexecuted instantiation: playlist.c:vlc_player_CanRewind
Unexecuted instantiation: preparse.c:vlc_player_CanRewind
Unexecuted instantiation: input.c:vlc_player_CanRewind
Unexecuted instantiation: timer.c:vlc_player_CanRewind
Unexecuted instantiation: track.c:vlc_player_CanRewind
Unexecuted instantiation: title.c:vlc_player_CanRewind
Unexecuted instantiation: aout.c:vlc_player_CanRewind
Unexecuted instantiation: vout.c:vlc_player_CanRewind
Unexecuted instantiation: osd.c:vlc_player_CanRewind
Unexecuted instantiation: medialib.c:vlc_player_CanRewind
Unexecuted instantiation: strings.c:vlc_player_CanRewind
Unexecuted instantiation: vlm.c:vlc_player_CanRewind
Unexecuted instantiation: vlm_event.c:vlc_player_CanRewind
Unexecuted instantiation: vlmshell.c:vlc_player_CanRewind
Unexecuted instantiation: libvlc-module.c:vlc_player_CanRewind
570
571
/**
572
 * Get the rate of the player
573
 *
574
 * @see vlc_player_cbs.on_rate_changed
575
 *
576
 * @param player locked player instance
577
 * @return rate of the player (< 1.f is slower, > 1.f is faster)
578
 */
579
VLC_API float
580
vlc_player_GetRate(vlc_player_t *player);
581
582
/**
583
 * Change the rate of the player
584
 *
585
 * @note The rate is saved across several medias
586
 *
587
 * @param player locked player instance
588
 * @param rate new rate (< 1.f is slower, > 1.f is faster)
589
 */
590
VLC_API void
591
vlc_player_ChangeRate(vlc_player_t *player, float rate);
592
593
/**
594
 * Increment the rate of the player (faster)
595
 *
596
 * @param player locked player instance
597
 */
598
VLC_API void
599
vlc_player_IncrementRate(vlc_player_t *player);
600
601
/**
602
 * Decrement the rate of the player (Slower)
603
 *
604
 * @param player locked player instance
605
 */
606
VLC_API void
607
vlc_player_DecrementRate(vlc_player_t *player);
608
609
/**
610
 * Get the length of the current media
611
 *
612
 * @note A started and playing media doesn't have necessarily a valid length.
613
 *
614
 * @see vlc_player_cbs.on_length_changed
615
 *
616
 * @param player locked player instance
617
 * @return a valid length or VLC_TICK_INVALID (if no media is set,
618
 * playback is not yet started or in case of error)
619
 */
620
VLC_API vlc_tick_t
621
vlc_player_GetLength(vlc_player_t *player);
622
623
/**
624
 * Get the time of the current media
625
 *
626
 * @note A started and playing media doesn't have necessarily a valid time.
627
 *
628
 * @see vlc_player_cbs.on_position_changed
629
 *
630
 * @param player locked player instance
631
 * @return a valid time or VLC_TICK_INVALID (if no media is set, the media
632
 * doesn't have any time, if playback is not yet started or in case of error)
633
 */
634
VLC_API vlc_tick_t
635
vlc_player_GetTime(vlc_player_t *player);
636
637
/**
638
 * Get the position of the current media
639
 *
640
 * @see vlc_player_cbs.on_position_changed
641
 *
642
 * @param player locked player instance
643
 * @return a valid position in the range [0.f;1.f] or -1.f (if no media is
644
 * set,if playback is not yet started or in case of error)
645
 */
646
VLC_API double
647
vlc_player_GetPosition(vlc_player_t *player);
648
649
/**
650
 * Seek the current media by position
651
 *
652
 * @note This function can be called before vlc_player_Start() in order to set
653
 * a starting position.
654
 *
655
 * @param player locked player instance
656
 * @param position position in the range [0.f;1.f]
657
 * @param speed precise of fast
658
 * @param whence absolute or relative
659
 */
660
VLC_API void
661
vlc_player_SeekByPos(vlc_player_t *player, double position,
662
                     enum vlc_player_seek_speed speed,
663
                     enum vlc_player_whence whence);
664
665
/**
666
 * Seek the current media by time
667
 *
668
 * @note This function can be called before vlc_player_Start() in order to set
669
 * a starting position.
670
 *
671
 * @warning This function has an effect only if the media has a valid length.
672
 *
673
 * @param player locked player instance
674
 * @param time a time in the range [0;length]
675
 * @param speed precise of fast
676
 * @param whence absolute or relative
677
 */
678
VLC_API void
679
vlc_player_SeekByTime(vlc_player_t *player, vlc_tick_t time,
680
                      enum vlc_player_seek_speed speed,
681
                      enum vlc_player_whence whence);
682
683
/**
684
 * Helper to set the absolute position precisely
685
 */
686
static inline void
687
vlc_player_SetPosition(vlc_player_t *player, double position)
688
0
{
689
0
    vlc_player_SeekByPos(player, position, VLC_PLAYER_SEEK_PRECISE,
690
0
                         VLC_PLAYER_WHENCE_ABSOLUTE);
691
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SetPosition
Unexecuted instantiation: content.c:vlc_player_SetPosition
Unexecuted instantiation: control.c:vlc_player_SetPosition
Unexecuted instantiation: notify.c:vlc_player_SetPosition
Unexecuted instantiation: player.c:vlc_player_SetPosition
Unexecuted instantiation: playlist.c:vlc_player_SetPosition
Unexecuted instantiation: preparse.c:vlc_player_SetPosition
Unexecuted instantiation: input.c:vlc_player_SetPosition
Unexecuted instantiation: timer.c:vlc_player_SetPosition
Unexecuted instantiation: track.c:vlc_player_SetPosition
Unexecuted instantiation: title.c:vlc_player_SetPosition
Unexecuted instantiation: aout.c:vlc_player_SetPosition
Unexecuted instantiation: vout.c:vlc_player_SetPosition
Unexecuted instantiation: osd.c:vlc_player_SetPosition
Unexecuted instantiation: medialib.c:vlc_player_SetPosition
Unexecuted instantiation: strings.c:vlc_player_SetPosition
Unexecuted instantiation: vlm.c:vlc_player_SetPosition
Unexecuted instantiation: vlm_event.c:vlc_player_SetPosition
Unexecuted instantiation: vlmshell.c:vlc_player_SetPosition
Unexecuted instantiation: libvlc-module.c:vlc_player_SetPosition
692
693
/**
694
 * Helper to set the absolute position fast
695
 */
696
static inline void
697
vlc_player_SetPositionFast(vlc_player_t *player, double position)
698
0
{
699
0
    vlc_player_SeekByPos(player, position, VLC_PLAYER_SEEK_FAST,
700
0
                         VLC_PLAYER_WHENCE_ABSOLUTE);
701
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SetPositionFast
Unexecuted instantiation: content.c:vlc_player_SetPositionFast
Unexecuted instantiation: control.c:vlc_player_SetPositionFast
Unexecuted instantiation: notify.c:vlc_player_SetPositionFast
Unexecuted instantiation: player.c:vlc_player_SetPositionFast
Unexecuted instantiation: playlist.c:vlc_player_SetPositionFast
Unexecuted instantiation: preparse.c:vlc_player_SetPositionFast
Unexecuted instantiation: input.c:vlc_player_SetPositionFast
Unexecuted instantiation: timer.c:vlc_player_SetPositionFast
Unexecuted instantiation: track.c:vlc_player_SetPositionFast
Unexecuted instantiation: title.c:vlc_player_SetPositionFast
Unexecuted instantiation: aout.c:vlc_player_SetPositionFast
Unexecuted instantiation: vout.c:vlc_player_SetPositionFast
Unexecuted instantiation: osd.c:vlc_player_SetPositionFast
Unexecuted instantiation: medialib.c:vlc_player_SetPositionFast
Unexecuted instantiation: strings.c:vlc_player_SetPositionFast
Unexecuted instantiation: vlm.c:vlc_player_SetPositionFast
Unexecuted instantiation: vlm_event.c:vlc_player_SetPositionFast
Unexecuted instantiation: vlmshell.c:vlc_player_SetPositionFast
Unexecuted instantiation: libvlc-module.c:vlc_player_SetPositionFast
702
703
/**
704
 * Helper to jump the position precisely
705
 */
706
static inline void
707
vlc_player_JumpPos(vlc_player_t *player, double jumppos)
708
0
{
709
0
    /* No fask seek for jumps. Indeed, jumps can seek to the current position
710
0
     * if not precise enough or if the jump value is too small. */
711
0
    vlc_player_SeekByPos(player, jumppos, VLC_PLAYER_SEEK_PRECISE,
712
0
                         VLC_PLAYER_WHENCE_RELATIVE);
713
0
}
Unexecuted instantiation: libvlc.c:vlc_player_JumpPos
Unexecuted instantiation: content.c:vlc_player_JumpPos
Unexecuted instantiation: control.c:vlc_player_JumpPos
Unexecuted instantiation: notify.c:vlc_player_JumpPos
Unexecuted instantiation: player.c:vlc_player_JumpPos
Unexecuted instantiation: playlist.c:vlc_player_JumpPos
Unexecuted instantiation: preparse.c:vlc_player_JumpPos
Unexecuted instantiation: input.c:vlc_player_JumpPos
Unexecuted instantiation: timer.c:vlc_player_JumpPos
Unexecuted instantiation: track.c:vlc_player_JumpPos
Unexecuted instantiation: title.c:vlc_player_JumpPos
Unexecuted instantiation: aout.c:vlc_player_JumpPos
Unexecuted instantiation: vout.c:vlc_player_JumpPos
Unexecuted instantiation: osd.c:vlc_player_JumpPos
Unexecuted instantiation: medialib.c:vlc_player_JumpPos
Unexecuted instantiation: strings.c:vlc_player_JumpPos
Unexecuted instantiation: vlm.c:vlc_player_JumpPos
Unexecuted instantiation: vlm_event.c:vlc_player_JumpPos
Unexecuted instantiation: vlmshell.c:vlc_player_JumpPos
Unexecuted instantiation: libvlc-module.c:vlc_player_JumpPos
714
715
/**
716
 * Helper to set the absolute time precisely
717
 */
718
static inline void
719
vlc_player_SetTime(vlc_player_t *player, vlc_tick_t time)
720
0
{
721
0
    vlc_player_SeekByTime(player, time, VLC_PLAYER_SEEK_PRECISE,
722
0
                          VLC_PLAYER_WHENCE_ABSOLUTE);
723
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SetTime
Unexecuted instantiation: content.c:vlc_player_SetTime
Unexecuted instantiation: control.c:vlc_player_SetTime
Unexecuted instantiation: notify.c:vlc_player_SetTime
Unexecuted instantiation: player.c:vlc_player_SetTime
Unexecuted instantiation: playlist.c:vlc_player_SetTime
Unexecuted instantiation: preparse.c:vlc_player_SetTime
Unexecuted instantiation: input.c:vlc_player_SetTime
Unexecuted instantiation: timer.c:vlc_player_SetTime
Unexecuted instantiation: track.c:vlc_player_SetTime
Unexecuted instantiation: title.c:vlc_player_SetTime
Unexecuted instantiation: aout.c:vlc_player_SetTime
Unexecuted instantiation: vout.c:vlc_player_SetTime
Unexecuted instantiation: osd.c:vlc_player_SetTime
Unexecuted instantiation: medialib.c:vlc_player_SetTime
Unexecuted instantiation: strings.c:vlc_player_SetTime
Unexecuted instantiation: vlm.c:vlc_player_SetTime
Unexecuted instantiation: vlm_event.c:vlc_player_SetTime
Unexecuted instantiation: vlmshell.c:vlc_player_SetTime
Unexecuted instantiation: libvlc-module.c:vlc_player_SetTime
724
725
/**
726
 * Helper to set the absolute time fast
727
 */
728
static inline void
729
vlc_player_SetTimeFast(vlc_player_t *player, vlc_tick_t time)
730
0
{
731
0
    vlc_player_SeekByTime(player, time, VLC_PLAYER_SEEK_FAST,
732
0
                          VLC_PLAYER_WHENCE_ABSOLUTE);
733
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SetTimeFast
Unexecuted instantiation: content.c:vlc_player_SetTimeFast
Unexecuted instantiation: control.c:vlc_player_SetTimeFast
Unexecuted instantiation: notify.c:vlc_player_SetTimeFast
Unexecuted instantiation: player.c:vlc_player_SetTimeFast
Unexecuted instantiation: playlist.c:vlc_player_SetTimeFast
Unexecuted instantiation: preparse.c:vlc_player_SetTimeFast
Unexecuted instantiation: input.c:vlc_player_SetTimeFast
Unexecuted instantiation: timer.c:vlc_player_SetTimeFast
Unexecuted instantiation: track.c:vlc_player_SetTimeFast
Unexecuted instantiation: title.c:vlc_player_SetTimeFast
Unexecuted instantiation: aout.c:vlc_player_SetTimeFast
Unexecuted instantiation: vout.c:vlc_player_SetTimeFast
Unexecuted instantiation: osd.c:vlc_player_SetTimeFast
Unexecuted instantiation: medialib.c:vlc_player_SetTimeFast
Unexecuted instantiation: strings.c:vlc_player_SetTimeFast
Unexecuted instantiation: vlm.c:vlc_player_SetTimeFast
Unexecuted instantiation: vlm_event.c:vlc_player_SetTimeFast
Unexecuted instantiation: vlmshell.c:vlc_player_SetTimeFast
Unexecuted instantiation: libvlc-module.c:vlc_player_SetTimeFast
734
735
/**
736
 * Helper to jump the time precisely
737
 */
738
static inline void
739
vlc_player_JumpTime(vlc_player_t *player, vlc_tick_t jumptime)
740
0
{
741
0
    /* No fask seek for jumps. Indeed, jumps can seek to the current position
742
0
     * if not precise enough or if the jump value is too small. */
743
0
    vlc_player_SeekByTime(player, jumptime, VLC_PLAYER_SEEK_PRECISE,
744
0
                          VLC_PLAYER_WHENCE_RELATIVE);
745
0
}
Unexecuted instantiation: libvlc.c:vlc_player_JumpTime
Unexecuted instantiation: content.c:vlc_player_JumpTime
Unexecuted instantiation: control.c:vlc_player_JumpTime
Unexecuted instantiation: notify.c:vlc_player_JumpTime
Unexecuted instantiation: player.c:vlc_player_JumpTime
Unexecuted instantiation: playlist.c:vlc_player_JumpTime
Unexecuted instantiation: preparse.c:vlc_player_JumpTime
Unexecuted instantiation: input.c:vlc_player_JumpTime
Unexecuted instantiation: timer.c:vlc_player_JumpTime
Unexecuted instantiation: track.c:vlc_player_JumpTime
Unexecuted instantiation: title.c:vlc_player_JumpTime
Unexecuted instantiation: aout.c:vlc_player_JumpTime
Unexecuted instantiation: vout.c:vlc_player_JumpTime
Unexecuted instantiation: osd.c:vlc_player_JumpTime
Unexecuted instantiation: medialib.c:vlc_player_JumpTime
Unexecuted instantiation: strings.c:vlc_player_JumpTime
Unexecuted instantiation: vlm.c:vlc_player_JumpTime
Unexecuted instantiation: vlm_event.c:vlc_player_JumpTime
Unexecuted instantiation: vlmshell.c:vlc_player_JumpTime
Unexecuted instantiation: libvlc-module.c:vlc_player_JumpTime
746
747
/**
748
 * Display the player position on the vout OSD
749
 *
750
 * @param player locked player instance
751
 */
752
VLC_API void
753
vlc_player_DisplayPosition(vlc_player_t *player);
754
755
/**
756
 * Enable A to B loop of the current media
757
 *
758
 * This function need to be called 2 times with VLC_PLAYER_ABLOOP_A and
759
 * VLC_PLAYER_ABLOOP_B to setup an A to B loop. It uses and stores the
760
 * current time/position when called. The B time must be higher than the
761
 * A time.
762
 *
763
 * @param player locked player instance
764
 * @param abloop select which A/B cursor to set
765
 * @return VLC_SUCCESS or a VLC error code
766
 */
767
VLC_API int
768
vlc_player_SetAtoBLoop(vlc_player_t *player, enum vlc_player_abloop abloop);
769
770
/**
771
 * Enable A to B loop of the current media by setting start and end time
772
 *
773
 * The B time must be higher than the A time.
774
 *
775
 * @param player locked player instance
776
 * @param a_time start time for the loop
777
 * @param b_time end time for the loop
778
 * @return VLC_SUCCESS or a VLC error code
779
 */
780
VLC_API int
781
vlc_player_SetAtoBLoopTime(vlc_player_t *player, vlc_tick_t a_time, vlc_tick_t b_time);
782
783
/**
784
 * Enable A to B loop of the current media by setting start and end position
785
 *
786
 * The B position must be higher than the A position.
787
 *
788
 * @param player locked player instance
789
 * @param a_pos start position for the loop
790
 * @param b_pos end position for the loop
791
 * @return VLC_SUCCESS or a VLC error code
792
 */
793
VLC_API int
794
vlc_player_SetAtoBLoopPosition(vlc_player_t *player, double a_pos, double b_pos);
795
796
/**
797
 * Reset/remove the A to B loop of the current media
798
 *
799
 * @param player locked player instance
800
 * @return VLC_SUCCESS or a VLC error code
801
 */
802
VLC_API int
803
vlc_player_ResetAtoBLoop(vlc_player_t *player);
804
805
/**
806
 * Get the A to B loop status
807
 *
808
 * @note If the returned status is VLC_PLAYER_ABLOOP_A, then a_time and a_pos
809
 * will be valid. If the returned status is VLC_PLAYER_ABLOOP_B, then all
810
 * output parameters are valid. If the returned status is
811
 * VLC_PLAYER_ABLOOP_NONE, then all output parameters are invalid.
812
 *
813
 * @see vlc_player_cbs.on_atobloop_changed
814
 *
815
 * @param player locked player instance
816
 * @param a_time A time or VLC_TICK_INVALID (if the media doesn't have valid
817
 * times)
818
 * @param a_pos A position
819
 * @param b_time B time or VLC_TICK_INVALID (if the media doesn't have valid
820
 * times)
821
 * @param b_pos B position
822
 * @return A to B loop status
823
 */
824
VLC_API enum vlc_player_abloop
825
vlc_player_GetAtoBLoop(vlc_player_t *player, vlc_tick_t *a_time, double *a_pos,
826
                       vlc_tick_t *b_time, double *b_pos);
827
828
/**
829
 * Navigate (for DVD/Bluray menus or viewpoint)
830
 *
831
 * @param player locked player instance
832
 * @param nav navigation key
833
 */
834
VLC_API void
835
vlc_player_Navigate(vlc_player_t *player, enum vlc_player_nav nav);
836
837
/**
838
  * Update the viewpoint
839
  *
840
  * @param player locked player instance
841
  * @param viewpoint the viewpoint value
842
  * @param whence absolute or relative
843
  */
844
VLC_API void
845
vlc_player_UpdateViewpoint(vlc_player_t *player,
846
                           const vlc_viewpoint_t *viewpoint,
847
                           enum vlc_player_whence whence);
848
849
/**
850
 * Check if the playing is recording
851
 *
852
 * @see vlc_player_cbs.on_recording_changed
853
 *
854
 * @param player locked player instance
855
 * @return true if the player is recording
856
 */
857
VLC_API bool
858
vlc_player_IsRecording(vlc_player_t *player);
859
860
/**
861
 * Enable or disable recording for the current media
862
 *
863
 * @note A successful call will trigger the vlc_player_cbs.on_recording_changed
864
 * event.
865
 *
866
 * @param player locked player instance
867
 * @param enabled true to enable recording
868
 * @param dir_path path of the recording directory or NULL (use default path),
869
 * has only an effect when first enabling recording.
870
 */
871
VLC_API void
872
vlc_player_SetRecordingEnabled(vlc_player_t *player, bool enabled,
873
                               const char *dir_path);
874
875
/**
876
 * Helper to toggle the recording state
877
 */
878
static inline void
879
vlc_player_ToggleRecording(vlc_player_t *player)
880
0
{
881
0
    vlc_player_SetRecordingEnabled(player, !vlc_player_IsRecording(player), NULL);
882
0
}
Unexecuted instantiation: libvlc.c:vlc_player_ToggleRecording
Unexecuted instantiation: content.c:vlc_player_ToggleRecording
Unexecuted instantiation: control.c:vlc_player_ToggleRecording
Unexecuted instantiation: notify.c:vlc_player_ToggleRecording
Unexecuted instantiation: player.c:vlc_player_ToggleRecording
Unexecuted instantiation: playlist.c:vlc_player_ToggleRecording
Unexecuted instantiation: preparse.c:vlc_player_ToggleRecording
Unexecuted instantiation: input.c:vlc_player_ToggleRecording
Unexecuted instantiation: timer.c:vlc_player_ToggleRecording
Unexecuted instantiation: track.c:vlc_player_ToggleRecording
Unexecuted instantiation: title.c:vlc_player_ToggleRecording
Unexecuted instantiation: aout.c:vlc_player_ToggleRecording
Unexecuted instantiation: vout.c:vlc_player_ToggleRecording
Unexecuted instantiation: osd.c:vlc_player_ToggleRecording
Unexecuted instantiation: medialib.c:vlc_player_ToggleRecording
Unexecuted instantiation: strings.c:vlc_player_ToggleRecording
Unexecuted instantiation: vlm.c:vlc_player_ToggleRecording
Unexecuted instantiation: vlm_event.c:vlc_player_ToggleRecording
Unexecuted instantiation: vlmshell.c:vlc_player_ToggleRecording
Unexecuted instantiation: libvlc-module.c:vlc_player_ToggleRecording
883
884
/**
885
 * Add an associated (or external) media to the current media
886
 *
887
 * @param player locked player instance
888
 * @param cat SPU_ES or UNKNOWN_ES
889
 * @param uri absolute uri of the external media
890
 * @param select true to select the track of this external media
891
 * @param notify true to notify the OSD
892
 * @param check_ext true to check subtitles extension
893
 */
894
VLC_API int
895
vlc_player_AddAssociatedMedia(vlc_player_t *player,
896
                              enum es_format_category_e cat, const char *uri,
897
                              bool select, bool notify, bool check_ext);
898
899
/**
900
 * Get the signal quality and strength of the current media
901
 *
902
 * @param player locked player instance
903
 * @param quality a pointer that will be assigned with the signal quality
904
 * @param strength a pointer that will be assigned with the signal strength
905
 * @retval VLC_SUCCESS when quality and strength have been assigned
906
 * @retval VLC_EGENERIC in case of error (strength and quality are not assigned)
907
 */
908
VLC_API int
909
vlc_player_GetSignal(vlc_player_t *player, float *quality, float *strength);
910
911
/**
912
 * Get the statistics of the current media
913
 *
914
 * @warning The returned pointer becomes invalid when the player is unlocked.
915
 * The referenced structure can be safely copied.
916
 *
917
 * @see vlc_player_cbs.on_statistics_changed
918
 *
919
 * @param player locked player instance
920
 * @return pointer to the player stats structure or NULL
921
 */
922
VLC_API const struct input_stats_t *
923
vlc_player_GetStatistics(vlc_player_t *player);
924
925
/**
926
 * Restore the previous playback position of the current media
927
 */
928
VLC_API void
929
vlc_player_RestorePlaybackPos(vlc_player_t *player);
930
931
/**
932
 * Get the V4L2 object used to do controls
933
 *
934
 * @param player locked player instance
935
 * @return the V4L2 object or NULL if not any. This object must be used with
936
 * the player lock held.
937
 */
938
VLC_API vlc_object_t *
939
vlc_player_GetV4l2Object(vlc_player_t *player) VLC_DEPRECATED;
940
941
/** @} vlc_player__playback */
942
943
/**
944
 * @defgroup vlc_player__titles Title and chapter control
945
 * @{
946
 */
947
948
/**
949
 * Player chapter structure
950
 */
951
struct vlc_player_chapter
952
{
953
    /** Chapter name, always valid */
954
    const char *name;
955
    /** Position of this chapter */
956
    vlc_tick_t time;
957
};
958
959
/** vlc_player_title.flags: The title is a menu. */
960
#define VLC_PLAYER_TITLE_MENU         0x01
961
/** vlc_player_title.flags: The title is interactive. */
962
#define VLC_PLAYER_TITLE_INTERACTIVE  0x02
963
/** vlc_player_title.flags: The title is the main one. */
964
#define VLC_PLAYER_TITLE_MAIN         0x04
965
966
/** Player title structure */
967
struct vlc_player_title
968
{
969
    /** Title name, always valid */
970
    const char *name;
971
    /** Length of the title */
972
    vlc_tick_t length;
973
    /** Bit flag of @ref VLC_PLAYER_TITLE_MENU and @ref
974
     * VLC_PLAYER_TITLE_INTERACTIVE */
975
    unsigned flags;
976
    /** Number of chapters, can be 0 */
977
    size_t chapter_count;
978
    /** Array of chapters, can be NULL */
979
    const struct vlc_player_chapter *chapters;
980
};
981
982
/**
983
 * Opaque structure representing a list of @ref vlc_player_title.
984
 *
985
 * @see vlc_player_GetTitleList()
986
 * @see vlc_player_title_list_GetCount()
987
 * @see vlc_player_title_list_GetAt()
988
 */
989
typedef struct vlc_player_title_list vlc_player_title_list;
990
991
/**
992
 * Hold the title list of the player
993
 *
994
 * This function can be used to pass this title list from a callback to an
995
 * other thread.
996
 *
997
 * @see vlc_player_cbs.on_titles_changed
998
 *
999
 * @return the same instance
1000
 */
1001
VLC_API vlc_player_title_list *
1002
vlc_player_title_list_Hold(vlc_player_title_list *titles);
1003
1004
/**
1005
 * Release of previously held title list
1006
 */
1007
VLC_API void
1008
vlc_player_title_list_Release(vlc_player_title_list *titles);
1009
1010
/**
1011
 * Get the number of title of a list
1012
 */
1013
VLC_API size_t
1014
vlc_player_title_list_GetCount(vlc_player_title_list *titles);
1015
1016
/**
1017
 * Get the title at a given index
1018
 *
1019
 * @param titles a valid title list
1020
 * @param idx index in the range [0; count[
1021
 * @return a valid title (can't be NULL)
1022
 */
1023
VLC_API const struct vlc_player_title *
1024
vlc_player_title_list_GetAt(vlc_player_title_list *titles, size_t idx);
1025
1026
/**
1027
 * Get the title list of the current media
1028
 *
1029
 * @see vlc_player_cbs.on_titles_changed
1030
 *
1031
 * @param player locked player instance
1032
 */
1033
VLC_API vlc_player_title_list *
1034
vlc_player_GetTitleList(vlc_player_t *player);
1035
1036
/**
1037
 * Get the selected title index for the current media
1038
 *
1039
 * @see vlc_player_cbs.on_title_selection_changed
1040
 *
1041
 * @param player locked player instance
1042
 */
1043
VLC_API ssize_t
1044
vlc_player_GetSelectedTitleIdx(vlc_player_t *player);
1045
1046
/**
1047
 * Helper to get the current selected title
1048
 */
1049
static inline const struct vlc_player_title *
1050
vlc_player_GetSelectedTitle(vlc_player_t *player)
1051
0
{
1052
0
    vlc_player_title_list *titles = vlc_player_GetTitleList(player);
1053
0
    if (!titles)
1054
0
        return NULL;
1055
0
    ssize_t selected_idx = vlc_player_GetSelectedTitleIdx(player);
1056
0
    if (selected_idx < 0)
1057
0
        return NULL;
1058
0
    return vlc_player_title_list_GetAt(titles, selected_idx);
1059
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: content.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: control.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: notify.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: player.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: playlist.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: preparse.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: input.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: timer.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: track.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: title.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: aout.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: vout.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: osd.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: medialib.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: strings.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: vlm.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: vlm_event.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: vlmshell.c:vlc_player_GetSelectedTitle
Unexecuted instantiation: libvlc-module.c:vlc_player_GetSelectedTitle
1060
1061
/**
1062
 * Select a title index for the current media
1063
 *
1064
 * @note A successful call will trigger the
1065
 * vlc_player_cbs.on_title_selection_changed event.
1066
 *
1067
 * @see vlc_player_title_list_GetAt()
1068
 * @see vlc_player_title_list_GetCount()
1069
 *
1070
 * @param player locked player instance
1071
 * @param index valid index in the range [0;count[
1072
 */
1073
VLC_API void
1074
vlc_player_SelectTitleIdx(vlc_player_t *player, size_t index);
1075
1076
/**
1077
 * Select a title for the current media
1078
 *
1079
 * @note A successful call will trigger the
1080
 * vlc_player_cbs.on_title_selection_changed event.
1081
 *
1082
 * @see vlc_player_title_list_GetAt()
1083
 * @see vlc_player_title_list_GetCount()
1084
 *
1085
 * @param player locked player instance
1086
 * @param title a valid title coming from the vlc_player_title_list
1087
 */
1088
VLC_API void
1089
vlc_player_SelectTitle(vlc_player_t *player,
1090
                       const struct vlc_player_title *title);
1091
1092
/**
1093
 * Select a chapter for the current media
1094
 *
1095
 * @note A successful call will trigger the
1096
 * vlc_player_cbs.on_chapter_selection_changed event.
1097
 *
1098
 * @param player locked player instance
1099
 * @param title the selected title
1100
 * @param chapter_idx index from vlc_player_title.chapters
1101
 */
1102
VLC_API void
1103
vlc_player_SelectChapter(vlc_player_t *player,
1104
                         const struct vlc_player_title *title,
1105
                         size_t chapter_idx);
1106
1107
/**
1108
 * Select the next title for the current media
1109
 *
1110
 * @see vlc_player_SelectTitleIdx()
1111
 */
1112
VLC_API void
1113
vlc_player_SelectNextTitle(vlc_player_t *player);
1114
1115
/**
1116
 * Select the previous title for the current media
1117
 *
1118
 * @see vlc_player_SelectTitleIdx()
1119
 */
1120
VLC_API void
1121
vlc_player_SelectPrevTitle(vlc_player_t *player);
1122
1123
/**
1124
 * Get the selected chapter index for the current media
1125
 *
1126
 * @see vlc_player_cbs.on_chapter_selection_changed
1127
 *
1128
 * @param player locked player instance
1129
 */
1130
VLC_API ssize_t
1131
vlc_player_GetSelectedChapterIdx(vlc_player_t *player);
1132
1133
/**
1134
 * Helper to get the current selected chapter
1135
 */
1136
static inline const struct vlc_player_chapter *
1137
vlc_player_GetSelectedChapter(vlc_player_t *player)
1138
0
{
1139
0
    const struct vlc_player_title *title = vlc_player_GetSelectedTitle(player);
1140
0
    if (!title || !title->chapter_count)
1141
0
        return NULL;
1142
0
    ssize_t chapter_idx = vlc_player_GetSelectedChapterIdx(player);
1143
0
    return chapter_idx >= 0 ? &title->chapters[chapter_idx] : NULL;
1144
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: content.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: control.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: notify.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: player.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: playlist.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: preparse.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: input.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: timer.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: track.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: title.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: aout.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: vout.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: osd.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: medialib.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: strings.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: vlm.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: vlm_event.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: vlmshell.c:vlc_player_GetSelectedChapter
Unexecuted instantiation: libvlc-module.c:vlc_player_GetSelectedChapter
1145
1146
/**
1147
 * Select a chapter index for the current media
1148
 *
1149
 * @note A successful call will trigger the
1150
 * vlc_player_cbs.on_chapter_selection_changed event.
1151
 *
1152
 * @see vlc_player_title.chapters
1153
 *
1154
 * @param player locked player instance
1155
 * @param index valid index in the range [0;vlc_player_title.chapter_count[
1156
 */
1157
VLC_API void
1158
vlc_player_SelectChapterIdx(vlc_player_t *player, size_t index);
1159
1160
/**
1161
 * Select the next chapter for the current media
1162
 *
1163
 * @see vlc_player_SelectChapterIdx()
1164
 */
1165
VLC_API void
1166
vlc_player_SelectNextChapter(vlc_player_t *player);
1167
1168
/**
1169
 * Select the previous chapter for the current media
1170
 *
1171
 * @see vlc_player_SelectChapterIdx()
1172
 */
1173
VLC_API void
1174
vlc_player_SelectPrevChapter(vlc_player_t *player);
1175
1176
/** @} vlc_player__titles */
1177
1178
/**
1179
 * @defgroup vlc_player__programs Program control
1180
 * @{
1181
 */
1182
1183
/**
1184
 * Player program structure.
1185
 */
1186
struct vlc_player_program
1187
{
1188
    /** Id used for vlc_player_SelectProgram() */
1189
    int group_id;
1190
    /** Program name, always valid */
1191
    const char *name;
1192
    /** True if the program is selected */
1193
    bool selected;
1194
    /** True if the program is scrambled */
1195
    bool scrambled;
1196
};
1197
1198
/**
1199
 * Duplicate a program
1200
 *
1201
 * This function can be used to pass a program from a callback to an other
1202
 * context.
1203
 *
1204
 * @see vlc_player_cbs.on_program_list_changed
1205
 *
1206
 * @return a duplicated program or NULL on allocation error
1207
 */
1208
VLC_API struct vlc_player_program *
1209
vlc_player_program_Dup(const struct vlc_player_program *prgm);
1210
1211
/**
1212
 * Delete a duplicated program
1213
 */
1214
VLC_API void
1215
vlc_player_program_Delete(struct vlc_player_program *prgm);
1216
1217
/**
1218
 * Get the number of programs
1219
 *
1220
 * @warning The returned size becomes invalid when the player is unlocked.
1221
 *
1222
 * @param player locked player instance
1223
 * @return number of programs, or 0 (in case of error, or if the media is not
1224
 * started)
1225
 */
1226
VLC_API size_t
1227
vlc_player_GetProgramCount(vlc_player_t *player);
1228
1229
/**
1230
 * Get the program at a specific index
1231
 *
1232
 * @warning The behaviour is undefined if the index is not valid.
1233
 *
1234
 * @warning The returned pointer becomes invalid when the player is unlocked.
1235
 * The referenced structure can be safely copied with vlc_player_program_Dup().
1236
 *
1237
 * @param player locked player instance
1238
 * @param index valid index in the range [0; count[
1239
 * @return a valid program (can't be NULL if vlc_player_GetProgramCount()
1240
 * returned a valid count)
1241
 */
1242
VLC_API const struct vlc_player_program *
1243
vlc_player_GetProgramAt(vlc_player_t *player, size_t index);
1244
1245
/**
1246
 * Get a program from an ES group identifier
1247
 *
1248
 * @param player locked player instance
1249
 * @param group_id a program ID (retrieved from
1250
 * vlc_player_cbs.on_program_list_changed or vlc_player_GetProgramAt())
1251
 * @return a valid program or NULL (if the program was terminated by the
1252
 * playback thread)
1253
 */
1254
VLC_API const struct vlc_player_program *
1255
vlc_player_GetProgram(vlc_player_t *player, int group_id);
1256
1257
/**
1258
 * Select a program from an ES group identifier
1259
 *
1260
 * This function can be used to pre-select a program by its id before starting
1261
 * the player. It has only effect for the current media. It can also be used
1262
 * when the player is already started.
1263
 *
1264
 * @note Selecting a non-existing program will cause the player to no select
1265
 * any programs. Therefore, all tracks will be disabled.
1266
 *
1267
 * @param player locked player instance
1268
 * @param group_id a program ID (retrieved from
1269
 * vlc_player_cbs.on_program_list_changed or vlc_player_GetProgramAt())
1270
 */
1271
VLC_API void
1272
vlc_player_SelectProgram(vlc_player_t *player, int group_id);
1273
1274
/**
1275
 * Select the next program
1276
 *
1277
 * @param player locked player instance
1278
 */
1279
VLC_API void
1280
vlc_player_SelectNextProgram(vlc_player_t *player);
1281
1282
/**
1283
 * Select the previous program
1284
 *
1285
 * @param player locked player instance
1286
 */
1287
VLC_API void
1288
vlc_player_SelectPrevProgram(vlc_player_t *player);
1289
1290
/**
1291
 * Helper to get the current selected program
1292
 */
1293
static inline const struct vlc_player_program *
1294
vlc_player_GetSelectedProgram(vlc_player_t *player)
1295
0
{
1296
0
    size_t count = vlc_player_GetProgramCount(player);
1297
0
    for (size_t i = 0; i < count; ++i)
1298
0
    {
1299
0
        const struct vlc_player_program *program =
1300
0
            vlc_player_GetProgramAt(player, i);
1301
0
        assert(program);
1302
0
        if (program->selected)
1303
0
            return program;
1304
0
    }
1305
0
    return NULL;
1306
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: content.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: control.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: notify.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: player.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: playlist.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: preparse.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: input.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: timer.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: track.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: title.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: aout.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: vout.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: osd.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: medialib.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: strings.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: vlm.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: vlm_event.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: vlmshell.c:vlc_player_GetSelectedProgram
Unexecuted instantiation: libvlc-module.c:vlc_player_GetSelectedProgram
1307
1308
/** @} vlc_player__programs */
1309
1310
/**
1311
 * @defgroup vlc_player__tracks Tracks control
1312
 * @{
1313
 */
1314
1315
/**
1316
 * Player selection policy
1317
 *
1318
 * @see vlc_player_SelectEsId()
1319
 */
1320
enum vlc_player_select_policy
1321
{
1322
    /**
1323
     * Only one track per category is selected. Selecting a track with this
1324
     * policy will disable all other tracks for the same category.
1325
     */
1326
    VLC_PLAYER_SELECT_EXCLUSIVE,
1327
    /**
1328
     * Select multiple tracks for one category.
1329
     *
1330
     * Only one audio track can be selected at a time.
1331
     * Two subtitle tracks can be selected simultaneously.
1332
     * Multiple video tracks can be selected simultaneously.
1333
     */
1334
    VLC_PLAYER_SELECT_SIMULTANEOUS,
1335
};
1336
1337
/**
1338
 * Player track structure.
1339
 *
1340
 * A track is a representation of an ES identifier at a given time. Once the
1341
 * player is unlocked, all content except the es_id pointer can be updated.
1342
 *
1343
 * @see vlc_player_cbs.on_track_list_changed
1344
 * @see vlc_player_GetTrack
1345
 */
1346
struct vlc_player_track
1347
{
1348
    /** Id used for any player actions, like vlc_player_SelectEsId() */
1349
    vlc_es_id_t *es_id;
1350
    /** Track name, always valid */
1351
    const char *name;
1352
    /** Es format */
1353
    es_format_t fmt;
1354
    /** True if the track is selected */
1355
    bool selected;
1356
};
1357
1358
/**
1359
 * Duplicate a track
1360
 *
1361
 * This function can be used to pass a track from a callback to an other
1362
 * context. The es_id will be held by the duplicated track.
1363
 *
1364
 * @warning The returned track won't be updated if the original one is modified
1365
 * by the player.
1366
 *
1367
 * @see vlc_player_cbs.on_track_list_changed
1368
 *
1369
 * @return a duplicated track or NULL on allocation error
1370
 */
1371
VLC_API struct vlc_player_track *
1372
vlc_player_track_Dup(const struct vlc_player_track *track);
1373
1374
/**
1375
 * Delete a duplicated track
1376
 */
1377
VLC_API void
1378
vlc_player_track_Delete(struct vlc_player_track *track);
1379
1380
/**
1381
 * Get the number of tracks for an ES category
1382
 *
1383
 * @warning The returned size becomes invalid when the player is unlocked.
1384
 *
1385
 * @param player locked player instance
1386
 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1387
 * @return number of tracks, or 0 (in case of error, or if the media is not
1388
 * started)
1389
 */
1390
VLC_API size_t
1391
vlc_player_GetTrackCount(vlc_player_t *player, enum es_format_category_e cat);
1392
1393
/**
1394
 * Get the track at a specific index for an ES category
1395
 *
1396
 * @warning The behaviour is undefined if the index is not valid.
1397
 *
1398
 * @warning The returned pointer becomes invalid when the player is unlocked.
1399
 * The referenced structure can be safely copied with vlc_player_track_Dup().
1400
 *
1401
 * @param player locked player instance
1402
 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1403
 * @param index valid index in the range [0; count[
1404
 * @return a valid track (can't be NULL if vlc_player_GetTrackCount() returned
1405
 * a valid count)
1406
 */
1407
VLC_API const struct vlc_player_track *
1408
vlc_player_GetTrackAt(vlc_player_t *player, enum es_format_category_e cat,
1409
                      size_t index);
1410
1411
/**
1412
 * Helper to get the video track count
1413
 */
1414
static inline size_t
1415
vlc_player_GetVideoTrackCount(vlc_player_t *player)
1416
0
{
1417
0
    return vlc_player_GetTrackCount(player, VIDEO_ES);
1418
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: content.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: control.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: notify.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: player.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: playlist.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: preparse.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: input.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: timer.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: track.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: title.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: aout.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: vout.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: osd.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: medialib.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: strings.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: vlm.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: vlm_event.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: vlmshell.c:vlc_player_GetVideoTrackCount
Unexecuted instantiation: libvlc-module.c:vlc_player_GetVideoTrackCount
1419
1420
/**
1421
 * Helper to get a video track at a specific index
1422
 */
1423
static inline const struct vlc_player_track *
1424
vlc_player_GetVideoTrackAt(vlc_player_t *player, size_t index)
1425
0
{
1426
0
    return vlc_player_GetTrackAt(player, VIDEO_ES, index);
1427
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: content.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: control.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: notify.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: player.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: playlist.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: preparse.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: input.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: timer.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: track.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: title.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: aout.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: vout.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: osd.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: medialib.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: strings.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: vlm.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: vlm_event.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: vlmshell.c:vlc_player_GetVideoTrackAt
Unexecuted instantiation: libvlc-module.c:vlc_player_GetVideoTrackAt
1428
1429
/**
1430
 * Helper to get the audio track count
1431
 */
1432
static inline size_t
1433
vlc_player_GetAudioTrackCount(vlc_player_t *player)
1434
0
{
1435
0
    return vlc_player_GetTrackCount(player, AUDIO_ES);
1436
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: content.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: control.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: notify.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: player.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: playlist.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: preparse.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: input.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: timer.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: track.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: title.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: aout.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: vout.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: osd.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: medialib.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: strings.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: vlm.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: vlm_event.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: vlmshell.c:vlc_player_GetAudioTrackCount
Unexecuted instantiation: libvlc-module.c:vlc_player_GetAudioTrackCount
1437
1438
/**
1439
 * Helper to get an audio track at a specific index
1440
 */
1441
static inline const struct vlc_player_track *
1442
vlc_player_GetAudioTrackAt(vlc_player_t *player, size_t index)
1443
0
{
1444
0
    return vlc_player_GetTrackAt(player, AUDIO_ES, index);
1445
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: content.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: control.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: notify.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: player.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: playlist.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: preparse.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: input.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: timer.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: track.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: title.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: aout.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: vout.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: osd.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: medialib.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: strings.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: vlm.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: vlm_event.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: vlmshell.c:vlc_player_GetAudioTrackAt
Unexecuted instantiation: libvlc-module.c:vlc_player_GetAudioTrackAt
1446
1447
/**
1448
 * Helper to get the subtitle track count
1449
 */
1450
static inline size_t
1451
vlc_player_GetSubtitleTrackCount(vlc_player_t *player)
1452
0
{
1453
0
    return vlc_player_GetTrackCount(player, SPU_ES);
1454
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: content.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: control.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: notify.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: player.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: playlist.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: preparse.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: input.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: timer.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: track.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: title.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: aout.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: vout.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: osd.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: medialib.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: strings.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: vlm.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: vlm_event.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: vlmshell.c:vlc_player_GetSubtitleTrackCount
Unexecuted instantiation: libvlc-module.c:vlc_player_GetSubtitleTrackCount
1455
1456
/**
1457
 * Helper to get a subtitle track at a specific index
1458
 */
1459
static inline const struct vlc_player_track *
1460
vlc_player_GetSubtitleTrackAt(vlc_player_t *player, size_t index)
1461
0
{
1462
0
    return vlc_player_GetTrackAt(player, SPU_ES, index);
1463
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: content.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: control.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: notify.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: player.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: playlist.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: preparse.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: input.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: timer.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: track.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: title.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: aout.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: vout.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: osd.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: medialib.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: strings.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: vlm.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: vlm_event.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: vlmshell.c:vlc_player_GetSubtitleTrackAt
Unexecuted instantiation: libvlc-module.c:vlc_player_GetSubtitleTrackAt
1464
1465
/**
1466
 * Get a track from an ES identifier
1467
 *
1468
 * @warning The returned pointer becomes invalid when the player is unlocked.
1469
 * The referenced structure can be safely copied with vlc_player_track_Dup().
1470
 *
1471
 * @param player locked player instance
1472
 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1473
 * vlc_player_GetTrackAt())
1474
 * @return a valid player track or NULL (if the track was terminated by the
1475
 * playback thread)
1476
 */
1477
VLC_API const struct vlc_player_track *
1478
vlc_player_GetTrack(vlc_player_t *player, vlc_es_id_t *es_id);
1479
1480
/**
1481
 * Get and the video output used by a ES identifier
1482
 *
1483
 * @warning A same vout can be associated with multiple ES during the lifetime
1484
 * of the player. The information returned by this function becomes invalid
1485
 * when the player is unlocked. The returned vout doesn't need to be released,
1486
 * but must be held with vout_Hold() if it is accessed after the player is
1487
 * unlocked.
1488
 *
1489
 * @param player locked player instance
1490
 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1491
 * vlc_player_GetTrackAt())
1492
 * @param order if not null, the order of the vout
1493
 * @return a valid vout or NULL (if the track is disabled, it it's not a video
1494
 * or spu track, or if the vout failed to start)
1495
 */
1496
VLC_API vout_thread_t *
1497
vlc_player_GetEsIdVout(vlc_player_t *player, vlc_es_id_t *es_id,
1498
                       enum vlc_vout_order *order);
1499
1500
/**
1501
 * Get the ES identifier of a video output
1502
 *
1503
 * @warning A same vout can be associated with multiple ES during the lifetime
1504
 * of the player. The information returned by this function becomes invalid
1505
 * when the player is unlocked. The returned es_id doesn't need to be released,
1506
 * but must be held with vlc_es_id_Hold() if it accessed after the player is
1507
 * unlocked.
1508
 *
1509
 * @param player locked player instance
1510
 * @param vout vout (can't be NULL)
1511
 * @return a valid ES identifier or NULL (if the vout is stopped)
1512
 */
1513
VLC_API vlc_es_id_t *
1514
vlc_player_GetEsIdFromVout(vlc_player_t *player, vout_thread_t *vout);
1515
1516
/**
1517
 * Helper to get the selected track from an ES category
1518
 *
1519
 * @warning The player can have more than one selected track for a same ES
1520
 * category. This function will only return the first selected one. Use
1521
 * vlc_player_GetTrackAt() and vlc_player_GetTrackCount() to iterate through
1522
 * several selected tracks.
1523
 */
1524
static inline const struct vlc_player_track *
1525
vlc_player_GetSelectedTrack(vlc_player_t *player, enum es_format_category_e cat)
1526
0
{
1527
0
    size_t count = vlc_player_GetTrackCount(player, cat);
1528
0
    for (size_t i = 0; i < count; ++i)
1529
0
    {
1530
0
        const struct vlc_player_track *track =
1531
0
            vlc_player_GetTrackAt(player, cat, i);
1532
0
        assert(track);
1533
0
        if (track->selected)
1534
0
            return track;
1535
0
    }
1536
0
    return NULL;
1537
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: content.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: control.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: notify.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: player.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: playlist.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: preparse.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: input.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: timer.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: track.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: title.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: aout.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: vout.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: osd.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: medialib.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: strings.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: vlm.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: vlm_event.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: vlmshell.c:vlc_player_GetSelectedTrack
Unexecuted instantiation: libvlc-module.c:vlc_player_GetSelectedTrack
1538
1539
/**
1540
 * Select tracks by their string identifier
1541
 *
1542
 * This function can be used to pre-select a list of tracks before starting the
1543
 * player. It has only effect for the current media. It can also be used when
1544
 * the player is already started.
1545
1546
 * 'str_ids' can contain more than one track id, delimited with ','. "" or any
1547
 * invalid track id will cause the player to unselect all tracks of that
1548
 * category. NULL will disable the preference for newer tracks without
1549
 * unselecting any current tracks.
1550
 *
1551
 * Example:
1552
 * - (VIDEO_ES, "video/1,video/2") will select these 2 video tracks. If there
1553
 * is only one video track with the id "video/0", no tracks will be selected.
1554
 * - (SPU_ES, "${slave_url_md5sum}/spu/0) will select one spu added by an input
1555
 * slave with the corresponding url.
1556
 *
1557
 * @note The string identifier of a track can be found via vlc_es_id_GetStrId().
1558
 *
1559
 * @param player locked player instance
1560
 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1561
 * @param str_ids list of string identifier or NULL
1562
 */
1563
VLC_API void
1564
vlc_player_SelectTracksByStringIds(vlc_player_t *player,
1565
                                   enum es_format_category_e cat,
1566
                                   const char *str_ids);
1567
1568
/**
1569
 * Select a track from an ES identifier
1570
 *
1571
 * @note A successful call will trigger the
1572
 * vlc_player_cbs.on_track_selection_changed event.
1573
 *
1574
 * @param player locked player instance
1575
 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1576
 * vlc_player_GetTrackAt())
1577
 * @param policy exclusive or simultaneous
1578
 * @return the number of track selected for es_id category
1579
 */
1580
VLC_API unsigned
1581
vlc_player_SelectEsId(vlc_player_t *player, vlc_es_id_t *es_id,
1582
                      enum vlc_player_select_policy policy);
1583
1584
1585
/**
1586
 * Helper to select a track
1587
 */
1588
static inline unsigned
1589
vlc_player_SelectTrack(vlc_player_t *player,
1590
                       const struct vlc_player_track *track,
1591
                       enum vlc_player_select_policy policy)
1592
0
{
1593
0
    return vlc_player_SelectEsId(player, track->es_id, policy);
1594
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SelectTrack
Unexecuted instantiation: content.c:vlc_player_SelectTrack
Unexecuted instantiation: control.c:vlc_player_SelectTrack
Unexecuted instantiation: notify.c:vlc_player_SelectTrack
Unexecuted instantiation: player.c:vlc_player_SelectTrack
Unexecuted instantiation: playlist.c:vlc_player_SelectTrack
Unexecuted instantiation: preparse.c:vlc_player_SelectTrack
Unexecuted instantiation: input.c:vlc_player_SelectTrack
Unexecuted instantiation: timer.c:vlc_player_SelectTrack
Unexecuted instantiation: track.c:vlc_player_SelectTrack
Unexecuted instantiation: title.c:vlc_player_SelectTrack
Unexecuted instantiation: aout.c:vlc_player_SelectTrack
Unexecuted instantiation: vout.c:vlc_player_SelectTrack
Unexecuted instantiation: osd.c:vlc_player_SelectTrack
Unexecuted instantiation: medialib.c:vlc_player_SelectTrack
Unexecuted instantiation: strings.c:vlc_player_SelectTrack
Unexecuted instantiation: vlm.c:vlc_player_SelectTrack
Unexecuted instantiation: vlm_event.c:vlc_player_SelectTrack
Unexecuted instantiation: vlmshell.c:vlc_player_SelectTrack
Unexecuted instantiation: libvlc-module.c:vlc_player_SelectTrack
1595
1596
/**
1597
 * Select multiple tracks from a list of ES identifiers.
1598
 *
1599
 * Any tracks of the category, not referenced in the list will be unselected.
1600
 *
1601
 * @warning there is no guarantee all requested tracks will be selected. The
1602
 * behaviour is undefined if the list is not null-terminated.
1603
 *
1604
 * @note A successful call will trigger the
1605
 * vlc_player_cbs.on_track_selection_changed event for each track that has
1606
 * its selection state changed.
1607
 *
1608
 * @see VLC_PLAYER_SELECT_SIMULTANEOUS
1609
 *
1610
 * @param player locked player instance
1611
 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1612
 * @param es_id_list a null-terminated list of ES identifiers. es_ids not
1613
 * corresponding to the category will be ignored.
1614
 * (ES IDs can be retrieved from vlc_player_cbs.on_track_list_changed or
1615
 * vlc_player_GetTrackAt())
1616
 * @return the number of track selected for that category
1617
 */
1618
VLC_API unsigned
1619
vlc_player_SelectEsIdList(vlc_player_t *player,
1620
                          enum es_format_category_e cat,
1621
                          vlc_es_id_t *const es_id_list[]);
1622
1623
1624
/**
1625
 * Cycle through the tracks
1626
 *
1627
 * If the last track is already selected, a call to this function will disable
1628
 * this last track. And a second call will select the first track.
1629
 * Unless called on the PRIMARY with a SECONDARY selected, it will cycle through
1630
 *
1631
 * @param player locked player instance
1632
 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1633
 * @param next the cycle order
1634
 */
1635
VLC_API void
1636
vlc_player_CycleTrack(vlc_player_t *player, enum es_format_category_e cat,
1637
                      enum vlc_vout_order vout_order, bool next);
1638
1639
/**
1640
 * Helper to select the next track
1641
 *
1642
 * If the last track is already selected, a call to this function will disable
1643
 * this last track. And a second call will select the first track.
1644
 * Unless called on the PRIMARY with a SECONDARY selected, it will cycle through
1645
 *
1646
 * @param player locked player instance
1647
 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1648
 */
1649
static inline void
1650
vlc_player_SelectNextTrack(vlc_player_t *player, enum es_format_category_e cat,
1651
                           enum vlc_vout_order vout_order)
1652
0
{
1653
0
    vlc_player_CycleTrack(player, cat, vout_order, true);
1654
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SelectNextTrack
Unexecuted instantiation: content.c:vlc_player_SelectNextTrack
Unexecuted instantiation: control.c:vlc_player_SelectNextTrack
Unexecuted instantiation: notify.c:vlc_player_SelectNextTrack
Unexecuted instantiation: player.c:vlc_player_SelectNextTrack
Unexecuted instantiation: playlist.c:vlc_player_SelectNextTrack
Unexecuted instantiation: preparse.c:vlc_player_SelectNextTrack
Unexecuted instantiation: input.c:vlc_player_SelectNextTrack
Unexecuted instantiation: timer.c:vlc_player_SelectNextTrack
Unexecuted instantiation: track.c:vlc_player_SelectNextTrack
Unexecuted instantiation: title.c:vlc_player_SelectNextTrack
Unexecuted instantiation: aout.c:vlc_player_SelectNextTrack
Unexecuted instantiation: vout.c:vlc_player_SelectNextTrack
Unexecuted instantiation: osd.c:vlc_player_SelectNextTrack
Unexecuted instantiation: medialib.c:vlc_player_SelectNextTrack
Unexecuted instantiation: strings.c:vlc_player_SelectNextTrack
Unexecuted instantiation: vlm.c:vlc_player_SelectNextTrack
Unexecuted instantiation: vlm_event.c:vlc_player_SelectNextTrack
Unexecuted instantiation: vlmshell.c:vlc_player_SelectNextTrack
Unexecuted instantiation: libvlc-module.c:vlc_player_SelectNextTrack
1655
1656
/**
1657
 * Helper to select the Previous track
1658
 *
1659
 * If the first track is already selected, a call to this function will disable
1660
 * this first track. And a second call will select the last track.
1661
 * Unless called on the PRIMARY with a SECONDARY selected, it will cycle through
1662
 *
1663
 * @param player locked player instance
1664
 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1665
 */
1666
static inline void
1667
vlc_player_SelectPrevTrack(vlc_player_t *player, enum es_format_category_e cat,
1668
                           enum vlc_vout_order vout_order)
1669
0
{
1670
0
    vlc_player_CycleTrack(player, cat, vout_order, false);
1671
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: content.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: control.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: notify.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: player.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: playlist.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: preparse.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: input.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: timer.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: track.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: title.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: aout.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: vout.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: osd.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: medialib.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: strings.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: vlm.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: vlm_event.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: vlmshell.c:vlc_player_SelectPrevTrack
Unexecuted instantiation: libvlc-module.c:vlc_player_SelectPrevTrack
1672
1673
/**
1674
 * Unselect a track from an ES identifier
1675
 *
1676
 * @warning Other tracks of the same category won't be touched.
1677
 *
1678
 * @note A successful call will trigger the
1679
 * vlc_player_cbs.on_track_selection_changed event.
1680
 *
1681
 * @param player locked player instance
1682
 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1683
 * vlc_player_GetTrackAt())
1684
 */
1685
VLC_API void
1686
vlc_player_UnselectEsId(vlc_player_t *player, vlc_es_id_t *es_id);
1687
1688
/**
1689
 * Helper to unselect a track
1690
 */
1691
static inline void
1692
vlc_player_UnselectTrack(vlc_player_t *player,
1693
                         const struct vlc_player_track *track)
1694
0
{
1695
0
    vlc_player_UnselectEsId(player, track->es_id);
1696
0
}
Unexecuted instantiation: libvlc.c:vlc_player_UnselectTrack
Unexecuted instantiation: content.c:vlc_player_UnselectTrack
Unexecuted instantiation: control.c:vlc_player_UnselectTrack
Unexecuted instantiation: notify.c:vlc_player_UnselectTrack
Unexecuted instantiation: player.c:vlc_player_UnselectTrack
Unexecuted instantiation: playlist.c:vlc_player_UnselectTrack
Unexecuted instantiation: preparse.c:vlc_player_UnselectTrack
Unexecuted instantiation: input.c:vlc_player_UnselectTrack
Unexecuted instantiation: timer.c:vlc_player_UnselectTrack
Unexecuted instantiation: track.c:vlc_player_UnselectTrack
Unexecuted instantiation: title.c:vlc_player_UnselectTrack
Unexecuted instantiation: aout.c:vlc_player_UnselectTrack
Unexecuted instantiation: vout.c:vlc_player_UnselectTrack
Unexecuted instantiation: osd.c:vlc_player_UnselectTrack
Unexecuted instantiation: medialib.c:vlc_player_UnselectTrack
Unexecuted instantiation: strings.c:vlc_player_UnselectTrack
Unexecuted instantiation: vlm.c:vlc_player_UnselectTrack
Unexecuted instantiation: vlm_event.c:vlc_player_UnselectTrack
Unexecuted instantiation: vlmshell.c:vlc_player_UnselectTrack
Unexecuted instantiation: libvlc-module.c:vlc_player_UnselectTrack
1697
1698
/**
1699
 * Helper to unselect all tracks from an ES category
1700
 */
1701
static inline void
1702
vlc_player_UnselectTrackCategory(vlc_player_t *player,
1703
                                 enum es_format_category_e cat)
1704
0
{
1705
0
    size_t count = vlc_player_GetTrackCount(player, cat);
1706
0
    for (size_t i = 0; i < count; ++i)
1707
0
    {
1708
0
        const struct vlc_player_track *track =
1709
0
            vlc_player_GetTrackAt(player, cat, i);
1710
0
        assert(track);
1711
0
        if (track->selected)
1712
0
            vlc_player_UnselectTrack(player, track);
1713
0
    }
1714
0
}
Unexecuted instantiation: libvlc.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: content.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: control.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: notify.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: player.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: playlist.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: preparse.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: input.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: timer.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: track.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: title.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: aout.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: vout.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: osd.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: medialib.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: strings.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: vlm.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: vlm_event.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: vlmshell.c:vlc_player_UnselectTrackCategory
Unexecuted instantiation: libvlc-module.c:vlc_player_UnselectTrackCategory
1715
1716
/**
1717
 * Restart a track from an ES identifier
1718
 *
1719
 * @note A successful call will trigger the
1720
 * vlc_player_cbs.on_track_selection_changed event.
1721
 *
1722
 * @param player locked player instance
1723
 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1724
 * vlc_player_GetTrackAt())
1725
 */
1726
VLC_API void
1727
vlc_player_RestartEsId(vlc_player_t *player, vlc_es_id_t *es_id);
1728
1729
/**
1730
 * Helper to restart a track
1731
 */
1732
static inline void
1733
vlc_player_RestartTrack(vlc_player_t *player,
1734
                        const struct vlc_player_track *track)
1735
0
{
1736
0
    vlc_player_RestartEsId(player, track->es_id);
1737
0
}
Unexecuted instantiation: libvlc.c:vlc_player_RestartTrack
Unexecuted instantiation: content.c:vlc_player_RestartTrack
Unexecuted instantiation: control.c:vlc_player_RestartTrack
Unexecuted instantiation: notify.c:vlc_player_RestartTrack
Unexecuted instantiation: player.c:vlc_player_RestartTrack
Unexecuted instantiation: playlist.c:vlc_player_RestartTrack
Unexecuted instantiation: preparse.c:vlc_player_RestartTrack
Unexecuted instantiation: input.c:vlc_player_RestartTrack
Unexecuted instantiation: timer.c:vlc_player_RestartTrack
Unexecuted instantiation: track.c:vlc_player_RestartTrack
Unexecuted instantiation: title.c:vlc_player_RestartTrack
Unexecuted instantiation: aout.c:vlc_player_RestartTrack
Unexecuted instantiation: vout.c:vlc_player_RestartTrack
Unexecuted instantiation: osd.c:vlc_player_RestartTrack
Unexecuted instantiation: medialib.c:vlc_player_RestartTrack
Unexecuted instantiation: strings.c:vlc_player_RestartTrack
Unexecuted instantiation: vlm.c:vlc_player_RestartTrack
Unexecuted instantiation: vlm_event.c:vlc_player_RestartTrack
Unexecuted instantiation: vlmshell.c:vlc_player_RestartTrack
Unexecuted instantiation: libvlc-module.c:vlc_player_RestartTrack
1738
1739
/**
1740
  * Helper to restart all selected tracks from an ES category
1741
  */
1742
static inline void
1743
vlc_player_RestartTrackCategory(vlc_player_t *player,
1744
                                enum es_format_category_e cat)
1745
0
{
1746
0
    size_t count = vlc_player_GetTrackCount(player, cat);
1747
0
    for (size_t i = 0; i < count; ++i)
1748
0
    {
1749
0
        const struct vlc_player_track *track =
1750
0
            vlc_player_GetTrackAt(player, cat, i);
1751
0
        assert(track);
1752
0
        if (track->selected)
1753
0
            vlc_player_RestartTrack(player, track);
1754
0
    }
1755
0
}
Unexecuted instantiation: libvlc.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: content.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: control.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: notify.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: player.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: playlist.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: preparse.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: input.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: timer.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: track.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: title.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: aout.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: vout.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: osd.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: medialib.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: strings.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: vlm.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: vlm_event.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: vlmshell.c:vlc_player_RestartTrackCategory
Unexecuted instantiation: libvlc-module.c:vlc_player_RestartTrackCategory
1756
1757
/**
1758
 * Select the language for an ES category
1759
 *
1760
 * @warning The language will only be set for all future played media.
1761
 *
1762
 * @param player locked player instance
1763
 * @param cat AUDIO_ES or SPU_ES
1764
 * @param lang comma separated, two or three letters country code, 'any' as a
1765
 * fallback or NULL to reset the default state
1766
 */
1767
VLC_API void
1768
vlc_player_SelectCategoryLanguage(vlc_player_t *player,
1769
                                  enum es_format_category_e cat,
1770
                                  const char *lang);
1771
1772
/**
1773
 * Get the language of an ES category
1774
 *
1775
 * @warning This only reflects the change made by
1776
 * vlc_player_SelectCategoryLanguage(). The current playing track doesn't
1777
 * necessarily correspond to the returned language.
1778
 *
1779
 * @see vlc_player_SelectCategoryLanguage
1780
 *
1781
 * @param player locked player instance
1782
 * @param cat AUDIO_ES or SPU_ES
1783
 * @return valid language or NULL, need to be freed
1784
 */
1785
VLC_API char *
1786
vlc_player_GetCategoryLanguage(vlc_player_t *player,
1787
                               enum es_format_category_e cat);
1788
1789
/**
1790
 * Helper to select the audio language
1791
 */
1792
static inline void
1793
vlc_player_SelectAudioLanguage(vlc_player_t *player, const char *lang)
1794
0
{
1795
0
    vlc_player_SelectCategoryLanguage(player, AUDIO_ES, lang);
1796
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: content.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: control.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: notify.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: player.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: playlist.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: preparse.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: input.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: timer.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: track.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: title.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: aout.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: vout.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: osd.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: medialib.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: strings.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: vlm.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: vlm_event.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: vlmshell.c:vlc_player_SelectAudioLanguage
Unexecuted instantiation: libvlc-module.c:vlc_player_SelectAudioLanguage
1797
1798
/**
1799
 * Helper to select the subtitle language
1800
 */
1801
static inline void
1802
vlc_player_SelectSubtitleLanguage(vlc_player_t *player, const char *lang)
1803
0
{
1804
0
    vlc_player_SelectCategoryLanguage(player, SPU_ES, lang);
1805
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: content.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: control.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: notify.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: player.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: playlist.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: preparse.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: input.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: timer.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: track.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: title.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: aout.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: vout.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: osd.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: medialib.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: strings.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: vlm.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: vlm_event.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: vlmshell.c:vlc_player_SelectSubtitleLanguage
Unexecuted instantiation: libvlc-module.c:vlc_player_SelectSubtitleLanguage
1806
1807
/**
1808
 * Enable or disable a track category
1809
 *
1810
 * If a track category is disabled, the player won't select any tracks of this
1811
 * category automatically or via an user action (vlc_player_SelectTrack()).
1812
 *
1813
 * @param player locked player instance
1814
 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1815
 * @param enabled true to enable
1816
 */
1817
VLC_API void
1818
vlc_player_SetTrackCategoryEnabled(vlc_player_t *player,
1819
                                   enum es_format_category_e cat, bool enabled);
1820
1821
/**
1822
 * Check if a track category is enabled
1823
 *
1824
 * @param player locked player instance
1825
 * @param cat VIDEO_ES, AUDIO_ES or SPU_ES
1826
 */
1827
VLC_API bool
1828
vlc_player_IsTrackCategoryEnabled(vlc_player_t *player,
1829
                                  enum es_format_category_e cat);
1830
1831
/**
1832
 * Helper to enable or disable video tracks
1833
 */
1834
static inline void
1835
vlc_player_SetVideoEnabled(vlc_player_t *player, bool enabled)
1836
0
{
1837
0
    vlc_player_SetTrackCategoryEnabled(player, VIDEO_ES, enabled);
1838
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: content.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: control.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: notify.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: player.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: playlist.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: preparse.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: input.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: timer.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: track.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: title.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: aout.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: vout.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: osd.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: medialib.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: strings.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: vlm.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: vlm_event.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: vlmshell.c:vlc_player_SetVideoEnabled
Unexecuted instantiation: libvlc-module.c:vlc_player_SetVideoEnabled
1839
1840
/**
1841
 * Helper to check if video tracks are enabled
1842
 */
1843
static inline bool
1844
vlc_player_IsVideoEnabled(vlc_player_t *player)
1845
0
{
1846
0
    return vlc_player_IsTrackCategoryEnabled(player, VIDEO_ES);
1847
0
}
Unexecuted instantiation: libvlc.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: content.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: control.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: notify.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: player.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: playlist.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: preparse.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: input.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: timer.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: track.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: title.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: aout.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: vout.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: osd.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: medialib.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: strings.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: vlm.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: vlm_event.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: vlmshell.c:vlc_player_IsVideoEnabled
Unexecuted instantiation: libvlc-module.c:vlc_player_IsVideoEnabled
1848
1849
/**
1850
 * Helper to enable or disable audio tracks
1851
 */
1852
static inline void
1853
vlc_player_SetAudioEnabled(vlc_player_t *player, bool enabled)
1854
0
{
1855
0
    vlc_player_SetTrackCategoryEnabled(player, AUDIO_ES, enabled);
1856
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: content.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: control.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: notify.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: player.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: playlist.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: preparse.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: input.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: timer.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: track.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: title.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: aout.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: vout.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: osd.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: medialib.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: strings.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: vlm.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: vlm_event.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: vlmshell.c:vlc_player_SetAudioEnabled
Unexecuted instantiation: libvlc-module.c:vlc_player_SetAudioEnabled
1857
1858
/**
1859
 * Helper to check if audio tracks are enabled
1860
 */
1861
static inline bool
1862
vlc_player_IsAudioEnabled(vlc_player_t *player)
1863
0
{
1864
0
    return vlc_player_IsTrackCategoryEnabled(player, AUDIO_ES);
1865
0
}
Unexecuted instantiation: libvlc.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: content.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: control.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: notify.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: player.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: playlist.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: preparse.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: input.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: timer.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: track.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: title.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: aout.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: vout.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: osd.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: medialib.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: strings.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: vlm.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: vlm_event.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: vlmshell.c:vlc_player_IsAudioEnabled
Unexecuted instantiation: libvlc-module.c:vlc_player_IsAudioEnabled
1866
1867
/**
1868
 * Helper to enable or disable subtitle tracks
1869
 */
1870
static inline void
1871
vlc_player_SetSubtitleEnabled(vlc_player_t *player, bool enabled)
1872
0
{
1873
0
    vlc_player_SetTrackCategoryEnabled(player, SPU_ES, enabled);
1874
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: content.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: control.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: notify.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: player.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: playlist.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: preparse.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: input.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: timer.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: track.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: title.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: aout.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: vout.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: osd.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: medialib.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: strings.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: vlm.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: vlm_event.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: vlmshell.c:vlc_player_SetSubtitleEnabled
Unexecuted instantiation: libvlc-module.c:vlc_player_SetSubtitleEnabled
1875
1876
/**
1877
 * Helper to check if subtitle tracks are enabled
1878
 */
1879
static inline bool
1880
vlc_player_IsSubtitleEnabled(vlc_player_t *player)
1881
0
{
1882
0
    return vlc_player_IsTrackCategoryEnabled(player, SPU_ES);
1883
0
}
Unexecuted instantiation: libvlc.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: content.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: control.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: notify.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: player.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: playlist.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: preparse.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: input.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: timer.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: track.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: title.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: aout.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: vout.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: osd.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: medialib.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: strings.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: vlm.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: vlm_event.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: vlmshell.c:vlc_player_IsSubtitleEnabled
Unexecuted instantiation: libvlc-module.c:vlc_player_IsSubtitleEnabled
1884
1885
/**
1886
 * Helper to toggle subtitles
1887
 */
1888
static inline void
1889
vlc_player_ToggleSubtitle(vlc_player_t *player)
1890
0
{
1891
0
    bool enabled = !vlc_player_IsSubtitleEnabled(player);
1892
0
    vlc_player_SetSubtitleEnabled(player, enabled);
1893
0
}
Unexecuted instantiation: libvlc.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: content.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: control.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: notify.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: player.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: playlist.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: preparse.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: input.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: timer.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: track.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: title.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: aout.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: vout.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: osd.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: medialib.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: strings.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: vlm.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: vlm_event.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: vlmshell.c:vlc_player_ToggleSubtitle
Unexecuted instantiation: libvlc-module.c:vlc_player_ToggleSubtitle
1894
1895
/**
1896
 * Set the subtitle text scaling factor
1897
 *
1898
 * @note This function have an effect only if the subtitle track is a text type.
1899
 *
1900
 * @param player locked player instance
1901
 * @param scale factor in the range [10;500] (default: 100)
1902
 */
1903
VLC_API void
1904
vlc_player_SetSubtitleTextScale(vlc_player_t *player, unsigned scale);
1905
1906
/**
1907
 * Get the subtitle text scaling factor
1908
 *
1909
 * @param player locked player instance
1910
 * @return scale factor
1911
 */
1912
VLC_API unsigned
1913
vlc_player_GetSubtitleTextScale(vlc_player_t *player);
1914
1915
/** @} vlc_player__tracks */
1916
1917
/**
1918
 * @defgroup vlc_player__tracks_sync Tracks synchronisation (delay)
1919
 * @{
1920
 */
1921
1922
/**
1923
 * Get the delay of an ES category for the current media
1924
 *
1925
 * @see vlc_player_cbs.on_category_delay_changed
1926
 *
1927
 * @param player locked player instance
1928
 * @param cat AUDIO_ES or SPU_ES (VIDEO_ES not supported yet)
1929
 * @return a valid delay or 0
1930
 */
1931
VLC_API vlc_tick_t
1932
vlc_player_GetCategoryDelay(vlc_player_t *player, enum es_format_category_e cat);
1933
1934
/**
1935
 * Set the delay of one category for the current media
1936
 *
1937
 * @note A successful call will trigger the
1938
 * vlc_player_cbs.on_category_delay_changed event.
1939
 *
1940
 * @warning This has no effect on tracks where the delay was set by
1941
 * vlc_player_SetEsIdDelay()
1942
 *
1943
 * @param player locked player instance
1944
 * @param cat AUDIO_ES or SPU_ES (VIDEO_ES not supported yet)
1945
 * @param delay a valid time
1946
 * @param whence absolute or relative
1947
 * @return VLC_SUCCESS or VLC_EGENERIC if the category is not handled
1948
 */
1949
VLC_API int
1950
vlc_player_SetCategoryDelay(vlc_player_t *player, enum es_format_category_e cat,
1951
                            vlc_tick_t delay, enum vlc_player_whence whence);
1952
1953
/**
1954
 * Get the delay of a track
1955
 *
1956
 * @see vlc_player_cbs.on_track_delay_changed
1957
 *
1958
 * @param player locked player instance
1959
 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1960
 * vlc_player_GetTrackAt())
1961
 * @return a valid delay or INT64_MAX is no delay is set for this track
1962
 */
1963
VLC_API vlc_tick_t
1964
vlc_player_GetEsIdDelay(vlc_player_t *player, vlc_es_id_t *es_id);
1965
1966
/**
1967
 * Set the delay of one track
1968
 *
1969
 * @note A successful call will trigger the
1970
 * vlc_player_cbs.on_track_delay_changed event.
1971
 *
1972
 * @warning Setting the delay of one specific track will override previous and
1973
 * future changes of delay made by vlc_player_SetCategoryDelay()
1974
 *
1975
 * @param player locked player instance
1976
 * @param es_id an ES ID (retrieved from vlc_player_cbs.on_track_list_changed or
1977
 * vlc_player_GetTrackAt())
1978
 * @param delay a valid time or INT64_MAX to use default category delay
1979
 * @param whence absolute or relative
1980
 * @return VLC_SUCCESS or VLC_EGENERIC if the category of the es_id is not
1981
 * handled (VIDEO_ES not supported yet)
1982
 */
1983
VLC_API int
1984
vlc_player_SetEsIdDelay(vlc_player_t *player, vlc_es_id_t *es_id,
1985
                        vlc_tick_t delay, enum vlc_player_whence whence);
1986
1987
/**
1988
 * Helper to get the audio delay
1989
 */
1990
static inline vlc_tick_t
1991
vlc_player_GetAudioDelay(vlc_player_t *player)
1992
0
{
1993
0
    return vlc_player_GetCategoryDelay(player, AUDIO_ES);
1994
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetAudioDelay
Unexecuted instantiation: content.c:vlc_player_GetAudioDelay
Unexecuted instantiation: control.c:vlc_player_GetAudioDelay
Unexecuted instantiation: notify.c:vlc_player_GetAudioDelay
Unexecuted instantiation: player.c:vlc_player_GetAudioDelay
Unexecuted instantiation: playlist.c:vlc_player_GetAudioDelay
Unexecuted instantiation: preparse.c:vlc_player_GetAudioDelay
Unexecuted instantiation: input.c:vlc_player_GetAudioDelay
Unexecuted instantiation: timer.c:vlc_player_GetAudioDelay
Unexecuted instantiation: track.c:vlc_player_GetAudioDelay
Unexecuted instantiation: title.c:vlc_player_GetAudioDelay
Unexecuted instantiation: aout.c:vlc_player_GetAudioDelay
Unexecuted instantiation: vout.c:vlc_player_GetAudioDelay
Unexecuted instantiation: osd.c:vlc_player_GetAudioDelay
Unexecuted instantiation: medialib.c:vlc_player_GetAudioDelay
Unexecuted instantiation: strings.c:vlc_player_GetAudioDelay
Unexecuted instantiation: vlm.c:vlc_player_GetAudioDelay
Unexecuted instantiation: vlm_event.c:vlc_player_GetAudioDelay
Unexecuted instantiation: vlmshell.c:vlc_player_GetAudioDelay
Unexecuted instantiation: libvlc-module.c:vlc_player_GetAudioDelay
1995
1996
/**
1997
 * Helper to set the audio delay
1998
 */
1999
static inline void
2000
vlc_player_SetAudioDelay(vlc_player_t *player, vlc_tick_t delay,
2001
                         enum vlc_player_whence whence)
2002
2003
0
{
2004
0
    vlc_player_SetCategoryDelay(player, AUDIO_ES, delay, whence);
2005
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SetAudioDelay
Unexecuted instantiation: content.c:vlc_player_SetAudioDelay
Unexecuted instantiation: control.c:vlc_player_SetAudioDelay
Unexecuted instantiation: notify.c:vlc_player_SetAudioDelay
Unexecuted instantiation: player.c:vlc_player_SetAudioDelay
Unexecuted instantiation: playlist.c:vlc_player_SetAudioDelay
Unexecuted instantiation: preparse.c:vlc_player_SetAudioDelay
Unexecuted instantiation: input.c:vlc_player_SetAudioDelay
Unexecuted instantiation: timer.c:vlc_player_SetAudioDelay
Unexecuted instantiation: track.c:vlc_player_SetAudioDelay
Unexecuted instantiation: title.c:vlc_player_SetAudioDelay
Unexecuted instantiation: aout.c:vlc_player_SetAudioDelay
Unexecuted instantiation: vout.c:vlc_player_SetAudioDelay
Unexecuted instantiation: osd.c:vlc_player_SetAudioDelay
Unexecuted instantiation: medialib.c:vlc_player_SetAudioDelay
Unexecuted instantiation: strings.c:vlc_player_SetAudioDelay
Unexecuted instantiation: vlm.c:vlc_player_SetAudioDelay
Unexecuted instantiation: vlm_event.c:vlc_player_SetAudioDelay
Unexecuted instantiation: vlmshell.c:vlc_player_SetAudioDelay
Unexecuted instantiation: libvlc-module.c:vlc_player_SetAudioDelay
2006
2007
/**
2008
 * Helper to get the audio delay
2009
 */
2010
static inline vlc_tick_t
2011
vlc_player_GetVideoDelay(vlc_player_t *player)
2012
0
{
2013
0
    return vlc_player_GetCategoryDelay(player, VIDEO_ES);
2014
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetVideoDelay
Unexecuted instantiation: content.c:vlc_player_GetVideoDelay
Unexecuted instantiation: control.c:vlc_player_GetVideoDelay
Unexecuted instantiation: notify.c:vlc_player_GetVideoDelay
Unexecuted instantiation: player.c:vlc_player_GetVideoDelay
Unexecuted instantiation: playlist.c:vlc_player_GetVideoDelay
Unexecuted instantiation: preparse.c:vlc_player_GetVideoDelay
Unexecuted instantiation: input.c:vlc_player_GetVideoDelay
Unexecuted instantiation: timer.c:vlc_player_GetVideoDelay
Unexecuted instantiation: track.c:vlc_player_GetVideoDelay
Unexecuted instantiation: title.c:vlc_player_GetVideoDelay
Unexecuted instantiation: aout.c:vlc_player_GetVideoDelay
Unexecuted instantiation: vout.c:vlc_player_GetVideoDelay
Unexecuted instantiation: osd.c:vlc_player_GetVideoDelay
Unexecuted instantiation: medialib.c:vlc_player_GetVideoDelay
Unexecuted instantiation: strings.c:vlc_player_GetVideoDelay
Unexecuted instantiation: vlm.c:vlc_player_GetVideoDelay
Unexecuted instantiation: vlm_event.c:vlc_player_GetVideoDelay
Unexecuted instantiation: vlmshell.c:vlc_player_GetVideoDelay
Unexecuted instantiation: libvlc-module.c:vlc_player_GetVideoDelay
2015
2016
/**
2017
 * Helper to set the audio delay
2018
 */
2019
static inline void
2020
vlc_player_SetVideoDelay(vlc_player_t *player, vlc_tick_t delay,
2021
                         enum vlc_player_whence whence)
2022
2023
0
{
2024
0
    vlc_player_SetCategoryDelay(player, VIDEO_ES, delay, whence);
2025
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SetVideoDelay
Unexecuted instantiation: content.c:vlc_player_SetVideoDelay
Unexecuted instantiation: control.c:vlc_player_SetVideoDelay
Unexecuted instantiation: notify.c:vlc_player_SetVideoDelay
Unexecuted instantiation: player.c:vlc_player_SetVideoDelay
Unexecuted instantiation: playlist.c:vlc_player_SetVideoDelay
Unexecuted instantiation: preparse.c:vlc_player_SetVideoDelay
Unexecuted instantiation: input.c:vlc_player_SetVideoDelay
Unexecuted instantiation: timer.c:vlc_player_SetVideoDelay
Unexecuted instantiation: track.c:vlc_player_SetVideoDelay
Unexecuted instantiation: title.c:vlc_player_SetVideoDelay
Unexecuted instantiation: aout.c:vlc_player_SetVideoDelay
Unexecuted instantiation: vout.c:vlc_player_SetVideoDelay
Unexecuted instantiation: osd.c:vlc_player_SetVideoDelay
Unexecuted instantiation: medialib.c:vlc_player_SetVideoDelay
Unexecuted instantiation: strings.c:vlc_player_SetVideoDelay
Unexecuted instantiation: vlm.c:vlc_player_SetVideoDelay
Unexecuted instantiation: vlm_event.c:vlc_player_SetVideoDelay
Unexecuted instantiation: vlmshell.c:vlc_player_SetVideoDelay
Unexecuted instantiation: libvlc-module.c:vlc_player_SetVideoDelay
2026
2027
/**
2028
 * Helper to get the subtitle delay
2029
 */
2030
static inline vlc_tick_t
2031
vlc_player_GetSubtitleDelay(vlc_player_t *player)
2032
0
{
2033
0
    return vlc_player_GetCategoryDelay(player, SPU_ES);
2034
0
}
Unexecuted instantiation: libvlc.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: content.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: control.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: notify.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: player.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: playlist.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: preparse.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: input.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: timer.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: track.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: title.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: aout.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: vout.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: osd.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: medialib.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: strings.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: vlm.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: vlm_event.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: vlmshell.c:vlc_player_GetSubtitleDelay
Unexecuted instantiation: libvlc-module.c:vlc_player_GetSubtitleDelay
2035
2036
/**
2037
 * Helper to set the subtitle delay
2038
 */
2039
static inline void
2040
vlc_player_SetSubtitleDelay(vlc_player_t *player, vlc_tick_t delay,
2041
                            enum vlc_player_whence whence)
2042
0
{
2043
0
    vlc_player_SetCategoryDelay(player, SPU_ES, delay, whence);
2044
0
}
Unexecuted instantiation: libvlc.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: content.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: control.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: notify.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: player.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: playlist.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: preparse.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: input.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: timer.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: track.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: title.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: aout.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: vout.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: osd.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: medialib.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: strings.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: vlm.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: vlm_event.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: vlmshell.c:vlc_player_SetSubtitleDelay
Unexecuted instantiation: libvlc-module.c:vlc_player_SetSubtitleDelay
2045
2046
/**
2047
 * Set the associated subtitle FPS
2048
 *
2049
 * In order to correct the rate of the associated media according to this FPS
2050
 * and the media video FPS.
2051
 *
2052
 * @note A successful call will trigger the
2053
 * vlc_player_cbs.on_associated_subs_fps_changed event.
2054
 *
2055
 * @warning this function will change the rate of all external subtitle files
2056
 * associated with the current media.
2057
 *
2058
 * @param player locked player instance
2059
 * @param fps FPS of the subtitle file
2060
 */
2061
VLC_API void
2062
vlc_player_SetAssociatedSubsFPS(vlc_player_t *player, float fps);
2063
2064
/**
2065
 * Get the associated subtitle FPS
2066
 *
2067
 * @param player locked player instance
2068
 * @return fps
2069
 */
2070
VLC_API float
2071
vlc_player_GetAssociatedSubsFPS(vlc_player_t *player);
2072
2073
/** @} vlc_player__tracks_sync */
2074
2075
/**
2076
 * @defgroup vlc_player__teletext Teletext control
2077
 * @{
2078
 */
2079
2080
/**
2081
 * Check if the media has a teletext menu
2082
 *
2083
 * @see vlc_player_cbs.on_teletext_menu_changed
2084
 *
2085
 * @param player locked player instance
2086
 * @return true if the media has a teletext menu
2087
 */
2088
VLC_API bool
2089
vlc_player_HasTeletextMenu(vlc_player_t *player);
2090
2091
/**
2092
 * Enable or disable teletext
2093
 *
2094
 * This function has an effect only if the player has a teletext menu.
2095
 *
2096
 * @note A successful call will trigger the
2097
 * vlc_player_cbs.on_teletext_enabled_changed event.
2098
 *
2099
 * @param player locked player instance
2100
 * @param enabled true to enable
2101
 */
2102
VLC_API void
2103
vlc_player_SetTeletextEnabled(vlc_player_t *player, bool enabled);
2104
2105
/**
2106
 * Check if teletext is enabled
2107
 *
2108
 * @see vlc_player_cbs.on_teletext_enabled_changed
2109
 *
2110
 * @param player locked player instance
2111
 */
2112
VLC_API bool
2113
vlc_player_IsTeletextEnabled(vlc_player_t *player);
2114
2115
/**
2116
 * Select a teletext page or do an action from a key
2117
 *
2118
 * This function has an effect only if the player has a teletext menu.
2119
 *
2120
 * @note Page keys can be the following: @ref VLC_PLAYER_TELETEXT_KEY_RED,
2121
 * @ref VLC_PLAYER_TELETEXT_KEY_GREEN, @ref VLC_PLAYER_TELETEXT_KEY_YELLOW,
2122
 * @ref VLC_PLAYER_TELETEXT_KEY_BLUE or @ref VLC_PLAYER_TELETEXT_KEY_INDEX.
2123
2124
 * @note A successful call will trigger the
2125
 * vlc_player_cbs.on_teletext_page_changed event.
2126
 *
2127
 * @param player locked player instance
2128
 * @param page a page in the range ]0;888] or a valid key
2129
 */
2130
VLC_API void
2131
vlc_player_SelectTeletextPage(vlc_player_t *player, unsigned page);
2132
2133
/**
2134
 * Get the current teletext page
2135
 *
2136
 * @see vlc_player_cbs.on_teletext_page_changed
2137
 *
2138
 * @param player locked player instance
2139
 */
2140
VLC_API unsigned
2141
vlc_player_GetTeletextPage(vlc_player_t *player);
2142
2143
/**
2144
 * Enable or disable teletext transparency
2145
 *
2146
 * This function has an effect only if the player has a teletext menu.
2147
2148
 * @note A successful call will trigger the
2149
 * vlc_player_cbs.on_teletext_transparency_changed event.
2150
 *
2151
 * @param player locked player instance
2152
 * @param enabled true to enable
2153
 */
2154
VLC_API void
2155
vlc_player_SetTeletextTransparency(vlc_player_t *player, bool enabled);
2156
2157
/**
2158
 * Check if teletext is transparent
2159
 *
2160
 * @param player locked player instance
2161
 */
2162
VLC_API bool
2163
vlc_player_IsTeletextTransparent(vlc_player_t *player);
2164
2165
/** @} vlc_player__teletext */
2166
2167
/**
2168
 * @defgroup vlc_player__renderer External renderer control
2169
 * @{
2170
 */
2171
2172
/**
2173
 * Set the renderer
2174
 *
2175
 * Valid for the current media and all future ones.
2176
 *
2177
 * @note A successful call will trigger the vlc_player_cbs.on_renderer_changed
2178
 * event.
2179
 *
2180
 * @param player locked player instance
2181
 * @param renderer a valid renderer item or NULL (to disable it), the item will
2182
 * be held by the player
2183
 */
2184
VLC_API void
2185
vlc_player_SetRenderer(vlc_player_t *player, vlc_renderer_item_t *renderer);
2186
2187
/**
2188
 * Get the renderer
2189
 *
2190
 * @see vlc_player_cbs.on_renderer_changed
2191
 *
2192
 * @param player locked player instance
2193
 * @return the renderer item set by vlc_player_SetRenderer()
2194
 */
2195
VLC_API vlc_renderer_item_t *
2196
vlc_player_GetRenderer(vlc_player_t *player);
2197
2198
/** @} vlc_player__renderer */
2199
2200
/**
2201
 * @defgroup vlc_player__metadata Metadata callbacks
2202
 * @{
2203
 */
2204
2205
/**
2206
 * Player metadata listener opaque structure.
2207
 *
2208
 * This opaque structure is returned by vlc_player_AddMetadataListener() and
2209
 * can be used to remove the listener via
2210
 * vlc_player_RemoveMetadataListener().
2211
 */
2212
typedef struct vlc_player_metadata_listener_id vlc_player_metadata_listener_id;
2213
2214
/**
2215
 * Player metadata option
2216
 */
2217
enum vlc_player_metadata_option
2218
{
2219
    /**
2220
     * Ask for momentary loudness measurement
2221
     *
2222
     * Very low CPU usage.
2223
     * @see vlc_player_metadata_cbs.on_momentary_loudness_changed
2224
     */
2225
    VLC_PLAYER_METADATA_LOUDNESS_MOMENTARY,
2226
2227
    /**
2228
     * Ask for all loudness measurements
2229
     *
2230
     * High CPU usage.
2231
     * @see vlc_player_metadata_cbs.on_loudness_changed
2232
     */
2233
    VLC_PLAYER_METADATA_LOUDNESS_FULL,
2234
};
2235
2236
/**
2237
 * Player metadata callbacks
2238
 *
2239
 * Can be registered with vlc_player_AddMetadataListener().
2240
 *
2241
 * @warning To avoid deadlocks, users should never call vlc_player_t functions
2242
 * from these callbacks.
2243
 */
2244
union vlc_player_metadata_cbs
2245
{
2246
    /**
2247
     * Called when the momentary loudness measurement have changed
2248
     *
2249
     * @see VLC_PLAYER_METADATA_LOUDNESS_MOMEMTARY
2250
     *
2251
     * Only sent when audio is playing, approximately every 400ms (but can be
2252
     * higher, depending on the input sample size).
2253
     *
2254
     * @param date Absolute date of the measurement. It is most likely in the
2255
     * future (0 to 2seconds) depending on the audio output buffer size.
2256
     * @param momentary_loudness Momentary loudness
2257
     * @param data opaque pointer set by vlc_player_AddMetadataListener()
2258
     */
2259
    void (*on_momentary_loudness_changed)(vlc_tick_t date,
2260
                                          double momentary_loudness,
2261
                                          void *data);
2262
2263
    /**
2264
     * Called when loudness measurements have changed
2265
     *
2266
     * @see VLC_PLAYER_METADATA_LOUDNESS_FULL
2267
     *
2268
     * Only sent when audio is playing, approximately every 400ms (but can be
2269
     * higher, depending on the input sample size).
2270
     *
2271
     * @param date Absolute date of the measurement. It is most likely in the
2272
     * future (0 to 2seconds) depending on the audio output buffer size.
2273
     * @param loudness loudness measurement
2274
     * @param data opaque pointer set by vlc_player_AddMetadataListener()
2275
     */
2276
    void (*on_loudness_changed)(vlc_tick_t date,
2277
                                const struct vlc_audio_loudness *loudness,
2278
                                void *data);
2279
};
2280
2281
/**
2282
 * Add a metadata listener
2283
 *
2284
 * @note Every registered loudness meter need to be removed by the caller with
2285
 * vlc_player_RemoveMetadataListener().
2286
 *
2287
 * @param player locked player instance
2288
 * @param option select which metadata to listen
2289
 * @param cbs pointer to a vlc_player_metadata_cbs union, the
2290
 * structure must be valid during the lifetime of the player
2291
 * @param cbs_data opaque pointer used by the callbacks
2292
 * @return a valid listener id, or NULL in case of error (plugin missing)
2293
 */
2294
VLC_API vlc_player_metadata_listener_id *
2295
vlc_player_AddMetadataListener(vlc_player_t *player,
2296
                               enum vlc_player_metadata_option option,
2297
                               const union vlc_player_metadata_cbs *cbs,
2298
                               void *cbs_data);
2299
2300
/**
2301
 * Remove a metadata listener
2302
 *
2303
 * @param player player instance
2304
 * @param listener_id listener id returned by vlc_player_AddMetadataListener()
2305
 */
2306
VLC_API void
2307
vlc_player_RemoveMetadataListener(vlc_player_t *player,
2308
                                  vlc_player_metadata_listener_id *listener_id);
2309
2310
2311
/** @} vlc_player__metadata */
2312
2313
/**
2314
 * @defgroup vlc_player__aout Audio output control
2315
 * @{
2316
 */
2317
2318
/**
2319
 * Player aout listener opaque structure.
2320
 *
2321
 * This opaque structure is returned by vlc_player_aout_AddListener() and can
2322
 * be used to remove the listener via vlc_player_aout_RemoveListener().
2323
 */
2324
typedef struct vlc_player_aout_listener_id vlc_player_aout_listener_id;
2325
2326
/**
2327
 * Player aout callbacks
2328
 *
2329
 * Can be registered with vlc_player_aout_AddListener().
2330
 *
2331
 * @warning To avoid deadlocks, users should never call audio_output_t and
2332
 * vlc_player_t functions from these callbacks.
2333
 */
2334
struct vlc_player_aout_cbs
2335
{
2336
    /**
2337
     * Called when the volume has changed
2338
     *
2339
     * @see vlc_player_aout_SetVolume()
2340
     *
2341
     * @param aout the main aout of the player
2342
     * @param new_volume volume in the range [0;2.f]
2343
     * @param data opaque pointer set by vlc_player_aout_AddListener()
2344
     */
2345
    void (*on_volume_changed)(audio_output_t *aout, float new_volume,
2346
        void *data);
2347
2348
    /**
2349
     * Called when the mute state has changed
2350
     *
2351
     * @see vlc_player_aout_Mute()
2352
     *
2353
     * @param aout the main aout of the player
2354
     * @param new_mute true if muted
2355
     * @param data opaque pointer set by vlc_player_aout_AddListener()
2356
     */
2357
    void (*on_mute_changed)(audio_output_t *aout, bool new_muted,
2358
        void *data);
2359
2360
    /**
2361
     * Called when the audio device has changed
2362
     *
2363
     * @param aout the main aout of the player
2364
     * @param device the device name
2365
     * @param data opaque pointer set by vlc_player_aout_AddListener()
2366
     */
2367
    void (*on_device_changed)(audio_output_t *aout, const char *device,
2368
        void *data);
2369
};
2370
2371
/**
2372
 * Get the audio output
2373
 *
2374
 * @warning The returned pointer must be released with aout_Release().
2375
 *
2376
 * @param player player instance
2377
 * @return a valid audio_output_t * or NULL (if there is no aouts)
2378
 */
2379
VLC_API audio_output_t *
2380
vlc_player_aout_Hold(vlc_player_t *player);
2381
2382
/**
2383
 * Reset the main audio output
2384
 *
2385
 * @warning The main aout can only by reset if it is not currently used by any
2386
 * decoders (before any play).
2387
 *
2388
 * @param player player instance
2389
 */
2390
VLC_API void
2391
vlc_player_aout_Reset(vlc_player_t *player);
2392
2393
/**
2394
 * Add a listener callback for audio output events
2395
 *
2396
 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2397
 * functions.
2398
 * @note Every registered callbacks need to be removed by the caller with
2399
 * vlc_player_aout_RemoveListener().
2400
 *
2401
 * @param player player instance
2402
 * @param cbs pointer to a vlc_player_aout_cbs structure, the structure must be
2403
 * valid during the lifetime of the player
2404
 * @param cbs_data opaque pointer used by the callbacks
2405
 * @return a valid listener id, or NULL in case of allocation error
2406
 */
2407
VLC_API vlc_player_aout_listener_id *
2408
vlc_player_aout_AddListener(vlc_player_t *player,
2409
                            const struct vlc_player_aout_cbs *cbs,
2410
                            void *cbs_data);
2411
2412
/**
2413
 * Remove a aout listener callback
2414
 *
2415
 * @param player player instance
2416
 * @param listener_id listener id returned by vlc_player_aout_AddListener()
2417
 */
2418
VLC_API void
2419
vlc_player_aout_RemoveListener(vlc_player_t *player,
2420
                               vlc_player_aout_listener_id *listener_id);
2421
2422
/**
2423
 * Get the audio volume
2424
 *
2425
 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2426
 * functions.
2427
 *
2428
 * @see vlc_player_aout_cbs.on_volume_changed
2429
 *
2430
 * @param player player instance
2431
 * @return volume in the range [0;2.f] or -1.f if there is no audio outputs
2432
 * (independent of mute)
2433
 */
2434
VLC_API float
2435
vlc_player_aout_GetVolume(vlc_player_t *player);
2436
2437
/**
2438
 * Set the audio volume
2439
 *
2440
 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2441
 * functions.
2442
 *
2443
 * @note A successful call will trigger the
2444
 * vlc_player_vout_cbs.on_volume_changed event.
2445
 *
2446
 * @param player player instance
2447
 * @param volume volume in the range [0;2.f]
2448
 * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2449
 */
2450
VLC_API int
2451
vlc_player_aout_SetVolume(vlc_player_t *player, float volume);
2452
2453
/**
2454
 * Increment the audio volume
2455
 *
2456
 * @see vlc_player_aout_SetVolume()
2457
 *
2458
 * @param player player instance
2459
 * @param steps number of "volume-step"
2460
 * @param result pointer to store the resulting volume (can be NULL)
2461
 * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2462
 */
2463
VLC_API int
2464
vlc_player_aout_IncrementVolume(vlc_player_t *player, int steps, float *result);
2465
2466
/**
2467
 * Helper to decrement the audio volume
2468
 */
2469
static inline int
2470
vlc_player_aout_DecrementVolume(vlc_player_t *player, int steps, float *result)
2471
0
{
2472
0
    return vlc_player_aout_IncrementVolume(player, -steps, result);
2473
0
}
Unexecuted instantiation: libvlc.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: content.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: control.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: notify.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: player.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: playlist.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: preparse.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: input.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: timer.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: track.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: title.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: aout.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: vout.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: osd.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: medialib.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: strings.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: vlm.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: vlm_event.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: vlmshell.c:vlc_player_aout_DecrementVolume
Unexecuted instantiation: libvlc-module.c:vlc_player_aout_DecrementVolume
2474
2475
/**
2476
 * Check if the audio output is muted
2477
 *
2478
 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2479
 * functions.
2480
 *
2481
 * @see vlc_player_aout_cbs.on_mute_changed
2482
 *
2483
 * @param player player instance
2484
 * @return 0 if not muted, 1 if muted, -1 if there is no audio outputs
2485
 */
2486
VLC_API int
2487
vlc_player_aout_IsMuted(vlc_player_t *player);
2488
2489
/**
2490
 * Mute or unmute the audio output
2491
 *
2492
 * @note The player instance doesn't need to be locked for vlc_player_aout_*()
2493
 * functions.
2494
 *
2495
 * @note A successful call will trigger the
2496
 * vlc_player_aout_cbs.on_mute_changed event.
2497
 *
2498
 * @param player player instance
2499
 * @param mute true to mute
2500
 * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2501
 */
2502
VLC_API int
2503
vlc_player_aout_Mute(vlc_player_t *player, bool mute);
2504
2505
/**
2506
 * Helper to toggle the mute state
2507
 */
2508
static inline int
2509
vlc_player_aout_ToggleMute(vlc_player_t *player)
2510
0
{
2511
0
    return vlc_player_aout_Mute(player,
2512
0
                                !vlc_player_aout_IsMuted(player));
2513
0
}
Unexecuted instantiation: libvlc.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: content.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: control.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: notify.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: player.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: playlist.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: preparse.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: input.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: timer.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: track.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: title.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: aout.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: vout.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: osd.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: medialib.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: strings.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: vlm.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: vlm_event.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: vlmshell.c:vlc_player_aout_ToggleMute
Unexecuted instantiation: libvlc-module.c:vlc_player_aout_ToggleMute
2514
2515
/**
2516
 * Enable or disable an audio filter
2517
 *
2518
 * @see aout_EnableFilter()
2519
 *
2520
 * @return VLC_SUCCESS or VLC_EGENERIC if there is no audio outputs
2521
 */
2522
VLC_API int
2523
vlc_player_aout_EnableFilter(vlc_player_t *player, const char *name, bool add);
2524
2525
/** @} vlc_player__aout */
2526
2527
/**
2528
 * @defgroup vlc_player__vout Video output control
2529
 * @{
2530
 */
2531
2532
/**
2533
 * Player vout listener opaque structure.
2534
 *
2535
 * This opaque structure is returned by vlc_player_vout_AddListener() and can
2536
 * be used to remove the listener via vlc_player_vout_RemoveListener().
2537
 */
2538
typedef struct vlc_player_vout_listener_id vlc_player_vout_listener_id;
2539
2540
/**
2541
 * action of vlc_player_cbs.on_vout_changed callback
2542
 */
2543
enum vlc_player_vout_action
2544
{
2545
    VLC_PLAYER_VOUT_STARTED,
2546
    VLC_PLAYER_VOUT_STOPPED,
2547
};
2548
2549
/**
2550
 * Player vout callbacks
2551
 *
2552
 * Can be registered with vlc_player_vout_AddListener().
2553
 *
2554
 * @note The state changed from the callbacks can be either applied on the
2555
 * player (and all future video outputs), or on a specified video output. The
2556
 * state is applied on the player when the vout argument is NULL.
2557
 *
2558
 * @warning To avoid deadlocks, users should never call vout_thread_t and
2559
 * vlc_player_t functions from these callbacks.
2560
 */
2561
struct vlc_player_vout_cbs
2562
{
2563
    /**
2564
     * Called when the player and/or vout fullscreen state has changed
2565
     *
2566
     * @see vlc_player_vout_SetFullscreen()
2567
     *
2568
     * @param vout cf. vlc_player_vout_cbs note
2569
     * @param enabled true when fullscreen is enabled
2570
     * @param data opaque pointer set by vlc_player_vout_AddListener()
2571
     */
2572
    void (*on_fullscreen_changed)(vout_thread_t *vout, bool enabled,
2573
        void *data);
2574
2575
    /**
2576
     * Called when the player and/or vout wallpaper mode has changed
2577
     *
2578
     * @see vlc_player_vout_SetWallpaperModeEnabled()
2579
     *
2580
     * @param vout cf. vlc_player_vout_cbs note
2581
     * @param enabled true when wallpaper mode is enabled
2582
     * @param data opaque pointer set by vlc_player_vout_AddListener()
2583
     */
2584
    void (*on_wallpaper_mode_changed)(vout_thread_t *vout, bool enabled,
2585
        void *data);
2586
};
2587
2588
2589
/**
2590
 * Get and hold the main video output
2591
 *
2592
 * @warning the returned vout_thread_t * must be released with vout_Release().
2593
 * @see vlc_players_cbs.on_vout_changed
2594
 *
2595
 * @note The player is guaranteed to always hold one valid vout. Only vout
2596
 * variables can be changed from this instance. The vout returned before
2597
 * playback is not necessarily the same one that will be used for playback.
2598
 *
2599
 * @param player player instance
2600
 * @return a valid vout_thread_t * or NULL, cf. warning
2601
 */
2602
VLC_API vout_thread_t *
2603
vlc_player_vout_Hold(vlc_player_t *player);
2604
2605
/**
2606
 * Get and hold the list of video output
2607
 *
2608
 * @warning All vout_thread_t * element of the array must be released with
2609
 * vout_Release(). The returned array must be freed.
2610
 *
2611
 * @see vlc_players_cbs.on_vout_changed
2612
 *
2613
 * @param player player instance
2614
 * @param count valid pointer to store the array count
2615
 * @return a array of vout_thread_t * or NULL, cf. warning
2616
 */
2617
VLC_API vout_thread_t **
2618
vlc_player_vout_HoldAll(vlc_player_t *player, size_t *count);
2619
2620
/**
2621
 * Add a listener callback for video output events
2622
 *
2623
 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2624
 * functions.
2625
 * @note Every registered callbacks need to be removed by the caller with
2626
 * vlc_player_vout_RemoveListener().
2627
 *
2628
 * @param player player instance
2629
 * @param cbs pointer to a vlc_player_vout_cbs structure, the structure must be
2630
 * valid during the lifetime of the player
2631
 * @param cbs_data opaque pointer used by the callbacks
2632
 * @return a valid listener id, or NULL in case of allocation error
2633
 */
2634
VLC_API vlc_player_vout_listener_id *
2635
vlc_player_vout_AddListener(vlc_player_t *player,
2636
                            const struct vlc_player_vout_cbs *cbs,
2637
                            void *cbs_data);
2638
2639
/**
2640
 * Remove a vout listener callback
2641
 *
2642
 * @param player player instance
2643
 * @param listener_id listener id returned by vlc_player_vout_AddListener()
2644
 */
2645
VLC_API void
2646
vlc_player_vout_RemoveListener(vlc_player_t *player,
2647
                               vlc_player_vout_listener_id *listener_id);
2648
2649
/**
2650
 * Check if the player is fullscreen
2651
 *
2652
 * @warning The fullscreen state of the player and all vouts can be different.
2653
 *
2654
 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2655
 * functions.
2656
 *
2657
 * @see vlc_player_vout_cbs.on_fullscreen_changed
2658
 *
2659
 * @param player player instance
2660
 * @return true if the player is fullscreen
2661
 */
2662
VLC_API bool
2663
vlc_player_vout_IsFullscreen(vlc_player_t *player);
2664
2665
/**
2666
 * Enable or disable the player fullscreen state
2667
 *
2668
 * This will have an effect on all current and future vouts.
2669
 *
2670
 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2671
 * functions.
2672
 * @note A successful call will trigger the
2673
 * vlc_player_vout_cbs.on_fullscreen_changed event.
2674
 *
2675
 * @param player player instance
2676
 * @param enabled true to enable fullscreen
2677
 */
2678
VLC_API void
2679
vlc_player_vout_SetFullscreen(vlc_player_t *player, bool enabled);
2680
2681
/**
2682
 * Helper to toggle the player fullscreen state
2683
 */
2684
static inline void
2685
vlc_player_vout_ToggleFullscreen(vlc_player_t *player)
2686
0
{
2687
0
    vlc_player_vout_SetFullscreen(player,
2688
0
                                  !vlc_player_vout_IsFullscreen(player));
2689
0
}
Unexecuted instantiation: libvlc.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: content.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: control.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: notify.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: player.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: playlist.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: preparse.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: input.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: timer.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: track.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: title.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: aout.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: vout.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: osd.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: medialib.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: strings.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: vlm.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: vlm_event.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: vlmshell.c:vlc_player_vout_ToggleFullscreen
Unexecuted instantiation: libvlc-module.c:vlc_player_vout_ToggleFullscreen
2690
2691
/**
2692
 * Check if the player has wallpaper-mode enaled
2693
 *
2694
 * @warning The wallpaper-mode state of the player and all vouts can be
2695
 * different.
2696
 *
2697
 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2698
 * functions.
2699
 *
2700
 * @see vlc_player_vout_cbs.on_wallpaper_mode_changed
2701
 *
2702
 * @param player player instance
2703
 * @return true if the player is fullscreen
2704
 */
2705
VLC_API bool
2706
vlc_player_vout_IsWallpaperModeEnabled(vlc_player_t *player);
2707
2708
/**
2709
 * Enable or disable the player wallpaper-mode
2710
 *
2711
 * This will have an effect on all current and future vouts.
2712
 *
2713
 * @note The player instance doesn't need to be locked for vlc_player_vout_*()
2714
 * functions.
2715
 * @note A successful call will trigger the
2716
 * vlc_player_vout_cbs.on_wallpaper_mode_changed event.
2717
 *
2718
 * @param player player instance
2719
 * @param enabled true to enable wallpaper-mode
2720
 */
2721
VLC_API void
2722
vlc_player_vout_SetWallpaperModeEnabled(vlc_player_t *player, bool enabled);
2723
2724
/**
2725
 * Helper to toggle the player wallpaper-mode state
2726
 */
2727
static inline void
2728
vlc_player_vout_ToggleWallpaperMode(vlc_player_t *player)
2729
0
{
2730
0
    vlc_player_vout_SetWallpaperModeEnabled(player,
2731
0
        !vlc_player_vout_IsWallpaperModeEnabled(player));
2732
0
}
Unexecuted instantiation: libvlc.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: content.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: control.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: notify.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: player.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: playlist.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: preparse.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: input.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: timer.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: track.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: title.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: aout.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: vout.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: osd.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: medialib.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: strings.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: vlm.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: vlm_event.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: vlmshell.c:vlc_player_vout_ToggleWallpaperMode
Unexecuted instantiation: libvlc-module.c:vlc_player_vout_ToggleWallpaperMode
2733
2734
/**
2735
 * Take a snapshot on all vouts
2736
 *
2737
 * @param player player instance
2738
 */
2739
VLC_API void
2740
vlc_player_vout_Snapshot(vlc_player_t *player);
2741
2742
/**
2743
 * Display an OSD message on all vouts
2744
 *
2745
 * @param player player instance
2746
 * @param fmt format string
2747
 */
2748
VLC_API void
2749
vlc_player_osd_Message(vlc_player_t *player, const char *fmt, ...);
2750
2751
/** @} vlc_player__vout */
2752
2753
/**
2754
 * @defgroup vlc_player__events Player events
2755
 * @{
2756
 */
2757
2758
/**
2759
 * Player listener opaque structure.
2760
 *
2761
 * This opaque structure is returned by vlc_player_AddListener() and can be
2762
 * used to remove the listener via vlc_player_RemoveListener().
2763
 */
2764
typedef struct vlc_player_listener_id vlc_player_listener_id;
2765
2766
/**
2767
 * Action of vlc_player_cbs.on_track_list_changed,
2768
 * vlc_player_cbs.on_program_list_changed callbacks
2769
 */
2770
enum vlc_player_list_action
2771
{
2772
    VLC_PLAYER_LIST_ADDED,
2773
    VLC_PLAYER_LIST_REMOVED,
2774
    VLC_PLAYER_LIST_UPDATED,
2775
};
2776
2777
/**
2778
 * Player callbacks
2779
 *
2780
 * Can be registered with vlc_player_AddListener().
2781
 *
2782
 * All callbacks are called with the player locked (cf. vlc_player_Lock()) and
2783
 * from any threads (and even synchronously from a vlc_player function in some
2784
 * cases). It is safe to call any vlc_player functions from these callbacks
2785
 * except vlc_player_Delete().
2786
 *
2787
 * @warning To avoid deadlocks, users should never call vlc_player functions
2788
 * with an external mutex locked and lock this same mutex from a player
2789
 * callback.
2790
 */
2791
struct vlc_player_cbs
2792
{
2793
    /**
2794
     * Called when the current media has changed
2795
     *
2796
     * @note This can be called from the PLAYING state (when the player plays
2797
     * the next media internally) or from the STOPPED state (from
2798
     * vlc_player_SetCurrentMedia() or from an internal transition).
2799
     *
2800
     * The user could set the next media via vlc_player_SetNextMedia() from
2801
     * the current callback or anytime before the current media is stopped.
2802
2803
     * @see vlc_player_SetCurrentMedia()
2804
     *
2805
     * @param player locked player instance
2806
     * @param new_media new media currently played or NULL (when there is no
2807
     * more media to play)
2808
     * @param data opaque pointer set by vlc_player_AddListener()
2809
     */
2810
    void (*on_current_media_changed)(vlc_player_t *player,
2811
        input_item_t *new_media, void *data);
2812
2813
    /**
2814
     * Called when the player state has changed
2815
     *
2816
     * @see vlc_player_state
2817
     *
2818
     * @param player locked player instance
2819
     * @param new_state new player state
2820
     * @param data opaque pointer set by vlc_player_AddListener()
2821
     */
2822
    void (*on_state_changed)(vlc_player_t *player,
2823
        enum vlc_player_state new_state, void *data);
2824
2825
    /**
2826
     * Called when a media triggered an error
2827
     *
2828
     * Can be called from any states. When it happens the player will stop
2829
     * itself. It is safe to play an other media or event restart the player
2830
     * (This will reset the error state).
2831
     *
2832
     * @param player locked player instance
2833
     * @param error player error
2834
     * @param data opaque pointer set by vlc_player_AddListener()
2835
     */
2836
    void (*on_error_changed)(vlc_player_t *player,
2837
        enum vlc_player_error error, void *data);
2838
2839
    /**
2840
     * Called when the player buffering (or cache) has changed
2841
     *
2842
     * This event is always called with the 0 and 1 values before a playback
2843
     * (in case of success).  Values in between depends on the media type.
2844
     *
2845
     * @param player locked player instance
2846
     * @param new_buffering buffering in the range [0:1]
2847
     * @param data opaque pointer set by vlc_player_AddListener()
2848
     */
2849
    void (*on_buffering_changed)(vlc_player_t *player,
2850
        float new_buffering, void *data);
2851
2852
    /**
2853
     * Called when the player rate has changed
2854
     *
2855
     * Triggered by vlc_player_ChangeRate(), not sent when the media starts
2856
     * with the default rate (1.f)
2857
     *
2858
     * @param player locked player instance
2859
     * @param new_rate player
2860
     * @param data opaque pointer set by vlc_player_AddListener()
2861
     */
2862
    void (*on_rate_changed)(vlc_player_t *player,
2863
        float new_rate, void *data);
2864
2865
    /**
2866
     * Called when the media capabilities has changed
2867
     *
2868
     * Always called when the media is opening or stopping.
2869
     * Can be called during playback.
2870
     *
2871
     * @param player locked player instance
2872
     * @param old_caps old player capabilities
2873
     * @param new_caps new player capabilities
2874
     * @param data opaque pointer set by vlc_player_AddListener()
2875
     */
2876
    void (*on_capabilities_changed)(vlc_player_t *player,
2877
        int old_caps, int new_caps, void *data);
2878
2879
    /**
2880
     * Called when the player position has changed
2881
     *
2882
     * @note A started and playing media doesn't have necessarily a valid time.
2883
     *
2884
     * @param player locked player instance
2885
     * @param new_time a valid time or VLC_TICK_INVALID
2886
     * @param new_pos a valid position
2887
     * @param data opaque pointer set by vlc_player_AddListener()
2888
     */
2889
    void (*on_position_changed)(vlc_player_t *player,
2890
        vlc_tick_t new_time, double new_pos, void *data);
2891
2892
    /**
2893
     * Called when the media length has changed
2894
     *
2895
     * May be called when the media is opening or during playback.
2896
     *
2897
     * @note A started and playing media doesn't have necessarily a valid length.
2898
     *
2899
     * @param player locked player instance
2900
     * @param new_length a valid time or VLC_TICK_INVALID
2901
     * @param data opaque pointer set by vlc_player_AddListener()
2902
     */
2903
    void (*on_length_changed)(vlc_player_t *player,
2904
        vlc_tick_t new_length, void *data);
2905
2906
    /**
2907
     * Called when a track is added, removed, or updated
2908
     *
2909
     * @note The track is only valid from this callback context. Users should
2910
     * duplicate this track via vlc_player_track_Dup() if they want to use it
2911
     * from an other context.
2912
     *
2913
     * @param player locked player instance
2914
     * @param action added, removed or updated
2915
     * @param track valid track
2916
     * @param data opaque pointer set by vlc_player_AddListener()
2917
     */
2918
    void (*on_track_list_changed)(vlc_player_t *player,
2919
        enum vlc_player_list_action action,
2920
        const struct vlc_player_track *track, void *data);
2921
2922
    /**
2923
     * Called when a new track is selected and/or unselected
2924
     *
2925
     * @note This event can be called with both unselected_id and selected_id
2926
     * valid. This mean that a new track is replacing the old one.
2927
     *
2928
     * @param player locked player instance
2929
     * @param unselected_id valid track id or NULL (when nothing is unselected)
2930
     * @param selected_id valid track id or NULL (when nothing is selected)
2931
     * @param data opaque pointer set by vlc_player_AddListener()
2932
     */
2933
    void (*on_track_selection_changed)(vlc_player_t *player,
2934
        vlc_es_id_t *unselected_id, vlc_es_id_t *selected_id, void *data);
2935
2936
    /**
2937
     * Called when a track delay has changed
2938
     *
2939
     * @param player locked player instance
2940
     * @param es_id valid track id
2941
     * @param delay a valid delay or INT64_MAX if the delay of this track is
2942
     * canceled
2943
     */
2944
    void (*on_track_delay_changed)(vlc_player_t *player,
2945
        vlc_es_id_t *es_id, vlc_tick_t delay, void *data);
2946
2947
    /**
2948
     * Called when a new program is added, removed or updated
2949
     *
2950
     * @note The program is only valid from this callback context. Users should
2951
     * duplicate this program via vlc_player_program_Dup() if they want to use
2952
     * it from an other context.
2953
     *
2954
     * @param player locked player instance
2955
     * @param action added, removed or updated
2956
     * @param prgm valid program
2957
     * @param data opaque pointer set by vlc_player_AddListener()
2958
     */
2959
    void (*on_program_list_changed)(vlc_player_t *player,
2960
        enum vlc_player_list_action action,
2961
        const struct vlc_player_program *prgm, void *data);
2962
2963
    /**
2964
     * Called when a new program is selected and/or unselected
2965
     *
2966
     * @note This event can be called with both unselected_id and selected_id
2967
     * valid. This mean that a new program is replacing the old one.
2968
     *
2969
     * @param player locked player instance
2970
     * @param unselected_id valid program id or -1 (when nothing is unselected)
2971
     * @param selected_id valid program id or -1 (when nothing is selected)
2972
     * @param data opaque pointer set by vlc_player_AddListener()
2973
     */
2974
    void (*on_program_selection_changed)(vlc_player_t *player,
2975
        int unselected_id, int selected_id, void *data);
2976
2977
    /**
2978
     * Called when the media titles has changed
2979
     *
2980
     * This event is not called when the opening media doesn't have any titles.
2981
     * This title list and all its elements are constant. If an element is to
2982
     * be updated, a new list will be sent from this callback.
2983
     *
2984
     * @note Users should hold this list with vlc_player_title_list_Hold() if
2985
     * they want to use it from an other context.
2986
     *
2987
     * @param player locked player instance
2988
     * @param titles valid title list or NULL
2989
     * @param data opaque pointer set by vlc_player_AddListener()
2990
     */
2991
    void (*on_titles_changed)(vlc_player_t *player,
2992
        vlc_player_title_list *titles, void *data);
2993
2994
    /**
2995
     * Called when a new title is selected
2996
     *
2997
     * There are no events when a title is unselected. Titles are automatically
2998
     * unselected when the title list changes. Titles and indexes are always
2999
     * valid inside the vlc_player_title_list sent by
3000
     * vlc_player_cbs.on_titles_changed.
3001
     *
3002
     * @param player locked player instance
3003
     * @param new_title new selected title
3004
     * @param new_idx index of this title
3005
     * @param data opaque pointer set by vlc_player_AddListener()
3006
     */
3007
    void (*on_title_selection_changed)(vlc_player_t *player,
3008
        const struct vlc_player_title *new_title, size_t new_idx, void *data);
3009
3010
    /**
3011
     * Called when a new chapter is selected
3012
     *
3013
     * There are no events when a chapter is unselected. Chapters are
3014
     * automatically unselected when the title list changes. Titles, chapters
3015
     * and indexes are always valid inside the vlc_player_title_list sent by
3016
     * vlc_player_cbs.on_titles_changed.
3017
     *
3018
     * @param player locked player instance
3019
     * @param title selected title
3020
     * @param title_idx selected title index
3021
     * @param chapter new selected chapter
3022
     * @param chapter_idx new selected chapter index
3023
     * @param data opaque pointer set by vlc_player_AddListener()
3024
     */
3025
    void (*on_chapter_selection_changed)(vlc_player_t *player,
3026
        const struct vlc_player_title *title, size_t title_idx,
3027
        const struct vlc_player_chapter *new_chapter, size_t new_chapter_idx,
3028
        void *data);
3029
3030
    /**
3031
     * Called when the media has a teletext menu
3032
     *
3033
     * @param player locked player instance
3034
     * @param has_teletext_menu true if the media has a teletext menu
3035
     * @param data opaque pointer set by vlc_player_AddListener()
3036
     */
3037
    void (*on_teletext_menu_changed)(vlc_player_t *player,
3038
        bool has_teletext_menu, void *data);
3039
3040
    /**
3041
     * Called when teletext is enabled or disabled
3042
     *
3043
     * @see vlc_player_SetTeletextEnabled()
3044
     *
3045
     * @param player locked player instance
3046
     * @param enabled true if teletext is enabled
3047
     * @param data opaque pointer set by vlc_player_AddListener()
3048
     */
3049
    void (*on_teletext_enabled_changed)(vlc_player_t *player,
3050
        bool enabled, void *data);
3051
3052
    /**
3053
     * Called when the teletext page has changed
3054
     *
3055
     * @see vlc_player_SelectTeletextPage()
3056
     *
3057
     * @param player locked player instance
3058
     * @param new_page page in the range ]0;888]
3059
     * @param data opaque pointer set by vlc_player_AddListener()
3060
     */
3061
    void (*on_teletext_page_changed)(vlc_player_t *player,
3062
        unsigned new_page, void *data);
3063
3064
    /**
3065
     * Called when the teletext transparency has changed
3066
     *
3067
     * @see vlc_player_SetTeletextTransparency()
3068
     *
3069
     * @param player locked player instance
3070
     * @param enabled true is the teletext overlay is transparent
3071
     * @param data opaque pointer set by vlc_player_AddListener()
3072
     */
3073
    void (*on_teletext_transparency_changed)(vlc_player_t *player,
3074
        bool enabled, void *data);
3075
3076
    /**
3077
     * Called when the player category delay has changed for the current media
3078
     *
3079
     * @see vlc_player_SetCategoryDelay()
3080
     *
3081
     * @param player locked player instance
3082
     * @param cat AUDIO_ES or SPU_ES
3083
     * @param new_delay audio delay
3084
     * @param data opaque pointer set by vlc_player_AddListener()
3085
     */
3086
    void (*on_category_delay_changed)(vlc_player_t *player,
3087
         enum es_format_category_e cat, vlc_tick_t new_delay, void *data);
3088
3089
    /**
3090
     * Called when associated subtitle has changed
3091
     *
3092
     * @see vlc_player_SetAssociatedSubsFPS()
3093
     *
3094
     * @param player locked player instance
3095
     * @param sub_fps subtitle fps
3096
     * @param data opaque pointer set by vlc_player_AddListener()
3097
     */
3098
    void (*on_associated_subs_fps_changed)(vlc_player_t *player,
3099
        float subs_fps, void *data);
3100
3101
    /**
3102
     * Called when a new renderer item is set
3103
     *
3104
     * @see vlc_player_SetRenderer()
3105
     *
3106
     * @param player locked player instance
3107
     * @param new_item a valid renderer item or NULL (if unset)
3108
     * @param data opaque pointer set by vlc_player_AddListener()
3109
     */
3110
    void (*on_renderer_changed)(vlc_player_t *player,
3111
        vlc_renderer_item_t *new_item, void *data);
3112
3113
    /**
3114
     * Called when the player recording state has changed
3115
     *
3116
     * @see vlc_player_SetRecordingEnabled()
3117
     *
3118
     * @param player locked player instance
3119
     * @param recording true if recording is enabled
3120
     * @param data opaque pointer set by vlc_player_AddListener()
3121
     */
3122
    void (*on_recording_changed)(vlc_player_t *player,
3123
        bool recording, void *data);
3124
3125
    /**
3126
     * Called when the media signal has changed
3127
     *
3128
     * @param player locked player instance
3129
     * @param new_quality signal quality
3130
     * @param new_strength signal strength,
3131
     * @param data opaque pointer set by vlc_player_AddListener()
3132
     */
3133
    void (*on_signal_changed)(vlc_player_t *player,
3134
        float quality, float strength, void *data);
3135
3136
    /**
3137
     * Called when the player has new statisics
3138
     *
3139
     * @note The stats structure is only valid from this callback context. It
3140
     * can be copied in order to use it from an other context.
3141
     *
3142
     * @param player locked player instance
3143
     * @param stats valid stats, only valid from this context
3144
     * @param data opaque pointer set by vlc_player_AddListener()
3145
     */
3146
    void (*on_statistics_changed)(vlc_player_t *player,
3147
        const struct input_stats_t *stats, void *data);
3148
3149
    /**
3150
     * Called when the A to B loop has changed
3151
     *
3152
     * @see vlc_player_SetAtoBLoop()
3153
     *
3154
     * @param player locked player instance
3155
     * @param state A, when only A is set, B when both A and B are set, None by
3156
     * default
3157
     * @param time valid time or VLC_TICK_INVALID of the current state
3158
     * @param pos valid pos of the current state
3159
     * @param data opaque pointer set by vlc_player_AddListener()
3160
     */
3161
    void (*on_atobloop_changed)(vlc_player_t *player,
3162
        enum vlc_player_abloop new_state, vlc_tick_t time, double pos,
3163
        void *data);
3164
3165
    /**
3166
     * Called when the media meta and/or info has changed
3167
     *
3168
     * @param player locked player instance
3169
     * @param media current media
3170
     * @param data opaque pointer set by vlc_player_AddListener()
3171
     */
3172
    void (*on_media_meta_changed)(vlc_player_t *player,
3173
        input_item_t *media, void *data);
3174
3175
    /**
3176
     * Called when media epg has changed
3177
     *
3178
     * @param player locked player instance
3179
     * @param media current media
3180
     * @param data opaque pointer set by vlc_player_AddListener()
3181
     */
3182
    void (*on_media_epg_changed)(vlc_player_t *player,
3183
        input_item_t *media, void *data);
3184
3185
    /**
3186
     * Called when the media has new subitems
3187
     *
3188
     * @param player locked player instance
3189
     * @param media current media
3190
     * @param new_subitems node representing all media subitems
3191
     * @param data opaque pointer set by vlc_player_AddListener()
3192
     */
3193
    void (*on_media_subitems_changed)(vlc_player_t *player,
3194
        input_item_t *media, const input_item_node_t *new_subitems, void *data);
3195
3196
    /**
3197
     * Called when new attachments are added to the media
3198
     *
3199
     * @note It can be called several times for one parse request. The array
3200
     * contains only new elements after a second call.
3201
     *
3202
     * @param player locked player instance
3203
     * @param media current media
3204
     * @param array valid array containing new elements, should only be used
3205
     * within the callback. One and all elements can be held and stored on a
3206
     * new variable or new array.
3207
     * @param count number of elements in the array
3208
     * @param data opaque pointer set by vlc_player_AddListener()
3209
     */
3210
    void (*on_media_attachments_added)(vlc_player_t *player,
3211
        input_item_t *media, input_attachment_t *const *array, size_t count,
3212
        void *data);
3213
3214
    /**
3215
     * Called when a vout is started or stopped
3216
     *
3217
     * @note In case, several media with only one video track are played
3218
     * successively, the same vout instance will be started and stopped several
3219
     * time.
3220
     *
3221
     * @param player locked player instance
3222
     * @param action started or stopped
3223
     * @param vout vout (can't be NULL)
3224
     * @param order vout order
3225
     * @param es_id the ES id associated with this vout
3226
     * @param data opaque pointer set by vlc_player_AddListener()
3227
     */
3228
    void (*on_vout_changed)(vlc_player_t *player,
3229
        enum vlc_player_vout_action action, vout_thread_t *vout,
3230
        enum vlc_vout_order order, vlc_es_id_t *es_id, void *data);
3231
3232
    /**
3233
     * Called when the player is corked
3234
     *
3235
     * The player can be corked when the audio output loose focus or when a
3236
     * renderer was paused from the outside.
3237
     *
3238
     * @note called only if pause on cork was not set to true (by
3239
     * vlc_player_SetPauseOnCork())
3240
     * @note a cork_count higher than 0 means the player is corked. In that
3241
     * case, the user should pause the player and release all external resource
3242
     * needed by the player. A value higher than 1 mean that the player was
3243
     * corked more than one time (for different reasons). A value of 0 means
3244
     * the player is no longer corked. In that case, the user could resume the
3245
     * player.
3246
     *
3247
     * @param player locked player instance
3248
     * @param cork_count 0 for uncorked, > 0 for corked
3249
     * @param data opaque pointer set by vlc_player_AddListener()
3250
     */
3251
    void (*on_cork_changed)(vlc_player_t *player, unsigned cork_count,
3252
                            void *data);
3253
3254
    /**
3255
     * Called to query the user about restoring the previous playback position
3256
     *
3257
     * If this callback isn't provided, the user won't be asked to restore
3258
     * the previous playback position, effectively causing
3259
     * VLC_PLAYER_RESTORE_PLAYBACK_POS_ASK to be handled as
3260
     * VLC_PLAYER_RESTORE_PLAYBACK_POS_NEVER
3261
     *
3262
     * The implementation can react to this callback by calling
3263
     * vlc_player_RestorePlaybackPos(), or by discarding the event.
3264
     *
3265
     * @param player locked player instance
3266
     * @param data opaque pointer set by vlc_player_AddListener()
3267
     */
3268
    void (*on_playback_restore_queried)(vlc_player_t *player, void *data);
3269
3270
    /**
3271
     * Called when the player will stop the current media.
3272
     *
3273
     * @note This can be called from the PLAYING state, before the
3274
     * player requests the next media, or from the STOPPING state, ie.
3275
     * when the player is stopping.
3276
     *
3277
     * @see vlc_player_SetCurrentMedia()
3278
     * @see vlc_player_Stop()
3279
     *
3280
     * @param player locked player instance
3281
     * @param prev_media media currently stopping
3282
     * @param data opaque pointer set by vlc_player_AddListener()
3283
     */
3284
    void (*on_stopping_current_media)(vlc_player_t *player,
3285
            input_item_t *current_media, void *data);
3286
};
3287
3288
/**
3289
 * Add a listener callback
3290
 *
3291
 * @note Every registered callbacks need to be removed by the caller with
3292
 * vlc_player_RemoveListener().
3293
 *
3294
 * @param player locked player instance
3295
 * @param cbs pointer to a vlc_player_cbs structure, the structure must be
3296
 * valid during the lifetime of the player
3297
 * @param cbs_data opaque pointer used by the callbacks
3298
 * @return a valid listener id, or NULL in case of allocation error
3299
 */
3300
VLC_API vlc_player_listener_id *
3301
vlc_player_AddListener(vlc_player_t *player,
3302
                       const struct vlc_player_cbs *cbs, void *cbs_data);
3303
3304
/**
3305
 * Remove a listener callback
3306
 *
3307
 * @param player locked player instance
3308
 * @param listener_id listener id returned by vlc_player_AddListener()
3309
 */
3310
VLC_API void
3311
vlc_player_RemoveListener(vlc_player_t *player,
3312
                          vlc_player_listener_id *listener_id);
3313
3314
/** @} vlc_player__events */
3315
3316
/**
3317
 * @defgroup vlc_player__timer Player timer
3318
 * @{
3319
 */
3320
3321
/**
3322
 * Player timer opaque structure.
3323
 */
3324
typedef struct vlc_player_timer_id vlc_player_timer_id;
3325
3326
/**
3327
 * Player timer point
3328
 *
3329
 * @see vlc_player_timer_cbs.on_update
3330
 */
3331
struct vlc_player_timer_point
3332
{
3333
    /** Position in the range [0.0f;1.0] */
3334
    double position;
3335
    /** Rate of the player */
3336
    double rate;
3337
    /** Valid time >= VLC_TICK_0 or VLC_TICK_INVALID, subtract this time with
3338
     * VLC_TICK_0 to get the original value. */
3339
    vlc_tick_t ts;
3340
    /** Valid length >= VLC_TICK_0 or VLC_TICK_INVALID */
3341
    vlc_tick_t length;
3342
    /** System date of this record (always valid), this date can be in the
3343
     * future or in the past. The special value of INT64_MAX mean that the
3344
     * clock was paused when this point was updated. In that case,
3345
     * vlc_player_timer_point_Interpolate() will return the current ts/pos of
3346
     * this point (there is nothing to interpolate). */
3347
    vlc_tick_t system_date;
3348
};
3349
3350
/**
3351
 * Player smpte timecode
3352
 *
3353
 * @see vlc_player_timer_smpte_cbs
3354
 */
3355
struct vlc_player_timer_smpte_timecode
3356
{
3357
    /** Hours [0;n] */
3358
    unsigned hours;
3359
    /** Minutes [0;59] */
3360
    unsigned minutes;
3361
    /** Seconds [0;59] */
3362
    unsigned seconds;
3363
    /** Frame number [0;n] */
3364
    unsigned frames;
3365
    /** Maximum number of digits needed to display the frame number */
3366
    unsigned frame_resolution;
3367
    /** True if the source is NTSC 29.97fps or 59.94fps DF */
3368
    bool drop_frame;
3369
};
3370
3371
/**
3372
 * Player timer callbacks
3373
 *
3374
 * @see vlc_player_AddTimer
3375
 */
3376
struct vlc_player_timer_cbs
3377
{
3378
    /**
3379
     * Called when the state or the time changed (mandatory).
3380
     *
3381
     * Get notified when the time is updated by the input or output source. The
3382
     * input source is the 'demux' or the 'access_demux'. The output source are
3383
     * audio and video outputs: an update is received each time a video frame
3384
     * is displayed or an audio sample is written. The delay between each
3385
     * updates may depend on the input and source type (it can be every 5ms,
3386
     * 30ms, 1s or 10s...). The user of this timer may need to update the
3387
     * position at a higher frequency from its own mainloop via
3388
     * vlc_player_timer_point_Interpolate().
3389
     *
3390
     * @warning The player is not locked from this callback. It is forbidden
3391
     * to call any player functions from here.
3392
     *
3393
     * @param value always valid, the time corresponding to the state
3394
     * @param data opaque pointer set by vlc_player_AddTimer()
3395
     */
3396
    void (*on_update)(const struct vlc_player_timer_point *value, void *data);
3397
3398
    /**
3399
     * The player timer is paused (can be NULL).
3400
     *
3401
     * This event is sent when the player is paused or stopping. The player
3402
     * user should stop its "interpolate" timer.
3403
     *
3404
     * @note on_update() can be called when paused for those 2 reasons:
3405
     * - playback is resumed (vlc_player_timer_point.system_date is valid)
3406
     * - a track, likely video (next-frame) is outputted when paused
3407
     *   (vlc_player_timer_point.system_date = INT64_MAX)
3408
     *
3409
     * @warning The player is not locked from this callback. It is forbidden
3410
     * to call any player functions from here.
3411
     *
3412
     * @param system_date system date of this event, not valid when stopped. It
3413
     * can be used to interpolate the last updated point to this date in order
3414
     * to get the last paused ts/position.
3415
     * @param data opaque pointer set by vlc_player_AddTimer()
3416
     */
3417
    void (*on_paused)(vlc_tick_t system_date, void *data);
3418
3419
    /**
3420
     * Called when the player is seeking or finished seeking (can be NULL).
3421
     *
3422
     * @warning The player is not locked from this callback. It is forbidden
3423
     * to call any player functions from here.
3424
     *
3425
     * @note on_update() can be called when seeking. It corresponds to tracks
3426
     * updating their points prior to receiving the asynchronous seek event.
3427
     * The user could discard them manually.
3428
     *
3429
     * @param value point of the seek request or NULL when seeking is finished
3430
     * @param data opaque pointer set by vlc_player_AddTimer()
3431
     */
3432
    void (*on_seek)(const struct vlc_player_timer_point *value, void *data);
3433
};
3434
3435
/**
3436
 * Player smpte timer callbacks
3437
 *
3438
 * @see vlc_player_AddSmpteTimer
3439
 */
3440
struct vlc_player_timer_smpte_cbs
3441
{
3442
    /**
3443
     * Called when a new frame is displayed
3444
3445
     * @warning The player is not locked from this callback. It is forbidden
3446
     * to call any player functions from here.
3447
     *
3448
     * @param tc always valid, the timecode corresponding to the frame just
3449
     * displayed
3450
     * @param data opaque pointer set by vlc_player_AddTimer()
3451
     */
3452
    void (*on_update)(const struct vlc_player_timer_smpte_timecode *tc,
3453
                      void *data);
3454
};
3455
3456
/**
3457
 * Add a timer in order to get times updates
3458
 *
3459
 * @param player player instance (locked or not)
3460
 * @param min_period corresponds to the minimum period between each updates,
3461
 * use it to avoid flood from too many source updates, set it to
3462
 * VLC_TICK_INVALID to receive all updates.
3463
 * @param cbs pointer to a vlc_player_timer_cbs structure, the structure must
3464
 * be valid during the lifetime of the player
3465
 * @param cbs_data opaque pointer used by the callbacks
3466
 * @return a valid vlc_player_timer_id or NULL in case of memory allocation
3467
 * error
3468
 */
3469
VLC_API vlc_player_timer_id *
3470
vlc_player_AddTimer(vlc_player_t *player, vlc_tick_t min_period,
3471
                    const struct vlc_player_timer_cbs *cbs,
3472
                    void *cbs_data);
3473
3474
/**
3475
 * Add a smpte timer in order to get accurate video frame updates
3476
 *
3477
 * @param player player instance (locked or not)
3478
 * @param cbs pointer to a vlc_player_timer_smpte_cbs structure, the structure must
3479
 * be valid during the lifetime of the player
3480
 * @param cbs_data opaque pointer used by the callbacks
3481
 * @return a valid vlc_player_timer_id or NULL in case of memory allocation
3482
 * error
3483
 */
3484
VLC_API vlc_player_timer_id *
3485
vlc_player_AddSmpteTimer(vlc_player_t *player,
3486
                         const struct vlc_player_timer_smpte_cbs *cbs,
3487
                         void *cbs_data);
3488
3489
/**
3490
 * Remove a player timer
3491
 *
3492
 * @param player player instance (locked or not)
3493
 * @param timer timer created by vlc_player_AddTimer()
3494
 */
3495
VLC_API void
3496
vlc_player_RemoveTimer(vlc_player_t *player, vlc_player_timer_id *timer);
3497
3498
/**
3499
 * Interpolate the last timer value to now
3500
 *
3501
 * @param point time update obtained via the vlc_player_timer_cbs.on_update()
3502
 * callback
3503
 * @param system_now current system date
3504
 * @param out_ts pointer where to set the interpolated ts, subtract this time
3505
 * with VLC_TICK_0 to get the original value.
3506
 * @param out_pos pointer where to set the interpolated position
3507
 * @return VLC_SUCCESS in case of success, an error in the interpolated ts is
3508
 * negative (could happen during the buffering step)
3509
 */
3510
VLC_API int
3511
vlc_player_timer_point_Interpolate(const struct vlc_player_timer_point *point,
3512
                                   vlc_tick_t system_now,
3513
                                   vlc_tick_t *out_ts, double *out_pos);
3514
3515
/**
3516
 * Get the date of the next interval
3517
 *
3518
 * Can be used to setup an UI timer in order to update some widgets at specific
3519
 * interval. A next_interval of VLC_TICK_FROM_SEC(1) can be used to update a
3520
 * time widget when the media reaches a new second.
3521
 *
3522
 * @note The media time doesn't necessarily correspond to the system time, that
3523
 * is why this function is needed and use the rate of the current point.
3524
 *
3525
 * @param point time update obtained via the vlc_player_timer_cbs.on_update()
3526
 * @param system_now current system date
3527
 * @param interpolated_ts ts returned by vlc_player_timer_point_Interpolate()
3528
 * with the same system now
3529
 * @param next_interval next interval
3530
 * @return the absolute system date of the next interval
3531
 */
3532
VLC_API vlc_tick_t
3533
vlc_player_timer_point_GetNextIntervalDate(const struct vlc_player_timer_point *point,
3534
                                           vlc_tick_t system_now,
3535
                                           vlc_tick_t interpolated_ts,
3536
                                           vlc_tick_t next_interval);
3537
3538
/** @} vlc_player__timer */
3539
3540
/** @} vlc_player */
3541
3542
#endif