summaryrefslogtreecommitdiff
path: root/media-specs
diff options
context:
space:
mode:
Diffstat (limited to 'media-specs')
-rw-r--r--media-specs/Makefile596
-rw-r--r--media-specs/README7
-rw-r--r--media-specs/custom.dsl52
-rw-r--r--media-specs/custom.xsl29
-rw-r--r--media-specs/xml.dcl179
5 files changed, 863 insertions, 0 deletions
diff --git a/media-specs/Makefile b/media-specs/Makefile
new file mode 100644
index 000000000..04d285d58
--- /dev/null
+++ b/media-specs/Makefile
@@ -0,0 +1,596 @@
+SHELL=/bin/bash
+
+V4L_SGMLS = \
+ v4l/biblio.xml \
+ v4l/common.xml \
+ v4l/compat.xml \
+ v4l/controls.xml \
+ v4l/dev-capture.xml \
+ v4l/dev-codec.xml \
+ v4l/dev-effect.xml \
+ v4l/dev-osd.xml \
+ v4l/dev-output.xml \
+ v4l/dev-overlay.xml \
+ v4l/dev-radio.xml \
+ v4l/dev-raw-vbi.xml \
+ v4l/dev-rds.xml \
+ v4l/dev-sliced-vbi.xml \
+ v4l/dev-teletext.xml \
+ v4l/driver.xml \
+ v4l/libv4l.xml \
+ v4l/remote_controllers.xml \
+ v4l/fdl-appendix.xml \
+ v4l/func-close.xml \
+ v4l/func-ioctl.xml \
+ v4l/func-mmap.xml \
+ v4l/func-munmap.xml \
+ v4l/func-open.xml \
+ v4l/func-poll.xml \
+ v4l/func-read.xml \
+ v4l/func-select.xml \
+ v4l/func-write.xml \
+ v4l/io.xml \
+ v4l/pixfmt-grey.xml \
+ v4l/pixfmt-nv12.xml \
+ v4l/pixfmt-nv16.xml \
+ v4l/pixfmt-packed-rgb.xml \
+ v4l/pixfmt-packed-yuv.xml \
+ v4l/pixfmt-sbggr16.xml \
+ v4l/pixfmt-sbggr8.xml \
+ v4l/pixfmt-sgbrg8.xml \
+ v4l/pixfmt-sgrbg8.xml \
+ v4l/pixfmt-uyvy.xml \
+ v4l/pixfmt-vyuy.xml \
+ v4l/pixfmt-y16.xml \
+ v4l/pixfmt-y41p.xml \
+ v4l/pixfmt-yuv410.xml \
+ v4l/pixfmt-yuv411p.xml \
+ v4l/pixfmt-yuv420.xml \
+ v4l/pixfmt-yuv422p.xml \
+ v4l/pixfmt-yuyv.xml \
+ v4l/pixfmt-yvyu.xml \
+ v4l/pixfmt.xml \
+ v4l/vidioc-cropcap.xml \
+ v4l/vidioc-dbg-g-register.xml \
+ v4l/vidioc-encoder-cmd.xml \
+ v4l/vidioc-enum-fmt.xml \
+ v4l/vidioc-enum-frameintervals.xml \
+ v4l/vidioc-enum-framesizes.xml \
+ v4l/vidioc-enumaudio.xml \
+ v4l/vidioc-enumaudioout.xml \
+ v4l/vidioc-enuminput.xml \
+ v4l/vidioc-enumoutput.xml \
+ v4l/vidioc-enumstd.xml \
+ v4l/vidioc-g-audio.xml \
+ v4l/vidioc-g-audioout.xml \
+ v4l/vidioc-dbg-g-chip-ident.xml \
+ v4l/vidioc-g-crop.xml \
+ v4l/vidioc-g-ctrl.xml \
+ v4l/vidioc-g-enc-index.xml \
+ v4l/vidioc-g-ext-ctrls.xml \
+ v4l/vidioc-g-fbuf.xml \
+ v4l/vidioc-g-fmt.xml \
+ v4l/vidioc-g-frequency.xml \
+ v4l/vidioc-g-input.xml \
+ v4l/vidioc-g-jpegcomp.xml \
+ v4l/vidioc-g-modulator.xml \
+ v4l/vidioc-g-output.xml \
+ v4l/vidioc-g-parm.xml \
+ v4l/vidioc-g-priority.xml \
+ v4l/vidioc-g-sliced-vbi-cap.xml \
+ v4l/vidioc-g-std.xml \
+ v4l/vidioc-g-tuner.xml \
+ v4l/vidioc-log-status.xml \
+ v4l/vidioc-overlay.xml \
+ v4l/vidioc-qbuf.xml \
+ v4l/vidioc-querybuf.xml \
+ v4l/vidioc-querycap.xml \
+ v4l/vidioc-queryctrl.xml \
+ v4l/vidioc-querystd.xml \
+ v4l/vidioc-reqbufs.xml \
+ v4l/vidioc-s-hw-freq-seek.xml \
+ v4l/vidioc-streamon.xml \
+ v4l/capture.c.xml \
+ v4l/keytable.c.xml \
+ v4l/v4l2grab.c.xml \
+ v4l/videodev2.h.xml \
+ v4l/v4l2.xml
+
+V4L_PDFPICS = \
+ v4l/crop.pdf \
+ v4l/fieldseq_bt.pdf \
+ v4l/fieldseq_tb.pdf \
+ v4l/vbi_525.pdf \
+ v4l/vbi_625.pdf \
+ v4l/vbi_hsync.pdf
+
+V4L_GIFPICS = \
+ v4l/crop.gif \
+ v4l/fieldseq_bt.gif \
+ v4l/fieldseq_tb.gif \
+ v4l/vbi_525.gif \
+ v4l/vbi_625.gif \
+ v4l/vbi_hsync.gif
+
+DVB_SGMLS = \
+ dvb/intro.xml \
+ dvb/frontend.xml \
+ dvb/isdbt.xml \
+ dvb/demux.xml \
+ dvb/video.xml \
+ dvb/audio.xml \
+ dvb/ca.xml \
+ dvb/net.xml \
+ dvb/kdapi.xml \
+ dvb/examples.xml \
+ dvb/dvbapi.xml
+
+DVB_PDFPICS = \
+ dvb/dvbstb.pdf
+
+DVB_GIFPICS = \
+ dvb/dvbstb.png
+
+
+SGMLS = $(V4L_SGMLS) $(DVB_SGMLS) media.xml media-entities.tmpl media-indices.tmpl
+
+PDFPICS = $(V4L_PDFPICS) $(DVB_PDFPICS)
+
+GIFPICS = $(V4L_GIFPICS) $(DVB_GIFPICS)
+
+# Some Jade warnings for authors.
+WARN =
+#WARN = -w all -w duplicate -w net
+
+# Stylesheet customization.
+ # docbook/db2 syntax
+CUSTOM_HTML = --dsl custom.dsl\#html
+CUSTOM_PRINT = --dsl custom.dsl\#print
+ # xmlto syntax
+CUSTOM_HTML_XMLTO = -m custom.xsl
+CUSTOM_PRINT_XMLTO = -m custom.xsl
+
+all: capture html-single
+
+prep: Makefile checks $(SGMLS) $(GIFPICS)
+
+html: html-build.stamp
+
+html-single: html-single-build.stamp
+
+pdf: pdf-build.stamp
+
+man: man-build.stamp
+
+man_install: man-build.stamp
+ install -d /usr/local/man/man2
+ install -b man/* /usr/local/man/man2
+
+coffeebreak: all html pdf
+
+FUNCS = \
+ close \
+ ioctl \
+ mmap \
+ munmap \
+ open \
+ poll \
+ read \
+ select \
+ write \
+
+IOCTLS = \
+ VIDIOC_CROPCAP \
+ VIDIOC_DBG_G_CHIP_IDENT \
+ VIDIOC_DBG_G_REGISTER \
+ VIDIOC_DBG_S_REGISTER \
+ VIDIOC_DQBUF \
+ VIDIOC_ENCODER_CMD \
+ VIDIOC_ENUMAUDIO \
+ VIDIOC_ENUMAUDOUT \
+ VIDIOC_ENUMINPUT \
+ VIDIOC_ENUMOUTPUT \
+ VIDIOC_ENUMSTD \
+ VIDIOC_ENUM_FMT \
+ VIDIOC_ENUM_FRAMEINTERVALS \
+ VIDIOC_ENUM_FRAMESIZES \
+ VIDIOC_G_AUDIO \
+ VIDIOC_G_AUDOUT \
+ VIDIOC_G_CROP \
+ VIDIOC_G_CTRL \
+ VIDIOC_G_ENC_INDEX \
+ VIDIOC_G_EXT_CTRLS \
+ VIDIOC_G_FBUF \
+ VIDIOC_G_FMT \
+ VIDIOC_G_FREQUENCY \
+ VIDIOC_G_INPUT \
+ VIDIOC_G_JPEGCOMP \
+ VIDIOC_G_MPEGCOMP \
+ VIDIOC_G_MODULATOR \
+ VIDIOC_G_OUTPUT \
+ VIDIOC_G_PARM \
+ VIDIOC_G_PRIORITY \
+ VIDIOC_G_SLICED_VBI_CAP \
+ VIDIOC_G_STD \
+ VIDIOC_G_TUNER \
+ VIDIOC_LOG_STATUS \
+ VIDIOC_OVERLAY \
+ VIDIOC_QBUF \
+ VIDIOC_QUERYBUF \
+ VIDIOC_QUERYCAP \
+ VIDIOC_QUERYCTRL \
+ VIDIOC_QUERYMENU \
+ VIDIOC_QUERYSTD \
+ VIDIOC_REQBUFS \
+ VIDIOC_STREAMOFF \
+ VIDIOC_STREAMON \
+ VIDIOC_S_AUDIO \
+ VIDIOC_S_AUDOUT \
+ VIDIOC_S_CROP \
+ VIDIOC_S_CTRL \
+ VIDIOC_S_EXT_CTRLS \
+ VIDIOC_S_FBUF \
+ VIDIOC_S_FMT \
+ VIDIOC_S_FREQUENCY \
+ VIDIOC_S_HW_FREQ_SEEK \
+ VIDIOC_S_INPUT \
+ VIDIOC_S_JPEGCOMP \
+ VIDIOC_S_MPEGCOMP \
+ VIDIOC_S_MODULATOR \
+ VIDIOC_S_OUTPUT \
+ VIDIOC_S_PARM \
+ VIDIOC_S_PRIORITY \
+ VIDIOC_S_STD \
+ VIDIOC_S_TUNER \
+ VIDIOC_TRY_ENCODER_CMD \
+ VIDIOC_TRY_EXT_CTRLS \
+ VIDIOC_TRY_FMT \
+
+TYPES = \
+ v4l2_std_id \
+
+ENUMS = \
+ v4l2_buf_type \
+ v4l2_colorspace \
+ v4l2_ctrl_type \
+ v4l2_exposure_auto_type \
+ v4l2_field \
+ v4l2_frmivaltypes \
+ v4l2_frmsizetypes \
+ v4l2_memory \
+ v4l2_mpeg_audio_ac3_bitrate \
+ v4l2_mpeg_audio_crc \
+ v4l2_mpeg_audio_emphasis \
+ v4l2_mpeg_audio_encoding \
+ v4l2_mpeg_audio_l1_bitrate \
+ v4l2_mpeg_audio_l2_bitrate \
+ v4l2_mpeg_audio_l3_bitrate \
+ v4l2_mpeg_audio_mode \
+ v4l2_mpeg_audio_mode_extension \
+ v4l2_mpeg_audio_sampling_freq \
+ v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type \
+ v4l2_mpeg_cx2341x_video_luma_spatial_filter_type \
+ v4l2_mpeg_cx2341x_video_median_filter_type \
+ v4l2_mpeg_cx2341x_video_spatial_filter_mode \
+ v4l2_mpeg_cx2341x_video_temporal_filter_mode \
+ v4l2_mpeg_stream_type \
+ v4l2_mpeg_stream_vbi_fmt \
+ v4l2_mpeg_video_aspect \
+ v4l2_mpeg_video_bitrate_mode \
+ v4l2_mpeg_video_encoding \
+ v4l2_power_line_frequency \
+ v4l2_priority \
+ v4l2_tuner_type \
+ v4l2_preemphasis \
+
+STRUCTS = \
+ v4l2_audio \
+ v4l2_audioout \
+ v4l2_buffer \
+ v4l2_capability \
+ v4l2_captureparm \
+ v4l2_clip \
+ v4l2_control \
+ v4l2_crop \
+ v4l2_cropcap \
+ v4l2_dbg_chip_ident \
+ v4l2_dbg_match \
+ v4l2_dbg_register \
+ v4l2_enc_idx \
+ v4l2_enc_idx_entry \
+ v4l2_encoder_cmd \
+ v4l2_ext_control \
+ v4l2_ext_controls \
+ v4l2_fmtdesc \
+ v4l2_format \
+ v4l2_fract \
+ v4l2_framebuffer \
+ v4l2_frequency \
+ v4l2_frmival_stepwise \
+ v4l2_frmivalenum \
+ v4l2_frmsize_discrete \
+ v4l2_frmsize_stepwise \
+ v4l2_frmsizeenum \
+ v4l2_hw_freq_seek \
+ v4l2_input \
+ v4l2_jpegcompression \
+ v4l2_modulator \
+ v4l2_mpeg_vbi_fmt_ivtv \
+ v4l2_output \
+ v4l2_outputparm \
+ v4l2_pix_format \
+ v4l2_queryctrl \
+ v4l2_querymenu \
+ v4l2_rect \
+ v4l2_requestbuffers \
+ v4l2_sliced_vbi_cap \
+ v4l2_sliced_vbi_data \
+ v4l2_sliced_vbi_format \
+ v4l2_standard \
+ v4l2_streamparm \
+ v4l2_timecode \
+ v4l2_tuner \
+ v4l2_vbi_format \
+ v4l2_window \
+
+ERRORS = \
+ EACCES \
+ EAGAIN \
+ EBADF \
+ EBUSY \
+ EFAULT \
+ EIO \
+ EINTR \
+ EINVAL \
+ ENFILE \
+ ENOMEM \
+ ENOSPC \
+ ENOTTY \
+ ENXIO \
+ EMFILE \
+ EPERM \
+ ERANGE \
+
+ESCAPE = \
+ -e "s/&/\\&/g" \
+ -e "s/</\\&lt;/g" \
+ -e "s/>/\\&gt;/g"
+
+FILENAME = \
+ -e s,"^[^\/]*/",, \
+ -e s/"\\.xml"// \
+ -e s/"\\.tmpl"// \
+ -e s/\\\./-/g \
+ -e s/"^func-"// \
+ -e s/"^pixfmt-"// \
+ -e s/"^vidioc-"//
+
+# Generate references to these structs in videodev2.h.xml.
+DOCUMENTED = \
+ -e "s/\(enum *\)v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1<link linkend=\"\2\">v4l2_mpeg_cx2341x_video_\2<\/link>/g" \
+ -e "s/\(\(enum\|struct\) *\)\(v4l2_[a-zA-Z0-9_]*\)/\1<link linkend=\"\3\">\3<\/link>/g" \
+ -e "s/\(V4L2_PIX_FMT_[A-Z0-9_]\+\) /<link linkend=\"\1\">\1<\/link> /g" \
+ -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" \
+ -e "s/\(linkend\=\"\)v4l2\-mpeg\-vbi\-ITV0/\1v4l2-mpeg-vbi-itv0-1/g"
+
+.PHONY: links
+
+$(SGMLS): links
+$(PDFPICS): links
+$(GIFPICS): links
+
+links::
+ -rm v4l dvb
+ ln -sf ../linux/Documentation/DocBook/media.tmpl media.xml
+ ln -sf ../linux/Documentation/DocBook/v4l .
+ ln -sf ../linux/Documentation/DocBook/dvb .
+
+v4l/libv4l-fmt.xml: ../v4l2-apps/libv4l/libv4lconvert/*.c Makefile
+ cat ../v4l2-apps/libv4l/libv4lconvert/*.c| \
+ perl -ne 'if (m/(V4L2_PIX_FMT_[^\s\;\\)\,:]+)/) { printf "<link linkend=\"$$1\"><constant>$$1</constant></link>,\n"; };' \
+ |sort|uniq| \
+ sed -e ":a;s/\(linkend=\".*\)_\(.*\">\)/\1-\2/;ta" > $@
+
+v4l/capture.c.xml: ../v4l2-apps/test/capture-example.c Makefile
+ echo "<programlisting>" > $@
+ expand --tabs=8 < $< | \
+ sed $(ESCAPE) $(DOCUMENTED) | \
+ sed 's/i\.e\./&ie;/' >> $@
+ echo "</programlisting>" >> $@
+
+v4l/v4l2grab.c.xml: ../v4l2-apps/test/v4l2grab.c Makefile
+ echo "<programlisting>" > $@
+ expand --tabs=8 < $< | \
+ sed $(ESCAPE) $(DOCUMENTED) | \
+ sed 's/i\.e\./&ie;/' >> $@
+ echo "</programlisting>" >> $@
+
+v4l/keytable.c.xml: ../v4l2-apps/util/keytable.c Makefile
+ echo "<programlisting>" > $@
+ expand --tabs=8 < $< | \
+ sed $(ESCAPE) $(DOCUMENTED) | \
+ sed 's/i\.e\./&ie;/' >> $@
+ echo "</programlisting>" >> $@
+
+v4l/videodev2.h.xml: ../linux/include/linux/videodev2.h Makefile
+ echo "<programlisting>" > $@
+ expand --tabs=8 < $< | \
+ sed $(ESCAPE) $(DOCUMENTED) | \
+ sed 's/i\.e\./&ie;/' >> $@
+ echo "</programlisting>" >> $@
+
+checks: $(SGMLS)
+ # Warn about <constant>FOO-BAR</constant> which should be
+ # &FOO-BAR; or <constant>FOO_BAR</constant>.
+ (! grep '>[A-Z]+-[A-Z-]+<' $(V4L_SGMLS))
+ # Don't end a refpurpose blob with a period.
+ (! grep '\.</refpurpose>' $(V4L_SGMLS))
+ # Catch typos in error code names.
+ errs=`grep '<errorcode>[^<]\+</errorcode>' $(V4L_SGMLS) | \
+ sed 's/.*<errorcode>//;s/<\/errorcode>.*//' | sort -u` ; \
+ for err in $$errs; do \
+ if ! echo $(ERRORS) | grep -q $$err ; then \
+ echo Unknown error code $$err ; exit 1 ; \
+ fi ; \
+ done
+ # Use the respective entities instead.
+ for abbrev in "e\\.g\\." "i\\.e\\." "i2c" ; do \
+ grep "[^a-z&]$$abbrev[^a-z.;-]" $(V4L_SGMLS) | \
+ grep -v -E "(ENTITY|videodev2\.h)" && exit 1 ; \
+ done ; \
+ exit 0
+
+# We're generating these entities to avoid typos, to enforce consistent
+# naming, an to be warned about missing items (Jade screams bloody murder
+# if references are dangling).
+media-entities.tmpl: Makefile $(SGMLS)
+ echo "<!-- Generated file! Do not edit. -->" >$@
+ echo -e "\n<!-- Functions -->" >>$@
+ for ident in $(FUNCS) ; do \
+ entity=`echo $$ident | tr _ -` ; \
+ echo "<!ENTITY func-$$entity \"<link" \
+ "linkend='func-$$entity'><function>$$ident()</function></link>\">" \
+ >>$@ ; \
+ done
+ echo -e "\n<!-- Ioctls -->" >>$@
+ for ident in $(IOCTLS) ; do \
+ entity=`echo $$ident | tr _ -` ; \
+ id=`grep "<refname>$$ident" v4l/vidioc-*.xml |sed -r s,"^[^\/]*/",, | sed 's/\.xml.*//'` ; \
+ echo "<!ENTITY $$entity \"<link" \
+ "linkend='$$id'><constant>$$ident</constant></link>\">" \
+ >>$@ ; \
+ done
+ echo -e "\n<!-- Types -->" >>$@
+ for ident in $(TYPES) ; do \
+ entity=`echo $$ident | tr _ -` ; \
+ echo "<!ENTITY $$entity \"<link" \
+ "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
+ done
+ echo -e "\n<!-- Enums -->" >>$@
+ for ident in $(ENUMS) ; do \
+ entity=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -` ; \
+ echo "<!ENTITY $$entity \"enum&nbsp;<link" \
+ "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
+ done
+ echo -e "\n<!-- Structures -->" >>$@
+ for ident in $(STRUCTS) ; do \
+ entity=`echo $$ident | tr _ -` ; \
+ echo "<!ENTITY $$entity \"struct&nbsp;<link" \
+ "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
+ done
+ echo -e "\n<!-- Error Codes -->" >>$@
+ for ident in $(ERRORS) ; do \
+ echo "<!ENTITY $$ident \"<errorcode>$$ident</errorcode>" \
+ "error code\">" >>$@ ; \
+ done
+ echo -e "\n<!-- Subsections -->" >>$@
+ for file in $(SGMLS) ; do \
+ entity=`echo "$$file" | sed $(FILENAME) -e s/"^([^-]*)"/sub\1/` ; \
+ if ! echo "$$file" | \
+ grep -q -E -e '^(func|vidioc|pixfmt)-' ; then \
+ echo "<!ENTITY sub-$$entity SYSTEM \"$$file\">" >>$@ ; \
+ fi ; \
+ done
+ echo -e "\n<!-- Function Reference -->" >>$@
+ for file in $(SGMLS) ; do \
+ if echo "$$file" | \
+ grep -q -E -e '(func|vidioc|pixfmt)-' ; then \
+ entity=`echo "$$file" |sed $(FILENAME)` ; \
+ echo "<!ENTITY $$entity SYSTEM \"$$file\">" >>$@ ; \
+ fi ; \
+ done
+
+# Jade can auto-generate a list-of-tables, which includes all structs,
+# but we only want data types, all types, and sorted please.
+media-indices.tmpl: Makefile $(SGMLS)
+ echo "<!-- Generated file! Do not edit. -->" >$@
+ echo -e "\n<index><title>List of Types</title>" >>$@
+ for ident in $(TYPES) ; do \
+ id=`echo $$ident | tr _ -` ; \
+ echo "<indexentry><primaryie><link" \
+ "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
+ done
+ for ident in $(ENUMS) ; do \
+ id=`echo $$ident | sed -e "s/v4l2_mpeg_cx2341x_video_\([a-z]*_spatial_filter_type\)/\1/" | tr _ -`; \
+ echo "<indexentry><primaryie>enum&nbsp;<link" \
+ "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
+ done
+ for ident in $(STRUCTS) ; do \
+ id=`echo $$ident | tr _ -` ; \
+ echo "<indexentry><primaryie>struct&nbsp;<link" \
+ "linkend='$$id'>$$ident</link></primaryie></indexentry>" >>$@ ; \
+ done
+ echo "</index>" >>$@
+
+# HTML version.
+html-build.stamp: Makefile checks $(SGMLS) $(GIFPICS)
+ rm -rf media
+ if which xmlto >/dev/null ; then \
+ xmlto xhtml $(WARN) $(CUSTOM_HTML_XMLTO) -o media media.xml ; \
+ elif which docbook2html >/dev/null ; then \
+ export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \
+ docbook2html $(WARN) $$DCL $(CUSTOM_HTML) --output media media.xml ; \
+ else \
+ export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \
+ db2html $(WARN) $$DCL $(CUSTOM_HTML) --output media media.xml ; \
+ fi
+ cp $(GIFPICS) media/
+ cd media ; \
+ test -e index.html || ln -s book1.htm index.html ; \
+ test -e capture-example.html || \
+ ln -s `grep -l getopt_long *.htm` capture-example.html
+ chmod a+rX -R media
+ touch html-build.stamp
+
+# For online version. When you have a dial-up connection a single file
+# is more convenient than clicking through dozens of pages.
+html-single-build.stamp: Makefile checks $(SGMLS) $(GIFPICS)
+ rm -rf media-single
+ if which xmlto >/dev/null ; then \
+ xmlto html-nochunks $(WARN) $(CUSTOM_HTML_XMLTO) -o media-single media.xml ; \
+ elif which docbook2html >/dev/null ; then \
+ export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \
+ docbook2html $$DCL $(WARN) $(CUSTOM_HTML) --nochunks \
+ --output media-single media.xml ; \
+ else \
+ export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \
+ db2html $$DCL $(WARN) $(CUSTOM_HTML) --nochunks \
+ --output media-single media.xml ; \
+ fi
+ cp $(GIFPICS) media-single/
+ chmod a+rX -R media-single
+ touch html-single-build.stamp
+
+# For printing.
+pdf-build.stamp: Makefile checks $(SGMLS) $(PDFPICS)
+ if which db2pdf >/dev/null ; then \
+ export DCL="--dcl `find /usr/share/sgml -name xml.dcl|head -1`"; \
+ db2pdf $$DCL $(WARN) $(CUSTOM_PRINT) media.xml ; \
+ elif which xmlto >/dev/null ; then \
+ xmlto pdf $(WARN) $(CUSTOM_HTML_XMLTO) -o media media.xml ; \
+ else \
+ export DCL="--dcl `find /usr/share/sgml -name xml.dcl |head -1`"; \
+ docbook2pdf $$DCL $(WARN) $(CUSTOM_PRINT) media.xml ; \
+ fi
+ touch pdf-build.stamp
+
+
+# For man
+man-build.stamp: Makefile checks $(SGMLS) $(PDFPICS)
+ xmlto man $(WARN) $(CUSTOM_HTML_XMLTO) -o man media.xml
+
+# Example.
+capture: ../v4l2-apps/test/capture-example.c
+ gcc $^ -o $@
+
+distclean clean:
+ rm -f *.stamp
+ rm -f videodev2.h.xml
+ rm -f capture.c.xml
+ rm -f v4l2grab.c.xml
+ rm -f keytable.c.xml
+ rm -f media.aux media.log media.out
+ rm -f capture
+ rm -f media-indices.tmpl media-entities.tmpl
+ rm -rf media media-single media.pdf
+ rm -rf media.xml v4l dvb
diff --git a/media-specs/README b/media-specs/README
new file mode 100644
index 000000000..160826890
--- /dev/null
+++ b/media-specs/README
@@ -0,0 +1,7 @@
+This directory contains a staging SPEC that it is a joint document
+with both V4L and DVB API, in a trial to do an unified specification
+for media infrastructure.
+
+It is still under review, and may be incorrect/incomplete etc.
+
+The official specs are at /v4l2-spec and /dvb-spec directories.
diff --git a/media-specs/custom.dsl b/media-specs/custom.dsl
new file mode 100644
index 000000000..12a5e91d4
--- /dev/null
+++ b/media-specs/custom.dsl
@@ -0,0 +1,52 @@
+<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
+<!ENTITY % html "IGNORE">
+<![%html;[
+<!ENTITY % print "IGNORE">
+<!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA dsssl>
+]]>
+<!ENTITY % print "INCLUDE">
+<![%print;[
+<!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA dsssl>
+]]>
+]>
+
+<style-sheet>
+
+<style-specification id="print" use="docbook">
+<style-specification-body>
+
+<!-- See docbook-dsssl-1.x/doc -->
+(define %generate-reference-toc% #t)
+(define %refentry-new-page% #t)
+(define %number-programlisting-lines% #f)
+(define %section-autolabel% #t)
+(define bop-footnotes #t)
+<!-- (define %show-comments% #f) -->
+(define ($generate-book-lot-list$)
+ (list (normalize "figure")
+ (normalize "example")))
+<!-- A4 | USletter -->
+(define %paper-type% "A4")
+
+</style-specification-body>
+</style-specification>
+
+<style-specification id="html" use="docbook">
+<style-specification-body>
+
+<!-- See docbook-dsssl-1.x/doc -->
+(define %generate-reference-toc% #t)
+(define %number-programlisting-lines% #f)
+(define %section-autolabel% #t)
+(define bop-footnotes #t)
+<!-- (define %show-comments% #f) -->
+(define ($generate-book-lot-list$)
+ (list (normalize "figure")
+ (normalize "example")))
+
+</style-specification-body>
+</style-specification>
+
+<external-specification id="docbook" document="docbook.dsl">
+
+</style-sheet>
diff --git a/media-specs/custom.xsl b/media-specs/custom.xsl
new file mode 100644
index 000000000..e1556c37c
--- /dev/null
+++ b/media-specs/custom.xsl
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<!-- Extension for HTML files -->
+<param name="html.ext" select="'.html'"/>
+
+<!-- Generate TOCs for book, article, part -->
+<param name="generate.book.toc">1</param>
+<param name="generate.article.toc">0</param>
+<param name="generate.part.toc">0</param>
+<param name="toc.chapter.depth">0</param>
+
+<param name="refentry.separator">1</param>
+
+<param name="chunk.first.sections">1</param>
+<param name="chunk.id.as.filename">1</param>
+<param name="chunk.separate.lots">1</param>
+
+<param name="funcsynopsis.style">ansi</param>
+<param name="funcsynopsis.tabular.threshold">80</param>
+<param name="funcsynopsis.decoration">1</param>
+
+<param name="chapter.autolabel">1</param>
+<param name="section.autolabel">1</param>
+<param name="section.label.includes.component.label">1</param>
+<param name="toc.section.depth">3</param>
+
+<param name="paper.type">A4</param>
+</stylesheet>
diff --git a/media-specs/xml.dcl b/media-specs/xml.dcl
new file mode 100644
index 000000000..59a97922f
--- /dev/null
+++ b/media-specs/xml.dcl
@@ -0,0 +1,179 @@
+<!SGML -- SGML Declaration for valid XML documents --
+ "ISO 8879:1986 (WWW)"
+
+ CHARSET
+ BASESET
+ "ISO Registration Number 176//CHARSET
+ ISO/IEC 10646-1:1993 UCS-4 with implementation
+ level 3//ESC 2/5 2/15 4/6"
+ DESCSET
+ 0 9 UNUSED
+ 9 2 9
+ 11 2 UNUSED
+ 13 1 13
+ 14 18 UNUSED
+ 32 95 32
+ 127 1 UNUSED
+ 128 32 UNUSED
+ -- use this instead of the official declaration because SP only
+ supports 16-bit characters --
+ 160 65374 160
+ 65534 2 UNUSED
+ -- 55296 2048 UNUSED
+ 57344 8190 57344
+ 65534 2 UNUSED
+ 65536 1048576 65536 --
+ CAPACITY NONE
+
+ SCOPE DOCUMENT
+
+ SYNTAX
+ SHUNCHAR NONE
+ BASESET "ISO Registration Number 176//CHARSET
+ ISO/IEC 10646-1:1993 UCS-4 with implementation
+ level 3//ESC 2/5 2/15 4/6"
+ DESCSET
+ 0 1114112 0
+ FUNCTION
+ RE 13
+ RS 10
+ SPACE 32
+ TAB SEPCHAR 9
+
+ NAMING
+ LCNMSTRT ""
+ UCNMSTRT ""
+ NAMESTRT
+ 58 95 192-214 216-246 248-305 308-318 321-328
+ 330-382 384-451 461-496 500-501 506-535 592-680
+ 699-705 902 904-906 908 910-929 931-974 976-982
+ 986 988 990 992 994-1011 1025-1036 1038-1103
+ 1105-1116 1118-1153 1168-1220 1223-1224
+ 1227-1228 1232-1259 1262-1269 1272-1273
+ 1329-1366 1369 1377-1414 1488-1514 1520-1522
+ 1569-1594 1601-1610 1649-1719 1722-1726
+ 1728-1742 1744-1747 1749 1765-1766 2309-2361
+ 2365 2392-2401 2437-2444 2447-2448 2451-2472
+ 2474-2480 2482 2486-2489 2524-2525 2527-2529
+ 2544-2545 2565-2570 2575-2576 2579-2600
+ 2602-2608 2610-2611 2613-2614 2616-2617
+ 2649-2652 2654 2674-2676 2693-2699 2701
+ 2703-2705 2707-2728 2730-2736 2738-2739
+ 2741-2745 2749 2784 2821-2828 2831-2832
+ 2835-2856 2858-2864 2866-2867 2870-2873 2877
+ 2908-2909 2911-2913 2949-2954 2958-2960
+ 2962-2965 2969-2970 2972 2974-2975 2979-2980
+ 2984-2986 2990-2997 2999-3001 3077-3084
+ 3086-3088 3090-3112 3114-3123 3125-3129
+ 3168-3169 3205-3212 3214-3216 3218-3240
+ 3242-3251 3253-3257 3294 3296-3297 3333-3340
+ 3342-3344 3346-3368 3370-3385 3424-3425
+ 3585-3630 3632 3634-3635 3648-3653 3713-3714
+ 3716 3719-3720 3722 3725 3732-3735 3737-3743
+ 3745-3747 3749 3751 3754-3755 3757-3758 3760
+ 3762-3763 3773 3776-3780 3904-3911 3913-3945
+ 4256-4293 4304-4342 4352 4354-4355 4357-4359
+ 4361 4363-4364 4366-4370 4412 4414 4416 4428
+ 4430 4432 4436-4437 4441 4447-4449 4451 4453
+ 4455 4457 4461-4462 4466-4467 4469 4510 4520
+ 4523 4526-4527 4535-4536 4538 4540-4546 4587
+ 4592 4601 7680-7835 7840-7929 7936-7957
+ 7960-7965 7968-8005 8008-8013 8016-8023 8025
+ 8027 8029 8031-8061 8064-8116 8118-8124 8126
+ 8130-8132 8134-8140 8144-8147 8150-8155
+ 8160-8172 8178-8180 8182-8188 8486 8490-8491
+ 8494 8576-8578 12295 12321-12329 12353-12436
+ 12449-12538 12549-12588 19968-40869 44032-55203
+
+ LCNMCHAR ""
+ UCNMCHAR ""
+ NAMECHAR
+ 45-46 183 720-721 768-837 864-865 903 1155-1158
+ 1425-1441 1443-1465 1467-1469 1471 1473-1474
+ 1476 1600 1611-1618 1632-1641 1648 1750-1764
+ 1767-1768 1770-1773 1776-1785 2305-2307 2364
+ 2366-2381 2385-2388 2402-2403 2406-2415
+ 2433-2435 2492 2494-2500 2503-2504 2507-2509
+ 2519 2530-2531 2534-2543 2562 2620 2622-2626
+ 2631-2632 2635-2637 2662-2673 2689-2691 2748
+ 2750-2757 2759-2761 2763-2765 2790-2799
+ 2817-2819 2876 2878-2883 2887-2888 2891-2893
+ 2902-2903 2918-2927 2946-2947 3006-3010
+ 3014-3016 3018-3021 3031 3047-3055 3073-3075
+ 3134-3140 3142-3144 3146-3149 3157-3158
+ 3174-3183 3202-3203 3262-3268 3270-3272
+ 3274-3277 3285-3286 3302-3311 3330-3331
+ 3390-3395 3398-3400 3402-3405 3415 3430-3439
+ 3633 3636-3642 3654-3662 3664-3673 3761
+ 3764-3769 3771-3772 3782 3784-3789 3792-3801
+ 3864-3865 3872-3881 3893 3895 3897 3902-3903
+ 3953-3972 3974-3979 3984-3989 3991 3993-4013
+ 4017-4023 4025 8400-8412 8417 12293 12330-12335
+ 12337-12341 12441-12442 12445-12446 12540-12542
+
+ NAMECASE
+ GENERAL NO
+ ENTITY NO
+
+ DELIM
+ GENERAL SGMLREF
+ HCRO "&#38;#x" -- 38 is the number for ampersand --
+ NESTC "/"
+ NET ">"
+ PIC "?>"
+ SHORTREF NONE
+
+ NAMES
+ SGMLREF
+
+ QUANTITY NONE
+
+ ENTITIES
+ "amp" 38
+ "lt" 60
+ "gt" 62
+ "quot" 34
+ "apos" 39
+
+ FEATURES
+ MINIMIZE
+ DATATAG NO
+ OMITTAG NO
+ RANK NO
+ SHORTTAG
+ STARTTAG
+ EMPTY NO
+ UNCLOSED NO
+ NETENABL IMMEDNET
+ ENDTAG
+ EMPTY NO
+ UNCLOSED NO
+ ATTRIB
+ DEFAULT YES
+ OMITNAME NO
+ VALUE NO
+ EMPTYNRM YES
+ IMPLYDEF
+ ATTLIST NO
+ DOCTYPE NO
+ ELEMENT NO
+ ENTITY NO
+ NOTATION NO
+ LINK
+ SIMPLE NO
+ IMPLICIT NO
+ EXPLICIT NO
+ OTHER
+ CONCUR NO
+ SUBDOC NO
+ FORMAL NO
+ URN NO
+ KEEPRSRE YES
+ VALIDITY TYPE
+ ENTITIES
+ REF ANY
+ INTEGRAL YES
+ APPINFO NONE
+ SEEALSO "ISO 8879:1986//NOTATION
+ Extensible Markup Language (XML) 1.0//EN"
+>