r999: maintainers added to README_en.
[cinelerra_cv/mob.git] / cinelerra / dv1394input.C
blobf42844a60ff89afee1a1889cef5d059c0132f10b
1 #include "dv1394input.h"
5 DV1394Input::DV1394Input(VideoDevice *device)
6  : Thread(1, 1, 0)
8         this->device = device;
9         done = 0;
10         fd = 0;
14 DV1394Input::~DV1394Input()
16         if(Thread::running())
17         {
18                 done = 1;
19                 Thread::cancel();
20                 Thread::join();
21         }
23         if(fd > 0) close(fd);
26 void DV1394Input::start()
28         Thread::start();
33 void DV1394Input::run()
35 // Open the device
36         int error = 0;
37         if((fd = open(device->in_config->dv1394_path, O_RDWR)) < 0)
38         {
39                 fprintf(stderr, 
40                         "DV1394Input::run path=s: %s\n", 
41                         device->in_config->dv1394_path, 
42                         strerror(errno));
43                 error = 1;
44         }
46         if(!error)
47         {
48         struct dv1394_init init = 
49                 {
50            api_version: DV1394_API_VERSION,
51            channel:     device->out_config->dv1394_channel,
52                    n_frames:    length,
53            format:      is_pal ? DV1394_PAL : DV1394_NTSC,
54            cip_n:       0,
55            cip_d:       0,
56            syt_offset:  syt
57         };
59                 
60         }
62         while(!done)
63         {
64                 
65         }