Coverage Report

Created: 2026-06-30 07:56

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/vlc/src/input/input_internal.h
Line
Count
Source
1
/*****************************************************************************
2
 * input_internal.h: Internal input structures
3
 *****************************************************************************
4
 * Copyright (C) 1998-2006 VLC authors and VideoLAN
5
 *
6
 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
7
 *
8
 * This program is free software; you can redistribute it and/or modify it
9
 * under the terms of the GNU Lesser General Public License as published by
10
 * the Free Software Foundation; either version 2.1 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public License
19
 * along with this program; if not, write to the Free Software Foundation,
20
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21
 *****************************************************************************/
22
23
#ifndef LIBVLC_INPUT_INTERNAL_H
24
#define LIBVLC_INPUT_INTERNAL_H 1
25
26
#include <vlc_demux.h>
27
#include <vlc_input.h>
28
#include <vlc_mouse.h>
29
#include "input_interface.h"
30
#include "../misc/interrupt.h"
31
#include "./source.h"
32
33
struct input_stats;
34
35
/*****************************************************************************
36
 * input defines/constants.
37
 *****************************************************************************/
38
39
/**
40
 * Main structure representing an input thread. This structure is mostly
41
 * private. The only public fields are read-only and constant.
42
 */
43
typedef struct input_thread_t
44
{
45
    struct vlc_object_t obj;
46
} input_thread_t;
47
48
/*****************************************************************************
49
 * Input events and variables
50
 *****************************************************************************/
51
52
enum input_type {
53
    INPUT_TYPE_PLAYBACK,
54
    INPUT_TYPE_PREPARSING,
55
    INPUT_TYPE_THUMBNAILING,
56
};
57
58
/**
59
 * Input state
60
 *
61
 * This enum is used by the variable "state"
62
 */
63
typedef enum input_state_e
64
{
65
    INIT_S = 0,
66
    OPENING_S,
67
    PLAYING_S,
68
    PAUSE_S,
69
    END_S,
70
    ERROR_S,
71
} input_state_e;
72
73
/**
74
 * Input events
75
 *
76
 * You can catch input event by adding a callback on the variable "intf-event".
77
 * This variable is an integer that will hold a input_event_type_e value.
78
 */
