1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */ 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * 4*4882a593Smuzhiyun * Copyright (C) 2005 Mike Isely <isely@pobox.com> 5*4882a593Smuzhiyun */ 6*4882a593Smuzhiyun #ifndef __PVRUSB2_STD_H 7*4882a593Smuzhiyun #define __PVRUSB2_STD_H 8*4882a593Smuzhiyun 9*4882a593Smuzhiyun #include <linux/videodev2.h> 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun // Convert string describing one or more video standards into a mask of V4L 12*4882a593Smuzhiyun // standard bits. Return true if conversion succeeds otherwise return 13*4882a593Smuzhiyun // false. String is expected to be of the form: C1-x/y;C2-a/b where C1 and 14*4882a593Smuzhiyun // C2 are color system names (e.g. "PAL", "NTSC") and x, y, a, and b are 15*4882a593Smuzhiyun // modulation schemes (e.g. "M", "B", "G", etc). 16*4882a593Smuzhiyun int pvr2_std_str_to_id(v4l2_std_id *idPtr,const char *bufPtr, 17*4882a593Smuzhiyun unsigned int bufSize); 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun // Convert any arbitrary set of video standard bits into an unambiguous 20*4882a593Smuzhiyun // readable string. Return value is the number of bytes consumed in the 21*4882a593Smuzhiyun // buffer. The formatted string is of a form that can be parsed by our 22*4882a593Smuzhiyun // sibling std_std_to_id() function. 23*4882a593Smuzhiyun unsigned int pvr2_std_id_to_str(char *bufPtr, unsigned int bufSize, 24*4882a593Smuzhiyun v4l2_std_id id); 25*4882a593Smuzhiyun 26*4882a593Smuzhiyun // Create an array of suitable v4l2_standard structures given a bit mask of 27*4882a593Smuzhiyun // video standards to support. The array is allocated from the heap, and 28*4882a593Smuzhiyun // the number of elements is returned in the first argument. 29*4882a593Smuzhiyun struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr, 30*4882a593Smuzhiyun v4l2_std_id id); 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun // Return mask of which video standard bits are valid 33*4882a593Smuzhiyun v4l2_std_id pvr2_std_get_usable(void); 34*4882a593Smuzhiyun 35*4882a593Smuzhiyun #endif /* __PVRUSB2_STD_H */ 36