18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci *  Copyright (C) 2005 Mike Isely <isely@pobox.com>
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci#ifndef __PVRUSB2_STD_H
78c2ecf20Sopenharmony_ci#define __PVRUSB2_STD_H
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <linux/videodev2.h>
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci// Convert string describing one or more video standards into a mask of V4L
128c2ecf20Sopenharmony_ci// standard bits.  Return true if conversion succeeds otherwise return
138c2ecf20Sopenharmony_ci// false.  String is expected to be of the form: C1-x/y;C2-a/b where C1 and
148c2ecf20Sopenharmony_ci// C2 are color system names (e.g. "PAL", "NTSC") and x, y, a, and b are
158c2ecf20Sopenharmony_ci// modulation schemes (e.g. "M", "B", "G", etc).
168c2ecf20Sopenharmony_ciint pvr2_std_str_to_id(v4l2_std_id *idPtr,const char *bufPtr,
178c2ecf20Sopenharmony_ci		       unsigned int bufSize);
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci// Convert any arbitrary set of video standard bits into an unambiguous
208c2ecf20Sopenharmony_ci// readable string.  Return value is the number of bytes consumed in the
218c2ecf20Sopenharmony_ci// buffer.  The formatted string is of a form that can be parsed by our
228c2ecf20Sopenharmony_ci// sibling std_std_to_id() function.
238c2ecf20Sopenharmony_ciunsigned int pvr2_std_id_to_str(char *bufPtr, unsigned int bufSize,
248c2ecf20Sopenharmony_ci				v4l2_std_id id);
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci// Create an array of suitable v4l2_standard structures given a bit mask of
278c2ecf20Sopenharmony_ci// video standards to support.  The array is allocated from the heap, and
288c2ecf20Sopenharmony_ci// the number of elements is returned in the first argument.
298c2ecf20Sopenharmony_cistruct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr,
308c2ecf20Sopenharmony_ci					   v4l2_std_id id);
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci// Return mask of which video standard bits are valid
338c2ecf20Sopenharmony_civ4l2_std_id pvr2_std_get_usable(void);
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#endif /* __PVRUSB2_STD_H */
36