4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #ifndef DEVICEV4L2INPUT_H
23 #define DEVICEV4L2INPUT_H
25 #ifdef HAVE_VIDEO4LINUX2
27 #include "devicev4l2base.h"
28 #include "devicev4l2input.inc"
29 #include "devicempeginput.h"
30 #include "condition.h"
31 #include "audiodevice.h"
32 #include "videodevice.h"
36 #include "libzmpeg3.h"
42 class DeviceV4L2Status : public Thread
45 DeviceV4L2Input *in_v4l2;
47 DeviceV4L2Status(DeviceV4L2Input *in_v4l2);
52 class DeviceV4L2Input : public DeviceV4L2Base, public DeviceMPEGInput
54 friend class DeviceV4L2Status;
55 DeviceV4L2Status *status_v4l2;
56 Channel *device_channel;
58 DeviceV4L2Input(const char *name, int no);
59 static DeviceMPEGInput *NewV4L2Input(const char *name, int no);
62 static DeviceMPEGInput* get_mpeg_input(VideoDevice *device);
63 static DeviceMPEGInput* get_mpeg_input(AudioDevice *device);
64 void put_v4l2_video() { put_mpeg_video(); }
65 void put_v4l2_audio() { put_mpeg_audio(); }
68 int open_dev(int color_model);
74 VideoDevice *v4l2_device();
76 VDeviceV4L2 *v4l2_video() {
77 return video_device ? (VDeviceV4L2 *)video_device->input_base : 0;
79 AudioV4L2 *v4l2_audio() {
80 return audio_device ? (AudioV4L2 *)audio_device->lowlevel_in : 0;