79
typedef enum input_event_type_e
80
{
81
    /* "state" has changed */
82
    INPUT_EVENT_STATE,
83
    /* b_dead is true */
84
    INPUT_EVENT_DEAD,
85
    /* If the event is not handled, or if the listener is returning false,
86
     * the input will be stopped normally at EOF */
87
    INPUT_EVENT_EOF,
88
89
    /* "rate" has changed */
90
    INPUT_EVENT_RATE,
91
92
    /* "capabilities" has changed */
93
    INPUT_EVENT_CAPABILITIES,
94
95
    /* At least one of "position", "time" "length" has changed */
96
    INPUT_EVENT_TIMES,
97
98
    /* The output PTS changed */
99
    INPUT_EVENT_OUTPUT_CLOCK,
100
101
    /* A title has been added or removed or selected.
102
     * It implies that the chapter has changed (no chapter event is sent) */
103
    INPUT_EVENT_TITLE,
104
    /* A chapter has been added or removed or selected. */
105
    INPUT_EVENT_CHAPTER,
106
107
    /* A program ("program") has been added or removed or selected,
108
     * or "program-scrambled" has changed.*/
109
    INPUT_EVENT_PROGRAM,
110
    /* A ES has been added or removed or selected */
111
    INPUT_EVENT_ES,
112
113
    /* "record" has changed */
114
    INPUT_EVENT_RECORD,
115
116
    /* input_item_t media has changed */
117
    INPUT_EVENT_ITEM_META,
118
    /* input_item_t info has changed */
119
    INPUT_EVENT_ITEM_INFO,
120
    /* input_item_t epg has changed */
121
    INPUT_EVENT_ITEM_EPG,
122
123
    /* Input statistics have been updated */
124
    INPUT_EVENT_STATISTICS,
125
    /* At least one of "signal-quality" or "signal-strength" has changed */
126
    INPUT_EVENT_SIGNAL,
127
128
    /* "bookmark" has changed */
129
    INPUT_EVENT_BOOKMARK,
130
131
    /* cache" has changed */
132
    INPUT_EVENT_CACHE,
133
134
    /* A vout_thread_t object has been created/deleted by *the input* */
135
    INPUT_EVENT_VOUT,
136
137
    /* The output state changed (paused or resumed) */
138
    INPUT_EVENT_OUTPUT_STATE,
139
140
    /* (pre-)parsing events */
141
    INPUT_EVENT_SUBITEMS,
142
143
    /* vbi_page has changed */
144
    INPUT_EVENT_VBI_PAGE,
145
    /* vbi_transparent has changed */
146
    INPUT_EVENT_VBI_TRANSPARENCY,
147
148
    /* subs_fps has changed */
149
    INPUT_EVENT_SUBS_FPS,
150
151
    /* Thumbnail generation */
152
    INPUT_EVENT_THUMBNAIL_READY,
153
154
    /* Attachments */
155
    INPUT_EVENT_ATTACHMENTS,
156
157
    /* The demux is not able to navigate */
158
    INPUT_EVENT_NAV_FAILED,
159
160
    /* Mouse event */
161
    INPUT_EVENT_MOUSE_LEFT,
162
163
    /* frame-next status */
164
    INPUT_EVENT_FRAME_NEXT_STATUS,
165
    /* frame-previous status */
166
    INPUT_EVENT_FRAME_PREVIOUS_STATUS,
167
} input_event_type_e;
168
169
0
#define VLC_INPUT_CAPABILITIES_SEEKABLE (1<<0)
170
0
#define VLC_INPUT_CAPABILITIES_PAUSEABLE (1<<1)
171
0
#define VLC_INPUT_CAPABILITIES_CHANGE_RATE (1<<2)
172
0
#define VLC_INPUT_CAPABILITIES_REWINDABLE (1<<3)
173
174
struct vlc_input_event_state
175
{
176
    input_state_e value;
177
    /* Only valid for PAUSE_S and PLAYING_S states */
178
    vlc_tick_t date;
179
};
180
181
struct vlc_input_event_times
182
{
183
    double position;
184
    vlc_tick_t time;
185
    vlc_tick_t normal_time;
186
    vlc_tick_t length;
187
    bool live;
188
};
189
190
struct vlc_input_event_output_clock
191
{
192
    vlc_es_id_t *id;
193
    bool master;
194
    vlc_tick_t system_ts;
195
    vlc_tick_t ts;
196
    double rate;
197
    unsigned frame_rate;
198
    unsigned frame_rate_base;
199
};
200
201
struct vlc_input_event_title
202
{
203
    enum {
204
        VLC_INPUT_TITLE_NEW_LIST,
205
        VLC_INPUT_TITLE_SELECTED,
206
    } action;
207
    union
208
    {
209
        struct
210
        {
211
            input_title_t *const *array;
212
            size_t count;
213
        } list;
214
        size_t selected_idx;
215
    };
216
};
217
218
struct vlc_input_event_chapter
219
{
220
    int title;
221
    int seekpoint;
222
};
223
224
struct vlc_input_event_program {
225
    enum {
226
        VLC_INPUT_PROGRAM_ADDED,
227
        VLC_INPUT_PROGRAM_DELETED,
228
        VLC_INPUT_PROGRAM_UPDATED,
229
        VLC_INPUT_PROGRAM_SELECTED,
230
        VLC_INPUT_PROGRAM_SCRAMBLED,
231
    } action;
232
    int id;
233
    union {
234
        const char *title;
235
        bool scrambled;
236
    };
237
};
238
239
struct vlc_input_event_es {
240
    enum {
241
        VLC_INPUT_ES_ADDED,
242
        VLC_INPUT_ES_DELETED,
243
        VLC_INPUT_ES_UPDATED,
244
        VLC_INPUT_ES_SELECTED,
245
        VLC_INPUT_ES_UNSELECTED,
246
    } action;
247
    /**
248
     * ES track id: only valid from the event callback, unless the id is held
249
     * by the user with vlc_es_Hold(). */
250
    vlc_es_id_t *id;
251
    /**
252
     * Title of ES track, can be updated after the VLC_INPUT_ES_UPDATED event.
253
     */
254
    const char *title;
255
    /**
256
     * ES track information, can be updated after the VLC_INPUT_ES_UPDATED event.
257
     */
258
    const es_format_t *fmt;
259
    /**
260
     * Only valid with VLC_INPUT_ES_SELECTED, true if the track was selected by
261
     * the user.
262
     */
263
    bool forced;
264
265
    enum vlc_vout_order vout_order;
266
};
267
268
struct vlc_input_event_signal {
269
    float quality;
270
    float strength;
271
};
272
273
struct vlc_input_event_vout
274
{
275
    enum {
276
        VLC_INPUT_EVENT_VOUT_STARTED,
277
        VLC_INPUT_EVENT_VOUT_STOPPED,
278
    } action;
279
    vout_thread_t *vout;
280
    enum vlc_vout_order order;
281
    vlc_es_id_t *id;
282
};
283
284
struct vlc_input_event_output_state
285
{
286
    enum {
287
        VLC_INPUT_EVENT_OUTPUT_STATE_RESUMED,
288
        VLC_INPUT_EVENT_OUTPUT_STATE_PAUSED,
289
    } action;
290
    vlc_tick_t paused_date;
291
    vlc_es_id_t *id;
292
};
293
294
struct vlc_input_event_attachments
295
{
296
    input_attachment_t *const* array;
297
    size_t count;
298
};
299
300
struct vlc_input_event_mouse
301
{
302
    vlc_mouse_t oldmouse;
303
    vlc_mouse_t newmouse;
304
};
305
306
struct vlc_input_event
307
{
308
    input_event_type_e type;
309
310
    union {
311
        /* INPUT_EVENT_STATE */
312
        struct vlc_input_event_state state;
313
        /* INPUT_EVENT_RATE */
314
        float rate;
315
        /* INPUT_EVENT_CAPABILITIES */
316
        int capabilities; /**< cf. VLC_INPUT_CAPABILITIES_* bitwise flags */
317
        /* INPUT_EVENT_TIMES */
318
        struct vlc_input_event_times times;
319
        /* INPUT_EVENT_OUTPUT_CLOCK */
320
        struct vlc_input_event_output_clock output_clock;
321
        /* INPUT_EVENT_TITLE */
322
        struct vlc_input_event_title title;
323
        /* INPUT_EVENT_CHAPTER */
324
        struct vlc_input_event_chapter chapter;
325
        /* INPUT_EVENT_PROGRAM */
326
        struct vlc_input_event_program program;
327
        /* INPUT_EVENT_ES */
328
        struct vlc_input_event_es es;
329
        /* INPUT_EVENT_RECORD */
330
        bool record;
331
        /* INPUT_EVENT_STATISTICS */
332
        const struct input_stats_t *stats;
333
        /* INPUT_EVENT_SIGNAL */
334
        struct vlc_input_event_signal signal;
335
        /* INPUT_EVENT_CACHE */
336
        float cache;
337
        /* INPUT_EVENT_VOUT */
338
        struct vlc_input_event_vout vout;
339
        /* INPUT_EVENT_OUTPUT_STATE */
340
        struct vlc_input_event_output_state output_state;
341
        /* INPUT_EVENT_SUBITEMS */
342
        input_item_node_t *subitems;
343
        /* INPUT_EVENT_VBI_PAGE */
344
        unsigned vbi_page;
345
        /* INPUT_EVENT_VBI_TRANSPARENCY */
346
        bool vbi_transparent;
347
        /* INPUT_EVENT_SUBS_FPS */
348
        float subs_fps;
349
        /* INPUT_EVENT_THUMBNAIL_READY */
350
        picture_t *thumbnail;
351
        /* INPUT_EVENT_ATTACHMENTS */
352
        struct vlc_input_event_attachments attachments;
353
        /* INPUT_EVENT_NAV_FAILED */
354
        int nav_type;
355
        /* INPUT_EVENT_FRAME_NEXT_STATUS */
356
        int frame_next_status;
357
        /* INPUT_EVENT_FRAME_PREVIOUS_STATUS */
358
        int frame_previous_status;
359
    };
360
};
361
362
struct vlc_input_thread_callbacks
363
{
364
    bool (*on_event)(input_thread_t *input, const struct vlc_input_event *event,
365
                     void *userdata);
366
};
367
368
struct vlc_input_thread_cfg
369
{
370
    enum input_type type;
371
    enum
372
    {
373
        INPUT_CFG_HW_DEC_DEFAULT,
374
        INPUT_CFG_HW_DEC_DISABLED,
375
        INPUT_CFG_HW_DEC_ENABLED,
376
    } hw_dec;
377
    input_resource_t *resource;
378
    vlc_renderer_item_t *renderer;
379
    const struct vlc_input_thread_callbacks *cbs;
380
    void *cbs_data;
381
382
    struct {
383
        bool subitems;
384
    } preparsing;
385
    bool interact;
386
};
387
/**
388
 * Create a new input_thread_t.
389
 *
390
 * You need to call input_Start on it when you are done
391
 * adding callback on the variables/events you want to monitor.
392
 *
393
 * \param p_parent a vlc_object
394
 * \param p_item an input item
395
 * \param cfg pointer to a configuration struct, mandatory
396
 * \return a pointer to the spawned input thread
397
 */
