mask mousewheel segv bug, mask opengl sw fallback read to ram, fix tiff config withou...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / device1394input.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 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 #ifndef DEVICE1394INPUT_H
23 #define DEVICE1394INPUT_H
24
25
26
27 #ifdef HAVE_FIREWIRE
28
29 #include "condition.inc"
30 #include "libdv.h"
31 #include "dv1394.h"
32 #include "mutex.inc"
33 #include <libraw1394/raw1394.h>
34 #include "thread.h"
35 #include "vframe.inc"
36
37 // Common 1394 input for audio and video
38
39 // Extracts video and audio from the single DV stream
40 class Device1394Input : public Thread
41 {
42 public:
43         Device1394Input();
44         ~Device1394Input();
45
46         int open(const char *path,
47                 int port,
48                 int channel,
49                 int length,
50                 int channels,
51                 int samplerate,
52                 int bits,
53                 int w,
54                 int h);
55         void run();
56         void increment_counter(int *counter);
57         void decrement_counter(int *counter);
58
59 // Read a video frame with timed blocking
60
61         int read_video(VFrame *data);
62
63
64 // Read audio with timed blocking
65
66         int read_audio(char *data, int samples);
67
68 // Storage of all frames
69         char **buffer;
70         int *buffer_valid;
71         int buffer_size;
72         int total_buffers;
73         int current_inbuffer;
74
75 // For extracting audio
76         dv_t *decoder;
77
78 // Storage of audio data
79         char *audio_buffer;
80         int audio_samples;
81
82 // number of next video buffer to read
83         int current_outbuffer;
84         unsigned char *input_buffer;
85
86         Mutex *buffer_lock;
87         Condition *video_lock;
88         Condition *audio_lock;
89         int done;
90
91         int fd;
92         int channel;
93         int length;
94         int channels;
95         int samplerate;
96         int bits;
97         int w;
98         int h;
99         int is_pal;
100 };
101
102
103
104
105
106 #endif
107
108
109
110 #endif