1 /*****************************************************************************
2 * ts_pid.h: Transport Stream input module for VLC.
3 *****************************************************************************
4 * Copyright (C) 2004-2016 VLC authors and VideoLAN
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.
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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *****************************************************************************/
22 #include "ts_pid_fwd.h"
24 #define MIN_ES_PID 4 /* Should be 32.. broken muxers */
25 #define MAX_ES_PID 8190
27 #include "ts_streams.h"
29 typedef struct demux_sys_t demux_sys_t
;
50 #define SEEN(x) ((x)->i_flags & FLAG_SEEN)
51 #define SCRAMBLED(x) ((x).i_flags & FLAG_SCRAMBLED)
52 #define PREVPKTKEEPBYTES 16
59 uint8_t i_cc
; /* countinuity counter */
60 uint8_t i_dup
; /* duplicate counter */
62 uint8_t prevpktbytes
[PREVPKTKEEPBYTES
];
71 ts_stream_t
*p_stream
;
78 vlc_fourcc_t i_fourcc
;
79 vlc_fourcc_t i_original_fourcc
;
82 int i_pcr_count
; /* carries PCR field */
93 /* all non commons ones, dynamically allocated */
97 /* last recently used */
103 /* opacified pid list */
104 void ts_pid_list_Init( ts_pid_list_t
* );
105 void ts_pid_list_Release( demux_t
*, ts_pid_list_t
* );
107 /* creates missing pid on the fly */
108 ts_pid_t
* ts_pid_Get( ts_pid_list_t
*, uint16_t i_pid
);
110 /* returns NULL on end. requires context */
114 } ts_pid_next_context_t
;
115 #define ts_pid_NextContextInitValue { 0 }
116 ts_pid_t
* ts_pid_Next( ts_pid_list_t
*, ts_pid_next_context_t
* );
118 /* for legacy only: don't use and pass directly list reference */
119 #define GetPID(p_sys, i_pid) ts_pid_Get((&(p_sys)->pids), i_pid)
121 int UpdateHWFilter( demux_sys_t
*, ts_pid_t
* );
122 int SetPIDFilter( demux_sys_t
*, ts_pid_t
*, bool b_selected
);
124 bool PIDSetup( demux_t
*p_demux
, ts_pid_type_t i_type
, ts_pid_t
*pid
, ts_pid_t
*p_parent
);
125 void PIDRelease( demux_t
*p_demux
, ts_pid_t
*pid
);