398
input_thread_t * input_Create( vlc_object_t *p_parent, input_item_t *item,
399
                               const struct vlc_input_thread_cfg *cfg ) VLC_USED;
400
0
#define input_Create(a,b,c) input_Create(VLC_OBJECT(a),b,c)
401
402
int input_Start( input_thread_t * );
403
404
void input_Stop( input_thread_t * );
405
406
void input_Close( input_thread_t * );
407
408
void input_SetTime( input_thread_t *, vlc_tick_t i_time, bool b_fast );
409
410
void input_SetPosition( input_thread_t *, double f_position, bool b_fast );
411
412
/**
413
 * Set the delay of an ES identifier
414
 */
415
void input_SetEsIdDelay(input_thread_t *input, vlc_es_id_t *es_id,
416
                        vlc_tick_t delay);
417
418
/**
419
 * Get the input item for an input thread
420
 *
421
 * You have to keep a reference to the input or to the input_item_t until
422
 * you do not need it anymore.
423
 */
424
input_item_t* input_GetItem( input_thread_t * ) VLC_USED;
425
426
/*****************************************************************************
427
 *  Private input fields
428
 *****************************************************************************/
429
430
0
#define INPUT_CONTROL_FIFO_SIZE    100
431
432
typedef union
433
{
434
    vlc_value_t val;
435
    vlc_viewpoint_t viewpoint;
436
    vlc_es_id_t *id;
437
    struct {
438
        enum es_format_category_e cat;
439
        vlc_es_id_t **ids;
440
    } list;
441
    struct {
442
        bool b_fast_seek;
443
        vlc_tick_t i_val;
444
    } time;
445
    struct {
446
        bool b_fast_seek;
447
        double f_val;
448
    } pos;
449
    struct
450
    {
451
        enum es_format_category_e cat;
452
        vlc_tick_t delay;
453
    } cat_delay;
454
    struct
455
    {
456
        enum es_format_category_e cat;
457
        char *str_ids;
458
    } cat_ids;
459
    struct
460
    {
461
        vlc_es_id_t *id;
462
        vlc_tick_t delay;
463
    } es_delay;
464
    struct {
465
        vlc_es_id_t *id;
466
        unsigned page;
467
    } vbi_page;
468
    struct {
469
        vlc_es_id_t *id;
470
        bool enabled;
471
    } vbi_transparency;
472
    struct {
473
        bool enabled;
474
        char *dir_path;
475
    } record_state;
476
    struct
477
    {
478
        vlc_tick_t pts;
479
        unsigned frame_rate;
480
        unsigned frame_rate_base;
481
        int steps;
482
        bool failed;
483
    } frame_previous_seek;
484
} input_control_param_t;
485
486
typedef struct
487
{
488
    int         i_type;
489
    input_control_param_t param;
490
} input_control_t;
491
492
/** Private input fields */
493
typedef struct input_thread_private_t
494
{
495
    struct input_thread_t input;
496
497
    const struct vlc_input_thread_callbacks *cbs;
498
    void *cbs_data;
499
500
    enum input_type type;
501
    bool hw_dec;
502
    bool preparse_subitems;
503
504
    /* Current state */
505
    int         i_state;
506
    bool        is_running;
507
    bool        is_stopped;
508
    bool        b_recording;
509
    bool        b_pause_after_buffering; /* Defer pause until after buffering */
510
    float       rate;
511
512
    /* Playtime configuration and state */
513
    vlc_tick_t  i_start;    /* :start-time,0 by default */
514
    vlc_tick_t  i_stop;     /* :stop-time, 0 if none */
515
516
    /* Delays */
517
    bool        b_low_delay;
518
    vlc_tick_t  i_jitter_max;
519
520
    /* Output */
521
    bool            b_out_pace_control; /* XXX Move it ot es_sout ? */
522
    sout_stream_t   *p_sout;            /* Idem ? */
523
    struct vlc_input_es_out *p_es_out;
524
    struct vlc_input_es_out *p_es_out_display;
525
    vlc_viewpoint_t viewpoint;
526
    bool            viewpoint_changed;
527
    vlc_renderer_item_t *p_renderer;
528
529
530
    int i_title_offset;
531
    int i_seekpoint_offset;
532
533
    /* Input attachment */
534
    int i_attachment;
535
    input_attachment_t **attachment;
536
537
    /* Main input properties */
538
539
    /* Input item */
540
    input_item_t   *p_item;
541
542
    /* Main source */
543
    input_source_t *master;
544
    /* Slave sources (subs, and others) */
545
    size_t         i_slave;
546
    input_source_t **slave;
547
    float          slave_subs_rate;
548
549
    /* Resources */
550
    input_resource_t *p_resource;
551
552
    /* Stats counters */
553
    struct input_stats *stats;
554
555
    /* Buffer of pending actions */
556
    vlc_mutex_t lock_control;
557
    vlc_cond_t  wait_control;
558
    size_t i_control;
559
    input_control_t control[INPUT_CONTROL_FIFO_SIZE];
560
561
    vlc_thread_t thread;
562
    vlc_interrupt_t interrupt;
563
564
    struct {
565
        vlc_tick_t last_pts;
566
        bool enabled;
567
        bool end;
568
    } prev_frame;
569
570
    bool next_frame_need_data;
571
} input_thread_private_t;
572
573
static inline input_thread_private_t *input_priv(input_thread_t *input)
574
0
{
575
0
    return container_of(input, input_thread_private_t, input);
576
0
}
Unexecuted instantiation: var.c:input_priv
Unexecuted instantiation: libvlc.c:input_priv
Unexecuted instantiation: content.c:input_priv
Unexecuted instantiation: control.c:input_priv
Unexecuted instantiation: notify.c:input_priv
Unexecuted instantiation: player.c:input_priv
Unexecuted instantiation: playlist.c:input_priv
Unexecuted instantiation: preparse.c:input_priv
Unexecuted instantiation: item.c:input_priv
Unexecuted instantiation: access.c:input_priv
Unexecuted instantiation: decoder.c:input_priv
Unexecuted instantiation: demux.c:input_priv
Unexecuted instantiation: input.c:input_priv
Unexecuted instantiation: meta.c:input_priv
Unexecuted instantiation: timer.c:input_priv
Unexecuted instantiation: track.c:input_priv
Unexecuted instantiation: title.c:input_priv
Unexecuted instantiation: aout.c:input_priv
Unexecuted instantiation: vout.c:input_priv
Unexecuted instantiation: osd.c:input_priv
Unexecuted instantiation: medialib.c:input_priv
Unexecuted instantiation: resource.c:input_priv
Unexecuted instantiation: stats.c:input_priv
Unexecuted instantiation: stream.c:input_priv
Unexecuted instantiation: stream_extractor.c:input_priv
Unexecuted instantiation: stream_filter.c:input_priv
Unexecuted instantiation: stream_memory.c:input_priv
Unexecuted instantiation: subtitles.c:input_priv
Unexecuted instantiation: vout_subpictures.c:input_priv
Unexecuted instantiation: internal.c:input_priv
Unexecuted instantiation: es_out.c:input_priv
Unexecuted instantiation: es_out_source.c:input_priv
Unexecuted instantiation: es_out_timeshift.c:input_priv
Unexecuted instantiation: parse.c:input_priv
577
578
/***************************************************************************
579
 * Internal control helpers
580
 ***************************************************************************/
