r1005: Increase the number of displayed digits for resample audio dialog box
[cinelerra_cv/mob.git] / cinelerra / iec61883input.h
blobeb0f9f1358c4ca50f1c23ddf903486ea4884ded9
1 #ifndef IEC61883INPUT_H
2 #define IEC61883INPUT_H
6 #ifdef HAVE_FIREWIRE
8 #include "condition.inc"
9 #include <libiec61883/iec61883.h>
10 #include "libdv.h"
11 #include "mutex.inc"
12 #include "thread.h"
13 #include "vframe.inc"
15 // Common 1394 input for audio and video
17 // Extracts video and audio from the single DV stream
18 class IEC61883Input : public Thread
20 public:
21 IEC61883Input();
22 ~IEC61883Input();
24 int open(int port,
25 int channel,
26 int length,
27 int channels,
28 int samplerate,
29 int bits,
30 int w,
31 int h);
32 void run();
33 void increment_counter(int *counter);
34 void decrement_counter(int *counter);
36 // Read a video frame with timed blocking
38 int read_video(VFrame *data);
41 // Read audio with timed blocking
43 int read_audio(char *data, int samples);
46 int write_frame(unsigned char *data, int len, int complete);
48 raw1394handle_t handle;
49 iec61883_dv_fb_t frame;
50 int fd;
60 // Storage of all frames
61 char **buffer;
62 int *buffer_valid;
63 int buffer_size;
64 int total_buffers;
65 int current_inbuffer;
67 // For extracting audio
68 dv_t *decoder;
70 // Storage of audio data
71 char *audio_buffer;
72 int audio_samples;
74 // number of next video buffer to read
75 int current_outbuffer;
76 unsigned char *input_buffer;
78 Mutex *buffer_lock;
79 Condition *video_lock;
80 Condition *audio_lock;
81 int done;
83 int port;
84 int channel;
85 int length;
86 int channels;
87 int samplerate;
88 int bits;
89 int w;
90 int h;
91 int is_pal;
98 #endif
102 #endif