1 #ifndef IEC61883OUTPUT_H
2 #define IEC61883OUTPUT_H
8 #include "audiodevice.inc"
9 #include "condition.inc"
10 #include <libiec61883/iec61883.h>
15 #include "videodevice.inc"
17 // Common 1394 output for audio and video
19 // This runs continuously to keep the VTR warm.
20 // Takes encoded DV frames and PCM audio.
21 class IEC61883Output
: public Thread
24 IEC61883Output(VideoDevice
*vdevice
);
25 IEC61883Output(AudioDevice
*adevice
);
40 // Write frame with timed blocking.
42 void write_frame(VFrame
*input
);
45 // Write audio with timed blocking.
47 void write_samples(char *data
, int samples
);
48 long get_audio_position();
54 void increment_counter(int *counter
);
55 void decrement_counter(int *counter
);
56 int read_frame(unsigned char *data
, int n
, unsigned int dropped
);
65 int current_outbuffer
;
69 // Encoder for audio frames
73 // Block while waiting for the first buffer to be allocated
74 Condition
*start_lock
;
77 // Provide timed blocking for writing routines.
79 Condition
*video_lock
;
80 Condition
*audio_lock
;
86 raw1394handle_t handle
;
88 // Must break up each frame into 480 byte chunks again.
97 VFrame
*temp_frame
, *temp_frame2
;
98 // Encoder for making DV frames
101 unsigned char *output_buffer
;
103 unsigned int packet_sizes
[321];
104 unsigned char continuity_counter
;
115 VideoDevice
*vdevice
;
116 AudioDevice
*adevice
;