581
enum input_control_e
582
{
583
    INPUT_CONTROL_SET_STATE,
584
585
    INPUT_CONTROL_SET_RATE,
586
587
    INPUT_CONTROL_SET_POSITION,
588
589
    INPUT_CONTROL_SET_TIME,
590
591
    INPUT_CONTROL_SET_PROGRAM,
592
593
    INPUT_CONTROL_SET_TITLE,
594
    INPUT_CONTROL_SET_TITLE_NEXT,
595
    INPUT_CONTROL_SET_TITLE_PREV,
596
597
    INPUT_CONTROL_SET_SEEKPOINT,
598
    INPUT_CONTROL_SET_SEEKPOINT_NEXT,
599
    INPUT_CONTROL_SET_SEEKPOINT_PREV,
600
601
    INPUT_CONTROL_SET_BOOKMARK,
602
603
    INPUT_CONTROL_RESET_POSITION,
604
605
    INPUT_CONTROL_NAV_ACTIVATE, // NOTE: INPUT_CONTROL_NAV_* values must be
606
    INPUT_CONTROL_NAV_UP,       // contiguous and in the same order as
607
    INPUT_CONTROL_NAV_DOWN,     // INPUT_NAV_* and DEMUX_NAV_*.
608
    INPUT_CONTROL_NAV_LEFT,
609
    INPUT_CONTROL_NAV_RIGHT,
610
    INPUT_CONTROL_NAV_POPUP,
611
    INPUT_CONTROL_NAV_MENU,
612
613
    INPUT_CONTROL_SET_ES,
614
    INPUT_CONTROL_SET_ES_LIST,  // select a list of ES atomically
615
    INPUT_CONTROL_UNSET_ES,
616
    INPUT_CONTROL_RESTART_ES,
617
    INPUT_CONTROL_SET_ES_CAT_IDS,
618
619
    INPUT_CONTROL_SET_VIEWPOINT,    // new absolute viewpoint
620
    INPUT_CONTROL_SET_INITIAL_VIEWPOINT, // set initial viewpoint (generally from video)
621
    INPUT_CONTROL_UPDATE_VIEWPOINT, // update viewpoint relative to current
622
623
    INPUT_CONTROL_SET_CATEGORY_DELAY,
624
    INPUT_CONTROL_SET_ES_DELAY,
625
626
    INPUT_CONTROL_ADD_SLAVE,
627
    INPUT_CONTROL_SET_SUBS_FPS,
628
629
    INPUT_CONTROL_SET_RECORD_STATE,
630
631
    INPUT_CONTROL_SET_FRAME_NEXT,
632
    INPUT_CONTROL_SET_FRAME_PREVIOUS,
633
    INPUT_CONTROL_NEED_DATA_FRAME_NEXT,
634
    INPUT_CONTROL_SEEK_FRAME_PREVIOUS,
635
636
    INPUT_CONTROL_SET_RENDERER,
637
638
    INPUT_CONTROL_SET_VBI_PAGE,
639
    INPUT_CONTROL_SET_VBI_TRANSPARENCY,
640
};
641
642
/* Internal helpers */
643
644
int input_ControlPush( input_thread_t *, int, const input_control_param_t * );
645
646
/* XXX for string value you have to allocate it before calling
647
 * input_ControlPushHelper
648
 */
