1d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely/*
2d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *
3d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *
4d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *  Copyright (C) 2005 Mike Isely <isely@pobox.com>
5d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *
6d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *  This program is free software; you can redistribute it and/or modify
7d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *  it under the terms of the GNU General Public License as published by
8d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *  the Free Software Foundation; either version 2 of the License
9d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *
10d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *  This program is distributed in the hope that it will be useful,
11d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *  GNU General Public License for more details.
14d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *
15d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *  You should have received a copy of the GNU General Public License
16d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *  along with this program; if not, write to the Free Software
17d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely *
19d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely */
20d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely#ifndef __PVRUSB2_STD_H
21d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely#define __PVRUSB2_STD_H
22d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely
23d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely#include <linux/videodev2.h>
24d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely
25d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// Convert string describing one or more video standards into a mask of V4L
26d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// standard bits.  Return true if conversion succeeds otherwise return
27d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// false.  String is expected to be of the form: C1-x/y;C2-a/b where C1 and
28d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// C2 are color system names (e.g. "PAL", "NTSC") and x, y, a, and b are
29d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// modulation schemes (e.g. "M", "B", "G", etc).
30d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Iselyint pvr2_std_str_to_id(v4l2_std_id *idPtr,const char *bufPtr,
31d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely		       unsigned int bufSize);
32d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely
33d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// Convert any arbitrary set of video standard bits into an unambiguous
34d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// readable string.  Return value is the number of bytes consumed in the
35d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// buffer.  The formatted string is of a form that can be parsed by our
36d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// sibling std_std_to_id() function.
37d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Iselyunsigned int pvr2_std_id_to_str(char *bufPtr, unsigned int bufSize,
38d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely				v4l2_std_id id);
39d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely
40d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// Create an array of suitable v4l2_standard structures given a bit mask of
41d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// video standards to support.  The array is allocated from the heap, and
42d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// the number of elements is returned in the first argument.
43d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Iselystruct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr,
44d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely					   v4l2_std_id id);
45d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely
46d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely// Return mask of which video standard bits are valid
47d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Iselyv4l2_std_id pvr2_std_get_usable(void);
48d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely
49d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely#endif /* __PVRUSB2_STD_H */
50d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely
51d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely/*
52d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely  Stuff for Emacs to see, in order to encourage consistent editing style:
53d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely  *** Local Variables: ***
54d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely  *** mode: c ***
55d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely  *** fill-column: 75 ***
56d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely  *** tab-width: 8 ***
57d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely  *** c-basic-offset: 8 ***
58d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely  *** End: ***
59d855497edbfbf9e19a17f4a1154bca69cb4bd9baMike Isely  */
60