prevent popup deactivation while button_down
[goodguy/history.git] / cinelerra-5.1 / cinelerra / devicev4l2input.h
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 #ifndef DEVICEV4L2INPUT_H
23 #define DEVICEV4L2INPUT_H
24
25 #include "devicev4l2base.h"
26 #include "devicev4l2input.inc"
27 #include "devicempeginput.h"
28 #include "condition.h"
29 #include "audiodevice.h"
30 #include "videodevice.h"
31
32 #include <stdint.h>
33 #include "thread.h"
34 #include "libzmpeg3.h"
35
36 // stubs
37 class VDeviceV4L2;
38 class AudioV4L2;
39
40 class DeviceV4L2Status : public Thread
41 {
42         int done;
43         DeviceV4L2Input *in_v4l2;
44 public:
45         DeviceV4L2Status(DeviceV4L2Input *in_v4l2);
46         ~DeviceV4L2Status();
47         void run();
48 };
49
50 class DeviceV4L2Input : public DeviceV4L2Base, public DeviceMPEGInput
51 {
52         friend class DeviceV4L2Status;
53         DeviceV4L2Status *status_v4l2;
54         Channel *device_channel;
55 public:
56         DeviceV4L2Input(const char *name, int no);
57         static DeviceMPEGInput *NewV4L2Input(const char *name, int no);
58         ~DeviceV4L2Input();
59
60         static DeviceMPEGInput* get_mpeg_input(VideoDevice *device);
61         static DeviceMPEGInput* get_mpeg_input(AudioDevice *device);
62         void put_v4l2_video() { put_mpeg_video(); }
63         void put_v4l2_audio() { put_mpeg_audio(); }
64
65         int mpeg_fd();
66         int open_dev(int color_model);
67         void close_dev();
68         int status_dev();
69         int start_dev();
70         int stop_dev();
71
72         VideoDevice *v4l2_device();
73
74         VDeviceV4L2 *v4l2_video() {
75                 return video_device ? (VDeviceV4L2 *)video_device->input_base : 0;
76         }
77         AudioV4L2 *v4l2_audio() {
78                 return audio_device ? (AudioV4L2 *)audio_device->lowlevel_in : 0;
79         }
80 };
81
82 #endif