ts_streams_private.h 3.5 KB
Newer Older
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
49
50
51
/*****************************************************************************
 * ts_streams_private.h: Transport Stream input module for VLC.
 *****************************************************************************
 * Copyright (C) 2004-2016 VLC authors and VideoLAN
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *****************************************************************************/
#ifndef VLC_TS_STREAMS_PRIVATE_H
#define VLC_TS_STREAMS_PRIVATE_H

typedef struct dvbpsi_s dvbpsi_t;
typedef struct ts_sections_processor_t ts_sections_processor_t;

#include "mpeg4_iod.h"

#include <vlc_common.h>
#include <vlc_es.h>

struct ts_pat_t
{
    int             i_version;
    int             i_ts_id;
    dvbpsi_t       *handle;
    DECL_ARRAY(ts_pid_t *) programs;

};

struct ts_pmt_t
{
    dvbpsi_t       *handle;
    int             i_version;
    int             i_number;
    int             i_pid_pcr;
    bool            b_selected;
    /* IOD stuff (mpeg4) */
    od_descriptor_t *iod;
    od_descriptors_t od;

    DECL_ARRAY(ts_pid_t *) e_streams;

52
    ts_pid_t        *p_atsc_si_basepid;
53
54
55
56
57
58
59
60
61
62
63
64

    struct
    {
        mtime_t i_current;
        mtime_t i_first; // seen <> != -1
        /* broken PCR handling */
        mtime_t i_first_dts;
        mtime_t i_pcroffset;
        bool    b_disable; /* ignore PCR field, use dts */
        bool    b_fix_done;
    } pcr;

65
66
67
68
69
70
    struct
    {
        time_t i_event_start;
        time_t i_event_length;
    } eit;

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
    mtime_t i_last_dts;

};

struct ts_pes_es_t
{
    ts_pmt_t *p_program;
    es_format_t  fmt;
    es_out_id_t *id;
    uint16_t i_sl_es_id;
    ts_pes_es_t *p_extraes; /* Some private streams encapsulate several ES (eg. DVB subtitles) */
    ts_pes_es_t *p_next; /* Next es on same pid from different pmt (shared pid) */
    /* J2K stuff */
    uint8_t  b_interlaced;
};

typedef enum
{
    TS_ES_DATA_PES,
    TS_ES_DATA_TABLE_SECTION
} ts_es_data_type_t;

struct ts_pes_t
{
    ts_pes_es_t *p_es;

    uint8_t i_stream_type;

    ts_es_data_type_t data_type;
    int         i_data_size;
    int         i_data_gathered;
    block_t     *p_data;
    block_t     **pp_last;
    bool        b_always_receive;
    ts_sections_processor_t *p_sections_proc;

    block_t *   p_prepcr_outqueue;

    /* SL AU */
    struct
    {
        block_t     *p_data;
        block_t     **pp_last;
    } sl;
};

117
typedef struct ts_si_context_t ts_si_context_t;
118

119
struct ts_si_t
120
{
121
122
    dvbpsi_t *handle;
    int       i_version;
123
124
};

125
126
typedef struct ts_psip_context_t ts_psip_context_t;

127
128
129
130
struct ts_psip_t
{
    dvbpsi_t       *handle;
    int             i_version;
131
132
    ts_pes_es_t    *p_eas_es;
    ts_psip_context_t *p_ctx;
133
134
135
    /* Used to track list of active pid for eit/ett, to call PIDRelease on them.
       VCT table could have been used, but PIDSetup can fail, and we can't alter
       the VCT table accordingly without going ahead of more troubles */
136
137
138
139
140
    DECL_ARRAY(ts_pid_t *) eit;

};

#endif