1 /*****************************************************************************
2 * v4l2.h : Video4Linux2 input module for vlc
3 *****************************************************************************
4 * Copyright (C) 2002-2011 the VideoLAN team
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
21 #include <vlc_common.h>
23 #if defined(HAVE_LINUX_VIDEODEV2_H)
24 # include <linux/videodev2.h>
25 #elif defined(HAVE_SYS_VIDEOIO_H)
26 # include <sys/videoio.h>
28 # error "No Video4Linux2 headers found."
34 # define v4l2_close close
36 # define v4l2_ioctl ioctl
37 # define v4l2_read read
38 # define v4l2_mmap mmap
39 # define v4l2_munmap munmap
42 #define CFG_PREFIX "v4l2-"
44 int ControlList(vlc_object_t *, int fd, bool b_demux);
46 /* TODO: remove this, use callbacks */
53 /* TODO: move this to .c */
61 struct buffer_t *p_buffers;
62 unsigned int i_nbuffers;
63 #define blocksize i_nbuffers /* HACK HACK */
66 uint32_t i_block_flags;
82 void ParseMRL(vlc_object_t *, const char *);
83 int OpenVideo(vlc_object_t *, demux_sys_t *, bool);
84 block_t* GrabVideo(vlc_object_t *, demux_sys_t *);
87 int DemuxOpen(vlc_object_t *);
88 void DemuxClose(vlc_object_t *);
89 float GetAbsoluteMaxFrameRate(vlc_object_t *, int fd, uint32_t fmt);
90 void GetMaxDimensions(vlc_object_t *, int fd, uint32_t fmt, float fps_min,
91 uint32_t *pwidth, uint32_t *pheight);
94 int AccessOpen(vlc_object_t *);
95 void AccessClose(vlc_object_t *);