4 #include "condition.inc"
11 class FileThread
: public Thread
14 FileThread(File
*file
, int do_audio
, int do_video
);
17 void create_objects(File
*file
,
20 void delete_objects();
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
,
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();
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
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
52 int *last_buffer
; // last_buffer[ring buffer]
58 int buffer_size
; // Frames or samples per ring buffer
59 // Color model of frames
61 // Whether to use the compressed data in the frame