license header for review
[cinelerra_cv/ct.git] / cinelerra / device1394input.h
blob4916cb31ef6d33904a939c5599177eb8bf9b67a3
1 #ifndef DEVICE1394INPUT_H
2 #define DEVICE1394INPUT_H
6 #ifdef HAVE_FIREWIRE
8 #include "condition.inc"
9 #include "libdv.h"
10 #include "dv1394.h"
11 #include "mutex.inc"
12 #include <libraw1394/raw1394.h>
13 #include "thread.h"
14 #include "vframe.inc"
16 // Common 1394 input for audio and video
18 // Extracts video and audio from the single DV stream
19 class Device1394Input : public Thread
21 public:
22 Device1394Input();
23 ~Device1394Input();
25 int open(const char *path,
26 int port,
27 int channel,
28 int length,
29 int channels,
30 int samplerate,
31 int bits,
32 int w,
33 int h);
34 void run();
35 void increment_counter(int *counter);
36 void decrement_counter(int *counter);
38 // Read a video frame with timed blocking
40 int read_video(VFrame *data);
43 // Read audio with timed blocking
45 int read_audio(char *data, int samples);
47 // Storage of all frames
48 char **buffer;
49 int *buffer_valid;
50 int buffer_size;
51 int total_buffers;
52 int current_inbuffer;
54 // For extracting audio
55 dv_t *decoder;
57 // Storage of audio data
58 char *audio_buffer;
59 int audio_samples;
61 // number of next video buffer to read
62 int current_outbuffer;
63 unsigned char *input_buffer;
65 Mutex *buffer_lock;
66 Condition *video_lock;
67 Condition *audio_lock;
68 int done;
70 int fd;
71 int channel;
72 int length;
73 int channels;
74 int samplerate;
75 int bits;
76 int w;
77 int h;
78 int is_pal;
85 #endif
89 #endif
91 // Local Variables:
92 // mode: C++
93 // c-file-style: "linux"
94 // End: