summaryrefslogtreecommitdiffstats
path: root/demux/timeline.h
blob: 69d93a4a2ea6747992aeb4dbbd61cb0ba74136b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef MP_TIMELINE_H_
#define MP_TIMELINE_H_

struct timeline_part {
    double start;
    double source_start;
    char *url;
    struct demuxer *source;
};

struct timeline {
    struct mpv_global *global;
    struct mp_log *log;
    struct mp_cancel *cancel;

    // main source
    struct demuxer *demuxer;

    bstr init_fragment;
    bool dash;

    // All referenced files.
    struct demuxer **sources;
    int num_sources;

    // Segments to play, ordered by time. parts[num_parts] must be valid; its
    // start field sets the duration, and source must be NULL.
    struct timeline_part *parts;
    int num_parts;

    struct demux_chapter *chapters;
    int num_chapters;

    // Which source defines the overall track list (over the full timeline).
    struct demuxer *track_layout;

    // For tracks which require a separate opened demuxer, such as separate
    // audio tracks. (For example, for ordered chapters this would be NULL,
    // because all streams demux from the same file at a given time, while
    // for DASH-style video+audio, each track would have its own timeline.)
    struct timeline *next;
};

struct timeline *timeline_load(struct mpv_global *global, struct mp_log *log,
                               struct demuxer *demuxer);
void timeline_destroy(struct timeline *tl);

#endif