1 #ifndef DEVICE1394OUTPUT_H
2 #define DEVICE1394OUTPUT_H
8 #include "condition.inc"
13 #include "video1394.h"
15 // Common 1394 output for audio and video
17 // This runs continuously to keep the VTR warm.
18 // Takes encoded DV frames and PCM audio. Does the 1394 encryption on the fly.
19 class Device1394Output
: public Thread
37 // Write frame with timed blocking.
39 void write_frame(VFrame
*input
);
42 // Write audio with timed blocking.
44 void write_samples(char *data
, int samples
);
45 long get_audio_position();
50 void encrypt(unsigned char *output
,
55 void increment_counter(int *counter
);
56 void decrement_counter(int *counter
);
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 struct video1394_mmap output_mmap
;
87 struct video1394_queue_variable output_queue
;
88 // raw1394handle_t avc_handle;
89 VFrame
*temp_frame
, *temp_frame2
;
90 // Encoder for making DV frames
93 unsigned int cip_n
, cip_d
;
94 unsigned int cip_counter
;
96 Device1394Output
*output_thread
;
97 unsigned char *output_buffer
;
99 unsigned int packet_sizes
[321];
100 unsigned char continuity_counter
;