r885: Don't delete a borrowed frame.
[cinelerra_cv/ct.git] / cinelerra / indexthread.h
blob54fba019604dd640d5a8d8b428b81a6fef0beb48
1 #ifndef INDEXTHREAD_H
2 #define INDEXTHREAD_H
4 #include "asset.inc"
5 #include "condition.inc"
6 #include "indexfile.inc"
7 #include "mwindow.inc"
8 #include "thread.h"
10 #define TOTAL_BUFFERS 2
12 // Recieves buffers from Indexfile and calculates the index.
14 class IndexThread : public Thread
16 public:
17 IndexThread(MWindow *mwindow,
18 IndexFile *index_file,
19 Asset *asset,
20 char *index_filename,
21 int64_t buffer_size,
22 int64_t length_source);
23 ~IndexThread();
25 friend class IndexFile;
27 int start_build();
28 int stop_build();
29 void run();
31 IndexFile *index_file;
32 MWindow *mwindow;
33 Asset *asset;
34 char *index_filename;
35 int64_t buffer_size, length_source;
36 int current_buffer;
38 private:
39 int interrupt_flag;
40 double **buffer_in[TOTAL_BUFFERS];
41 Condition *input_lock[TOTAL_BUFFERS], *output_lock[TOTAL_BUFFERS];
42 int last_buffer[TOTAL_BUFFERS];
43 int64_t input_len[TOTAL_BUFFERS];
48 #endif