3 #include "audioconfig.h"
4 #include "audiodevice.h"
5 #include "device1394input.h"
6 #include "device1394output.h"
8 #include "preferences.h"
9 #include "recordconfig.h"
10 #include "vdevice1394.h"
12 #include "playbackconfig.h"
13 #include "videodevice.h"
25 VDevice1394::VDevice1394(VideoDevice *device)
31 VDevice1394::~VDevice1394()
36 int VDevice1394::initialize()
43 int VDevice1394::open_input()
45 //printf("VDevice1394::open_input 1\n");
46 // Share audio driver. The audio driver does the capturing in this case
47 // and fills video frames for us.
50 device->adevice->in_config->driver == AUDIO_1394)
52 Audio1394 *low_level = (Audio1394*)device->adevice->get_lowlevel_in();
53 input_thread = low_level->input_thread;
59 input_thread = new Device1394Input;
60 result = input_thread->open(device->in_config->firewire_port,
61 device->in_config->firewire_channel,
62 device->in_config->capture_length,
75 int VDevice1394::open_output()
77 // Share audio driver. The audio driver takes DV frames from us and
80 device->adevice->out_config->driver == AUDIO_1394)
82 Audio1394 *low_level = (Audio1394*)device->adevice->get_lowlevel_out();
83 output_thread = low_level->output_thread;
89 output_thread = new Device1394Output;
90 output_thread->open(device->out_config->firewire_path,
91 device->out_config->firewire_port,
92 device->out_config->firewire_channel,
97 device->out_config->firewire_syt,
98 device->out_config->firewire_use_dv1394);
104 int VDevice1394::close_all()
121 delete output_thread;
125 if(user_frame) delete user_frame;
131 int VDevice1394::read_buffer(VFrame *frame)
136 if(!input_thread) return 1;
138 input_thread->read_video(frame);
144 void VDevice1394::new_output_buffer(VFrame **outputs,
149 if(colormodel != user_frame->get_color_model())
161 user_frame = new VFrame;
164 user_frame = new VFrame(0,
172 user_frame->set_shm_offset(0);
173 outputs[0] = user_frame;
176 int VDevice1394::write_buffer(VFrame **frame, EDL *edl)
178 output_thread->write_frame(frame[0]);
185 int VDevice1394::can_copy_from(Asset *asset, int output_w, int output_h)
200 #endif // HAVE_FIREWIRE