649
static inline int input_ControlPushHelper( input_thread_t *p_input, int i_type, vlc_value_t *val )
650
0
{
651
0
    if( val != NULL )
652
0
    {
653
0
        input_control_param_t param = { .val = *val };
654
0
        return input_ControlPush( p_input, i_type, &param );
655
0
    }
656
0
    else
657
0
    {
658
0
        return input_ControlPush( p_input, i_type, NULL );
659
0
    }
660
0
}
Unexecuted instantiation: var.c:input_ControlPushHelper
Unexecuted instantiation: libvlc.c:input_ControlPushHelper
Unexecuted instantiation: content.c:input_ControlPushHelper
Unexecuted instantiation: control.c:input_ControlPushHelper
Unexecuted instantiation: notify.c:input_ControlPushHelper
Unexecuted instantiation: player.c:input_ControlPushHelper
Unexecuted instantiation: playlist.c:input_ControlPushHelper
Unexecuted instantiation: preparse.c:input_ControlPushHelper
Unexecuted instantiation: item.c:input_ControlPushHelper
Unexecuted instantiation: access.c:input_ControlPushHelper
Unexecuted instantiation: decoder.c:input_ControlPushHelper
Unexecuted instantiation: demux.c:input_ControlPushHelper
Unexecuted instantiation: input.c:input_ControlPushHelper
Unexecuted instantiation: meta.c:input_ControlPushHelper
Unexecuted instantiation: timer.c:input_ControlPushHelper
Unexecuted instantiation: track.c:input_ControlPushHelper
Unexecuted instantiation: title.c:input_ControlPushHelper
Unexecuted instantiation: aout.c:input_ControlPushHelper
Unexecuted instantiation: vout.c:input_ControlPushHelper
Unexecuted instantiation: osd.c:input_ControlPushHelper
Unexecuted instantiation: medialib.c:input_ControlPushHelper
Unexecuted instantiation: resource.c:input_ControlPushHelper
Unexecuted instantiation: stats.c:input_ControlPushHelper
Unexecuted instantiation: stream.c:input_ControlPushHelper
Unexecuted instantiation: stream_extractor.c:input_ControlPushHelper
Unexecuted instantiation: stream_filter.c:input_ControlPushHelper
Unexecuted instantiation: stream_memory.c:input_ControlPushHelper
Unexecuted instantiation: subtitles.c:input_ControlPushHelper
Unexecuted instantiation: vout_subpictures.c:input_ControlPushHelper
Unexecuted instantiation: internal.c:input_ControlPushHelper
Unexecuted instantiation: es_out.c:input_ControlPushHelper
Unexecuted instantiation: es_out_source.c:input_ControlPushHelper
Unexecuted instantiation: es_out_timeshift.c:input_ControlPushHelper
Unexecuted instantiation: parse.c:input_ControlPushHelper
661
662
static inline int input_ControlPushEsHelper( input_thread_t *p_input, int i_type,
663
                                             vlc_es_id_t *id )
