CVD 0.8
cvd_src/Linux/kernel-video1394.h
00001 /*                       
00002     This file is part of the CVD Library.
00003 
00004     Copyright (C) 2005 The Authors
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Lesser General Public
00008     License as published by the Free Software Foundation; either
00009     version 2.1 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Lesser General Public License for more details.
00015 
00016     You should have received a copy of the GNU Lesser General Public
00017     License along with this library; if not, write to the Free Software
00018     Foundation, Inc., 
00019     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 */
00021 #ifndef CVD_KERNEL_VIDEO1394_H
00022 #define CVD_KERNEL_VIDEO1394_H
00023 
00024 //Header file which contains stuff which is 100% compatible with 
00025 //drivers/ieee1394/video1394.h
00026 //without including any GPL code.
00027 
00028 
00029 #include <sys/ioctl.h>
00030 #include <sys/time.h>
00031 
00032 #define SYNC_FRAMES      1
00033 
00034 struct cvd_video1394_mmap 
00035 {
00036     int channel_number;
00037     unsigned int syncronization_tag;
00038     unsigned int num_buffers;
00039     unsigned int buffer_size;
00040     unsigned int size_of_packet;
00041     unsigned int frames_per_second;
00042     unsigned int syt_time_offset;
00043     unsigned int capture_flags;     
00044 };
00045 
00046 struct cvd_video1394_wait 
00047 {
00048     unsigned int channel_number;
00049     unsigned int buffer;
00050     struct timeval time;                //Buffer filled up at this time
00051 };
00052 
00053 
00054 //Define the ioctls
00055 
00056 #if (((CVD_KERNEL_MAJOR==2) && (CVD_KERNEL_MINOR==6)) || (CVD_KERNEL_MAJOR>=3))
00057     #define LISTEN_CHANNEL          _IOWR('#', 0x10, struct cvd_video1394_mmap)
00058     #define UNLISTEN_CHANNEL        _IOW ('#', 0x11, int)
00059     #define LISTEN_QUEUE_BUFFER     _IOW ('#', 0x12, struct cvd_video1394_wait)
00060     #define LISTEN_WAIT_BUFFER      _IOWR('#', 0x13, struct cvd_video1394_wait)
00061     #define LISTEN_POLL_BUFFER      _IOWR('#', 0x18, struct cvd_video1394_wait)
00062 #elif ((CVD_KERNEL_MAJOR==2) && (CVD_KERNEL_MINOR==4))
00063     #define LISTEN_CHANNEL          0
00064     #define UNLISTEN_CHANNEL        1
00065     #define LISTEN_QUEUE_BUFFER     2
00066     #define LISTEN_WAIT_BUFFER      3
00067     #define LISTEN_POLL_BUFFER      8
00068 #else 
00069     #define UNKNOWN_KERNEL
00070 #endif
00071 
00072 #endif