dvbd / remux.h @ bfdb7446
History | View | Annotate | Download (2.97 KB)
1 |
/*
|
---|---|
2 |
* mpegtools for the Siemens Fujitsu DVB PCI card
|
3 |
*
|
4 |
* Copyright (C) 2000, 2001 Marcus Metzler
|
5 |
* for convergence integrated media GmbH
|
6 |
*
|
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 |
* GNU 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
23 |
* Or, point your browser to http://www.gnu.org/copyleft/gpl.html
|
24 |
*
|
25 |
|
26 |
* The author can be reached at marcus@convergence.de,
|
27 |
|
28 |
* the project's page is at http://linuxtv.org/dvb/
|
29 |
*/
|
30 |
|
31 |
#include <stdio.h> |
32 |
#include <stdlib.h> |
33 |
#include <errno.h> |
34 |
#include <unistd.h> |
35 |
#include <netinet/in.h> |
36 |
#include <string.h> |
37 |
#include <sys/types.h> |
38 |
#include <sys/stat.h> |
39 |
#include <fcntl.h> |
40 |
#include <sys/ioctl.h> |
41 |
#include <libgen.h> |
42 |
#include <stdint.h> |
43 |
|
44 |
#include "ringbuffy.h" |
45 |
#include "ctools.h" |
46 |
|
47 |
#ifndef _REMUX_H_
|
48 |
#define _REMUX_H_
|
49 |
|
50 |
#ifdef __cplusplus
|
51 |
extern "C" { |
52 |
#endif /* __cplusplus */ |
53 |
|
54 |
typedef struct video_i{ |
55 |
u32 horizontal_size; |
56 |
u32 vertical_size ; |
57 |
u32 aspect_ratio ; |
58 |
double framerate ;
|
59 |
u32 video_format; |
60 |
u32 bit_rate ; |
61 |
u32 comp_bit_rate ; |
62 |
u32 vbv_buffer_size; |
63 |
u32 CSPF ; |
64 |
u32 off; |
65 |
} VideoInfo; |
66 |
|
67 |
typedef struct audio_i{ |
68 |
int layer;
|
69 |
u32 bit_rate; |
70 |
u32 frequency; |
71 |
u32 mode; |
72 |
u32 mode_extension; |
73 |
u32 emphasis; |
74 |
u32 framesize; |
75 |
u32 off; |
76 |
} AudioInfo; |
77 |
|
78 |
|
79 |
|
80 |
typedef
|
81 |
struct PTS_list_struct{
|
82 |
u32 PTS; |
83 |
int pos;
|
84 |
u32 dts; |
85 |
int spos;
|
86 |
} PTS_List; |
87 |
|
88 |
typedef
|
89 |
struct frame_list_struct{
|
90 |
int type;
|
91 |
int pos;
|
92 |
u32 FRAME; |
93 |
u32 time; |
94 |
u32 pts; |
95 |
u32 dts; |
96 |
} FRAME_List; |
97 |
|
98 |
typedef
|
99 |
struct remux_struct{
|
100 |
ringbuffy vid_buffy; |
101 |
ringbuffy aud_buffy; |
102 |
PTS_List vpts_list[MAX_PTS]; |
103 |
PTS_List apts_list[MAX_PTS]; |
104 |
FRAME_List vframe_list[MAX_FRAME]; |
105 |
FRAME_List aframe_list[MAX_FRAME]; |
106 |
int vptsn;
|
107 |
int aptsn;
|
108 |
int vframen;
|
109 |
int aframen;
|
110 |
long apes;
|
111 |
long vpes;
|
112 |
u32 vframe; |
113 |
u32 aframe; |
114 |
u32 vcframe; |
115 |
u32 acframe; |
116 |
u32 vpts; |
117 |
u32 vdts; |
118 |
u32 apts; |
119 |
u32 vpts_old; |
120 |
u32 apts_old; |
121 |
u32 SCR; |
122 |
u32 apts_off; |
123 |
u32 vpts_off; |
124 |
u32 apts_delay; |
125 |
u32 vpts_delay; |
126 |
u32 dts_delay; |
127 |
AudioInfo audio_info; |
128 |
VideoInfo video_info; |
129 |
int fin;
|
130 |
int fout;
|
131 |
long int awrite; |
132 |
long int vwrite; |
133 |
long int aread; |
134 |
long int vread; |
135 |
u32 group; |
136 |
u32 groupframe; |
137 |
u32 muxr; |
138 |
int pack_size;
|
139 |
u32 time_off; |
140 |
} Remux; |
141 |
|
142 |
enum { NONE, I_FRAME, P_FRAME, B_FRAME, D_FRAME };
|
143 |
|
144 |
void remux(int fin, int fout, int pack_size, int mult); |
145 |
void remux2(int fdin, int fdout); |
146 |
#ifdef __cplusplus
|
147 |
} |
148 |
#endif /* __cplusplus */ |
149 |
|
150 |
#endif /*_REMUX_H_*/ |