Coverage Report

Created: 2026-10-17 07:46

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