664
0
{
665
0
    assert( i_type == INPUT_CONTROL_SET_ES || i_type == INPUT_CONTROL_UNSET_ES ||
666
0
            i_type == INPUT_CONTROL_RESTART_ES );
667
0
    return input_ControlPush( p_input, i_type, &(input_control_param_t) {
668
0
        .id = vlc_es_id_Hold( id ),
669
0
    } );
670
0
}
Unexecuted instantiation: var.c:input_ControlPushEsHelper
Unexecuted instantiation: libvlc.c:input_ControlPushEsHelper
Unexecuted instantiation: content.c:input_ControlPushEsHelper
Unexecuted instantiation: control.c:input_ControlPushEsHelper
Unexecuted instantiation: notify.c:input_ControlPushEsHelper
Unexecuted instantiation: player.c:input_ControlPushEsHelper
Unexecuted instantiation: playlist.c:input_ControlPushEsHelper
Unexecuted instantiation: preparse.c:input_ControlPushEsHelper
Unexecuted instantiation: item.c:input_ControlPushEsHelper
Unexecuted instantiation: access.c:input_ControlPushEsHelper
Unexecuted instantiation: decoder.c:input_ControlPushEsHelper
Unexecuted instantiation: demux.c:input_ControlPushEsHelper
Unexecuted instantiation: input.c:input_ControlPushEsHelper
Unexecuted instantiation: meta.c:input_ControlPushEsHelper
Unexecuted instantiation: timer.c:input_ControlPushEsHelper
Unexecuted instantiation: track.c:input_ControlPushEsHelper
Unexecuted instantiation: title.c:input_ControlPushEsHelper
Unexecuted instantiation: aout.c:input_ControlPushEsHelper
Unexecuted instantiation: vout.c:input_ControlPushEsHelper
Unexecuted instantiation: osd.c:input_ControlPushEsHelper
Unexecuted instantiation: medialib.c:input_ControlPushEsHelper
Unexecuted instantiation: resource.c:input_ControlPushEsHelper
Unexecuted instantiation: stats.c:input_ControlPushEsHelper
Unexecuted instantiation: stream.c:input_ControlPushEsHelper
Unexecuted instantiation: stream_extractor.c:input_ControlPushEsHelper
Unexecuted instantiation: stream_filter.c:input_ControlPushEsHelper
Unexecuted instantiation: stream_memory.c:input_ControlPushEsHelper
Unexecuted instantiation: subtitles.c:input_ControlPushEsHelper
Unexecuted instantiation: vout_subpictures.c:input_ControlPushEsHelper
Unexecuted instantiation: internal.c:input_ControlPushEsHelper
Unexecuted instantiation: es_out.c:input_ControlPushEsHelper
Unexecuted instantiation: es_out_source.c:input_ControlPushEsHelper
Unexecuted instantiation: es_out_timeshift.c:input_ControlPushEsHelper
Unexecuted instantiation: parse.c:input_ControlPushEsHelper
671
672
/**
673
 * Set the program id
674
 *
675
 * cf. ES_OUT_SET_GROUP
676
 * This function can be called before start or while started.
677
 * This function is not thread-safe, the caller should handle the locking.
678
 */
