1
0
Fork 0
Commit Graph

11 Commits (b06898d119f6b8dba7b318ad73558ce2d39161e8)

Author SHA1 Message Date
Sakari Ailus 4ee92289c2 media: docs-rst: Document EBUSY for VIDIOC_S_FMT
VIDIOC_S_FMT may return EBUSY if the device is streaming or there are
buffers allocated. Document this.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-26 07:57:09 -03:00
Laurent Pinchart c2b66cafdf [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 <laurent.pinchart@ideasonboard.com>
2016-09-22 07:03:14 -03:00
Mauro Carvalho Chehab 56683d7dea [media] docs-rst: fix cross-references for videodev2.h
There are several broken references there, due to the conversion to
C domain. Fix them using this shell script and manually adjust what's
broken:

	# funcs is a file with the broken functions/references
	for i in $(cat funcs|sort|uniq|perl -ne 'print "$1\n" if (m/(\S+)$/)'); do
		i=${i//-/_}
		echo $i
		j=${i//_/-}
		for k in $(git grep -l "_$j:" Documentation/); do
			sed s,\_$j\:,"c\:type\:\: $i", <$k >a && mv a $k
		done
		for k in $(git grep -l "$j" Documentation/media/*.exceptions); do
			sed s,$j,":c\:type\:\`$i\`", <$k >a && mv a $k
		done
		for k in $(git grep -l "$j" Documentation/); do
			sed "s,:ref:\`$i <$j>\`,:c:type:\`$i\`," <$k >a && mv a $k
			sed "s,:ref:\`$j\`,:c:type:\`$i\`," <$k >a && mv a $k
			sed -E "s,:ref:\`(.*)<$j>\`,:c:type:\`\1<$i>\`," <$k >a && mv a $k
		done
		for k in $(git grep -l "<$j>" include/media); do
			sed -E "s,:ref:\`(.*)<$j>\`,enum \&$i," <$k >a && mv a $k
		done
	done

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 09:57:23 -03:00
Mauro Carvalho Chehab fc78c7c7a1 [media] docs-rst: simplify c:type: cross references
Instead of using c:type:`struct foo <foo>`, use:
	struct c:type:`foo`

This patch was generated via this shell script:

	for i in `find Documentation/media -type f`; do perl -ne 'if (m/\:c\:type\:\`struct\s+(\S+)\s*\<(\S+)\>\`/) { $s=$1; $r=$2; if ($s eq $r) { s/\:c\:type\:\`struct\s+(\S+)\s*\<(\S+)\>\`/struct :c:type:`$2`/; s/struct\s+struct/struct/;  s/(struct\s+\:c\:type\:\`\S+\`)\s+structure/$1/;  }} print $_' <$i >a && mv a $i; done

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 09:54:54 -03:00
Mauro Carvalho Chehab e8be7e97e6 [media] docs-rst: convert uAPI structs to C domain
instead of declaring the uAPI structs using usual refs, e. g.:
	.. _foo-struct:

Use the C domain way:
	.. c:type:: foo_struct

This way, the kAPI documentation can use cross-references to
point to the uAPI symbols.

That solves about ~100 undefined warnings like:
	WARNING: c:type reference target not found: foo_struct

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-09-09 09:34:01 -03:00
Mauro Carvalho Chehab 41d804653e [media] docs-rst: Convert V4L2 uAPI to use C function references
Name all ioctl references and make them match the ioctls that
are documented. That will improve the cross-reference index,
as it will have all ioctls and syscalls there.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-22 21:23:27 -03:00
Mauro Carvalho Chehab 1b81f010bf [media] docs-next: stop abusing on the cpp domain
Now that we have an override for the c domain that will do
the right thing for the Kernel, stop abusing on the cpp
domain.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-22 21:23:00 -03:00
Mauro Carvalho Chehab ef76c0685f [media] adjust some vidioc-*rst tables with wrong columns
Adjust simple cases where the columns on some vidioc files
are overriding their neighbours.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-22 10:22:46 -03:00
Mauro Carvalho Chehab 8968da9b86 Revert "[media] docs-rst: escape [] characters"
This patch touches on places where it shouldn't: image
files and code examples. Also, it doesn't fix all array
occurrences.

So, let's revert it.

This reverts commit ffbab694ed.
2016-07-13 08:43:30 -03:00
Mauro Carvalho Chehab ffbab694ed [media] docs-rst: escape [] characters
Those characters are used for citations. Better to escape, to
avoid them to be misinterpreted.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-12 15:20:11 -03:00
Mauro Carvalho Chehab 60c2820d0f doc_rst: rename the media Sphinx suff to Documentation/media
The name of the subsystem is "media", and not "linux_tv". Also,
as we plan to add other stuff there in the future, let's
rename also the media uAPI book to media_uapi, to make it
clearer.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08 11:59:40 -03:00