4 #include "condition.inc"
11 class FileThread
: public Thread
14 FileThread(File
*file
, int do_audio
, int do_video
);
15 FileThread(File
*file
,
24 void create_objects(File
*file
,
32 // Allocate the buffers and start loop
33 int start_writing(long buffer_size
,
38 // write data into next available buffer
39 int write_buffer(long size
);
40 // get pointer to next buffer to be written and lock it
41 double** get_audio_buffer();
42 // get pointer to next frame to be written and lock it
43 VFrame
*** get_video_buffer();
48 double **audio_buffer
[RING_BUFFERS
];
49 // (VFrame*)(VFrame array *)(Track *)[ring buffer]
50 VFrame
***video_buffer
[RING_BUFFERS
];
51 long output_size
[RING_BUFFERS
]; // Number of frames or samples to write
52 int is_compressed
[RING_BUFFERS
]; // Whether to use the compressed data in the frame
53 Condition
*output_lock
[RING_BUFFERS
], *input_lock
[RING_BUFFERS
];
54 // Lock access to the file to allow it to be changed without stopping the loop
58 int last_buffer
[RING_BUFFERS
];
64 int buffer_size
; // Frames or samples per ring buffer
65 // Color model of frames