679
void input_SetProgramId(input_thread_t *input, int group_id);
680
681
/**
682
 * Set the default delay applied to the given category.
683
 *
684
 * Set the default delay for the given \p es_format_category_e synchronously
685
 * if the input is not running yet, otherwise push a control to signal to the
686
 * input which delay should be updated.
687
 *
688
 * @param input Any input to change the delay for.
689
 * @param cat The ES category to apply the delay to.
690
 * @param delay The delay to apply to the category, a positive delay shifting
691
 *              the track to the future.
692
 * @return VLC_SUCCESS when the delay has been applied, or signal an error
693
 *         otherwise.
694
 *
695
 * @note This function can be called before start or while running.
696
 * @note This function is not thread-safe, the caller should handle the locking.
697
 */
698
int input_SetEsCatDelay(input_thread_t *input, enum es_format_category_e cat,
699
                        vlc_tick_t delay);
700
701
/**
702
 * Set the list of string ids to enable for a category
703
 *
704
 * cf. ES_OUT_SET_ES_CAT_IDS
705
 * This function can be called before start or while started.
706
 * This function is not thread-safe, the caller should handle the locking.
707
 */
708
void input_SetEsCatIds(input_thread_t *, enum es_format_category_e cat,
709
                       const char *str_ids);
710
711
bool input_Stopped( input_thread_t * );
712
713
int input_GetAttachments(input_thread_t *input, input_attachment_t ***attachments);
714
715
input_attachment_t *input_GetAttachment(input_thread_t *input, const char *name);
716
717
bool input_CanPaceControl(input_thread_t *input);
718
719
/**
720
 * Calculates the duration of the item in an input thread.
721
 *
722
 * This function determines the duration of a track item based on the start and 
723
 * stop times stored in the input thread's private data. If the stop time is not 
724
 * set (i.e., equals zero), the function considers the given `duration` as the 
725
 * stop time and calculates the effective duration based on the start time. 
726
 * Otherwise, it calculates the duration using the set start and stop times.
727
 *
728
 * @param input   Pointer to the input_thread_t object.
729
 * @param duration The initial duration value, used if the stop time is not set.
730
 *
731
 * @return The calculated duration based on the start and stop times.
732
 */
