From c2b66cafdf020856f6981d03efd9f2706d5f0156 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 5 Sep 2016 08:44:34 -0300 Subject: [media] v4l: doc: Remove row numbers from tables Shorten the tables by removing row numbers in comments, allowing for later insertion of rows with minimal diffs. All changes have been generated by the following script. import io import re import sys def process_table(fname, data): if fname.endswith('hist-v4l2.rst'): data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE) data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE) else: data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE) data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE) data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE) data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE) data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE) data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE) data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE) return data def process_file(fname, data): buf = io.StringIO(data) output = '' in_table = False table_separator = 0 for line in buf.readlines(): if line.find('.. flat-table::') != -1: in_table = True table = '' elif in_table and not re.match('^[\t\n]|( )', line): in_table = False output += process_table(fname, table) if in_table: table += line else: output += line if in_table: in_table = False output += process_table(fname, table) return output fname = sys.argv[1] data = file(fname, 'rb').read().decode('utf-8') data = process_file(fname, data) file(fname, 'wb').write(data.encode('utf-8')) Signed-off-by: Laurent Pinchart --- .../media/uapi/v4l/vidioc-s-hw-freq-seek.rst | 132 +++++++-------------- 1 file changed, 46 insertions(+), 86 deletions(-) (limited to 'Documentation/media/uapi/v4l/vidioc-s-hw-freq-seek.rst') diff --git a/Documentation/media/uapi/v4l/vidioc-s-hw-freq-seek.rst b/Documentation/media/uapi/v4l/vidioc-s-hw-freq-seek.rst index fc5e31c63b95..5672ca48d2bd 100644 --- a/Documentation/media/uapi/v4l/vidioc-s-hw-freq-seek.rst +++ b/Documentation/media/uapi/v4l/vidioc-s-hw-freq-seek.rst @@ -68,92 +68,52 @@ error code is returned and no seek takes place. :stub-columns: 0 :widths: 1 1 2 - - - .. row 1 - - - __u32 - - - ``tuner`` - - - The tuner index number. This is the same value as in the struct - :c:type:`v4l2_input` ``tuner`` field and the struct - :c:type:`v4l2_tuner` ``index`` field. - - - .. row 2 - - - __u32 - - - ``type`` - - - The tuner type. This is the same value as in the struct - :c:type:`v4l2_tuner` ``type`` field. See - :c:type:`v4l2_tuner_type` - - - .. row 3 - - - __u32 - - - ``seek_upward`` - - - If non-zero, seek upward from the current frequency, else seek - downward. - - - .. row 4 - - - __u32 - - - ``wrap_around`` - - - If non-zero, wrap around when at the end of the frequency range, - else stop seeking. The struct :c:type:`v4l2_tuner` - ``capability`` field will tell you what the hardware supports. - - - .. row 5 - - - __u32 - - - ``spacing`` - - - If non-zero, defines the hardware seek resolution in Hz. The - driver selects the nearest value that is supported by the device. - If spacing is zero a reasonable default value is used. - - - .. row 6 - - - __u32 - - - ``rangelow`` - - - If non-zero, the lowest tunable frequency of the band to search in - units of 62.5 kHz, or if the struct - :c:type:`v4l2_tuner` ``capability`` field has the - ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the - struct :c:type:`v4l2_tuner` ``capability`` field has - the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If - ``rangelow`` is zero a reasonable default value is used. - - - .. row 7 - - - __u32 - - - ``rangehigh`` - - - If non-zero, the highest tunable frequency of the band to search - in units of 62.5 kHz, or if the struct - :c:type:`v4l2_tuner` ``capability`` field has the - ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the - struct :c:type:`v4l2_tuner` ``capability`` field has - the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If - ``rangehigh`` is zero a reasonable default value is used. - - - .. row 8 - - - __u32 - - - ``reserved``\ [5] - - - Reserved for future extensions. Applications must set the array to - zero. + * - __u32 + - ``tuner`` + - The tuner index number. This is the same value as in the struct + :c:type:`v4l2_input` ``tuner`` field and the struct + :c:type:`v4l2_tuner` ``index`` field. + * - __u32 + - ``type`` + - The tuner type. This is the same value as in the struct + :c:type:`v4l2_tuner` ``type`` field. See + :c:type:`v4l2_tuner_type` + * - __u32 + - ``seek_upward`` + - If non-zero, seek upward from the current frequency, else seek + downward. + * - __u32 + - ``wrap_around`` + - If non-zero, wrap around when at the end of the frequency range, + else stop seeking. The struct :c:type:`v4l2_tuner` + ``capability`` field will tell you what the hardware supports. + * - __u32 + - ``spacing`` + - If non-zero, defines the hardware seek resolution in Hz. The + driver selects the nearest value that is supported by the device. + If spacing is zero a reasonable default value is used. + * - __u32 + - ``rangelow`` + - If non-zero, the lowest tunable frequency of the band to search in + units of 62.5 kHz, or if the struct + :c:type:`v4l2_tuner` ``capability`` field has the + ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the + struct :c:type:`v4l2_tuner` ``capability`` field has + the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If + ``rangelow`` is zero a reasonable default value is used. + * - __u32 + - ``rangehigh`` + - If non-zero, the highest tunable frequency of the band to search + in units of 62.5 kHz, or if the struct + :c:type:`v4l2_tuner` ``capability`` field has the + ``V4L2_TUNER_CAP_LOW`` flag set, in units of 62.5 Hz or if the + struct :c:type:`v4l2_tuner` ``capability`` field has + the ``V4L2_TUNER_CAP_1HZ`` flag set, in units of 1 Hz. If + ``rangehigh`` is zero a reasonable default value is used. + * - __u32 + - ``reserved``\ [5] + - Reserved for future extensions. Applications must set the array to + zero. Return Value -- cgit v1.2.3