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
25 #ifdef HAVE_VIDEO4LINUX
29 #include "vdevicebase.h"
30 #include <linux/videodev.h>
31 #include "videodevice.inc"
33 class VDeviceV4L : public VDeviceBase
36 VDeviceV4L(VideoDevice *device);
42 int read_buffer(VFrame *frame);
43 int get_best_colormodel(Asset *asset);
44 int set_channel(Channel *channel);
45 int set_picture(PictureConfig *picture);
48 int set_cloexec_flag(int desc, int value);
49 int set_mute(int muted);
50 int v4l1_get_inputs();
51 int v4l1_set_mute(int muted);
52 unsigned long translate_colormodel(int colormodel);
53 int v4l1_set_channel(Channel *channel);
54 int v4l1_get_norm(int norm);
55 int v4l1_set_picture(PictureConfig *picture);
56 void v4l1_start_capture();
57 int capture_frame(int capture_frame_number);
59 int read_v4l_frame(VFrame *frame);
60 int frame_to_vframe(VFrame *frame, unsigned char *input);
61 int next_frame(int previous_frame);
63 int unmap_v4l_shmem();
66 int input_fd, output_fd;
67 // FourCC Colormodel for device
68 unsigned long device_colormodel;
69 // BC colormodel for device
73 struct video_capability cap1;
74 struct video_window window_params;
75 struct video_picture picture_params;
76 struct video_mbuf capture_params; // Capture for Video4Linux
79 char *capture_buffer; // sequentual capture buffers for v4l1 or read buffer for v4l2
80 int capture_frame_number; // number of frame to capture into
81 int read_frame_number; // number of the captured frame to read
82 int shared_memory; // Capturing directly to memory
83 int initialization_complete;
88 #endif // HAVE_VIDEO4LINUX