1 #ifndef DEVICE1394OUTPUT_H
2 #define DEVICE1394OUTPUT_H
8 #include "condition.inc"
13 #include "video1394.h"
14 #include <libdv/dv1394.h>
16 // Common 1394 output for audio and video
18 // This runs continuously to keep the VTR warm.
19 // Takes encoded DV frames and PCM audio. Does the 1394 encryption on the fly.
20 class Device1394Output
: public Thread
39 // Write frame with timed blocking.
41 void write_frame(VFrame
*input
);
44 // Write audio with timed blocking.
46 void write_samples(char *data
, int samples
);
47 long get_audio_position();
52 void encrypt(unsigned char *output
,
57 void increment_counter(int *counter
);
58 void decrement_counter(int *counter
);
67 int current_outbuffer
;
71 // Encoder for audio frames
75 // Block while waiting for the first buffer to be allocated
76 Condition
*start_lock
;
79 // Provide timed blocking for writing routines.
81 Condition
*video_lock
;
82 Condition
*audio_lock
;
88 struct dv1394_status status
;
89 struct video1394_mmap output_mmap
;
90 struct video1394_queue_variable output_queue
;
91 // raw1394handle_t avc_handle;
92 VFrame
*temp_frame
, *temp_frame2
;
93 // Encoder for making DV frames
96 unsigned int cip_n
, cip_d
;
97 unsigned int cip_counter
;
99 Device1394Output
*output_thread
;
100 unsigned char *output_buffer
;
102 unsigned int packet_sizes
[321];
103 unsigned char continuity_counter
;