733
vlc_tick_t input_GetItemDuration(input_thread_t *input, vlc_tick_t duration);
734
735
/* Bound pts_delay */
736
0
#define INPUT_PTS_DELAY_MAX VLC_TICK_FROM_SEC(60)
737
738
/**********************************************************************
739
 * Item metadata
740
 **********************************************************************/
741
/* input_ExtractAttachmentAndCacheArt:
742
 *  Be careful: p_item lock will be taken! */
743
void input_ExtractAttachmentAndCacheArt( input_thread_t *, const char *name );
744
745
/***************************************************************************
746
 * Internal prototypes
747
 ***************************************************************************/
748
749
/* var.c */
750
751
void vlc_object_InitInputConfig(vlc_object_t *obj,
752
                                bool playback, bool do_inherit);
753
754
/* Subtitles */
755
int subtitles_Detect( input_thread_t *, char *, const char *, input_item_slave_t ***, int * );
756
int subtitles_Filter( const char *);
757
758
/* stats.c */
759
typedef struct input_rate_t
760
{
761
    vlc_mutex_t lock;
762
    uintmax_t updates;
763
    uintmax_t value;
764
    struct
765
    {
766
        uintmax_t  value;
767
        vlc_tick_t date;
768
    } samples[2];
769
} input_rate_t;
770
771
struct input_stats {
772
    input_rate_t input_bitrate;
773
    input_rate_t demux_bitrate;
774
    atomic_uintmax_t demux_corrupted;
775
    atomic_uintmax_t demux_discontinuity;
776
    atomic_uintmax_t decoded_audio;
777
    atomic_uintmax_t decoded_video;
778
    atomic_uintmax_t played_abuffers;
779
    atomic_uintmax_t lost_abuffers;
780
    atomic_uintmax_t displayed_pictures;
781
    atomic_uintmax_t late_pictures;
782
    atomic_uintmax_t lost_pictures;
783
};
784
785
struct input_stats *input_stats_Create(void);
786
void input_stats_Destroy(struct input_stats *);
787
void input_rate_Add(input_rate_t *, uintmax_t);
788
void input_stats_Compute(struct input_stats *, input_stats_t*);
789
790
#endif