initial commit
[goodguy/history.git] / cinelerra-5.0 / cinelerra / filefork.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2009 Adam Williams <broadcast at earthling dot net>
5  * 
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  */
21
22
23 #ifndef FILEFORK_H
24 #define FILEFORK_H
25
26 #include "file.inc"
27 #include "fileserver.inc"
28 #include "forkwrapper.h"
29
30 // This is an object created by File which runs in a separate process to 
31 // actually interface the data.  File functions redirect to this process.
32 // This is to isolate file format crashes.
33
34
35
36 #ifdef USE_FILEFORK
37 class FileFork : public ForkWrapper
38 {
39 public:
40         FileFork(FileServer *server);
41         virtual ~FileFork();
42         
43         void init_child();
44         int handle_command();
45
46 // Instance of file that does the actual work.  
47         File *file;
48 // If this is a dummy filefork, the pointer of the real filefork in the fileserver
49 // memory space.
50         FileFork *real_fork;
51         FileServer *server;
52
53 // Command tokens
54         enum
55         {
56                 NO_COMMAND,
57                 OPEN_FILE,
58                 SET_PROCESSORS,
59                 SET_PRELOAD,
60                 SET_SUBTITLE,
61                 SET_INTERPOLATE_RAW,
62                 SET_WHITE_BALANCE_RAW,
63                 CLOSE_FILE,
64                 GET_INDEX,
65                 START_VIDEO_THREAD,
66                 START_AUDIO_THREAD,             // 10
67                 START_VIDEO_DECODE_THREAD,
68                 STOP_AUDIO_THREAD,
69                 STOP_VIDEO_THREAD,
70                 SET_CHANNEL,
71                 SET_LAYER,
72                 GET_AUDIO_LENGTH,
73                 GET_VIDEO_LENGTH,
74                 GET_AUDIO_POSITION,
75                 GET_VIDEO_POSITION,
76                 SET_AUDIO_POSITION,             // 20
77                 SET_VIDEO_POSITION,
78                 WRITE_SAMPLES,
79                 WRITE_FRAMES,
80                 WRITE_AUDIO_BUFFER,
81                 WRITE_VIDEO_BUFFER,
82                 GET_AUDIO_BUFFER,
83                 GET_VIDEO_BUFFER,
84                 READ_SAMPLES,
85                 READ_COMPRESSED_FRAME,
86                 COMPRESSED_FRAME_SIZE,          // 30
87                 READ_FRAME,
88                 CAN_COPY_FROM,
89                 COLORMODEL_SUPPORTED,
90                 FILE_MEMORY_USAGE,
91                 SET_PROGRAM,
92                 GET_CELL_TIME,
93                 GET_STT_TIME,
94                 GET_AUDIO4VIDEO,
95                 GET_VIDEO_PID, 
96                 GET_VIDEO_INFO,                 // 40
97                 SELECT_VIDEO_STREAM,
98                 SELECT_AUDIO_STREAM,
99         };
100 };
101
102 #endif // USE_FILEFORK
103
104
105 #endif
106
107
108