]> git.vomp.tv Git - vompserver.git/blob - libdvbmpeg/remux.h
Initial import
[vompserver.git] / libdvbmpeg / remux.h
1 /*
2  *  dvb-mpegtools for the Siemens Fujitsu DVB PCI card
3  *
4  * Copyright (C) 2000, 2001 Marcus Metzler 
5  *            for convergence integrated media GmbH
6  * Copyright (C) 2002 Marcus Metzler 
7  * 
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  * 
14
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  * 
20
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24  * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
25  * 
26
27  * The author can be reached at mocm@metzlerbros.de, 
28  */
29
30 #include <stdio.h>
31 #include <stdlib.h>
32 #include <errno.h>
33 #include <unistd.h>
34 #include <netinet/in.h>
35 #include <string.h>
36 #include <sys/types.h>
37 #include <sys/stat.h>
38 #include <fcntl.h>
39 #include <sys/ioctl.h>
40 //#include <libgen.h>
41 #include <stdint.h>
42
43 #include "ringbuffy.h"
44 #include "ctools.h"
45
46 #ifndef _REMUX_H_
47 #define _REMUX_H_
48
49 #ifdef __cplusplus
50 extern "C" {
51 #endif                          /* __cplusplus */
52
53         typedef struct video_i{
54                 uint32_t horizontal_size;
55                 uint32_t vertical_size  ;
56                 uint32_t aspect_ratio   ;
57                 double framerate        ;
58                 uint32_t video_format;
59                 uint32_t bit_rate       ;
60                 uint32_t comp_bit_rate  ;
61                 uint32_t vbv_buffer_size;
62                 uint32_t CSPF           ;
63                 uint32_t off;
64         } VideoInfo;            
65
66         typedef struct audio_i{
67                 int layer;
68                 uint32_t bit_rate;
69                 uint32_t frequency;
70                 uint32_t mode;
71                 uint32_t mode_extension;
72                 uint32_t emphasis;
73                 uint32_t framesize;
74                 uint32_t off;
75         } AudioInfo;
76
77
78
79         typedef
80         struct PTS_list_struct{
81                 uint32_t PTS;
82                 int pos;
83                 uint32_t dts;
84                 int spos;
85         } PTS_List;
86
87         typedef
88         struct frame_list_struct{
89                 int type;
90                 int pos;
91                 uint32_t FRAME;
92                 uint32_t time;
93                 uint32_t pts;
94                 uint32_t dts;
95         } FRAME_List;
96
97         typedef
98         struct remux_struct{
99                 ringbuffy vid_buffy;
100                 ringbuffy aud_buffy;
101                 PTS_List vpts_list[MAX_PTS];
102                 PTS_List apts_list[MAX_PTS];
103                 FRAME_List vframe_list[MAX_FRAME];
104                 FRAME_List aframe_list[MAX_FRAME];
105                 int vptsn;
106                 int aptsn;
107                 int vframen;
108                 int aframen;
109                 long apes;
110                 long vpes;
111                 uint32_t vframe;
112                 uint32_t aframe;
113                 uint32_t vcframe;
114                 uint32_t acframe;
115                 uint32_t vpts;
116                 uint32_t vdts;
117                 uint32_t apts;
118                 uint32_t vpts_old;
119                 uint32_t apts_old;
120                 uint32_t SCR;
121                 uint32_t apts_off;
122                 uint32_t vpts_off;
123                 uint32_t apts_delay;
124                 uint32_t vpts_delay;
125                 uint32_t dts_delay;
126                 AudioInfo audio_info;
127                 VideoInfo video_info;
128                 int fin;
129                 int fout;
130                 long int awrite;
131                 long int vwrite;
132                 long int aread;
133                 long int vread;
134                 uint32_t group;
135                 uint32_t groupframe;
136                 uint32_t muxr;
137                 int pack_size;
138                 uint32_t time_off;
139         } Remux;
140
141         enum { NONE, I_FRAME, P_FRAME, B_FRAME, D_FRAME };
142
143         void remux(int fin, int fout, int pack_size, int mult);
144         void remux2(int fdin, int fdout);
145 #ifdef __cplusplus
146 }
147 #endif                          /* __cplusplus */
148
149 #endif /*_REMUX_H_*/