1*2504ba9fSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 20c0d06caSMauro Carvalho Chehab /* 30c0d06caSMauro Carvalho Chehab * 40c0d06caSMauro Carvalho Chehab * Copyright (C) 2005 Mike Isely <isely@pobox.com> 50c0d06caSMauro Carvalho Chehab */ 60c0d06caSMauro Carvalho Chehab #ifndef __PVRUSB2_STD_H 70c0d06caSMauro Carvalho Chehab #define __PVRUSB2_STD_H 80c0d06caSMauro Carvalho Chehab 90c0d06caSMauro Carvalho Chehab #include <linux/videodev2.h> 100c0d06caSMauro Carvalho Chehab 110c0d06caSMauro Carvalho Chehab // Convert string describing one or more video standards into a mask of V4L 120c0d06caSMauro Carvalho Chehab // standard bits. Return true if conversion succeeds otherwise return 130c0d06caSMauro Carvalho Chehab // false. String is expected to be of the form: C1-x/y;C2-a/b where C1 and 140c0d06caSMauro Carvalho Chehab // C2 are color system names (e.g. "PAL", "NTSC") and x, y, a, and b are 150c0d06caSMauro Carvalho Chehab // modulation schemes (e.g. "M", "B", "G", etc). 160c0d06caSMauro Carvalho Chehab int pvr2_std_str_to_id(v4l2_std_id *idPtr,const char *bufPtr, 170c0d06caSMauro Carvalho Chehab unsigned int bufSize); 180c0d06caSMauro Carvalho Chehab 190c0d06caSMauro Carvalho Chehab // Convert any arbitrary set of video standard bits into an unambiguous 200c0d06caSMauro Carvalho Chehab // readable string. Return value is the number of bytes consumed in the 210c0d06caSMauro Carvalho Chehab // buffer. The formatted string is of a form that can be parsed by our 220c0d06caSMauro Carvalho Chehab // sibling std_std_to_id() function. 230c0d06caSMauro Carvalho Chehab unsigned int pvr2_std_id_to_str(char *bufPtr, unsigned int bufSize, 240c0d06caSMauro Carvalho Chehab v4l2_std_id id); 250c0d06caSMauro Carvalho Chehab 260c0d06caSMauro Carvalho Chehab // Create an array of suitable v4l2_standard structures given a bit mask of 270c0d06caSMauro Carvalho Chehab // video standards to support. The array is allocated from the heap, and 280c0d06caSMauro Carvalho Chehab // the number of elements is returned in the first argument. 290c0d06caSMauro Carvalho Chehab struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr, 300c0d06caSMauro Carvalho Chehab v4l2_std_id id); 310c0d06caSMauro Carvalho Chehab 320c0d06caSMauro Carvalho Chehab // Return mask of which video standard bits are valid 330c0d06caSMauro Carvalho Chehab v4l2_std_id pvr2_std_get_usable(void); 340c0d06caSMauro Carvalho Chehab 350c0d06caSMauro Carvalho Chehab #endif /* __PVRUSB2_STD_H */ 36