11 #include "vdevicebase.h"
12 #include "vdevicebuz.inc"
16 #define INPUT_BUFFER_SIZE 0x40000
18 // Let's get real. The Buz driver doesn't work. If the buffers overflow
19 // for enough time it locks up and can't be recovered except by a
20 // SIGINT and restart. We need to cascade the buffer reading in another
21 // ring buffer thread, have it read continuously, and cancel it if it
22 // dies. How about if we do this in SCHED_RR and wait for it to die before
23 // implementing cancellation?
26 class VDeviceBUZInput
: public Thread
29 VDeviceBUZInput(VDeviceBUZ
*device
);
33 void get_buffer(char **ptr
, int *size
);
35 void increment_counter(int *counter
);
36 void decrement_counter(int *counter
);
43 int current_outbuffer
;
50 class VDeviceBUZ
: public VDeviceBase
53 VDeviceBUZ(VideoDevice
*device
);
56 friend class VDeviceBUZInput
;
61 int read_buffer(VFrame
*frame
);
62 int write_buffer(VFrame
**frames
, EDL
*edl
);
63 int reset_parameters();
64 ArrayList
<int>* get_render_strategies();
65 int set_channel(Channel
*channel
);
66 int get_norm(int norm
);
67 static void get_inputs(ArrayList
<char *> *input_sources
);
68 int set_picture(int brightness
,
73 int get_best_colormodel(int colormodel
);
74 void create_channeldb(ArrayList
<Channel
*> *channeldb
);
75 void new_output_buffer(VFrame
**outputs
, int colormodel
);
79 int open_input_core(Channel
*channel
);
80 int close_input_core();
81 int open_output_core(Channel
*channel
);
82 int close_output_core();
85 char *input_buffer
, *frame_buffer
, *output_buffer
;
86 long frame_size
, frame_allocated
;
88 // quicktime_mjpeg_hdr jpeg_header;
90 ArrayList
<int> render_strategies
;
91 // Temporary frame for compressing output data
93 // Frame given to user to acquire data
97 VDeviceBUZInput
*input_thread
;
99 struct buz_params bparm
;
100 struct buz_requestbuffers breq
;
101 // Can't CSYNC the first loop
103 // Number of output frame to load