00001 /* 00002 * replex.h 00003 * 00004 * 00005 * Copyright (C) 2003 Marcus Metzler <mocm@metzlerbros.de> 00006 * Metzler Brothers Systementwicklung GbR 00007 * 00008 * This program is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU General Public License 00010 * as published by the Free Software Foundation; either version 2 00011 * of the License, or (at your option) any later version. 00012 * 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * General Public License for more details. 00018 * 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 00024 * 00025 */ 00026 00027 #ifndef _REPLEX_H_ 00028 #define _REPLEX_H_ 00029 00030 #include <stdint.h> 00031 #include "mpg_common.h" 00032 #include "ts.h" 00033 #include "element.h" 00034 #include "ringbuffer.h" 00035 #include "avi.h" 00036 #include "multiplex.h" 00037 00038 enum { S_SEARCH, S_FOUND, S_ERROR }; 00039 00040 struct replex { 00041 #define REPLEX_TS 0 00042 #define REPLEX_PS 1 00043 #define REPLEX_AVI 2 00044 int itype; 00045 int otype; 00046 int ignore_pts; 00047 int keep_pts; 00048 int fix_sync; 00049 uint64_t inflength; 00050 uint64_t finread; 00051 int lastper; 00052 int avi_rest; 00053 int avi_vcount; 00054 int fd_in; 00055 int fd_out; 00056 int finish; 00057 int demux; 00058 int dmx_out[N_AC3+N_AUDIO+1]; 00059 int analyze; 00060 avi_context ac; 00061 int vdr; 00062 00063 uint64_t video_delay; 00064 uint64_t audio_delay; 00065 00066 #define VIDEO_BUF (6*1024*1024) 00067 #define AUDIO_BUF (VIDEO_BUF/10) 00068 #define AC3_BUF (VIDEO_BUF/10) 00069 #define INDEX_BUF (32000*32) 00070 int audiobuf; 00071 int ac3buf; 00072 int videobuf; 00073 00074 int ext_count; 00075 int exttype[N_AUDIO]; 00076 int exttypcnt[N_AUDIO]; 00077 audio_frame_t extframe[N_AUDIO]; 00078 ringbuffer extrbuffer[N_AUDIO]; 00079 ringbuffer index_extrbuffer[N_AUDIO]; 00080 00081 //ac3 00082 int ac3n; 00083 uint16_t ac3_id[N_AC3]; 00084 pes_in_t pac3[N_AC3]; 00085 index_unit current_ac3index[N_AC3]; 00086 int ac3pes_abort[N_AC3]; 00087 ringbuffer ac3rbuffer[N_AC3]; 00088 ringbuffer index_ac3rbuffer[N_AC3]; 00089 uint64_t ac3frame_count[N_AC3]; 00090 audio_frame_t ac3frame[N_AC3]; 00091 uint64_t first_ac3pts[N_AC3]; 00092 int ac3_state[N_AUDIO]; 00093 uint64_t last_ac3pts[N_AC3]; 00094 00095 // mpeg audio 00096 int apidn; 00097 uint16_t apid[N_AUDIO]; 00098 pes_in_t paudio[N_AUDIO]; 00099 index_unit current_aindex[N_AUDIO]; 00100 int apes_abort[N_AUDIO]; 00101 ringbuffer arbuffer[N_AUDIO]; 00102 ringbuffer index_arbuffer[N_AUDIO]; 00103 uint64_t aframe_count[N_AUDIO]; 00104 audio_frame_t aframe[N_AUDIO]; 00105 uint64_t first_apts[N_AUDIO]; 00106 int audio_state[N_AUDIO]; 00107 uint64_t last_apts[N_AUDIO]; 00108 00109 //mpeg video 00110 uint16_t vpid; 00111 int first_iframe; 00112 pes_in_t pvideo; 00113 index_unit current_vindex; 00114 int vpes_abort; 00115 ringbuffer vrbuffer; 00116 ringbuffer index_vrbuffer; 00117 uint64_t vframe_count; 00118 uint64_t vgroup_count; 00119 sequence_t seq_head; 00120 uint64_t first_vpts; 00121 int video_state; 00122 uint64_t last_vpts; 00123 00124 void *priv; 00125 int scan_found; 00126 }; 00127 00128 void init_index(index_unit *iu); 00129 #endif
1.6.3