Coverage Report

Created: 2026-01-17 06:26

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