MythTV  master
multiplex.h
Go to the documentation of this file.
1 /*
2  * multiplex.h
3  *
4  *
5  * Copyright (C) 2003 Marcus Metzler <mocm@metzlerbros.de>
6  * Metzler Brothers Systementwicklung GbR
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * General Public License for more details.
18  *
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
24  *
25  */
26 #ifndef MULTIPLEX_H
27 #define MULTIPLEX_H
28 
29 #include <array>
30 
31 #include "mpg_common.h"
32 #include "pes.h"
33 #include "element.h"
34 
35 #define N_AUDIO 32
36 #define N_AC3 8
37 
38 using ext_arr = std::array<extdata_t,N_AUDIO>;
39 using aok_arr = std::array<bool,N_AUDIO>;
40 
41 struct multiplex_t {
42  int fd_out;
43 #define REPLEX_MPEG2 0
44 #define REPLEX_DVD 1
45 #define REPLEX_HDTV 2
46 #define REPLEX_TS_SD 3
47 #define REPLEX_TS_HD 4
48  int otype;
49  int startup;
50  int finish;
51 
52  //muxing options
53  uint64_t video_delay;
54  uint64_t audio_delay;
55  int pack_size;
56  unsigned int data_size;
59  uint32_t mux_rate;
60  uint32_t muxr;
61  uint8_t navpack;
62 #define TIME_ALWAYS 1
63 #define TIME_IFRAME 2
65  int VBR;
66  int is_ts;
70  unsigned int vsize, extsize;
71  int64_t extra_clock;
72  uint64_t SCR;
73  uint64_t oldSCR;
74  uint64_t SCRinc;
76 
78 
80  int extcnt;
81 
86 
87  int (*fill_buffers)(void *p, int f);
88  void *priv;
89 };
90 
91 void check_times( multiplex_t *mx, int *video_ok, aok_arr &ext_ok, int *start);
92 void write_out_packs( multiplex_t *mx, int video_ok, aok_arr &ext_ok);
93 void finish_mpg(multiplex_t *mx);
94 void init_multiplex( multiplex_t *mx, sequence_t *seq_head,
95  audio_frame_t *extframe, int *exttype, const int *exttypcnt,
96  uint64_t video_delay, uint64_t audio_delay, int fd,
97  int (*fill_buffers)(void *p, int f),
98  ringbuffer *vrbuffer, ringbuffer *index_vrbuffer,
99  ringbuffer *extrbuffer, ringbuffer *index_extrbuffer,
100  int otype);
101 
102 void setup_multiplex(multiplex_t *mx);
103 #endif /* MULTIPLEX_H */
multiplex_t::finish
int finish
Definition: multiplex.h:50
pes.h
finish_mpg
void finish_mpg(multiplex_t *mx)
Definition: multiplex.cpp:600
fill_buffers
static int fill_buffers(void *r, int finish)
Definition: replex.cpp:1835
multiplex_t::oldSCR
uint64_t oldSCR
Definition: multiplex.h:73
ringbuffer
Definition: ringbuffer.h:39
multiplex_t::audio_buffer_size
uint32_t audio_buffer_size
Definition: multiplex.h:57
multiplex_t::vrbuffer
ringbuffer * vrbuffer
Definition: multiplex.h:84
sequence_t
Definition: element.h:87
multiplex_t::mux_rate
uint32_t mux_rate
Definition: multiplex.h:59
multiplex_t::fd_out
int fd_out
Definition: multiplex.h:42
multiplex_t::viu
index_unit viu
Definition: multiplex.h:75
init_multiplex
void init_multiplex(multiplex_t *mx, sequence_t *seq_head, audio_frame_t *extframe, int *exttype, const int *exttypcnt, uint64_t video_delay, uint64_t audio_delay, int fd, int(*fill_buffers)(void *p, int f), ringbuffer *vrbuffer, ringbuffer *index_vrbuffer, ringbuffer *extrbuffer, ringbuffer *index_extrbuffer, int otype)
Definition: multiplex.cpp:678
ext_arr
std::array< extdata_t, N_AUDIO > ext_arr
Definition: multiplex.h:38
multiplex_t::navpack
uint8_t navpack
Definition: multiplex.h:61
multiplex_t::otype
int otype
Definition: multiplex.h:48
multiplex_t::ext
ext_arr ext
Definition: multiplex.h:79
multiplex_t::index_extrbuffer
ringbuffer * index_extrbuffer
Definition: multiplex.h:83
multiplex_t::write_end_codes
int write_end_codes
Definition: multiplex.h:68
multiplex_t::vsize
unsigned int vsize
Definition: multiplex.h:70
hardwareprofile.config.p
p
Definition: config.py:33
multiplex_t::index_vrbuffer
ringbuffer * index_vrbuffer
Definition: multiplex.h:85
setup_multiplex
void setup_multiplex(multiplex_t *mx)
Definition: multiplex.cpp:837
write_out_packs
void write_out_packs(multiplex_t *mx, int video_ok, aok_arr &ext_ok)
Definition: multiplex.cpp:581
multiplex_t::audio_delay
uint64_t audio_delay
Definition: multiplex.h:54
mpg_common.h
multiplex_t::VBR
int VBR
Definition: multiplex.h:65
f
QTextStream t & f
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:606
multiplex_t::set_broken_link
int set_broken_link
Definition: multiplex.h:69
element.h
multiplex_t::SCR
uint64_t SCR
Definition: multiplex.h:72
multiplex_t::vdbuf
dummy_buffer vdbuf
Definition: multiplex.h:77
multiplex_t::reset_clocks
int reset_clocks
Definition: multiplex.h:67
multiplex_t::pack_size
int pack_size
Definition: multiplex.h:55
multiplex_t::extra_clock
int64_t extra_clock
Definition: multiplex.h:71
dummy_buffer
Definition: ringbuffer.h:49
multiplex_t::extcnt
int extcnt
Definition: multiplex.h:80
multiplex_t::fill_buffers
int(* fill_buffers)(void *p, int f)
Definition: multiplex.h:87
check_times
void check_times(multiplex_t *mx, int *video_ok, aok_arr &ext_ok, int *start)
Definition: multiplex.cpp:485
multiplex_t::startup
int startup
Definition: multiplex.h:49
multiplex_t::muxr
uint32_t muxr
Definition: multiplex.h:60
multiplex_t::data_size
unsigned int data_size
Definition: multiplex.h:56
multiplex_t::extsize
unsigned int extsize
Definition: multiplex.h:70
multiplex_t::video_buffer_size
uint32_t video_buffer_size
Definition: multiplex.h:58
audio_frame_t
Definition: element.h:109
multiplex_t
Definition: multiplex.h:41
multiplex_t::priv
void * priv
Definition: multiplex.h:88
index_unit
Definition: mpg_common.h:35
multiplex_t::is_ts
int is_ts
Definition: multiplex.h:66
multiplex_t::video_delay
uint64_t video_delay
Definition: multiplex.h:53
multiplex_t::frame_timestamps
int frame_timestamps
Definition: multiplex.h:64
multiplex_t::extrbuffer
ringbuffer * extrbuffer
Definition: multiplex.h:82
multiplex_t::SCRinc
uint64_t SCRinc
Definition: multiplex.h:74
aok_arr
std::array< bool, N_AUDIO > aok_arr
Definition: multiplex.h:39