fast drag mode honours follow_edits labels/plugins/keyframes
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / dv1394input.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #include "dv1394input.h"
23
24
25
26 DV1394Input::DV1394Input(VideoDevice *device)
27  : Thread(1, 1, 0)
28 {
29         this->device = device;
30         done = 0;
31         fd = 0;
32 }
33
34
35 DV1394Input::~DV1394Input()
36 {
37         if(Thread::running())
38         {
39                 done = 1;
40                 Thread::cancel();
41         }
42         Thread::join();
43
44         if(fd > 0) close(fd);
45 }
46
47 void DV1394Input::start()
48 {
49         Thread::start();
50 }
51
52
53
54 void DV1394Input::run()
55 {
56 // Open the device
57         int error = 0;
58         if((fd = open(device->in_config->dv1394_path, O_RDWR)) < 0)
59         {
60                 fprintf(stderr,
61                         "DV1394Input::run path=s: %s\n",
62                         device->in_config->dv1394_path,
63                         strerror(errno));
64                 error = 1;
65         }
66
67         if(!error)
68         {
69         struct dv1394_init init =
70                 {
71            api_version: DV1394_API_VERSION,
72            channel:     device->out_config->dv1394_channel,
73                    n_frames:    length,
74            format:      is_pal ? DV1394_PAL : DV1394_NTSC,
75            cip_n:       0,
76            cip_d:       0,
77            syt_offset:  syt
78         };
79
80
81         }
82
83         while(!done)
84         {
85
86         }
87 }