r632: Boost up the requirement for mjpegtools to 1.6.3
[cinelerra_cv/mob.git] / cinelerra / filethread.h
blob76000293251bf692a8afc07c250b37ae98335509
1 #ifndef FILETHREAD_H
2 #define FILETHREAD_H
4 #include "condition.inc"
5 #include "file.inc"
6 #include "mutex.inc"
7 #include "thread.h"
8 #include "vframe.inc"
11 class FileThread : public Thread
13 public:
14 FileThread(File *file, int do_audio, int do_video);
15 ~FileThread();
17 void create_objects(File *file,
18 int do_audio,
19 int do_video);
20 void delete_objects();
21 void reset();
22 int start_writing();
23 // Allocate the buffers and start loop.
24 // compressed - if 1 write_compressed_frames is called in the file
25 // - if 0 write_frames is called
26 int start_writing(long buffer_size,
27 int color_model,
28 int ring_buffers,
29 int compressed);
30 int stop_writing();
31 // write data into next available buffer
32 int write_buffer(long size);
33 // get pointer to next buffer to be written and lock it
34 double** get_audio_buffer();
35 // get pointer to next frame to be written and lock it
36 VFrame*** get_video_buffer();
38 void run();
39 int swap_buffer();
41 double ***audio_buffer;
42 // (VFrame*)(VFrame array *)(Track *)[ring buffer]
43 VFrame ****video_buffer;
44 long *output_size; // Number of frames or samples to write
45 // Not used
46 int *is_compressed; // Whether to use the compressed data in the frame
47 Condition **output_lock, **input_lock;
48 // Lock access to the file to allow it to be changed without stopping the loop
49 Mutex *file_lock;
50 int current_buffer;
51 int local_buffer;
52 int *last_buffer; // last_buffer[ring buffer]
53 int return_value;
54 int do_audio;
55 int do_video;
56 File *file;
57 int ring_buffers;
58 int buffer_size; // Frames or samples per ring buffer
59 // Color model of frames
60 int color_model;
61 // Whether to use the compressed data in the frame
62 int compressed;
67 #endif