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 "mpg_common.h"
30 #include "pes.h"
31 #include "element.h"
32 
33 #define N_AUDIO 32
34 #define N_AC3 8
35 
36 typedef struct multiplex_s{
37  int fd_out;
38 #define REPLEX_MPEG2 0
39 #define REPLEX_DVD 1
40 #define REPLEX_HDTV 2
41 #define REPLEX_TS_SD 3
42 #define REPLEX_TS_HD 4
43  int otype;
44  int startup;
45  int finish;
46 
47  //muxing options
48  uint64_t video_delay;
49  uint64_t audio_delay;
50  int pack_size;
51  unsigned int data_size;
54  uint32_t mux_rate;
55  uint32_t muxr;
56  uint8_t navpack;
57 #define TIME_ALWAYS 1
58 #define TIME_IFRAME 2
60  int VBR;
61  int is_ts;
65  unsigned int vsize, extsize;
66  int64_t extra_clock;
67  uint64_t SCR;
68  uint64_t oldSCR;
69  uint64_t SCRinc;
71 
73 
75  int extcnt;
76 
81 
82  int (*fill_buffers)(void *p, int f);
83  void *priv;
84 } multiplex_t;
85 
86 void check_times( multiplex_t *mx, int *video_ok, int *ext_ok, int *start);
87 void write_out_packs( multiplex_t *mx, int video_ok, int *ext_ok);
88 void finish_mpg(multiplex_t *mx);
89 void init_multiplex( multiplex_t *mx, sequence_t *seq_head,
90  audio_frame_t *extframe, int *exttype, const int *exttypcnt,
91  uint64_t video_delay, uint64_t audio_delay, int fd,
92  int (*fill_buffers)(void *p, int f),
93  ringbuffer *vrbuffer, ringbuffer *index_vrbuffer,
94  ringbuffer *extrbuffer, ringbuffer *index_extrbuffer,
95  int otype);
96 
98 #endif /* _MULTIPLEX_H_*/
int frame_timestamps
Definition: multiplex.h:59
ringbuffer * extrbuffer
Definition: multiplex.h:77
int write_end_codes
Definition: multiplex.h:63
unsigned int extsize
Definition: multiplex.h:65
uint32_t muxr
Definition: multiplex.h:55
index_unit viu
Definition: multiplex.h:70
uint64_t audio_delay
Definition: multiplex.h:49
uint32_t video_buffer_size
Definition: multiplex.h:53
static int fill_buffers(void *r, int finish)
Definition: replex.c:1821
uint32_t audio_buffer_size
Definition: multiplex.h:52
uint64_t SCRinc
Definition: multiplex.h:69
int pack_size
Definition: multiplex.h:50
unsigned int data_size
Definition: multiplex.h:51
int startup
Definition: multiplex.h:44
int extcnt
Definition: multiplex.h:75
uint64_t SCR
Definition: multiplex.h:67
struct multiplex_s multiplex_t
void * priv
Definition: multiplex.h:83
uint32_t mux_rate
Definition: multiplex.h:54
void setup_multiplex(multiplex_t *mx)
Definition: multiplex.c:835
int finish
Definition: multiplex.h:45
ringbuffer * index_vrbuffer
Definition: multiplex.h:80
unsigned int vsize
Definition: multiplex.h:65
uint64_t video_delay
Definition: multiplex.h:48
extdata_t ext[N_AUDIO]
Definition: multiplex.h:74
int(* fill_buffers)(void *p, int f)
Definition: multiplex.h:82
int64_t extra_clock
Definition: multiplex.h:66
void write_out_packs(multiplex_t *mx, int video_ok, int *ext_ok)
Definition: multiplex.c:574
uint8_t navpack
Definition: multiplex.h:56
int set_broken_link
Definition: multiplex.h:64
dummy_buffer vdbuf
Definition: multiplex.h:72
int reset_clocks
Definition: multiplex.h:62
void check_times(multiplex_t *mx, int *video_ok, int *ext_ok, int *start)
Definition: multiplex.c:482
void finish_mpg(multiplex_t *mx)
Definition: multiplex.c:595
#define N_AUDIO
Definition: multiplex.h:33
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.c:676
ringbuffer * vrbuffer
Definition: multiplex.h:79
int fd_out
Definition: multiplex.h:37
uint64_t oldSCR
Definition: multiplex.h:68
ringbuffer * index_extrbuffer
Definition: multiplex.h:78