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 ||
51 device->adevice->in_config->driver == AUDIO_DV1394))
53 Audio1394 *low_level = (Audio1394*)device->adevice->get_lowlevel_in();
54 input_thread = low_level->input_thread;
60 input_thread = new Device1394Input;
61 result = input_thread->open(device->in_config->firewire_port,
62 device->in_config->firewire_channel,
63 device->in_config->capture_length,
76 int VDevice1394::open_output()
78 // Share audio driver. The audio driver takes DV frames from us and
81 (device->adevice->out_config->driver == AUDIO_1394 ||
82 device->adevice->out_config->driver == AUDIO_DV1394))
84 Audio1394 *low_level = (Audio1394*)device->adevice->get_lowlevel_out();
85 output_thread = low_level->output_thread;
91 output_thread = new Device1394Output(device);
92 if(device->out_config->driver == PLAYBACK_DV1394)
94 output_thread->open(device->out_config->dv1394_path,
95 device->out_config->dv1394_port,
96 device->out_config->dv1394_channel,
101 device->out_config->dv1394_syt);
105 output_thread->open(device->out_config->firewire_path,
106 device->out_config->firewire_port,
107 device->out_config->firewire_channel,
112 device->out_config->firewire_syt);
119 int VDevice1394::close_all()
136 delete output_thread;
140 if(user_frame) delete user_frame;
146 int VDevice1394::read_buffer(VFrame *frame)
151 if(!input_thread) return 1;
153 input_thread->read_video(frame);
159 void VDevice1394::new_output_buffer(VFrame **outputs,
164 if(colormodel != user_frame->get_color_model())
176 user_frame = new VFrame;
179 user_frame = new VFrame(0,
187 user_frame->set_shm_offset(0);
188 outputs[0] = user_frame;
191 int VDevice1394::write_buffer(VFrame **frame, EDL *edl)
193 output_thread->write_frame(frame[0]);
200 int VDevice1394::can_copy_from(Asset *asset, int output_w, int output_h)
215 #endif // HAVE_FIREWIRE