Multi Format Codec 5.1 driver for s5pv210 and exynos4 SoC
Subsystems (2)
v9 cover Multi Format Codec 5.1 driver for s5pv210 and exynos4 SoC
Hi,
This is the ninth version of the MFC 5.1 driver. Both encoding and decoding is supported. The encoding part was done Jeongtae Park with some of my modifications.
Changes in videodev2.h have been split to two patches:
1) v4l: add fourcc definitons for compressed formats.
(http://permalink.gmane.org/gmane.linux.drivers.video-input-infrastructure/30740)
This one has been already discussed on the mailing list (sent on the 23/03/2011). However there is one change in the names of VC1 fourccs:
- V4L2_PIX_FMT_VC1_AP changed to V4L2_PIX_FMT_VC1_ANNEX_G
- V4L2_PIX_FMT_VC1 changed to V4L2_PIX_FMT_VC1_ANNEX_L
2) v4l: add control definitions for codec devices.
I am posting the newest version of this patch in this patch set.
The changes from v3 that was posted on the list:
(http://permalink.gmane.org/gmane.linux.drivers.video-input-infrastructure/33438)
- use already existing controls instead of creating new
(during the discussion it turned out that some controls mean the same as already existing ones)
- V4L2_CID_MPEG_LEVEL control hase been split into two separate for MPEG4 and H264
- use V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES instead of *_MAX_BITS
- use V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE instead of *_SYMBOL_MODE
- added CYCLIC to V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB
- V4L2_CID_MFC51_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER is no longer MFC specific
- new names for vop_time_increment and vop_time_increment_resolution controls
- extended the documentation and corrected mistakes in the doc
Another major change is use of the dma_contig memory allocator. This removes the dependence on other subsystems, which could delay merging of MFC.
I have also removed the per buffer controls implemented by Jeongtae from this version. Handling of such controls was complicated and is not necessary for the driver to work. We will get back to this feature after the first version of MFC get merged.
The branch with all necessary patches applied can be found here (in couple of hours):
http://git.infradead.org/users/kmpark/linux-2.6-samsung/shortlog/refs/heads/mfc-for-mauro
This driver requires platform modification that can be found here (it will also sync in a couple of hours):
http://git.infradead.org/users/kmpark/linux-2.6-samsung/shortlog/refs/heads/mfc-for-kgene
The platform modification have been sent today to the linux-samsung-soc list.
Best regards,
Kamil Debski
* Changelog:
==================
Changes since v8
==================
1) Change code to use only dma_contig memory allocator, this removes any dependencies on other subsystems that could delay the merging of MFC to the mainline.
2) Support for per buffer controls have been removed, it will be added at later time after the initial version gets merged in mainline. This is because the support for per buffer controls was overly complicated and offered little added functionality.
3) Due to licensing issues support for DIVX has been removed from the driver.
4) Update the code to work with latest version of codec controls patch.
==================
Changes since v7
==================
1) New fourcc definitions for codecs
- Fourcc definitions based on the new RFC
2) New controls defined in videodev2.h
- Controls definitions based on the new RFC
3) Support for multiple memory allocators - DMA Pool, CMA and IOMMU
- Now one can choose memory allocator in the kernel config.
4) Improved method of handling shared memory - by using memory barriers
- Problems with using the shared memory registers have been previously addressed with cleaning and invalidating cache. Now it is handles by memory barriers and proper mapping.
5) Fixed packed PB sequence numbering
- Numbering of sequence numbers was corrected for streams with packed PB.
6) Proper poll mechanism has been included
- Previously poll would not distinguish between queues.
==================
Changes since v6
==================
1) Stream seeking handling
- done by running stream off and then stream on from another point of the stream
2) Support for streams during which the resolution is changed
- done by calling stream off, reallocating the buffers and stream on again to resume
3) Power domain handling
4) Clock gating hw related operations
- This has introduced a large reduction in power use
5) Support for IOMMU allocator
- Using IOMMU as the memory allocator removes the cache problem and the need for reserving continuous memory at system boot
6) Flags of v4l2_buffer are set accordingly to the returned buffer frame type V4L2_BUF_FLAG_(KEY|P|B)FRAME
7) Fixed display delay handling of H264. Now dealy of 0 frames is possible, although it may cause that the frames are returned out of order.
8) Minor changes
- global s5p_mfc_dev variable has been removed
- improved Packed PB handling
- fixed error handling - separate for decoding and display frames
- some cosmetic changes to simplify the code and make it more readable
==================
Changes since v5
==================
1) Changes suggested by Hans Verkuil:
- small change in videodev2.h - corrected control offsets
- made the code more readable by simplifying if statements and using temporary pointers
- mfc_mutex is now included in s5p_mfc_dev structure
- after discussion with Peter Oh modification of fourcc defintions (replaced DX52 and DX53 with DX50)
2) Changes suggested by JongHun Han:
- comsmetic changed of defines in regs-mfc5.h
- in buffers that have no width adn height, such as the buffer for compressed stream, those values are set to 0 instead of 1
- remove redundant pointer to MFC registers
- change name of the union in s5p_mfc_buf from paddr to cookie
- removed global variable (struct s5p_mfc_dev *dev) and moved to use video_drvdata
3) Other changes:
- added check for values returned after parsing header - in rare circumstances MFC hw returned 0x0 as image size and this could cause problems
==================
Changes since v4
==================
1) Changes suggested by Kukjin Kim from:
- removed comment arch/arm/mach-s5pv210/include/mach/map.h
- changed device name to s5p-mfc (removed "5", MFC version number) also removed the version number from the name of MFC device file
- added GPL license to arch/arm/plat-s5p/dev-mfc.c
- removed unused include file from dev-mfc.c and unnecessary comments
2) Cache handling improvement:
- changed cache handling to use dma_map_single and dma_unmap_single
==================
Changes since v3
==================
1) Update to the v6 videobuf2 API (here thanks go to Marek Szyprowski)
- s5p_mfc_buf_negotiate and s5p_mfc_buf_setup_plane functions have been merged
- queue initialization has been adapted to the new API
- use of the allocator memops has been changed, now there are single memops for all the allocator contexts
2) Split of the s5p_mfc_try_run and s5p_mfc_handle_frame_int functions
- parts of the s5p_mfc_try_run function have been moved to separate functions (s5p_mfc_get_new_ctx, s5p_mfc_run_dec_last_frames, s5p_mfc_run_dec_frame, s5p_mfc_run_get_inst_no, s5p_mfc_run_return_inst s5p_mfc_run_init_dec,s5p_mfc_run_init_dec_buffers)
- s5p_mfc_handle_frame_int has been split to the following functions:s5p_mfc_handle_frame_all_extracted, s5p_mfc_handle_frame_new and s5p_mfc_handle_frame to handle different cases
3) Remove remaining magic numbers and tidy up comments
==================
Changes since v2
==================
1) Update to newest videobuf2 API
This is the major change from v2. The videobuf2 API will hopefully have no more major API changes. Buffer initialization has been moved from buf_prepare callback to buf_init to simplify the process. Locking mechanism has been modified to the requirements of new videobuf2 version.
2) Code cleanup
Removed more magic contants and replaced them with appropriate defines. Changed code to use unlocked_ioctl instead of ioctl in v4l2 file ops.
3) Allocators
All internal buffer allocations are done using the selected vb2 allocator, instead of using CMA functions directly.
==================
Changes since v1
==================
1) Cleanup accoridng to Peter Oh suggestions on the mailing list (Thanks).
* Original cover letter:
==============
Introduction
==============
The purpose of this RFC is to discuss the driver for a hw video codec embedded in the new Samusng's SoCs. Multi Format Codec 5.0 is able to handle video decoding of in a range of formats.
So far no hardware codec was supported in V4L2 and this would be the first one. I guess there are more similar device that would benefit from a V4L2 unified interface. I suggest a separate control class for codec devices - V4L2_CTRL_CLASS_CODEC.
Internally the driver uses videobuf2 framework and CMA memory allocator. I am aware that those have not yet been merged, but I wanted to start discussion about the driver earlier so it could be merged sooner. The driver posted here is the initial version, so I suppose it will require more work.
==================
Device interface
==================
The driver principle is based on the idea of memory-to-memory devices:
it provides a single video node and each opened file handle gets its own private context with separate buffer queues. Each context consist of 2 buffer queues: OUTPUT (for source buffers, i.e. encoded video frames) and CAPTURE (for destination buffers, i.e. decoded raw video frames). The process of decoding video data from stream is a bit more complicated than typical memory-to-memory processing, that's why the m2m framework is not directly used (it is too limited for this case). The main reason for this is the fact that the CAPTURE buffers can be dequeued in a different order than they queued. The hw block decides which buffer has been completely processed. This is due to the structure of most compressed video streams - use of B frames causes that decoding and display order may be different.
==============================
Decoding initialization path
==============================
First the OUTPUT queue is initialized. With S_FMT the application chooses which video format to decode and what size should be the input buffer. Fourcc values have been defined for different codecs e.g. V4L2_PIX_FMT_H264 for h264. Then the OUTPUT buffers are requested and mmaped. The stream header frame is loaded into the first buffer, queued and streaming is enabled. At this point the hardware is able to start processing the stream header and afterwards it will have information about the video dimensions and the size of the buffers with raw video data.
The next step is setting up the CAPTURE queue and buffers. The width, height, buffer size and minimum number of buffers can be read with G_FMT call. The application can request more output buffer if necessary. After requesting and mmaping buffers the device is ready to decode video stream.
The stream frames (ES frames) are written to the OUTPUT buffers, and decoded video frames can be read from the CAPTURE buffers. When no more source frames are present a single buffer with bytesused set to 0 should be queued. This will inform the driver that processing should be finished and it can dequeue all video frames that are still left. The number of such frames is dependent on the stream and its internal structure (how many frames had to be kept as reference frames for decoding, etc).
===============
Usage summary
===============
This is a step by step summary of the video decoding (from user application point of view, with 2 treads and blocking api):
01. S_FMT(OUTPUT, V4L2_PIX_FMT_H264, ...)
02. REQ_BUFS(OUTPUT, n)
03. for i=1..n MMAP(OUTPUT, i)
04. put stream header to buffer #1
05. QBUF(OUTPUT, #1)
06. STREAM_ON(OUTPUT)
07. G_FMT(CAPTURE)
08. REQ_BUFS(CAPTURE, m)
09. for j=1..m MMAP(CAPTURE, j)
10. for j=1..m QBUF(CAPTURE, #j)
11. STREAM_ON(CAPTURE)
display thread:
12. DQBUF(CAPTURE) -> got decoded video data in buffer #j
13. display buffer #j
14. QBUF(CAPTURE, #j)
15. goto 12
parser thread:
16. put next ES frame to buffer #i
17. QBUF(OUTPUT, #i)
18. DQBUF(OUTPUT) -> get next empty buffer #i 19. goto 16
...
Similar usage sequence can be achieved with single threaded application and non-blocking api with poll() call.
Branch with MFC, CMA and videobuf2 will be soon available at
http://git.infradead.org/users/kmpark/linux-2.6-samsung/shortlog/refs/heads/vb2-mfc-fimc
This tree is based on 2.6.37 rc4.
Please have a look at the code and the idea of how to introduce codec devices to V4L2. Comments will be very much appreciated.
Patch summary:
*** BLURB HERE ***
Kamil Debski (4):
v4l: add fourcc definitions for compressed formats.
v4l: add control definitions for codec devices.
v4l2-ctrl: add codec controls support to the control framework
MFC: Add MFC 5.1 V4L2 driver
Documentation/DocBook/media/v4l/controls.xml | 965 ++++++++++++- Documentation/DocBook/media/v4l/pixfmt.xml | 67 +- drivers/media/video/Kconfig | 8 + drivers/media/video/Makefile | 1 + drivers/media/video/s5p-mfc/Makefile | 5 + drivers/media/video/s5p-mfc/regs-mfc.h | 385 +++++ drivers/media/video/s5p-mfc/s5p_mfc.c | 1359 +++++++++++++++++ drivers/media/video/s5p-mfc/s5p_mfc_cmd.c | 143 ++ drivers/media/video/s5p-mfc/s5p_mfc_cmd.h | 28 + drivers/media/video/s5p-mfc/s5p_mfc_common.h | 472 ++++++ drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c | 393 +++++ drivers/media/video/s5p-mfc/s5p_mfc_ctrl.h | 27 + drivers/media/video/s5p-mfc/s5p_mfc_debug.h | 48 + drivers/media/video/s5p-mfc/s5p_mfc_dec.c | 1106 ++++++++++++++ drivers/media/video/s5p-mfc/s5p_mfc_dec.h | 23 + drivers/media/video/s5p-mfc/s5p_mfc_enc.c | 2021 ++++++++++++++++++++++++++ drivers/media/video/s5p-mfc/s5p_mfc_enc.h | 23 + drivers/media/video/s5p-mfc/s5p_mfc_inst.c | 52 + drivers/media/video/s5p-mfc/s5p_mfc_inst.h | 19 + drivers/media/video/s5p-mfc/s5p_mfc_intr.c | 94 ++ drivers/media/video/s5p-mfc/s5p_mfc_intr.h | 26 + drivers/media/video/s5p-mfc/s5p_mfc_mem.h | 55 + drivers/media/video/s5p-mfc/s5p_mfc_opr.c | 1588 ++++++++++++++++++++ drivers/media/video/s5p-mfc/s5p_mfc_opr.h | 88 ++ drivers/media/video/s5p-mfc/s5p_mfc_pm.c | 131 ++ drivers/media/video/s5p-mfc/s5p_mfc_pm.h | 24 + drivers/media/video/s5p-mfc/s5p_mfc_reg.c | 30 + drivers/media/video/s5p-mfc/s5p_mfc_reg.h | 126 ++ drivers/media/video/s5p-mfc/s5p_mfc_shm.c | 55 + drivers/media/video/s5p-mfc/s5p_mfc_shm.h | 86 ++ drivers/media/video/v4l2-ctrls.c | 281 ++++ include/linux/videodev2.h | 192 +++- 32 files changed, 9914 insertions(+), 7 deletions(-) create mode 100644 drivers/media/video/s5p-mfc/Makefile create mode 100644 drivers/media/video/s5p-mfc/regs-mfc.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_cmd.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_cmd.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_common.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_ctrl.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_debug.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_dec.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_dec.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_enc.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_enc.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_inst.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_inst.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_intr.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_intr.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_mem.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_opr.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_opr.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_pm.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_pm.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_reg.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_reg.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_shm.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_shm.h
PATCH v9 1/4 v4l: add fourcc definitions for compressed formats.
Add fourcc definitions and documentation for the following compressed formats: H264, H264 without start codes, MPEG1/2/4 ES, DIVX versions 3.11, 4, 5.0-5.0.2, 5.03 and up, XVID, VC1 Annex G and Annex L compliant.
--- Documentation/DocBook/media/v4l/controls.xml | 7 ++- Documentation/DocBook/media/v4l/pixfmt.xml | 67 +++++++++++++++++++++++++- include/linux/videodev2.h | 21 +++++++-- 3 files changed, 88 insertions(+), 7 deletions(-)
Documentation/DocBook/media/v4l/controls.xml +5 -2
@@ -670,7 +670,8 @@ caption of a Tab page in a GUI, for example.</entry> </row><row><entry spanname="descr">The MPEG-1, -2 or -4 output stream type. One cannot assume anything here. Each hardware MPEG encoder tends to support different subsets of the available MPEG -stream types. The currently defined stream types are:</entry> +stream types. This control is specific to multiplexed MPEG streams. +The currently defined stream types are:</entry> </row> <row> <entrytbl spanname="descr" cols="2">
@@ -800,6 +801,7 @@ frequency. Possible values are:</entry> <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_ENCODING</constant> </entry> <entry>enum v4l2_mpeg_audio_encoding</entry> </row><row><entry spanname="descr">MPEG Audio encoding. +This control is specific to multiplexed MPEG streams. Possible values are:</entry> </row> <row>
@@ -1250,7 +1252,8 @@ and reproducible audio bitstream. 0 = unmuted, 1 = muted.</entry> <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_ENCODING</constant> </entry> <entry>enum v4l2_mpeg_video_encoding</entry> </row><row><entry spanname="descr">MPEG Video encoding -method. Possible values are:</entry> +method. This control is specific to multiplexed MPEG streams. +Possible values are:</entry> </row> <row> <entrytbl spanname="descr" cols="2">
Documentation/DocBook/media/v4l/pixfmt.xml +66 -1
76 lines not on this page · raw message
include/linux/videodev2.h +17 -4
@@ -376,7 +376,20 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G')/* Motion-JPEG */ #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G')/* JFIF JPEG */ #define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd')/* 1394 */ -#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G')/* MPEG-1/2/4 */ +#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G')/* MPEG-1/2/4 Multiplexed */ +#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4')/* H264 with start codes */ +#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1')/* H264 without start codes */ +#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3')/* H263 */ +#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1')/* MPEG-1 ES */ +#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2')/* MPEG-2 ES */ +#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4')/* MPEG-4 ES */ +#define V4L2_PIX_FMT_DIVX3 v4l2_fourcc('D', 'I', 'V', '3')/* DivX 3.11 */ +#define V4L2_PIX_FMT_DIVX4 v4l2_fourcc('D', 'I', 'V', '4')/* DivX 4.12 */ +#define V4L2_PIX_FMT_DIVX500 v4l2_fourcc('D', 'X', '5', '0')/* DivX 5.00 - 5.02 */ +#define V4L2_PIX_FMT_DIVX5 v4l2_fourcc('D', 'I', 'V', '5')/* DivX 5.03 - x */ +#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D')/* Xvid */ +#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G')/* SMPTE 421M Annex G compliant stream */ +#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L')/* SMPTE 421M Annex L compliant stream */ /* Vendor-specific formats */ #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A')/* cpia1 YUV */
@@ -1151,7 +1164,7 @@ enum v4l2_colorfx {#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) -/* MPEG streams */ +/* MPEG streams, specific to multiplexed streams */ #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)enum v4l2_mpeg_stream_type {V4L2_MPEG_STREAM_TYPE_MPEG2_PS =0 ,/* MPEG-2 program stream */
@@ -1173,7 +1186,7 @@ enum v4l2_mpeg_stream_vbi_fmt { V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ }; -/* MPEG audio */ +/* MPEG audio controls specific to multiplexed streams */ #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)enum v4l2_mpeg_audio_sampling_freq {V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 =0 ,
@@ -1289,7 +1302,7 @@ enum v4l2_mpeg_audio_ac3_bitrate { V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18, }; -/* MPEG video */ +/* MPEG video controls specific to multiplexed streams */ #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)enum v4l2_mpeg_video_encoding {V4L2_MPEG_VIDEO_ENCODING_MPEG_1 =0 ,
Signature · 1 line
1.6.3.3
Re: [PATCH 1/4 v9] v4l: add fourcc definitions for compressed formats.
Quoted 136 lines · On Tuesday, June 14, 2011 18:36:53 Kamil Debski wrote:
Add fourcc definitions and documentation for the following compressed formats: H264, H264 without start codes, MPEG1/2/4 ES, DIVX versions 3.11, 4, 5.0-5.0.2, 5.03 and up, XVID, VC1 Annex G and Annex L compliant.
Signed-off-by Kamil Debski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- Documentation/DocBook/media/v4l/controls.xml | 7 ++- Documentation/DocBook/media/v4l/pixfmt.xml | 67 +++++++++++++++++++++++++- include/linux/videodev2.h | 21 +++++++-- 3 files changed, 88 insertions(+), 7 deletions(-)Documentation/DocBook/media/v4l/controls.xml +5
-2@@ -670,7 +670,8 @@ caption of a Tab page in a GUI, for example.</entry> </row><row><entry spanname="descr">The MPEG-1, -2 or -4 output stream type. One cannot assume anything here. Each hardware MPEG encoder tends to support different subsets of the available MPEG -stream types. The currently defined stream types are:</entry> +stream types. This control is specific to multiplexed MPEG streams. +The currently defined stream types are:</entry> </row> <row> <entrytbl spanname="descr" cols="2">@@ -800,6 +801,7 @@ frequency. Possible values are:</entry> <entry spanname="id"><constant>V4L2_CID_MPEG_AUDIO_ENCODING</constant> </entry> <entry>enum v4l2_mpeg_audio_encoding</entry> </row><row><entry spanname="descr">MPEG Audio encoding. +This control is specific to multiplexed MPEG streams. Possible values are:</entry> </row> <row>@@ -1250,7 +1252,8 @@ and reproducible audio bitstream. 0 = unmuted, 1 = muted.</entry> <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_ENCODING</constant> </entry> <entry>enum v4l2_mpeg_video_encoding</entry> </row><row><entry spanname="descr">MPEG Video encoding -method. Possible values are:</entry> +method. This control is specific to multiplexed MPEG streams. +Possible values are:</entry> </row> <row> <entrytbl spanname="descr" cols="2">Documentation/DocBook/media/v4l/pixfmt.xml +66
-1@@ -741,10 +741,75 @@ information.</para> <row id="V4L2-PIX-FMT-MPEG"> <entry><constant>V4L2_PIX_FMT_MPEG</constant></entry> <entry>'MPEG'</entry> - <entry>MPEG stream. The actual format is determined by + <entry>MPEG multiplexed stream. The actual format is determined by extended control <constant>V4L2_CID_MPEG_STREAM_TYPE</constant>, see <xref linkend="mpeg-control-id" />.</entry> </row> + <row id="V4L2-PIX-FMT-H264"> + <entry><constant>V4L2_PIX_FMT_H264</constant></entry> + <entry>'H264'</entry> + <entry>H264 video elementary stream with start codes.</entry> + </row> + <row id="V4L2-PIX-FMT-H264-NO-SC"> + <entry><constant>V4L2_PIX_FMT_H264_NO_SC</constant></entry> + <entry>'AVC1'</entry> + <entry>H264 video elementary stream without start codes.</entry> + </row> + <row id="V4L2-PIX-FMT-H263"> + <entry><constant>V4L2_PIX_FMT_H263</constant></entry> + <entry>'H263'</entry> + <entry>H263 video elementary stream.</entry> + </row> + <row id="V4L2-PIX-FMT-MPEG1"> + <entry><constant>V4L2_PIX_FMT_MPEG1</constant></entry> + <entry>'MPG1'</entry> + <entry>MPEG1 video elementary stream.</entry> + </row> + <row id="V4L2-PIX-FMT-MPEG2"> + <entry><constant>V4L2_PIX_FMT_MPEG2</constant></entry> + <entry>'MPG2'</entry> + <entry>MPEG2 video elementary stream.</entry> + </row> + <row id="V4L2-PIX-FMT-MPEG4"> + <entry><constant>V4L2_PIX_FMT_MPEG4</constant></entry> + <entry>'MPG4'</entry> + <entry>MPEG4 video elementary stream.</entry> + </row> + <row id="V4L2-PIX-FMT-DIVX3"> + <entry><constant>V4L2_PIX_FMT_DIVX3</constant></entry> + <entry>'DIV3'</entry> + <entry>Divx 3.11 video elementary stream.</entry> + </row> + <row id="V4L2-PIX-FMT-DIVX4"> + <entry><constant>V4L2_PIX_FMT_DIVX4</constant></entry> + <entry>'DIV4'</entry> + <entry>Divx 4 video elementary stream.</entry> + </row> + <row id="V4L2-PIX-FMT-DIVX500"> + <entry><constant>V4L2_PIX_FMT_DIVX500</constant></entry> + <entry>'DX50'</entry> + <entry>Divx 5.0-5.0.2 video elementary stream.</entry> + </row> + <row id="V4L2-PIX-FMT-DIVX5"> + <entry><constant>V4L2_PIX_FMT_DIVX5</constant></entry> + <entry>'DIV5'</entry> + <entry>Divx 5.0.3+ video elementary stream.</entry> + </row> + <row id="V4L2-PIX-FMT-XVID"> + <entry><constant>V4L2_PIX_FMT_XVID</constant></entry> + <entry>'XVID'</entry> + <entry>Xvid video elementary stream.</entry> + </row> + <row id="V4L2-PIX-FMT-VC1-ANNEX-G"> + <entry><constant>V4L2_PIX_FMT_VC1_ANNEX_G</constant></entry> + <entry>'VC1G'</entry> + <entry>VC1, SMPTE 421M Annex G compliant stream.</entry> + </row> + <row id="V4L2-PIX-FMT-VC1-ANNEX-L"> + <entry><constant>V4L2_PIX_FMT_VC1_ANNEX_L</constant></entry> + <entry>'VC1L'</entry> + <entry>VC1, SMPTE 421M Annex L compliant stream.</entry> + </row> </tbody> </tgroup> </table>include/linux/videodev2.h +1
-1@@ -376,7 +376,20 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G')/* Motion-JPEG */ #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G')/* JFIF JPEG */ #define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd')/* 1394 */ -#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G')/* MPEG-1/2/4 */ +#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G')/* MPEG-1/2/4 Multiplexed */
include/linux/videodev2.h struct v4l2_pix_format { · line 389
Quoted 10 lines
include/linux/videodev2.h +10
-0+#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4')/* H264 with start codes */ +#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1')/* H264 without start codes */ +#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3')/* H263 */ +#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1')/* MPEG-1 ES */ +#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2')/* MPEG-2 ES */ +#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4')/* MPEG-4 ES */ +#define V4L2_PIX_FMT_DIVX3 v4l2_fourcc('D', 'I', 'V', '3')/* DivX 3.11 */ +#define V4L2_PIX_FMT_DIVX4 v4l2_fourcc('D', 'I', 'V', '4')/* DivX 4.12 */ +#define V4L2_PIX_FMT_DIVX500 v4l2_fourcc('D', 'X', '5', '0')/* DivX 5.00 - 5.02 */ +#define V4L2_PIX_FMT_DIVX5 v4l2_fourcc('D', 'I', 'V', '5')/* DivX 5.03 - x */
Wasn't DIVX removed due to licensing issues?
include/linux/videodev2.h struct v4l2_pix_format { · line 392
Quoted 3 lines
include/linux/videodev2.h +3
-0+#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D')/* Xvid */ +#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G')/* SMPTE 421M Annex G compliant stream */ +#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L')/* SMPTE 421M Annex L compliant stream */
Just to verify: are all these formats actually used in the driver?
Quoted 22 lines
include/linux/videodev2.h +2
-2/* Vendor-specific formats */ #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A')/* cpia1 YUV */ @@ -1151,7 +1164,7 @@ enum v4l2_colorfx {#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) -/* MPEG streams */ +/* MPEG streams, specific to multiplexed streams */ #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)enum v4l2_mpeg_stream_type {V4L2_MPEG_STREAM_TYPE_MPEG2_PS =0 ,/* MPEG-2 program stream */ @@ -1173,7 +1186,7 @@ enum v4l2_mpeg_stream_vbi_fmt { V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ }; -/* MPEG audio */ +/* MPEG audio controls specific to multiplexed streams */ #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)enum v4l2_mpeg_audio_sampling_freq {V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 =0 ,
include/linux/videodev2.h enum v4l2_mpeg_audio_ac3_bitrate { · line 1305
Quoted 5 lines
include/linux/videodev2.h +1
-1@@ -1289,7 +1302,7 @@ enum v4l2_mpeg_audio_ac3_bitrate { V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18, }; -/* MPEG video */ +/* MPEG video controls specific to multiplexed streams */
The 'multiplexed' part of this comment is only true for VIDEO_ENCODING. The other controls are valid for elementary streams as well.
include/linux/videodev2.h enum v4l2_mpeg_audio_ac3_bitrate { · line 1308
Quoted 4 lines
include/linux/videodev2.h +0
-0#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)enum v4l2_mpeg_video_encoding {V4L2_MPEG_VIDEO_ENCODING_MPEG_1 =0 ,
Regards,
Hans
RE: [PATCH 1/4 v9] v4l: add fourcc definitions for compressed formats.
Hi,
Quoted 27 lines
-----Original Message-----
From: Hans Verkuil [mailto:[email protected]]
Sent: 15 June 2011 08:40
To: Kamil Debski
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/4 v9] v4l: add fourcc definitions for compressed formats.Quoted 10 lines · On Tuesday, June 14, 2011 18:36:53 Kamil Debski wrote:
Add fourcc definitions and documentation for the following compressed formats: H264, H264 without start codes, MPEG1/2/4 ES, DIVX versions 3.11, 4, 5.0-5.0.2, 5.03 and up, XVID, VC1 Annex G and Annex L compliant.
Signed-off-by Kamil Debski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- Documentation/DocBook/media/v4l/controls.xml | 7 ++- Documentation/DocBook/media/v4l/pixfmt.xml | 67+++++++++++++++++++++++++-
Review
Quoted 4 lines
include/linux/videodev2.h | 21 +++++++-- 3 files changed, 88 insertions(+), 7 deletions(-)(quoted diff) +0
-0
b/Documentation/DocBook/media/v4l/controls.xml
[snip]
Quoted 29 lines
include/linux/videodev2.h struct v4l2_pix_format { · line 376
Quoted 6 lines
include/linux/videodev2.h +0
-0@@ -376,7 +376,20 @@ struct v4l2_pix_format {#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G')/* Motion- JPEG */
include/linux/videodev2.h struct v4l2_pix_format { · line 377
Quoted 1 line
include/linux/videodev2.h +0
-0#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G')/* JFIF JPEG */
include/linux/videodev2.h struct v4l2_pix_format { · line 378
Quoted 1 line
include/linux/videodev2.h +0
-0#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd')/* 1394 */
include/linux/videodev2.h struct v4l2_pix_format { · line 379
Quoted 1 line
include/linux/videodev2.h +0
-1-#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G')/* MPEG- 1/2/4 */
include/linux/videodev2.h struct v4l2_pix_format { · line 379
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G')/* MPEG- 1/2/4 Multiplexed */
include/linux/videodev2.h struct v4l2_pix_format { · line 380
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4')/* H264 with start codes */
include/linux/videodev2.h struct v4l2_pix_format { · line 381
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1')/* H264 without start codes */
include/linux/videodev2.h struct v4l2_pix_format { · line 382
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3')/* H263 */
include/linux/videodev2.h struct v4l2_pix_format { · line 383
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1')/* MPEG-1 ES */
include/linux/videodev2.h struct v4l2_pix_format { · line 384
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2')/* MPEG-2 ES */
include/linux/videodev2.h struct v4l2_pix_format { · line 385
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4')/* MPEG-4 ES */
include/linux/videodev2.h struct v4l2_pix_format { · line 386
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_DIVX3 v4l2_fourcc('D', 'I', 'V', '3')/* DivX 3.11 */
Quoted 8 lines
include/linux/videodev2.h struct v4l2_pix_format { · line 387
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_DIVX4 v4l2_fourcc('D', 'I', 'V', '4')/* DivX 4.12 */
include/linux/videodev2.h struct v4l2_pix_format { · line 388
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_DIVX500 v4l2_fourcc('D', 'X', '5', '0')/* DivX 5.00 - 5.02 */
include/linux/videodev2.h struct v4l2_pix_format { · line 389
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_DIVX5 v4l2_fourcc('D', 'I', 'V', '5')/* DivX 5.03 - x */
Wasn't DIVX removed due to licensing issues?
The idea is to have a separate patch that will add DIVX support to the driver. I thought that I could leave the pixel format definitions here - if any other driver cares to use them.
There is no problem to remove it from videodev2.h also and have the DIVX patch add it. Do you think we should do it this way?
Quoted 8 lines
include/linux/videodev2.h struct v4l2_pix_format { · line 390
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D')/* Xvid */
include/linux/videodev2.h struct v4l2_pix_format { · line 391
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G')/* SMPTE 421M Annex G compliant stream */
include/linux/videodev2.h struct v4l2_pix_format { · line 392
Quoted 1 line
include/linux/videodev2.h +1
-0+#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L')/* SMPTE 421M Annex L compliant stream */
Just to verify: are all these formats actually used in the driver?
All but the DIVX and V4L2_PIX_FMT_H264_NO_SC pixel format. V4L2_PIX_FMT_H264_NO_SC pixel format was requested by Laurent.
Quoted 8 lines
include/linux/videodev2.h struct v4l2_pix_format { · line 394
Quoted 3 lines
include/linux/videodev2.h +0
-0/* Vendor-specific formats */ #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A')/* cpia1 YUV */
include/linux/videodev2.h enum v4l2_colorfx { · line 1164
Quoted 2 lines
include/linux/videodev2.h +0
-0@@ -1151,7 +1164,7 @@ enum v4l2_colorfx {#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG |
0x900)Quoted 1 line
include/linux/videodev2.h +0
-0#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG |
1)
Quoted 20 lines
include/linux/videodev2.h enum v4l2_mpeg_stream_vbi_fmt { · line 1186
Quoted 8 lines
include/linux/videodev2.h +1
-1-/* MPEG streams */ +/* MPEG streams, specific to multiplexed streams */ #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)enum v4l2_mpeg_stream_type {V4L2_MPEG_STREAM_TYPE_MPEG2_PS =0 ,/* MPEG-2 program stream */ @@ -1173,7 +1186,7 @@ enum v4l2_mpeg_stream_vbi_fmt { V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTVformat */
Quoted 11 lines
include/linux/videodev2.h +1
-1}; -/* MPEG audio */ +/* MPEG audio controls specific to multiplexed streams */ #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)enum v4l2_mpeg_audio_sampling_freq {V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 =0 ,@@ -1289,7 +1302,7 @@ enum v4l2_mpeg_audio_ac3_bitrate { V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18, };
Quoted 5 lines
include/linux/videodev2.h enum v4l2_mpeg_audio_ac3_bitrate { · line 1305
Quoted 2 lines
include/linux/videodev2.h +1
-1-/* MPEG video */ +/* MPEG video controls specific to multiplexed streams */ The 'multiplexed' part of this comment is only true for
VIDEO_ENCODING. The other controls are valid for elementary streams as well.
Ok, I will remove this comment.
Quoted 9 lines
include/linux/videodev2.h enum v4l2_mpeg_audio_ac3_bitrate { · line 1308
Quoted 5 lines
include/linux/videodev2.h +0
-0#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)enum v4l2_mpeg_video_encoding {V4L2_MPEG_VIDEO_ENCODING_MPEG_1 =0 ,Regards,
Hans
Best regards,
--
Kamil Debski
Linux Platform Group
Samsung Poland R&D Center
Re: [PATCH 1/4 v9] v4l: add fourcc definitions for compressed formats.
Hi Kamil,
Quoted 9 lines · On Wednesday 15 June 2011 10:05:42 Kamil Debski wrote:
Quoted 8 lines · On 15 June 2011 08:40 Hans Verkuil wrote:
Quoted 7 lines · On Tuesday, June 14, 2011 18:36:53 Kamil Debski wrote:
Add fourcc definitions and documentation for the following compressed formats: H264, H264 without start codes, MPEG1/2/4 ES, DIVX versions 3.11, 4, 5.0-5.0.2, 5.03 and up, XVID, VC1 Annex G and Annex L compliant.
Signed-off-by Kamil Debski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>
[snip]
Quoted 4 lines
Quoted 1 line
Just to verify: are all these formats actually used in the driver?
All but the DIVX and
V4L2_PIX_FMT_H264_NO_SCpixel format.V4L2_PIX_FMT_H264_NO_SCpixel format was requested by Laurent.
I'm fine with adding it later when a driver will use it.
Signature · 3 lines
Regards, Laurent Pinchart
PATCH v9 2/4 v4l: add control definitions for codec devices.
In reply to Kamil DebskiAdd control definitions and documentation for controls specific to codec devices.
--- Documentation/DocBook/media/v4l/controls.xml | 958 ++++++++++++++++++++++++++ include/linux/videodev2.h | 171 +++++ 2 files changed, 1129 insertions(+), 0 deletions(-)
Documentation/DocBook/media/v4l/controls.xml +958 -0
@@ -325,6 +325,22 @@ minimum value disables backlight compensation.</entry> <constant>V4L2_CID_ILLUMINATORS_2</constant> + 1).</entry> </row> <row> + <entry><constant>V4L2_CID_MIN_BUFFERS_FOR_CAPTURE</constant></entry> + <entry>integer</entry> + <entry>This is a read-only control that can be read by the application +and used as a hint to determine the number of CAPTURE buffers to pass to REQBUFS. +The value is the minimum number of CAPTURE buffers that is necessary for hardware +to work.</entry> + </row> + <row> + <entry><constant>V4L2_CID_MIN_BUFFERRS_FOR_OUTPUT</constant></entry> + <entry>integer</entry> + <entry>This is a read-only control that can be read by the application +and used as a hint to determine the number of OUTPUT buffers to pass to REQBUFS. +The value is the minimum number of OUTPUT buffers that is necessary for hardware +to work.</entry> + </row> + <row> <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry> <entry></entry> <entry>ID of the first custom (driver specific) control.
@@ -1409,6 +1425,948 @@ of the video. The supplied 32-bit integer is interpreted as follows (bit </tbody> </entrytbl> </row> + + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE</constant> </entry> + <entry>boolean</entry> + </row> + <row><entry spanname="descr">If enabled the decoder expects a single slice in one OUTPUT buffer, otherwise +the decoder expects a single frame in one input buffer. Applicable to the decoder, all codecs. +</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE</constant> </entry> + <entry>boolean</entry> + </row> + <row><entry spanname="descr">Enable writing sample aspect ratio in the Video Usability Information. +Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC</constant> </entry> + <entry>enum v4l2_mpeg_video_h264_vui_sar_idc</entry> + </row> + <row><entry spanname="descr">VUI sample aspect ratio indicator for H.264 encoding. The value +is defined in the table E-1 in the standard. Applicable to the H264 encoder.</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED</constant> </entry> + <entry>Unspecified</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1</constant> </entry> + <entry>1x1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11</constant> </entry> + <entry>12x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11</constant> </entry> + <entry>10x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11</constant> </entry> + <entry>16x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33</constant> </entry> + <entry>40x33</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11</constant> </entry> + <entry>24x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11</constant> </entry> + <entry>20x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11</constant> </entry> + <entry>32x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33</constant> </entry> + <entry>80x33</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11</constant> </entry> + <entry>18x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11</constant> </entry> + <entry>15x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33</constant> </entry> + <entry>64x33</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99</constant> </entry> + <entry>160x99</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3</constant> </entry> + <entry>4x3</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2</constant> </entry> + <entry>3x2</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1</constant> </entry> + <entry>2x1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED</constant> </entry> + <entry>Extended SAR</entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Extended sample aspect ratio width for H.264 VUI encoding. +Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Extended sample aspect ratio height for H.264 VUI encoding. +Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LEVEL</constant> </entry> + <entry>enum v4l2_mpeg_video_h264_level</entry> + </row> + <row><entry spanname="descr">The level information for the H264 video elementary stream. +Applicable to the H264 encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1_0</constant> </entry> + <entry>Level 1.0</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1B</constant> </entry> + <entry>Level 1B</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1_1</constant> </entry> + <entry>Level 1.1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1_2</constant> </entry> + <entry>Level 1.2</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1_3</constant> </entry> + <entry>Level 1.3</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_2_0</constant> </entry> + <entry>Level 2.0</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_2_1</constant> </entry> + <entry>Level 2.1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_2_2</constant> </entry> + <entry>Level 2.2</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_3_0</constant> </entry> + <entry>Level 3.0</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_3_1</constant> </entry> + <entry>Level 3.1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_3_2</constant> </entry> + <entry>Level 3.2</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_4_0</constant> </entry> + <entry>Level 4.0</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_4_1</constant> </entry> + <entry>Level 4.1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_4_2</constant> </entry> + <entry>Level 4.2</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_5_0</constant> </entry> + <entry>Level 5.0</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_5_1</constant> </entry> + <entry>Level 5.1</entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL</constant> </entry> + <entry>enum v4l2_mpeg_video_mpeg4_level</entry> + </row> + <row><entry spanname="descr">The level information for the MPEG4 elementary stream. +Applicable to the MPEG4 encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_0</constant> </entry> + <entry>Level 0</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_0B</constant> </entry> + <entry>Level 0b</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_1</constant> </entry> + <entry>Level 1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_2</constant> </entry> + <entry>Level 2</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_3</constant> </entry> + <entry>Level 3</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_3B</constant> </entry> + <entry>Level 3b</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_4</constant> </entry> + <entry>Level 4</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_5</constant> </entry> + <entry>Level 5</entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_PROFILE</constant> </entry> + <entry>enum v4l2_mpeg_h264_profile</entry> + </row> + <row><entry spanname="descr">The profile information for H264. +Applicable to the H264 encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE</constant> </entry> + <entry>Baseline profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE</constant> </entry> + <entry>Constrained Baseline profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_MAIN</constant> </entry> + <entry>Main profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED</constant> </entry> + <entry>Extended profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH</constant> </entry> + <entry>High profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10</constant> </entry> + <entry>High 10 profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422</constant> </entry> + <entry>High 422 profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE</constant> </entry> + <entry>High 444 Predictive profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA</constant> </entry> + <entry>High 10 Intra profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA</constant> </entry> + <entry>High 422 Intra profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA</constant> </entry> + <entry>High 444 Intra profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA</constant> </entry> + <entry>CAVLC 444 Intra profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE</constant> </entry> + <entry>Scalable Baseline profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH</constant> </entry> + <entry>Scalable High profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA</constant> </entry> + <entry>Scalable High Intra profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH</constant> </entry> + <entry>Stereo High profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH</constant> </entry> + <entry>Multiview High profile</entry> + </row> + + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE</constant> </entry> + <entry>enum v4l2_mpeg_mpeg4_profile</entry> + </row> + <row><entry spanname="descr">The profile information for MPEG4. +Applicable to the MPEG4 encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_PROFILE_SIMPLE</constant> </entry> + <entry>Simple profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_PROFILE_ADVANCED_SIMPLE</constant> </entry> + <entry>Advanced Simple profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_PROFILE_CORE</constant> </entry> + <entry>Core profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_PROFILE_SIMPLE_SCALABLE</constant> </entry> + <entry>Simple Scalable profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_PROFILE_ADVANCED_CODING_EFFICIENCY</constant> </entry> + <entry></entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MAX_REF_PIC</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">The maximum number of reference pictures used for encoding. +Applicable to the encoder. +</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE</constant> </entry> + <entry>enum v4l2_mpeg_multi_slice_mode</entry> + </row> + <row><entry spanname="descr">Determines how should the encoder handle division of frame into slices. +Applicable to the encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE</constant> </entry> + <entry>Single slice per frame.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB</constant> </entry> + <entry>Multiple slices with set maximum number of macroblocks per slice.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES</constant> </entry> + <entry>Multiple slice with set maximum size in bytes per slice.</entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">The maximum number of macroblocks in a slice. Used when +<constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE</constant> is set to <constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB</constant>. +Applicable to the encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">The maximum size of a slice in bytes. Used when +<constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE</constant> is set to <constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES</constant>. +Applicable to the encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE</constant> </entry> + <entry>enum v4l2_mpeg_h264_loop_filter_mode</entry> + </row> + <row><entry spanname="descr">Loop filter mode for H264 encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED</constant> </entry> + <entry>Loop filter is enabled.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED</constant> </entry> + <entry>Loop filter is disabled.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY</constant> </entry> + <entry>Loop filter is disabled at the slice boundary.</entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Loop filter alpha coefficient, defined in the H264 standard. +Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Loop filter beta coefficient, defined in the H264 standard. +Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE</constant> </entry> + <entry>enum v4l2_mpeg_h264_symbol_mode</entry> + </row> + <row><entry spanname="descr">Entropy coding mode for H264 - CABAC/CAVALC. +Applicable to the H264 encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC</constant> </entry> + <entry>Use CAVLC entropy coding.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC</constant> </entry> + <entry>Use CABAC entropy coding.</entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM</constant> </entry> + <entry>boolean</entry> + </row> + <row><entry spanname="descr">Enable 8X8 transform for H264. Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Cyclic intra macroblock refresh. This is the number of continuous macroblocks +refreshed every frame. Each frame a succesive set of macroblocks is refreshed until the cycle completes and starts from the +top of the frame. Applicable to H264, H263 and MPEG4 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE</constant> </entry> + <entry>boolean</entry> + </row> + <row><entry spanname="descr">Frame level rate control enable. +If this control is disabled then the quantization parameter for each frame type is constant and set with appropriate controls +(e.g. <constant>V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP</constant>). +If frame rate control is enabled then quantization parameter is adjusted to meet the chosen bitrate. Minimum and maximum value +for the quantization parameter can be set with appropriate controls (e.g. <constant>V4L2_CID_MPEG_VIDEO_H263_MIN_QP</constant>). +Applicable to encoders.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant> </entry> + <entry>boolean</entry> + </row> + <row><entry spanname="descr">Macroblock level rate control enable. +Applicable to the MPEG4 and H264 encoders.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_QPEL</constant> </entry> + <entry>boolean</entry> + </row> + <row><entry spanname="descr">Quarter pixel motion estimation for MPEG4. Applicable to the MPEG4 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an I frame for H263. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_MIN_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Minimum quantization parameter for H263. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_MAX_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Maximum quantization parameter for H263. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an P frame for H263. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an B frame for H263. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an I frame for H264. Valid range: from 0 to 51.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_MIN_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Minimum quantization parameter for H264. Valid range: from 0 to 51.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_MAX_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Maximum quantization parameter for H264. Valid range: from 0 to 51.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an P frame for H264. Valid range: from 0 to 51.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an B frame for H264. Valid range: from 0 to 51.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an I frame for MPEG4. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Minimum quantization parameter for MPEG4. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Maximum quantization parameter for MPEG4. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an P frame for MPEG4. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an B frame for MPEG4. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_VBV_SIZE</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">The Video Buffer Verifier size in kilobytes, it used as a limitation of frame skip. +Applicable to the MPEG1, MPEG2, MPEG4 encoders.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">The Coded Picture Buffer size in kilobytes, it used as a limitation of frame skip. +Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_I_PERIOD</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Period between I-frames in the open GOP for H264. In case of an open GOP +this is the period between two I-frames. The period between IDR (Instantaneous Decoding Refresh) frames is taken from the GOP_SIZE control. +An IDR frame, which stands for Instantaneous Decoding Refresh is an I-frame after which no prior frames are +referenced. This means that a stream can be restarted from an IDR frame without the need to store or decode any +previous frames. Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_HEADER_MODE</constant> </entry> + <entry>enum v4l2_mpeg_header_mode</entry> + </row> + <row><entry spanname="descr">Determines whether the header is returned as the first buffer or is +it returned together with the first frame. Applicable to encoders. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE</constant> </entry> + <entry>The stream header is returned separately in the first buffer.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME</constant> </entry> + <entry>The stream header is returned together with the first encoded frame.</entry> + </row> + </tbody> + </entrytbl> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER</constant> </entry> + <entry>boolean</entry> + </row><row><entry spanname="descr">Enabled the deblocking post processing filter for MPEG4 decoder. +Applicable to the MPEG4 decoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">vop_time_increment_resolution value for MPEG4. Applicable to the MPEG4 encoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">vop_time_increment value for MPEG4. Applicable to the MPEG4 encoder.</entry> + </row> + + </tbody> + </tgroup> + </table> + </section> + + <section> + <title>MFC 5.1 MPEG Controls</title> + + <para>The following MPEG class controls deal with MPEG +decoding and encoding settings that are specific to the Multi Format Codec 5.1 device present +in the S5P family of SoCs by Samsung. +</para> + + <table pgwide="1" frame="none" id="mfc51-control-id"> + <title>MFC 5.1 Control IDs</title> + <tgroup cols="4"> + <colspec colname="c1" colwidth="1*" /> + <colspec colname="c2" colwidth="6*" /> + <colspec colname="c3" colwidth="2*" /> + <colspec colname="c4" colwidth="6*" /> + <spanspec namest="c1" nameend="c2" spanname="id" /> + <spanspec namest="c2" nameend="c4" spanname="descr" /> + <thead> + <row> + <entry spanname="id" align="left">ID</entry> + <entry align="left">Type</entry> + </row><row><entry spanname="descr" align="left">Description</entry> + </row> + </thead> + <tbody valign="top"> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">If the display delay is enabled then the decoder has to return an +CAPTURE buffer after processing a certain number of OUTPUT buffers. If this number is low, then it may result in +buffers not being dequeued in display order. In addition hardware may still use those buffers as reference, thus +application should not write to those buffers. This feature can be used for example for generating thumbnails of videos. +Applicable to the H264 decoder. + </entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">Display delay value for H264 decoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">The number of reference pictures used for encoding a P picture. +Applicable to the H264 encoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_PADDING</constant> </entry> + <entry>boolean</entry> + </row><row><entry spanname="descr">Padding enable in the encoder - use a color instead of repeating border pixels. +Applicable to encoders.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">Padding color in the encoder. Applicable to encoders. The supplied 32-bit integer is interpreted as follows (bit +0 = least significant bit):</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry>Bit 0:7</entry> + <entry>V chrominance information</entry> + </row> + <row> + <entry>Bit 8:15</entry> + <entry>U chrominance information</entry> + </row> + <row> + <entry>Bit 16:23</entry> + <entry>Y luminance information</entry> + </row> + <row> + <entry>Bit 24:31</entry> + <entry>Must be zero.</entry> + </row> + </tbody> + </entrytbl> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">Reaction coefficient for MFC rate control. Applicable to encoders. +<para>Note 1: Valid only when the frame level RC is enabled.</para> +<para>Note 2: For tight CBR, this field must be small (ex. 2 ~ 10). +For VBR, this field must be large (ex. 100 ~ 1000).</para> +<para>Note 3: It is not recommended to use the greater number than FRAME_RATE * (10^9 / BIT_RATE).</para> +</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK</constant> </entry> + <entry>boolean</entry> + </row><row><entry spanname="descr">Adaptive rate control for dark region. +Valid only when H.264 and macroblock level RC is enabled (<constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>). +Applicable to the H264 encoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH</constant> </entry> + <entry>boolean</entry> + </row><row><entry spanname="descr">Adaptive rate control for smooth region. +Valid only when H.264 and macroblock level RC is enabled (<constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>). +Applicable to the H264 encoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC</constant> </entry> + <entry>boolean</entry> + </row><row><entry spanname="descr">Adaptive rate control for static region. +Valid only when H.264 and macroblock level RC is enabled (<constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>). +Applicable to the H264 encoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY</constant> </entry> + <entry>boolean</entry> + </row><row><entry spanname="descr">Adaptive rate control for activity region. +Valid only when H.264 and macroblock level RC is enabled (<constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>). +Applicable to the H264 encoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE</constant> </entry> + <entry>enum v4l2_mpeg_mfc51_frame_skip_mode</entry> + </row> + <row><entry spanname="descr"> +Indicates in what conditions should the encoder skip frames. If encoding a frame would cause the encoded stream to be larger then +a chosen data limit then the frame will be skipped. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_DISABLED</constant> </entry> + <entry>Frame skip mode is disabled.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_LEVEL_LIMIT</constant> </entry> + <entry>Frame skip mode enabled and buffer limit is set by the chosen level.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_VBV_LIMIT</constant> </entry> + <entry>Frame skip mode enabled and buffer limit is set by the VBV buffer size control.</entry> + </row> + </tbody> + </entrytbl> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">Enable rate-control with fixed target bit. +If this setting is enabled, then the rate control logic of the encoder will calculate the average bitrate for a GOP and keep it below or equal the set bitrate target. +Otherwise the rate control logic calculates the overall average bitrate for the stream and keeps it below or equal to the set bitrate. In the first case the +average bitrate for the whole stream will be smaller then the set bitrate. This is caused because the average is calculated for smaller number of frames, on the +other hand enabling this setting will ensure that the stream will meet tight bandwidth contraints. Applicable to encoders. +</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE</constant> </entry> + <entry>enum v4l2_mpeg_mfc51_force_frame_type</entry> + </row> + <row><entry spanname="descr">Force a frame type for the next queued buffer. Applicable to encoders. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_DISABLED</constant> </entry> + <entry>Forcing a specific frame type disabled.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_I_FRAME</constant> </entry> + <entry>Force an I-frame.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_NOT_CODED</constant> </entry> + <entry>Force a non-coded frame.</entry> + </row> + </tbody> + </entrytbl> + </row> </tbody> </tgroup> </table>
include/linux/videodev2.h +171 -0
189 lines not on this page · raw message
Signature · 1 line
1.6.3.3
Re: [PATCH 2/4 v9] v4l: add control definitions for codec devices.
Quoted 10 lines · On Tuesday, June 14, 2011 18:36:54 Kamil Debski wrote:
Add control definitions and documentation for controls specific to codec devices.
Signed-off-by Kamil Debski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- Documentation/DocBook/media/v4l/controls.xml | 958 ++++++++++++++++++++++++++ include/linux/videodev2.h | 171 +++++ 2 files changed, 1129 insertions(+), 0 deletions(-)
...
include/linux/videodev2.h enum v4l2_colorfx { · line 1166
Quoted 12 lines
include/linux/videodev2.h +4
-0@@ -1160,6 +1160,10 @@ enum v4l2_colorfx {/* last CID + 1 */ #define V4L2_CID_LASTP1 (V4L2_CID_BASE+39) +/* Minimum number of buffer neede by the device */ +#define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+40) +#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+41) +
These two lines should go *before* CID_LASTP1 and LASTP1 should be adjusted accordingly.
include/linux/videodev2.h enum v4l2_mpeg_video_bitrate_mode { · line 1340
Quoted 10 lines
include/linux/videodev2.h +3
-0/* MPEG-class control IDs defined by V4L2 */ #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)@@ -1331,6 +1335,146 @@ enum v4l2_mpeg_video_bitrate_mode {#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) +#define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212) +#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+213) +#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+214)
Can you sort these controls as well into general video controls, H263 controls, H264 controls and MPEG4 controls? In fact, for the codec-specific controls I think we should start at MPEG_BASE + 300 and reserving blocks of 50 controls per codec. It makes it easier to add controls later.
Quoted 141 lines
include/linux/videodev2.h +137
-0+enum v4l2_mpeg_video_h264_vui_sar_idc { +V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED =0 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 =1 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11 =2 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11 =3 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11 =4 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33 =5 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11 =6 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11 =7 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11 =8 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33 =9 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11 =10 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11 =11 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33 =12 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99 =13 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3 =14 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2 =15 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 =16 , +V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED =17 , +}; + +#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+215) +#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+216) +#define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+217) +enum v4l2_mpeg_video_h264_level { +V4L2_MPEG_VIDEO_H264_LEVEL_1_0 =0 , +V4L2_MPEG_VIDEO_H264_LEVEL_1B =1 , +V4L2_MPEG_VIDEO_H264_LEVEL_1_1 =2 , +V4L2_MPEG_VIDEO_H264_LEVEL_1_2 =3 , +V4L2_MPEG_VIDEO_H264_LEVEL_1_3 =4 , +V4L2_MPEG_VIDEO_H264_LEVEL_2_0 =5 , +V4L2_MPEG_VIDEO_H264_LEVEL_2_1 =6 , +V4L2_MPEG_VIDEO_H264_LEVEL_2_2 =7 , +V4L2_MPEG_VIDEO_H264_LEVEL_3_0 =8 , +V4L2_MPEG_VIDEO_H264_LEVEL_3_1 =9 , +V4L2_MPEG_VIDEO_H264_LEVEL_3_2 =10 , +V4L2_MPEG_VIDEO_H264_LEVEL_4_0 =11 , +V4L2_MPEG_VIDEO_H264_LEVEL_4_1 =12 , +V4L2_MPEG_VIDEO_H264_LEVEL_4_2 =13 , +V4L2_MPEG_VIDEO_H264_LEVEL_5_0 =14 , +V4L2_MPEG_VIDEO_H264_LEVEL_5_1 =15 , +}; +#define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+218) +enum v4l2_mpeg_video_mpeg4_level { +V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 =0 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B =1 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_1 =2 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_2 =3 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_3 =4 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B =5 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 =6 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 =7 , +}; +#define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+219) +enum v4l2_mpeg_video_h264_profile { +V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE =0 , +V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE =1 , +V4L2_MPEG_VIDEO_H264_PROFILE_MAIN =2 , +V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED =3 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH =4 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10 =5 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422 =6 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE =7 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA =8 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA =9 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA =10 , +V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA =11 , +V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE =12 , +V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH =13 , +V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA =14 , +V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH =15 , +V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH =16 , +}; +#define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+220) +enum v4l2_mpeg_video_mpeg4_profile { +V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE =0 , +V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE =1 , +V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE =2 , +V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE =3 , +V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY =4 , +}; +#define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+221) +#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+222) +enum v4l2_mpeg_video_multi_slice_mode { +V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE =0 , +V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB =1 , +V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES =2 , +}; +#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+223) +#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+224) +#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+225) +enum v4l2_mpeg_video_h264_loop_filter_mode { +V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED =0 , +V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED =1 , +V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY =2 , +}; +#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+226) +#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+227) +#define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+228) +enum v4l2_mpeg_video_h264_symbol_mode { +V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC =0 , +V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC =1 , +}; + +#define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+229) +#define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+230) +#define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+231) +#define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+232) +#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+233) +#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+234) +#define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+235) +#define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+236) +#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+237) +#define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+238) +#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+239) +#define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+240) +#define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+241) +#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+242) +#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+243) +#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+244) +#define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+245) +#define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+246) +#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+247) +#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+248) +#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+249) +#define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+250) +#define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+251) +#define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+252) +enum v4l2_mpeg_video_header_mode { +V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE =0 , +V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME =1 , + +}; +#define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+253) +#define V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES (V4L2_CID_MPEG_BASE+254) +#define V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC (V4L2_CID_MPEG_BASE+255) +/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
include/linux/videodev2.h enum v4l2_mpeg_cx2341x_video_median_filter_type { · line 1520
Quoted 5 lines
include/linux/videodev2.h +2
-0@@ -1372,6 +1516,33 @@ enum v4l2_mpeg_cx2341x_video_median_filter_type {#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11) +/* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */ +#define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
Control IDs must be unique, so change the base to CLASS_MPEG | 0x1100.
Quoted 14 lines
include/linux/videodev2.h +14
-0+ +#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0) +#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1) +#define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+2) +#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+3) +#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+4) +#define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+5) +#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+6) +#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+7) +#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+8) +#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+9) +#define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+10) +enum v4l2_mpeg_mfc51_video_frame_skip_mode { +V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED =0 ,
include/linux/videodev2.h enum v4l2_mpeg_cx2341x_video_median_filter_type { · line 1544
Quoted 10 lines
include/linux/videodev2.h +10
-0+V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT =1 , + V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_VBV_LIMIT = 2, +}; +#define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+11) +#define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+12) +enum v4l2_mpeg_mfc51_video_force_frame_type { +V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED =0 , +V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME =1 , +V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED =2 , +};
Here too it would help if the controls are sorted by codec/functionality.
include/linux/videodev2.h enum v4l2_mpeg_cx2341x_video_median_filter_type { · line 1548
Quoted 5 lines
include/linux/videodev2.h +1
-0+/* Camera class control IDs */ #define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1)
Regards,
Hans
Re: [PATCH 2/4 v9] v4l: add control definitions for codec devices.
In reply to Kamil DebskiQuoted 17 lines · On Tuesday, June 14, 2011 18:36:54 Kamil Debski wrote:
Add control definitions and documentation for controls specific to codec devices.
Signed-off-by Kamil Debski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- Documentation/DocBook/media/v4l/controls.xml | 958 ++++++++++++++++++++++++++ include/linux/videodev2.h | 171 +++++ 2 files changed, 1129 insertions(+), 0 deletions(-)Documentation/DocBook/media/v4l/controls.xml +0
-0@@ -325,6 +325,22 @@ minimum value disables backlight compensation.</entry> <constant>V4L2_CID_ILLUMINATORS_2</constant> + 1).</entry> </row>
Documentation/DocBook/media/v4l/controls.xml minimum value disables backlight compensation.</entry> · line 336
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +9
-0<row> + <entry><constant>V4L2_CID_MIN_BUFFERS_FOR_CAPTURE</constant></entry> + <entry>integer</entry> + <entry>This is a read-only control that can be read by the application +and used as a hint to determine the number of CAPTURE buffers to pass to REQBUFS. +The value is the minimum number of CAPTURE buffers that is necessary for hardware +to work.</entry> + </row> + <row> + <entry><constant>V4L2_CID_MIN_BUFFERRS_FOR_OUTPUT</constant></entry>
Typo: double 'R' in BUFFERRS :-)
Quoted 13 lines
Documentation/DocBook/media/v4l/controls.xml +7
-0+ <entry>integer</entry> + <entry>This is a read-only control that can be read by the application +and used as a hint to determine the number of OUTPUT buffers to pass to REQBUFS. +The value is the minimum number of OUTPUT buffers that is necessary for hardware +to work.</entry> + </row> + <row> <entry><constant>V4L2_CID_PRIVATE_BASE</constant></entry> <entry></entry> <entry>ID of the first custom (driver specific) control.@@ -1409,6 +1425,948 @@ of the video. The supplied 32-bit integer is interpreted as follows (bit </tbody> </entrytbl>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit · line 1436
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +9
-0</row> + + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE</constant> </entry> + <entry>boolean</entry> + </row> + <row><entry spanname="descr">If enabled the decoder expects a single slice in one OUTPUT buffer, otherwise +the decoder expects a single frame in one input buffer. Applicable to the decoder, all codecs.
'in one OUTPUT buffer' vs 'in one input buffer'. Perhaps rewriting it like this is better:
<row><entry spanname="descr">If enabled the decoder expects to receive a single slice per buffer, otherwise
the decoder expects a single frame in per buffer. Applicable to the decoder, all codecs.
BTW: 'all codecs'? Your decoder hardware can handle e.g. MPEG-2 sliced input? I thought slices were specific to e.g. MPEG4/H264? Just checking...
Quoted 373 lines
Documentation/DocBook/media/v4l/controls.xml +373
-0+</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE</constant> </entry> + <entry>boolean</entry> + </row> + <row><entry spanname="descr">Enable writing sample aspect ratio in the Video Usability Information. +Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC</constant> </entry> + <entry>enum v4l2_mpeg_video_h264_vui_sar_idc</entry> + </row> + <row><entry spanname="descr">VUI sample aspect ratio indicator for H.264 encoding. The value +is defined in the table E-1 in the standard. Applicable to the H264 encoder.</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED</constant> </entry> + <entry>Unspecified</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1</constant> </entry> + <entry>1x1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11</constant> </entry> + <entry>12x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11</constant> </entry> + <entry>10x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11</constant> </entry> + <entry>16x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33</constant> </entry> + <entry>40x33</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11</constant> </entry> + <entry>24x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11</constant> </entry> + <entry>20x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11</constant> </entry> + <entry>32x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33</constant> </entry> + <entry>80x33</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11</constant> </entry> + <entry>18x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11</constant> </entry> + <entry>15x11</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33</constant> </entry> + <entry>64x33</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99</constant> </entry> + <entry>160x99</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3</constant> </entry> + <entry>4x3</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2</constant> </entry> + <entry>3x2</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1</constant> </entry> + <entry>2x1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED</constant> </entry> + <entry>Extended SAR</entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Extended sample aspect ratio width for H.264 VUI encoding. +Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Extended sample aspect ratio height for H.264 VUI encoding. +Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LEVEL</constant> </entry> + <entry>enum v4l2_mpeg_video_h264_level</entry> + </row> + <row><entry spanname="descr">The level information for the H264 video elementary stream. +Applicable to the H264 encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1_0</constant> </entry> + <entry>Level 1.0</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1B</constant> </entry> + <entry>Level 1B</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1_1</constant> </entry> + <entry>Level 1.1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1_2</constant> </entry> + <entry>Level 1.2</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_1_3</constant> </entry> + <entry>Level 1.3</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_2_0</constant> </entry> + <entry>Level 2.0</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_2_1</constant> </entry> + <entry>Level 2.1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_2_2</constant> </entry> + <entry>Level 2.2</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_3_0</constant> </entry> + <entry>Level 3.0</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_3_1</constant> </entry> + <entry>Level 3.1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_3_2</constant> </entry> + <entry>Level 3.2</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_4_0</constant> </entry> + <entry>Level 4.0</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_4_1</constant> </entry> + <entry>Level 4.1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_4_2</constant> </entry> + <entry>Level 4.2</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_5_0</constant> </entry> + <entry>Level 5.0</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LEVEL_5_1</constant> </entry> + <entry>Level 5.1</entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL</constant> </entry> + <entry>enum v4l2_mpeg_video_mpeg4_level</entry> + </row> + <row><entry spanname="descr">The level information for the MPEG4 elementary stream. +Applicable to the MPEG4 encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_0</constant> </entry> + <entry>Level 0</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_0B</constant> </entry> + <entry>Level 0b</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_1</constant> </entry> + <entry>Level 1</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_2</constant> </entry> + <entry>Level 2</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_3</constant> </entry> + <entry>Level 3</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_3B</constant> </entry> + <entry>Level 3b</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_4</constant> </entry> + <entry>Level 4</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_LEVEL_5</constant> </entry> + <entry>Level 5</entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_PROFILE</constant> </entry> + <entry>enum v4l2_mpeg_h264_profile</entry> + </row> + <row><entry spanname="descr">The profile information for H264. +Applicable to the H264 encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE</constant> </entry> + <entry>Baseline profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE</constant> </entry> + <entry>Constrained Baseline profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_MAIN</constant> </entry> + <entry>Main profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED</constant> </entry> + <entry>Extended profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH</constant> </entry> + <entry>High profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10</constant> </entry> + <entry>High 10 profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422</constant> </entry> + <entry>High 422 profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE</constant> </entry> + <entry>High 444 Predictive profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA</constant> </entry> + <entry>High 10 Intra profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA</constant> </entry> + <entry>High 422 Intra profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA</constant> </entry> + <entry>High 444 Intra profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA</constant> </entry> + <entry>CAVLC 444 Intra profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE</constant> </entry> + <entry>Scalable Baseline profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH</constant> </entry> + <entry>Scalable High profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA</constant> </entry> + <entry>Scalable High Intra profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH</constant> </entry> + <entry>Stereo High profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH</constant> </entry> + <entry>Multiview High profile</entry> + </row> + + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE</constant> </entry> + <entry>enum v4l2_mpeg_mpeg4_profile</entry> + </row> + <row><entry spanname="descr">The profile information for MPEG4. +Applicable to the MPEG4 encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_PROFILE_SIMPLE</constant> </entry> + <entry>Simple profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_PROFILE_ADVANCED_SIMPLE</constant> </entry> + <entry>Advanced Simple profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_PROFILE_CORE</constant> </entry> + <entry>Core profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_PROFILE_SIMPLE_SCALABLE</constant> </entry> + <entry>Simple Scalable profile</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_PROFILE_ADVANCED_CODING_EFFICIENCY</constant> </entry> + <entry></entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MAX_REF_PIC</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">The maximum number of reference pictures used for encoding.
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit · line 1819
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +10
-0+Applicable to the encoder. +</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE</constant> </entry> + <entry>enum v4l2_mpeg_multi_slice_mode</entry> + </row> + <row><entry spanname="descr">Determines how should the encoder handle division of frame into slices.
Should be: 'Determines how the decoder should handle...'
Quoted 139 lines
Documentation/DocBook/media/v4l/controls.xml +139
-0+Applicable to the encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE</constant> </entry> + <entry>Single slice per frame.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB</constant> </entry> + <entry>Multiple slices with set maximum number of macroblocks per slice.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES</constant> </entry> + <entry>Multiple slice with set maximum size in bytes per slice.</entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">The maximum number of macroblocks in a slice. Used when +<constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE</constant> is set to <constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB</constant>. +Applicable to the encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">The maximum size of a slice in bytes. Used when +<constant>V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE</constant> is set to <constant>V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES</constant>. +Applicable to the encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE</constant> </entry> + <entry>enum v4l2_mpeg_h264_loop_filter_mode</entry> + </row> + <row><entry spanname="descr">Loop filter mode for H264 encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED</constant> </entry> + <entry>Loop filter is enabled.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED</constant> </entry> + <entry>Loop filter is disabled.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY</constant> </entry> + <entry>Loop filter is disabled at the slice boundary.</entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Loop filter alpha coefficient, defined in the H264 standard. +Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Loop filter beta coefficient, defined in the H264 standard. +Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE</constant> </entry> + <entry>enum v4l2_mpeg_h264_symbol_mode</entry> + </row> + <row><entry spanname="descr">Entropy coding mode for H264 - CABAC/CAVALC. +Applicable to the H264 encoder. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC</constant> </entry> + <entry>Use CAVLC entropy coding.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC</constant> </entry> + <entry>Use CABAC entropy coding.</entry> + </row> + </tbody> + </entrytbl> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM</constant> </entry> + <entry>boolean</entry> + </row> + <row><entry spanname="descr">Enable 8X8 transform for H264. Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Cyclic intra macroblock refresh. This is the number of continuous macroblocks +refreshed every frame. Each frame a succesive set of macroblocks is refreshed until the cycle completes and starts from the +top of the frame. Applicable to H264, H263 and MPEG4 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE</constant> </entry> + <entry>boolean</entry> + </row> + <row><entry spanname="descr">Frame level rate control enable. +If this control is disabled then the quantization parameter for each frame type is constant and set with appropriate controls +(e.g. <constant>V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP</constant>). +If frame rate control is enabled then quantization parameter is adjusted to meet the chosen bitrate. Minimum and maximum value +for the quantization parameter can be set with appropriate controls (e.g. <constant>V4L2_CID_MPEG_VIDEO_H263_MIN_QP</constant>).
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit · line 1968
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +10
-0+Applicable to encoders.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant> </entry> + <entry>boolean</entry> + </row> + <row><entry spanname="descr">Macroblock level rate control enable. +Applicable to the MPEG4 and H264 encoders.</entry>
If I understand this right enabling this will 'activate' the V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_* controls.
So this makes me wonder whether this control shouldn't perhaps be MFC51 specific as well. Alternatively, we can say something like: 'How macroblock rate control is implemented will differ per device, so devices that implement this will have their own set of controls.'
Quoted 6 lines
Documentation/DocBook/media/v4l/controls.xml +6
-0+ </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_QPEL</constant> </entry> + <entry>boolean</entry>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit · line 1984
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +10
-0+ </row> + <row><entry spanname="descr">Quarter pixel motion estimation for MPEG4. Applicable to the MPEG4 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an I frame for H263. Valid range: from 1 to 31.</entry>
Is this range defined by the H263 standard? If not, then you shouldn't mention the range as it is hardware dependent.
Quoted 110 lines
Documentation/DocBook/media/v4l/controls.xml +110
-0+ </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_MIN_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Minimum quantization parameter for H263. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_MAX_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Maximum quantization parameter for H263. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an P frame for H263. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an B frame for H263. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an I frame for H264. Valid range: from 0 to 51.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_MIN_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Minimum quantization parameter for H264. Valid range: from 0 to 51.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_MAX_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Maximum quantization parameter for H264. Valid range: from 0 to 51.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an P frame for H264. Valid range: from 0 to 51.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an B frame for H264. Valid range: from 0 to 51.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an I frame for MPEG4. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Minimum quantization parameter for MPEG4. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Maximum quantization parameter for MPEG4. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an P frame for MPEG4. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP</constant> </entry> + <entry>integer</entry>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit · line 2104
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +10
-0+ </row> + <row><entry spanname="descr">Quantization parameter for an B frame for MPEG4. Valid range: from 1 to 31.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_VBV_SIZE</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">The Video Buffer Verifier size in kilobytes, it used as a limitation of frame skip.
Typo: 'it used' -> 'it is used'
I think it would be good to either give some background information here, or refer to the standard for that information.
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit · line 2113
Quoted 9 lines
Documentation/DocBook/media/v4l/controls.xml +9
-0+Applicable to the MPEG1, MPEG2, MPEG4 encoders.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">The Coded Picture Buffer size in kilobytes, it used as a limitation of frame skip.
Same typo.
Quoted 46 lines
Documentation/DocBook/media/v4l/controls.xml +46
-0+Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_I_PERIOD</constant> </entry> + <entry>integer</entry> + </row> + <row><entry spanname="descr">Period between I-frames in the open GOP for H264. In case of an open GOP +this is the period between two I-frames. The period between IDR (Instantaneous Decoding Refresh) frames is taken from the GOP_SIZE control. +An IDR frame, which stands for Instantaneous Decoding Refresh is an I-frame after which no prior frames are +referenced. This means that a stream can be restarted from an IDR frame without the need to store or decode any +previous frames. Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_HEADER_MODE</constant> </entry> + <entry>enum v4l2_mpeg_header_mode</entry> + </row> + <row><entry spanname="descr">Determines whether the header is returned as the first buffer or is +it returned together with the first frame. Applicable to encoders. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE</constant> </entry> + <entry>The stream header is returned separately in the first buffer.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME</constant> </entry> + <entry>The stream header is returned together with the first encoded frame.</entry> + </row> + </tbody> + </entrytbl> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER</constant> </entry> + <entry>boolean</entry> + </row><row><entry spanname="descr">Enabled the deblocking post processing filter for MPEG4 decoder. +Applicable to the MPEG4 decoder.</entry> + </row> + <row><entry></entry></row>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit · line 2169
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +10
-0+ <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">vop_time_increment_resolution value for MPEG4. Applicable to the MPEG4 encoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">vop_time_increment value for MPEG4. Applicable to the MPEG4 encoder.</entry>
How should these two controls be used? Are you supposed to set them? Or do they have suitable default values?
Quoted 27 lines
Documentation/DocBook/media/v4l/controls.xml +27
-0+ </row> + + </tbody> + </tgroup> + </table> + </section> + + <section> + <title>MFC 5.1 MPEG Controls</title> + + <para>The following MPEG class controls deal with MPEG +decoding and encoding settings that are specific to the Multi Format Codec 5.1 device present +in the S5P family of SoCs by Samsung. +</para> + + <table pgwide="1" frame="none" id="mfc51-control-id"> + <title>MFC 5.1 Control IDs</title> + <tgroup cols="4"> + <colspec colname="c1" colwidth="1*" /> + <colspec colname="c2" colwidth="6*" /> + <colspec colname="c3" colwidth="2*" /> + <colspec colname="c4" colwidth="6*" /> + <spanspec namest="c1" nameend="c2" spanname="id" /> + <spanspec namest="c2" nameend="c4" spanname="descr" /> + <thead> + <row> + <entry spanname="id" align="left">ID</entry>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit · line 2206
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +10
-0+ <entry align="left">Type</entry> + </row><row><entry spanname="descr" align="left">Description</entry> + </row> + </thead> + <tbody valign="top"> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">If the display delay is enabled then the decoder has to return an
typo: 'return a'
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit · line 2217
Quoted 11 lines
Documentation/DocBook/media/v4l/controls.xml +11
-0+CAPTURE buffer after processing a certain number of OUTPUT buffers. If this number is low, then it may result in +buffers not being dequeued in display order. In addition hardware may still use those buffers as reference, thus +application should not write to those buffers. This feature can be used for example for generating thumbnails of videos. +Applicable to the H264 decoder. + </entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">Display delay value for H264 decoder.</entry>
What's the unit of this control? Frames? Slices? Buffers?
Quoted 84 lines
Documentation/DocBook/media/v4l/controls.xml +84
-0+ </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">The number of reference pictures used for encoding a P picture. +Applicable to the H264 encoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_PADDING</constant> </entry> + <entry>boolean</entry> + </row><row><entry spanname="descr">Padding enable in the encoder - use a color instead of repeating border pixels. +Applicable to encoders.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">Padding color in the encoder. Applicable to encoders. The supplied 32-bit integer is interpreted as follows (bit +0 = least significant bit):</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry>Bit 0:7</entry> + <entry>V chrominance information</entry> + </row> + <row> + <entry>Bit 8:15</entry> + <entry>U chrominance information</entry> + </row> + <row> + <entry>Bit 16:23</entry> + <entry>Y luminance information</entry> + </row> + <row> + <entry>Bit 24:31</entry> + <entry>Must be zero.</entry> + </row> + </tbody> + </entrytbl> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">Reaction coefficient for MFC rate control. Applicable to encoders. +<para>Note 1: Valid only when the frame level RC is enabled.</para> +<para>Note 2: For tight CBR, this field must be small (ex. 2 ~ 10). +For VBR, this field must be large (ex. 100 ~ 1000).</para> +<para>Note 3: It is not recommended to use the greater number than FRAME_RATE * (10^9 / BIT_RATE).</para> +</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK</constant> </entry> + <entry>boolean</entry> + </row><row><entry spanname="descr">Adaptive rate control for dark region. +Valid only when H.264 and macroblock level RC is enabled (<constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>). +Applicable to the H264 encoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH</constant> </entry> + <entry>boolean</entry> + </row><row><entry spanname="descr">Adaptive rate control for smooth region. +Valid only when H.264 and macroblock level RC is enabled (<constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>). +Applicable to the H264 encoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC</constant> </entry> + <entry>boolean</entry> + </row><row><entry spanname="descr">Adaptive rate control for static region. +Valid only when H.264 and macroblock level RC is enabled (<constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>). +Applicable to the H264 encoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY</constant> </entry> + <entry>boolean</entry> + </row><row><entry spanname="descr">Adaptive rate control for activity region.
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +10
-0+Valid only when H.264 and macroblock level RC is enabled (<constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant>). +Applicable to the H264 encoder.</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE</constant> </entry> + <entry>enum v4l2_mpeg_mfc51_frame_skip_mode</entry> + </row> + <row><entry spanname="descr"> +Indicates in what conditions should the encoder skip frames. If encoding a frame would cause the
Typo: 'Indicates in what conditions the encoder should skip frames.'
Quoted 4 lines
encoded stream to be larger then
Documentation/DocBook/media/v4l/controls.xml +3
-0+a chosen data limit then the frame will be skipped. +Possible values are:</entry> + </row>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit · line 2324
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml +10
-0+ <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_DISABLED</constant> </entry> + <entry>Frame skip mode is disabled.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_LEVEL_LIMIT</constant> </entry> + <entry>Frame skip mode enabled and buffer limit is set by the chosen level.</entry>
With which control do I set that level?
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit · line 2328
Quoted 4 lines
Documentation/DocBook/media/v4l/controls.xml +4
-0+ </row> + <row> + <entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_VBV_LIMIT</constant> </entry> + <entry>Frame skip mode enabled and buffer limit is set by the VBV buffer size control.</entry>
VBV or H264_CPB. Perhaps this should be renamed SKIP_MODE_BUF_LIMIT with references to the VBV and H264_CPB controls.
Quoted 231 lines
Documentation/DocBook/media/v4l/controls.xml +41
-0+ </row> + </tbody> + </entrytbl> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT</constant> </entry> + <entry>integer</entry> + </row><row><entry spanname="descr">Enable rate-control with fixed target bit. +If this setting is enabled, then the rate control logic of the encoder will calculate the average bitrate for a GOP and keep it below or equal the set bitrate target. +Otherwise the rate control logic calculates the overall average bitrate for the stream and keeps it below or equal to the set bitrate. In the first case the +average bitrate for the whole stream will be smaller then the set bitrate. This is caused because the average is calculated for smaller number of frames, on the +other hand enabling this setting will ensure that the stream will meet tight bandwidth contraints. Applicable to encoders. +</entry> + </row> + <row><entry></entry></row> + <row> + <entry spanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE</constant> </entry> + <entry>enum v4l2_mpeg_mfc51_force_frame_type</entry> + </row> + <row><entry spanname="descr">Force a frame type for the next queued buffer. Applicable to encoders. +Possible values are:</entry> + </row> + <row> + <entrytbl spanname="descr" cols="2"> + <tbody valign="top"> + <row> + <entry><constant>V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_DISABLED</constant> </entry> + <entry>Forcing a specific frame type disabled.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_I_FRAME</constant> </entry> + <entry>Force an I-frame.</entry> + </row> + <row> + <entry><constant>V4L2_MPEG_MFC51_FORCE_FRAME_TYPE_NOT_CODED</constant> </entry> + <entry>Force a non-coded frame.</entry> + </row> + </tbody> + </entrytbl> + </row> </tbody> </tgroup> </table>include/linux/videodev2.h +164
-0@@ -1160,6 +1160,10 @@ enum v4l2_colorfx {/* last CID + 1 */ #define V4L2_CID_LASTP1 (V4L2_CID_BASE+39) +/* Minimum number of buffer neede by the device */ +#define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+40) +#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+41) +/* MPEG-class control IDs defined by V4L2 */ #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)@@ -1331,6 +1335,146 @@ enum v4l2_mpeg_video_bitrate_mode {#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) +#define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212) +#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+213) +#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+214) +enum v4l2_mpeg_video_h264_vui_sar_idc { +V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED =0 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 =1 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11 =2 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11 =3 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11 =4 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33 =5 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11 =6 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11 =7 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11 =8 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33 =9 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11 =10 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11 =11 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33 =12 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99 =13 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3 =14 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2 =15 , + V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 =16 , +V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED =17 , +}; + +#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+215) +#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+216) +#define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+217) +enum v4l2_mpeg_video_h264_level { +V4L2_MPEG_VIDEO_H264_LEVEL_1_0 =0 , +V4L2_MPEG_VIDEO_H264_LEVEL_1B =1 , +V4L2_MPEG_VIDEO_H264_LEVEL_1_1 =2 , +V4L2_MPEG_VIDEO_H264_LEVEL_1_2 =3 , +V4L2_MPEG_VIDEO_H264_LEVEL_1_3 =4 , +V4L2_MPEG_VIDEO_H264_LEVEL_2_0 =5 , +V4L2_MPEG_VIDEO_H264_LEVEL_2_1 =6 , +V4L2_MPEG_VIDEO_H264_LEVEL_2_2 =7 , +V4L2_MPEG_VIDEO_H264_LEVEL_3_0 =8 , +V4L2_MPEG_VIDEO_H264_LEVEL_3_1 =9 , +V4L2_MPEG_VIDEO_H264_LEVEL_3_2 =10 , +V4L2_MPEG_VIDEO_H264_LEVEL_4_0 =11 , +V4L2_MPEG_VIDEO_H264_LEVEL_4_1 =12 , +V4L2_MPEG_VIDEO_H264_LEVEL_4_2 =13 , +V4L2_MPEG_VIDEO_H264_LEVEL_5_0 =14 , +V4L2_MPEG_VIDEO_H264_LEVEL_5_1 =15 , +}; +#define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+218) +enum v4l2_mpeg_video_mpeg4_level { +V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 =0 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B =1 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_1 =2 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_2 =3 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_3 =4 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B =5 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 =6 , +V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 =7 , +}; +#define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+219) +enum v4l2_mpeg_video_h264_profile { +V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE =0 , +V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE =1 , +V4L2_MPEG_VIDEO_H264_PROFILE_MAIN =2 , +V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED =3 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH =4 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10 =5 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422 =6 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE =7 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA =8 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA =9 , +V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA =10 , +V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA =11 , +V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE =12 , +V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH =13 , +V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA =14 , +V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH =15 , +V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH =16 , +}; +#define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+220) +enum v4l2_mpeg_video_mpeg4_profile { +V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE =0 , +V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE =1 , +V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE =2 , +V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE =3 , +V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY =4 , +}; +#define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+221) +#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+222) +enum v4l2_mpeg_video_multi_slice_mode { +V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE =0 , +V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB =1 , +V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES =2 , +}; +#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+223) +#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+224) +#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+225) +enum v4l2_mpeg_video_h264_loop_filter_mode { +V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED =0 , +V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED =1 , +V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY =2 , +}; +#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+226) +#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+227) +#define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+228) +enum v4l2_mpeg_video_h264_symbol_mode { +V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC =0 , +V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC =1 , +}; + +#define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+229) +#define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+230) +#define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+231) +#define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+232) +#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+233) +#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+234) +#define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+235) +#define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+236) +#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+237) +#define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+238) +#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+239) +#define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+240) +#define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+241) +#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+242) +#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+243) +#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+244) +#define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+245) +#define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+246) +#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+247) +#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+248) +#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+249) +#define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+250) +#define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+251) +#define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+252) +enum v4l2_mpeg_video_header_mode { +V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE =0 , +V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME =1 , + +}; +#define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+253) +#define V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES (V4L2_CID_MPEG_BASE+254) +#define V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC (V4L2_CID_MPEG_BASE+255) +/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)@@ -1372,6 +1516,33 @@ enum v4l2_mpeg_cx2341x_video_median_filter_type {#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11) +/* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */ +#define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) + +#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0) +#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1) +#define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+2) +#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+3) +#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+4) +#define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+5) +#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+6) +#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+7) +#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+8) +#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+9) +#define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+10) +enum v4l2_mpeg_mfc51_video_frame_skip_mode { +V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED =0 , +V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT =1 , +V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_VBV_LIMIT =2 , +}; +#define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+11)
include/linux/videodev2.h enum v4l2_mpeg_cx2341x_video_median_filter_type { · line 1548
Quoted 10 lines
include/linux/videodev2.h +7
-0+#define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+12) +enum v4l2_mpeg_mfc51_video_force_frame_type { +V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED =0 , +V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME =1 , +V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED =2 , +}; +/* Camera class control IDs */ #define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1)
Regards,
Hans
RE: [PATCH 2/4 v9] v4l: add control definitions for codec devices.
Hi,
Quoted 32 lines
-----Original Message-----
From: Hans Verkuil [mailto:[email protected]]
Sent: 22 June 2011 10:26
To: Kamil Debski
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 2/4 v9] v4l: add control definitions for codec devices.Quoted 7 lines · On Tuesday, June 14, 2011 18:36:54 Kamil Debski wrote:
Add control definitions and documentation for controls specific to codec devices.
Signed-off-by Kamil Debski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- Documentation/DocBook/media/v4l/controls.xml | 958++++++++++++++++++++++++++
Review
Quoted 4 lines
include/linux/videodev2.h | 171 +++++ 2 files changed, 1129 insertions(+), 0 deletions(-)(quoted diff) +0
-0
b/Documentation/DocBook/media/v4l/controls.xmlDocumentation/DocBook/media/v4l/controls.xml minimum value disables backlight
Quoted 4 lines
index 6880798..6b0d06a 100644
Documentation/DocBook/media/v4l/controls.xml +0
-0@@ -325,6 +325,22 @@ minimum value disables backlightcompensation.</entry>
Quoted 4 lines
Documentation/DocBook/media/v4l/controls.xml +1
-0<constant>V4L2_CID_ILLUMINATORS_2</constant> + 1).</entry> </row> <row> +
...
Quoted 17 lines
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 5 lines
Documentation/DocBook/media/v4l/controls.xml +5
-0+ + + <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE</constan t> </entry>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 3 lines
Documentation/DocBook/media/v4l/controls.xml +3
-0+ <entry>boolean</entry> + </row> + <row><entry spanname="descr">If enabled the decoder expects asingle slice in one OUTPUT buffer, otherwise
Quoted 1 line
+the decoder expects a single frame in one input buffer. Applicable to the
decoder, all codecs.
'in one OUTPUT buffer' vs 'in one input buffer'. Perhaps rewriting it like this is better:
Quoted 7 lines
<row><entry spanname="descr">If enabled the decoder expects to
receive a single slice per buffer, otherwise
the decoder expects a single frame in per buffer. Applicable to the decoder, all codecs.BTW: 'all codecs'? Your decoder hardware can handle e.g. MPEG-2 sliced input? I thought slices were specific to e.g. MPEG4/H264? Just checking...
I've checked the H263 spec and it mentions slice, same for MPEG2 (this site http://goo.gl/vXUEb mentions slices). It could be better to explicitly list the codecs, as there might be a codec that doesn't support slices.
Quoted 16 lines
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 7 lines
+</entry>
Documentation/DocBook/media/v4l/controls.xml +5
-0+ </row> + + <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE</constant>&n bsp;</entry>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 3 lines
Documentation/DocBook/media/v4l/controls.xml +3
-0+ <entry>boolean</entry> + </row> + <row><entry spanname="descr">Enable writing sample aspect ratioin the Video Usability Information.
Quoted 3 lines
Documentation/DocBook/media/v4l/controls.xml +3
-0+Applicable to the H264 encoder.</entry> + </row> +
...
Quoted 6 lines
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 4 lines
Documentation/DocBook/media/v4l/controls.xml +4
-0+ + <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP</constant> </entry>
Quoted 8 lines
Documentation/DocBook/media/v4l/controls.xml minimum value disables backlight compensation.</entry>
Quoted 3 lines
Documentation/DocBook/media/v4l/controls.xml +3
-0+ <entry>integer</entry> + </row> + <row><entry spanname="descr">Quantization parameter for an Iframe for H263. Valid range: from 1 to 31.</entry>
Is this range defined by the H263 standard? If not, then you shouldn't mention
the range as it is hardware dependent.
Yes it is defined in the standard.
Quoted 8 lines
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 6 lines
Documentation/DocBook/media/v4l/controls.xml +5
-0+ </row> + + <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_VIDEO_H263_MIN_QP</constant> </en try>
....
Quoted 11 lines
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 4 lines
Documentation/DocBook/media/v4l/controls.xml +4
-0+ + <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_VIDEO_VBV_SIZE</constant> </entry
Documentation/DocBook/media/v4l/controls.xml minimum value disables backlight compensation.</entry>
Quoted 4 lines
Documentation/DocBook/media/v4l/controls.xml +3
-0+ <entry>integer</entry> + </row> + <row><entry spanname="descr">The Video Buffer Verifier size inkilobytes, it used as a limitation of frame skip.
Quoted 5 lines
Typo: 'it used' -> 'it is used'
I think it would be good to either give some background information here, or refer
to the standard for that information.
Ok, will do.
Quoted 36 lines
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 6 lines
Documentation/DocBook/media/v4l/controls.xml +6
-0+Applicable to the MPEG1, MPEG2, MPEG4 encoders.</entry> + </row> + + <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE</constant> </ entry>
Documentation/DocBook/media/v4l/controls.xml minimum value disables backlight compensation.</entry>
Quoted 3 lines
Documentation/DocBook/media/v4l/controls.xml +3
-0+ <entry>integer</entry> + </row> + <row><entry spanname="descr">The Coded Picture Buffer size inkilobytes, it used as a limitation of frame skip.
Same typo.
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 6 lines
Documentation/DocBook/media/v4l/controls.xml +6
-0+Applicable to the H264 encoder.</entry> + </row> + + <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_VIDEO_H264_I_PERIOD</constant> </ entry>
Documentation/DocBook/media/v4l/controls.xml minimum value disables backlight compensation.</entry>
Quoted 3 lines
Documentation/DocBook/media/v4l/controls.xml +3
-0+ <entry>integer</entry> + </row> + <row><entry spanname="descr">Period between I-frames in the openGOP for H264. In case of an open GOP
Quoted 1 line
+this is the period between two I-frames. The period between IDR
(Instantaneous Decoding Refresh) frames is taken from the
GOP_SIZEcontrol.Quoted 1 line
+An IDR frame, which stands for Instantaneous Decoding Refresh is an I-
frame after which no prior frames are
Quoted 1 line
+referenced. This means that a stream can be restarted from an IDR frame
without the need to store or decode any
Quoted 3 lines
Documentation/DocBook/media/v4l/controls.xml +3
-0+previous frames. Applicable to the H264 encoder.</entry> + </row> +
...
Quoted 13 lines
Documentation/DocBook/media/v4l/controls.xml
Quoted 2 lines
Documentation/DocBook/media/v4l/controls.xml +2
-0+ <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES</constant>&nb sp;</entry>
Documentation/DocBook/media/v4l/controls.xml
Quoted 2 lines
Documentation/DocBook/media/v4l/controls.xml +2
-0+ <entry>integer</entry> + </row><row><entry spanname="descr">vop_time_increment_resolutionvalue for MPEG4. Applicable to the MPEG4 encoder.</entry>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 4 lines
Documentation/DocBook/media/v4l/controls.xml +4
-0+ </row> + <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC</constant>&nb sp;</entry>
Quoted 7 lines
Documentation/DocBook/media/v4l/controls.xml
Quoted 2 lines
Documentation/DocBook/media/v4l/controls.xml +2
-0+ <entry>integer</entry> + </row><row><entry spanname="descr">vop_time_increment value forMPEG4. Applicable to the MPEG4 encoder.</entry>
How should these two controls be used? Are you supposed to set them? Or do they
have suitable default values?
They are used only in MPEG4 and are used instead of S_PARM to set fps. You are supposed to set them, but I think the driver could set a default value (such as vop_time_res = 30000 and vop_time_res_increment = 1000).
Quoted 7 lines
Quoted 7 lines
Documentation/DocBook/media/v4l/controls.xml +7
-0+ </row> + + </tbody> + </tgroup> + </table> + </section> +
...
Quoted 10 lines
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 3 lines
Documentation/DocBook/media/v4l/controls.xml +3
-0+ <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY </constant> </entry>
Documentation/DocBook/media/v4l/controls.xml
Quoted 2 lines
Documentation/DocBook/media/v4l/controls.xml +2
-0+ <entry>integer</entry> + </row><row><entry spanname="descr">Display delay value for H264decoder.</entry>
What's the unit of this control? Frames? Slices? Buffers?
It is expressed in frames, I will add it to the documentation.
Quoted 13 lines
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 4 lines
Documentation/DocBook/media/v4l/controls.xml +4
-0+ </row> + <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P</co nstant> </entry>
Documentation/DocBook/media/v4l/controls.xml
Quoted 2 lines
Documentation/DocBook/media/v4l/controls.xml +2
-0+ <entry>integer</entry> + </row><row><entry spanname="descr">The number of referencepictures used for encoding a P picture.
Quoted 4 lines
Documentation/DocBook/media/v4l/controls.xml +4
-0+Applicable to the H264 encoder.</entry> + </row> + <row><entry></entry></row> + <row>
...
Quoted 9 lines
Quoted 1 line
+
<entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_DISABLED</constant> </ entry>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 4 lines
Documentation/DocBook/media/v4l/controls.xml +4
-0+ <entry>Frame skip mode is disabled.</entry> + </row> + <row> +<entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_LEVEL_LIMIT</constant>  ;</entry>
Quoted 4 lines
Documentation/DocBook/media/v4l/controls.xml
Quoted 1 line
Documentation/DocBook/media/v4l/controls.xml +1
-0+ <entry>Frame skip mode enabled and buffer limit is set bythe chosen level.</entry>
With which control do I set that level?
*_MPEG4_LEVEL and *_H264_LEVEL, I will add some clarification.
Quoted 11 lines
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit · line 1448
Quoted 3 lines
Documentation/DocBook/media/v4l/controls.xml +3
-0+ </row> + <row> +<entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_VBV_LIMIT</constant> < /entry>
Documentation/DocBook/media/v4l/controls.xml
Quoted 1 line
Documentation/DocBook/media/v4l/controls.xml +1
-0+ <entry>Frame skip mode enabled and buffer limit is set bythe VBV buffer size control.</entry>
VBV or
H264_CPB. Perhaps this should be renamedSKIP_MODE_BUF_LIMITwith references
to the VBV andH264_CPBcontrols.
Yes, it is a good idea to rename the control.
Quoted 9 lines
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 7 lines
Documentation/DocBook/media/v4l/controls.xml +7
-0+ </row> + </tbody> + </entrytbl> + </row> + <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT</const ant> </entry>
...
Best regards,
--
Kamil Debski
Linux Platform Group
Samsung Poland R&D Center
Re: [PATCH 2/4 v9] v4l: add control definitions for codec devices.
Quoted 17 lines · On Wednesday, June 22, 2011 12:30:45 Kamil Debski wrote:
Quoted 17 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES</constant>&nb sp;</entry>
Review
Quoted 2 lines
(quoted diff) +2
-0+ <entry>integer</entry> + </row><row><entry spanname="descr">vop_time_increment_resolutionvalue for MPEG4. Applicable to the MPEG4 encoder.</entry>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 4 lines
Documentation/DocBook/media/v4l/controls.xml +4
-0+ </row> + <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC</constant>&nb sp;</entry>
Review
Quoted 2 lines
(quoted diff) +2
-0+ <entry>integer</entry> + </row><row><entry spanname="descr">vop_time_increment value forMPEG4. Applicable to the MPEG4 encoder.</entry>
Quoted 7 lines
Quoted 3 lines
How should these two controls be used? Are you supposed to set them? Or do they
have suitable default values?They are used only in MPEG4 and are used instead of
S_PARMto set fps. You are supposed to set them, but I think the driver could set a default value (such asvop_time_res= 30000 andvop_time_res_increment= 1000).
Hmm. Perhaps S_PARM should be used for this? I am not too keen on adding this when it looks like it is exactly the same as the S_PARM functionality.
How do other codecs do this?
Quoted 9 lines
Quoted 9 lines
Quoted 1 line
+
<entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_DISABLED</constant> </ entry>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 4 lines
Documentation/DocBook/media/v4l/controls.xml +4
-0+ <entry>Frame skip mode is disabled.</entry> + </row> + <row> +<entry><constant>V4L2_MPEG_MFC51_FRAME_SKIP_MODE_LEVEL_LIMIT</constant>  ;</entry>
Quoted 6 lines
Quoted 4 lines
Review
Quoted 1 line
(quoted diff) +1
-0+ <entry>Frame skip mode enabled and buffer limit is set bythe chosen level.</entry>
With which control do I set that level?
*_MPEG4_LEVELand*_H264_LEVEL, I will add some clarification.
Ah! That level :-)
Regards,
Hans
RE: [PATCH 2/4 v9] v4l: add control definitions for codec devices.
In reply to Hans VerkuilHi,
Just a quick comment below.
Quoted 22 lines
-----Original Message-----
From: Hans Verkuil [mailto:[email protected]]
Sent: 22 June 2011 10:26Quoted 7 lines · On Tuesday, June 14, 2011 18:36:54 Kamil Debski wrote:
Add control definitions and documentation for controls specific to codec devices.
Signed-off-by Kamil Debski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- Documentation/DocBook/media/v4l/controls.xml | 958++++++++++++++++++++++++++
Review
Quoted 4 lines
include/linux/videodev2.h | 171 +++++ 2 files changed, 1129 insertions(+), 0 deletions(-)(quoted diff) +0
-0
b/Documentation/DocBook/media/v4l/controls.xmlQuoted 4 lines
index 6880798..6b0d06a 100644
Documentation/DocBook/media/v4l/controls.xml +0
-0@@ -325,6 +325,22 @@ minimum value disables backlight
...
Quoted 14 lines
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 3 lines
Documentation/DocBook/media/v4l/controls.xml +3
-0+ <row><entry></entry></row> + <row> + <entryspanname="id"><constant>V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE</constant> </e ntry>
Documentation/DocBook/media/v4l/controls.xml of the video. The supplied 32-bit integer is interpreted as follows (bit
Quoted 3 lines
Documentation/DocBook/media/v4l/controls.xml +3
-0+ <entry>boolean</entry> + </row> + <row><entry spanname="descr">Macroblock level rate controlenable.
Quoted 1 line
+Applicable to the MPEG4 and H264 encoders.</entry>
If I understand this right enabling this will 'activate' the V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_* controls.
Quoted 8 lines
So this makes me wonder whether this control shouldn't perhaps be MFC51 specific
as well. Alternatively, we can say something like: 'How macroblock rate control is
implemented will differ per device, so devices that implement this will have their
own set of controls.'
The V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_* controls are an added tweak by MFC. So I think it should stay as a generic control, especially that macroblock rate control is defined in the MPEG4 standard.
...
Best regards,
--
Kamil Debski
Linux Platform Group
Samsung Poland R&D Center
PATCH v9 3/4 v4l2-ctrl: add codec controls support to the control framework
In reply to Kamil DebskiAdd support for the codec controls to the v4l2 control framework.
--- drivers/media/video/v4l2-ctrls.c | 281 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 281 insertions(+), 0 deletions(-)
drivers/media/video/v4l2-ctrls.c +281 -0
@@ -216,6 +216,118 @@ const char * const *v4l2_ctrl_get_menu(u32 id)"75 useconds" , NULL, }; +static const char *const multi_slice[] = { +"Single" , +"Max macroblocks" , +"Max bits" , +NULL , + }; +static const char *const force_frame[] = { +"Disabled" , +"I frame" , +"Not coded" , +NULL , + }; +static const char *const header_mode[] = { +"Separate buffer" , +"Joined with 1st frame" , +NULL , + }; +static const char *const frame_skip[] = { +"Disabled" , +"Level limit" , +"VBV/CPB limit" , +NULL , + }; +static const char *const h264_profile[] = { +"Baseline" , +"Constrained Baseline" , +"Main" , +"Extended" , +"High" , +"High 10" , +"High 422" , +"High 444 Predictive" , +"High 10 Intra" , +"High 422 Intra" , +"High 444 Intra" , +"CAVLC 444 Intra" , +"Scalable Baseline" , +"Scalable High" , +"Scalable High Intra" , +"Multiview High" , +NULL , + }; +static const char *const mpeg4_profile[] = { +"Simple" , +"Adcanved simple" , +"Core" , +"Simple scalable" , +"Advanced Coding Efficency" , +NULL , + }; +static const char *const mpeg_h264_level[] = { +"1" , +"1b" , +"1.1" , +"1.2" , +"1.3" , +"2" , +"2.1" , +"2.2" , +"3" , +"3.1" , +"3.2" , +"4" , +"4.1" , +"4.2" , +"5" , +"5.1" , +NULL , + }; +static const char *const mpeg_mpeg4_level[] = { +"0" , +"0b" , +"1" , +"2" , +"3" , +"3b" , +"4" , +"5" , +NULL , + }; +static const char *const h264_loop_filter[] = { +"Enabled" , +"Disabled" , +"Disabled at slice boundary" , +NULL , + }; +static const char *const symbol_mode[] = { +"CAVLC" , +"CABAC" , +NULL , + }; +static const char * vui_sar_idc[] = { +"Unspecified" , +"1:1" , +"12:11" , +"10:11" , +"16:11" , +"40:33" , +"24:11" , +"20:11" , +"32:11" , +"80:33" , +"18:11" , +"15:11" , +"64:33" , +"160:99" , +"4:3" , +"3:2" , +"2:1" , +"Extended SAR" , +NULL , + };switch (id) {case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ :
@@ -256,6 +368,28 @@ const char * const *v4l2_ctrl_get_menu(u32 id)return colorfx;case V4L2_CID_TUNE_PREEMPHASIS :return tune_preemphasis; +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE : +return multi_slice; +case V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE : +return force_frame; +case V4L2_CID_MPEG_VIDEO_HEADER_MODE : +return header_mode; +case V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE : +return frame_skip; +case V4L2_CID_MPEG_VIDEO_H264_PROFILE : +return h264_profile; +case V4L2_CID_MPEG_VIDEO_H264_LEVEL : +return mpeg_h264_level; +case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL : +return mpeg_mpeg4_level; +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE : +return h264_loop_filter; +case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE : +return symbol_mode; +case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE : +return mpeg4_profile; +case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC : +return vui_sar_idc;default :return NULL ; }
@@ -389,6 +523,72 @@ const char *v4l2_ctrl_get_name(u32 id)case V4L2_CID_TUNE_POWER_LEVEL :return "Tune Power Level" ;case V4L2_CID_TUNE_ANTENNA_CAPACITOR :return "Tune Antenna Capacitor" ; +case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE :return "Decoder Slice Interface" ; +case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE :return "Minimum number of cap bufs" ; +case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT :return "Minimum number of out bufs" ; + +case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY :return "Decoder H264 Display Delay" ; +case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE :return "H264 Display Delay Enable" ; +case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER :return "Mpeg4 Loop Filter Enable" ; + +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE :return "The slice partitioning method" ; +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB :return "The number of MB in a slice" ; +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES :return "The maximum bits per slices" ; +case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB :return "The number of intra refresh MBs" ; +case V4L2_CID_MPEG_MFC51_VIDEO_PADDING :return "Padding control enable" ; +case V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV :return "Padding color YUV value" ; +case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE :return "Frame level rate control enable" ; +case V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF :return "Rate control reaction coeff." ; +case V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE :return "Force frame type" ; +case V4L2_CID_MPEG_VIDEO_VBV_SIZE :return "VBV buffer size" ; +case V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE :return "H264 CPB buffer size" ; +case V4L2_CID_MPEG_VIDEO_HEADER_MODE :return "Sequence header mode" ; +case V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE :return "Frame skip enable" ; +case V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT :return "Fixed target bit enable" ; +case V4L2_CID_MPEG_VIDEO_H264_PROFILE :return "H264 profile" ; +case V4L2_CID_MPEG_VIDEO_H264_LEVEL :return "H264 level" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL :return "MPEG4 level" ; +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE :return "H264 loop filter mode" ; +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA :return "H264 loop filter alpha offset" ; +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA :return "H264 loop filter beta offset" ; +case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE :return "H264 entorpy mode" ; +case V4L2_CID_MPEG_VIDEO_MAX_REF_PIC :return "The max number of ref. picture" ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P :return "The number of ref. picture of P" ; +case V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM :return "H264 8x8 transform enable" ; +case V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE :return "H264 MB level rate control" ; + +case V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP :return "H263 I-Frame QP value" ; +case V4L2_CID_MPEG_VIDEO_H263_MIN_QP :return "H263 Minimum QP value" ; +case V4L2_CID_MPEG_VIDEO_H263_MAX_QP :return "H263 Maximum QP value" ; +case V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP :return "H263 P frame QP value" ; +case V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP :return "H263 B frame QP value" ; + +case V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP :return "H264 I-Frame QP value" ; +case V4L2_CID_MPEG_VIDEO_H264_MIN_QP :return "H264 Minimum QP value" ; +case V4L2_CID_MPEG_VIDEO_H264_MAX_QP :return "H264 Maximum QP value" ; +case V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP :return "H264 P frame QP value" ; +case V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP :return "H264 B frame QP value" ; + +case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP :return "MPEG4 I-Frame QP value" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP :return "MPEG4 Minimum QP value" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP :return "MPEG4 Maximum QP value" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP :return "MPEG4 P frame QP value" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP :return "MPEG4 B frame QP value" ; + +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK :return "H264 dark region adaptive" ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH :return "H264 smooth region adaptive" ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC :return "H264 static region adaptive" ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY :return "H264 MB activity adaptive" ; +case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE :return "Aspect ratio VUI enable" ; +case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC :return "VUI aspect ratio IDC" ; +case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH :return "Horizontal size of SAR" ; +case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT :return "Vertical size of SAR" ; +case V4L2_CID_MPEG_VIDEO_H264_I_PERIOD :return "H264 I period" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE :return "MPEG4 profile" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_QPEL :return "Quarter pixel search enable" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES :return "MPEG4 vop time resolution" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC :return "MPEG4 frame delta" ; +default :return NULL ; }
@@ -520,6 +720,87 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, *flags |=V4L2_CTRL_FLAG_WRITE_ONLY ;break ; } +switch (id) { +case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE : + *type =V4L2_CTRL_TYPE_BOOLEAN ; +break ; +case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE : +case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT : + *type =V4L2_CTRL_TYPE_INTEGER ; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY : + *type =V4L2_CTRL_TYPE_INTEGER ; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE : +case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER : + *type =V4L2_CTRL_TYPE_BOOLEAN ; +break ; + + +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE : +case V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE : +case V4L2_CID_MPEG_VIDEO_HEADER_MODE : +case V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE : +case V4L2_CID_MPEG_VIDEO_H264_PROFILE : +case V4L2_CID_MPEG_VIDEO_H264_LEVEL : +case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL : +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE : +case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE : +case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE : +case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC : + *type =V4L2_CTRL_TYPE_MENU ; +break ; + +case V4L2_CID_MPEG_MFC51_VIDEO_PADDING : +case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE : +case V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT : +case V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM : +case V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE : +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK : +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH : +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC : +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY : +case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE : +case V4L2_CID_MPEG_VIDEO_MPEG4_QPEL : + *type =V4L2_CTRL_TYPE_BOOLEAN ; +break ; + +case V4L2_CID_MPEG_VIDEO_GOP_SIZE : +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB : +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES : +case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB : +case V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV : +case V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF : +case V4L2_CID_MPEG_VIDEO_VBV_SIZE : +case V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE : +case V4L2_CID_MPEG_VIDEO_B_FRAMES : +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA : +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA : +case V4L2_CID_MPEG_VIDEO_MAX_REF_PIC : +case V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P : +case V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H263_MIN_QP : +case V4L2_CID_MPEG_VIDEO_H263_MAX_QP : +case V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H264_MIN_QP : +case V4L2_CID_MPEG_VIDEO_H264_MAX_QP : +case V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP : +case V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP : +case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH : +case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT : +case V4L2_CID_MPEG_VIDEO_H264_I_PERIOD : +case V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES : +case V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC : + *type =V4L2_CTRL_TYPE_INTEGER ; +break ; + } }EXPORT_SYMBOL (v4l2_ctrl_fill);
Signature · 1 line
1.6.3.3
Re: [PATCH 3/4 v9] v4l2-ctrl: add codec controls support to the control framework
Quoted 13 lines · On Tuesday, June 14, 2011 18:36:55 Kamil Debski wrote:
Add support for the codec controls to the v4l2 control framework.
Signed-off-by Kamil Debski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/media/video/v4l2-ctrls.c | 281 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 281 insertions(+), 0 deletions(-)drivers/media/video/v4l2-ctrls.c +0
-0
drivers/media/video/v4l2-ctrls.c const char * const *v4l2_ctrl_get_menu(u32 id) · line 223
Quoted 8 lines
drivers/media/video/v4l2-ctrls.c +5
-0@@ -216,6 +216,118 @@ const char * const *v4l2_ctrl_get_menu(u32 id)"75 useconds" , NULL, }; +static const char *const multi_slice[] = { +"Single" , +"Max macroblocks" , +"Max bits" , + NULL,
The naming convention is to capitalize words (like in English titles). So this should be 'Max Macroblocks', 'Max Bits'. Ditto elsewhere.
I noticed a few existing menu and control name items that didn't do this correctly either. I would be great if you could add a patch that fixes them as well.
Quoted 140 lines
drivers/media/video/v4l2-ctrls.c +129
-0+ }; +static const char *const force_frame[] = { +"Disabled" , +"I frame" , +"Not coded" , +NULL , + }; +static const char *const header_mode[] = { +"Separate buffer" , +"Joined with 1st frame" , +NULL , + }; +static const char *const frame_skip[] = { +"Disabled" , +"Level limit" , +"VBV/CPB limit" , +NULL , + }; +static const char *const h264_profile[] = { +"Baseline" , +"Constrained Baseline" , +"Main" , +"Extended" , +"High" , +"High 10" , +"High 422" , +"High 444 Predictive" , +"High 10 Intra" , +"High 422 Intra" , +"High 444 Intra" , +"CAVLC 444 Intra" , +"Scalable Baseline" , +"Scalable High" , +"Scalable High Intra" , +"Multiview High" , +NULL , + }; +static const char *const mpeg4_profile[] = { +"Simple" , +"Adcanved simple" , +"Core" , +"Simple scalable" , +"Advanced Coding Efficency" , +NULL , + }; +static const char *const mpeg_h264_level[] = { +"1" , +"1b" , +"1.1" , +"1.2" , +"1.3" , +"2" , +"2.1" , +"2.2" , +"3" , +"3.1" , +"3.2" , +"4" , +"4.1" , +"4.2" , +"5" , +"5.1" , +NULL , + }; +static const char *const mpeg_mpeg4_level[] = { +"0" , +"0b" , +"1" , +"2" , +"3" , +"3b" , +"4" , +"5" , +NULL , + }; +static const char *const h264_loop_filter[] = { +"Enabled" , +"Disabled" , +"Disabled at slice boundary" , +NULL , + }; +static const char *const symbol_mode[] = { +"CAVLC" , +"CABAC" , +NULL , + }; +static const char * vui_sar_idc[] = { +"Unspecified" , +"1:1" , +"12:11" , +"10:11" , +"16:11" , +"40:33" , +"24:11" , +"20:11" , +"32:11" , +"80:33" , +"18:11" , +"15:11" , +"64:33" , +"160:99" , +"4:3" , +"3:2" , +"2:1" , +"Extended SAR" , +NULL , + };switch (id) {case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ :@@ -256,6 +368,28 @@ const char * const *v4l2_ctrl_get_menu(u32 id)return colorfx;case V4L2_CID_TUNE_PREEMPHASIS :return tune_preemphasis; +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE : +return multi_slice; +case V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE : +return force_frame; +case V4L2_CID_MPEG_VIDEO_HEADER_MODE : +return header_mode; +case V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE : +return frame_skip; +case V4L2_CID_MPEG_VIDEO_H264_PROFILE : +return h264_profile; +case V4L2_CID_MPEG_VIDEO_H264_LEVEL : +return mpeg_h264_level; +case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL : +return mpeg_mpeg4_level; +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE : +return h264_loop_filter; +case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE : +return symbol_mode; +case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE : +return mpeg4_profile; +case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC : +return vui_sar_idc;default :return NULL ; }
drivers/media/video/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 526
Quoted 4 lines
drivers/media/video/v4l2-ctrls.c +1
-0@@ -389,6 +523,72 @@ const char *v4l2_ctrl_get_name(u32 id)case V4L2_CID_TUNE_POWER_LEVEL :return "Tune Power Level" ;case V4L2_CID_TUNE_ANTENNA_CAPACITOR :return "Tune Antenna Capacitor" ; +case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE :return "Decoder Slice Interface" ;
Please add the MPEG controls to the MPEG control section in the switch instead of at the end.
drivers/media/video/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 527
Quoted 1 line
drivers/media/video/v4l2-ctrls.c +1
-0+case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE :return "Minimum number of cap bufs" ;
I'd phrase this as: "Minimum Capture Buffers".
Quoted 53 lines
drivers/media/video/v4l2-ctrls.c +53
-0+case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT :return "Minimum number of out bufs" ; + +case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY :return "Decoder H264 Display Delay" ; +case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE :return "H264 Display Delay Enable" ; +case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER :return "Mpeg4 Loop Filter Enable" ; + +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE :return "The slice partitioning method" ; +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB :return "The number of MB in a slice" ; +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES :return "The maximum bits per slices" ; +case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB :return "The number of intra refresh MBs" ; +case V4L2_CID_MPEG_MFC51_VIDEO_PADDING :return "Padding control enable" ; +case V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV :return "Padding color YUV value" ; +case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE :return "Frame level rate control enable" ; +case V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF :return "Rate control reaction coeff." ; +case V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE :return "Force frame type" ; +case V4L2_CID_MPEG_VIDEO_VBV_SIZE :return "VBV buffer size" ; +case V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE :return "H264 CPB buffer size" ; +case V4L2_CID_MPEG_VIDEO_HEADER_MODE :return "Sequence header mode" ; +case V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE :return "Frame skip enable" ; +case V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT :return "Fixed target bit enable" ; +case V4L2_CID_MPEG_VIDEO_H264_PROFILE :return "H264 profile" ; +case V4L2_CID_MPEG_VIDEO_H264_LEVEL :return "H264 level" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL :return "MPEG4 level" ; +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE :return "H264 loop filter mode" ; +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA :return "H264 loop filter alpha offset" ; +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA :return "H264 loop filter beta offset" ; +case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE :return "H264 entorpy mode" ; +case V4L2_CID_MPEG_VIDEO_MAX_REF_PIC :return "The max number of ref. picture" ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P :return "The number of ref. picture of P" ; +case V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM :return "H264 8x8 transform enable" ; +case V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE :return "H264 MB level rate control" ; + +case V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP :return "H263 I-Frame QP value" ; +case V4L2_CID_MPEG_VIDEO_H263_MIN_QP :return "H263 Minimum QP value" ; +case V4L2_CID_MPEG_VIDEO_H263_MAX_QP :return "H263 Maximum QP value" ; +case V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP :return "H263 P frame QP value" ; +case V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP :return "H263 B frame QP value" ; + +case V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP :return "H264 I-Frame QP value" ; +case V4L2_CID_MPEG_VIDEO_H264_MIN_QP :return "H264 Minimum QP value" ; +case V4L2_CID_MPEG_VIDEO_H264_MAX_QP :return "H264 Maximum QP value" ; +case V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP :return "H264 P frame QP value" ; +case V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP :return "H264 B frame QP value" ; + +case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP :return "MPEG4 I-Frame QP value" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP :return "MPEG4 Minimum QP value" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP :return "MPEG4 Maximum QP value" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP :return "MPEG4 P frame QP value" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP :return "MPEG4 B frame QP value" ; + +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK :return "H264 dark region adaptive" ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH :return "H264 smooth region adaptive" ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC :return "H264 static region adaptive" ;
drivers/media/video/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 590
Quoted 10 lines
drivers/media/video/v4l2-ctrls.c +10
-0+case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY :return "H264 MB activity adaptive" ; +case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE :return "Aspect ratio VUI enable" ; +case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC :return "VUI aspect ratio IDC" ; +case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH :return "Horizontal size of SAR" ; +case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT :return "Vertical size of SAR" ; +case V4L2_CID_MPEG_VIDEO_H264_I_PERIOD :return "H264 I period" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE :return "MPEG4 profile" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_QPEL :return "Quarter pixel search enable" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES :return "MPEG4 vop time resolution" ; +case V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC :return "MPEG4 frame delta" ;
Can you sort this list into general MPEG controls, MPEG4 controls, H263/4 controls and MFC51 controls? It's all mixed up now. It's the same elsewhere where you have a series of case statements.
drivers/media/video/v4l2-ctrls.c void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, · line 725
Quoted 11 lines
drivers/media/video/v4l2-ctrls.c +4
-0+default :return NULL ; }@@ -520,6 +720,87 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, *flags |=V4L2_CTRL_FLAG_WRITE_ONLY ;break ; } +switch (id) { +case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE : + *type =V4L2_CTRL_TYPE_BOOLEAN ;
Don't add a new switch, just add this to the already existing case statements for booleans, menus, etc.
drivers/media/video/v4l2-ctrls.c void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, · line 729
Quoted 4 lines
drivers/media/video/v4l2-ctrls.c +4
-0+break ; +case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE : +case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT : + *type =V4L2_CTRL_TYPE_INTEGER ;
No need to specify integer controls explicitly, that's already the default case.
Quoted 68 lines
drivers/media/video/v4l2-ctrls.c +67
-0+break ; +case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY : + *type =V4L2_CTRL_TYPE_INTEGER ; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE : +case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER : + *type =V4L2_CTRL_TYPE_BOOLEAN ; +break ; + + +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE : +case V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE : +case V4L2_CID_MPEG_VIDEO_HEADER_MODE : +case V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE : +case V4L2_CID_MPEG_VIDEO_H264_PROFILE : +case V4L2_CID_MPEG_VIDEO_H264_LEVEL : +case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL : +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE : +case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE : +case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE : +case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC : + *type =V4L2_CTRL_TYPE_MENU ; +break ; + +case V4L2_CID_MPEG_MFC51_VIDEO_PADDING : +case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE : +case V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT : +case V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM : +case V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE : +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK : +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH : +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC : +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY : +case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE : +case V4L2_CID_MPEG_VIDEO_MPEG4_QPEL : + *type =V4L2_CTRL_TYPE_BOOLEAN ; +break ; + +case V4L2_CID_MPEG_VIDEO_GOP_SIZE : +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB : +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES : +case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB : +case V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV : +case V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF : +case V4L2_CID_MPEG_VIDEO_VBV_SIZE : +case V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE : +case V4L2_CID_MPEG_VIDEO_B_FRAMES : +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA : +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA : +case V4L2_CID_MPEG_VIDEO_MAX_REF_PIC : +case V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P : +case V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H263_MIN_QP : +case V4L2_CID_MPEG_VIDEO_H263_MAX_QP : +case V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H264_MIN_QP : +case V4L2_CID_MPEG_VIDEO_H264_MAX_QP : +case V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP : +case V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP : +case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH :
drivers/media/video/v4l2-ctrls.c void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, · line 806
Quoted 10 lines
drivers/media/video/v4l2-ctrls.c +7
-0+case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT : +case V4L2_CID_MPEG_VIDEO_H264_I_PERIOD : +case V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES : +case V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC : + *type =V4L2_CTRL_TYPE_INTEGER ; +break ; + } }EXPORT_SYMBOL (v4l2_ctrl_fill);
Regards,
Hans
Re: [PATCH 3/4 v9] v4l2-ctrl: add codec controls support to the control framework
In reply to Kamil DebskiQuoted 12 lines · On Tuesday, June 14, 2011 18:36:55 Kamil Debski wrote:
Add support for the codec controls to the v4l2 control framework.
Signed-off-by Kamil Debski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>--- drivers/media/video/v4l2-ctrls.c | 281 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 281 insertions(+), 0 deletions(-)drivers/media/video/v4l2-ctrls.c +0
-0
...
drivers/media/video/v4l2-ctrls.c const char *v4l2_ctrl_get_name(u32 id) · line 581
Quoted 4 lines
drivers/media/video/v4l2-ctrls.c +4
-0+case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK :return "H264 dark region adaptive" ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH :return "H264 smooth region adaptive" ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC :return "H264 static region adaptive" ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY :return "H264 MB activity adaptive" ;
I forgot to mention: MFC51 specific controls should not be added here. Instead use v4l2_ctrl_new_custom() in the MFC driver itself.
Since these controls are driver-specific it makes no sense to add support for them to the V4L2 core code.
Regards,
Hans
PATCH v9 4/4 MFC: Add MFC 5.1 V4L2 driver
In reply to Kamil DebskiMulti Format Codec 5.1 is a hardware video coding acceleration module found in the S5PV210 and Exynos4 Samsung SoCs. It is capable of handling a range of video codecs and this driver provides a V4L2 interface for video decoding and encoding.
--- drivers/media/video/Kconfig | 8 + drivers/media/video/Makefile | 1 + drivers/media/video/s5p-mfc/Makefile | 5 + drivers/media/video/s5p-mfc/regs-mfc.h | 385 +++++ drivers/media/video/s5p-mfc/s5p_mfc.c | 1359 +++++++++++++++++ drivers/media/video/s5p-mfc/s5p_mfc_cmd.c | 143 ++ drivers/media/video/s5p-mfc/s5p_mfc_cmd.h | 28 + drivers/media/video/s5p-mfc/s5p_mfc_common.h | 472 ++++++ drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c | 393 +++++ drivers/media/video/s5p-mfc/s5p_mfc_ctrl.h | 27 + drivers/media/video/s5p-mfc/s5p_mfc_debug.h | 48 + drivers/media/video/s5p-mfc/s5p_mfc_dec.c | 1106 ++++++++++++++ drivers/media/video/s5p-mfc/s5p_mfc_dec.h | 23 + drivers/media/video/s5p-mfc/s5p_mfc_enc.c | 2021 ++++++++++++++++++++++++++ drivers/media/video/s5p-mfc/s5p_mfc_enc.h | 23 + drivers/media/video/s5p-mfc/s5p_mfc_inst.c | 52 + drivers/media/video/s5p-mfc/s5p_mfc_inst.h | 19 + drivers/media/video/s5p-mfc/s5p_mfc_intr.c | 94 ++ drivers/media/video/s5p-mfc/s5p_mfc_intr.h | 26 + drivers/media/video/s5p-mfc/s5p_mfc_mem.h | 55 + drivers/media/video/s5p-mfc/s5p_mfc_opr.c | 1588 ++++++++++++++++++++ drivers/media/video/s5p-mfc/s5p_mfc_opr.h | 88 ++ drivers/media/video/s5p-mfc/s5p_mfc_pm.c | 131 ++ drivers/media/video/s5p-mfc/s5p_mfc_pm.h | 24 + drivers/media/video/s5p-mfc/s5p_mfc_reg.c | 30 + drivers/media/video/s5p-mfc/s5p_mfc_reg.h | 126 ++ drivers/media/video/s5p-mfc/s5p_mfc_shm.c | 55 + drivers/media/video/s5p-mfc/s5p_mfc_shm.h | 86 ++ 28 files changed, 8416 insertions(+), 0 deletions(-) create mode 100644 drivers/media/video/s5p-mfc/Makefile create mode 100644 drivers/media/video/s5p-mfc/regs-mfc.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_cmd.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_cmd.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_common.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_ctrl.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_debug.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_dec.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_dec.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_enc.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_enc.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_inst.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_inst.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_intr.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_intr.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_mem.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_opr.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_opr.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_pm.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_pm.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_reg.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_reg.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_shm.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_shm.h
drivers/media/video/Kconfig +8 -0
@@ -1056,4 +1056,12 @@ config VIDEO_MEM2MEM_TESTDEV framework. +config VIDEO_SAMSUNG_S5P_MFC + tristate "Samsung S5P MFC 5.1 Video Codec" + depends on VIDEO_DEV && VIDEO_V4L2 && PLAT_S5P + select VIDEOBUF2_DMA_CONTIG + default n + help + MFC 5.1 driver for V4L2. + endif # V4L_MEM2MEM_DRIVERS
drivers/media/video/Makefile +1 -0
@@ -168,6 +168,7 @@ obj-$(CONFIG_VIDEO_SH_MOBILE_CEU) += sh_mobile_ceu_camera.o obj-$(CONFIG_VIDEO_OMAP1) += omap1_camera.o obj-$(CONFIG_VIDEO_SAMSUNG_S5P_FIMC) += s5p-fimc/ +obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MFC) += s5p-mfc/ obj-$(CONFIG_ARCH_DAVINCI) += davinci/
drivers/media/video/s5p-mfc/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MFC) := s5p-mfc.o +s5p-mfc-y += s5p_mfc.o s5p_mfc_intr.o s5p_mfc_opr.o +s5p-mfc-y += s5p_mfc_dec.o s5p_mfc_enc.o +s5p-mfc-y += s5p_mfc_ctrl.o s5p_mfc_inst.o s5p_mfc_cmd.o +s5p-mfc-y += s5p_mfc_pm.o s5p_mfc_shm.o s5p_mfc_reg.o
drivers/media/video/s5p-mfc/regs-mfc.h new file +385 -0
385 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc.c new file +1359 -0
1,359 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_cmd.c new file +143 -0
143 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_cmd.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* linux/drivers/media/video/s5p-mfc/s5p_mfc_cmd.h +* +* Copyright (c) 2010 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#ifndef __S5P_MFC_CMD_H +#define __S5P_MFC_CMD_H __FILE__ + +#define MAX_H2R_ARG 4 + +struct s5p_mfc_cmd_args { +unsigned int arg[MAX_H2R_ARG ]; +}; + +int s5p_mfc_sys_init_cmd (struct s5p_mfc_dev *dev); +int s5p_mfc_sleep_cmd (struct s5p_mfc_dev *dev); +int s5p_mfc_wakeup_cmd (struct s5p_mfc_dev *dev); +int s5p_mfc_open_inst_cmd (struct s5p_mfc_ctx *ctx); +int s5p_mfc_close_inst_cmd (struct s5p_mfc_ctx *ctx); + +#endif /* __S5P_MFC_CMD_H */
drivers/media/video/s5p-mfc/s5p_mfc_common.h new file +472 -0
472 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c new file +393 -0
393 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_ctrl.h new file +27 -0
@@ -0,0 +1,27 @@ +/* +* linux/drivers/media/video/s5p-mfc/s5p_mfc_ctrl.h +* +* Copyright (c) 2010 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#ifndef __S5P_MFC_CTRL_H +#define __S5P_MFC_CTRL_H + +int s5p_mfc_release_firmware (struct s5p_mfc_dev *dev); +int s5p_mfc_alloc_firmware (struct s5p_mfc_dev *dev); +int s5p_mfc_load_firmware (struct s5p_mfc_dev *dev); + +int s5p_mfc_init_hw (struct s5p_mfc_dev *dev); + +int s5p_mfc_sleep (struct s5p_mfc_dev *dev); +int s5p_mfc_wakeup (struct s5p_mfc_dev *dev); + +int s5p_mfc_reset (void ); + +#endif /* __S5P_MFC_CTRL_H */
drivers/media/video/s5p-mfc/s5p_mfc_debug.h new file +48 -0
48 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +1106 -0
121 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_dec.h new file +23 -0
Lines of this file are not shown. View the raw message.
drivers/media/video/s5p-mfc/s5p_mfc_enc.c new file +2021 -0
2,021 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_enc.h new file +23 -0
Lines of this file are not shown. View the raw message.
drivers/media/video/s5p-mfc/s5p_mfc_inst.c new file +52 -0
52 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_inst.h new file +19 -0
Lines of this file are not shown. View the raw message.
drivers/media/video/s5p-mfc/s5p_mfc_intr.c new file +94 -0
94 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_intr.h new file +26 -0
Lines of this file are not shown. View the raw message.
drivers/media/video/s5p-mfc/s5p_mfc_mem.h new file +55 -0
55 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_opr.c new file +1588 -0
1,588 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_opr.h new file +88 -0
88 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_pm.c new file +131 -0
131 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_pm.h new file +24 -0
Lines of this file are not shown. View the raw message.
drivers/media/video/s5p-mfc/s5p_mfc_reg.c new file +30 -0
Lines of this file are not shown. View the raw message.
drivers/media/video/s5p-mfc/s5p_mfc_reg.h new file +126 -0
126 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_shm.c new file +55 -0
55 lines not on this page · raw message
drivers/media/video/s5p-mfc/s5p_mfc_shm.h new file +86 -0
86 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.6.3.3
Part of the diff is not shown here. View the raw message.
Re: [PATCH 4/4 v9] MFC: Add MFC 5.1 V4L2 driver
Quoted 8 lines · On Tuesday, June 14, 2011 18:36:56 Kamil Debski wrote:
Multi Format Codec 5.1 is a hardware video coding acceleration module found in the S5PV210 and Exynos4 Samsung SoCs. It is capable of handling a range of video codecs and this driver provides a V4L2 interface for video decoding and encoding.
Signed-off-by Kamil Debski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>Cc Jeongtae Park <[email protected]>
Just a quick one:
Quoted 54 lines
drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +49
-0+static struct mfc_control controls[] = { + { + .id =V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY , + .type =V4L2_CTRL_TYPE_INTEGER , + .name ="H264 Display Delay" , + .minimum =0 , + .maximum =16383 , + .step =1 , + .default_value =0 , + }, + { + .id =V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE , + .type =V4L2_CTRL_TYPE_BOOLEAN , + .name ="H264 Display Delay Enable" , + .minimum =0 , + .maximum =1 , + .step =1 , + .default_value =0 , + }, + { + .id =V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER , + .type =V4L2_CTRL_TYPE_BOOLEAN , + .name ="Mpeg4 Loop Filter Enable" , + .minimum =0 , + .maximum =1 , + .step =1 , + .default_value =0 , + }, + { + .id =V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE , + .type =V4L2_CTRL_TYPE_BOOLEAN , + .name ="Slice Interface Enable" , + .minimum =0 , + .maximum =1 , + .step =1 , + .default_value =0 , + }, + { + .id =V4L2_CID_MIN_BUFFERS_FOR_CAPTURE , + .type =V4L2_CTRL_TYPE_INTEGER , + .name ="Minimum number of cap bufs" , + .minimum =1 , + .maximum =32 , + .step =1 , + .default_value =1 , + .is_volatile =1 , + }, +}; +
...
Quoted 4 lines
drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +4
-0+for (i =0 ; i <NUM_CTRLS ; i++) { + + ctx->ctrls[i] = v4l2_ctrl_new_std(&ctx->ctrl_handler, + &s5p_mfc_dec_ctrl_ops,
drivers/media/video/s5p-mfc/s5p_mfc_dec.c line 1091
Quoted 10 lines
drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +10
-0+ controls[i].id, controls[i].minimum, + controls[i].maximum, controls[i].step, + controls[i].default_value); +if (ctx->ctrl_handler.error) { +mfc_err ("Adding control (%d) failed\n" , i); +return ctx->ctrl_handler.error; + } +if (controls[i].is_volatile && ctx->ctrls[i]) { + ctx->ctrls[i]->is_volatile =1 ; + ctx->ctrls[i]->flags =V4L2_CTRL_FLAG_READ_ONLY ;
This flag for V4L2_CID_MIN_BUFFERS_FOR_CAPTURE should have been set in v4l2_ctrl_fill().
Regards,
Hans
drivers/media/video/s5p-mfc/s5p_mfc_dec.c
Quoted 5 lines
drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +5
-0+ } + } + +return 0 ; +}
Why not just call v4l2_ctrl_new_std? A good non-trivial example of how I would do things is in media/video/cx2341x.c, cx2341x_handler_init(). Although for the new_custom calls I would probably use an array of static const struct v4l2_ctrl_config these days.
Regards,
Hans
Re: [PATCH 4/4 v9] MFC: Add MFC 5.1 V4L2 driver
In reply to Kamil DebskiHi Kamil,
I went through the decoder flow (not codec specific yet) of your MFC driver. Since I havent acquired/produced a v4l2 based test case, I didnt check the functionality yet. Below are some of minor comments I found during my review.
Regards,
Subash
SISO-SLG
On 06/14/2011 10:06 PM, Kamil Debski wrote:
...
Quoted 2 lines
drivers/media/video/s5p-mfc/s5p_mfc.c new file +0
-0
...
Quoted 113 lines
drivers/media/video/s5p-mfc/s5p_mfc.c new file +113
-0+/* Open an MFC node */ +static int s5p_mfc_open (struct file *file) +{ +struct s5p_mfc_ctx *ctx =NULL ; +struct s5p_mfc_dev *dev =video_drvdata (file); +struct vb2_queue *q; +unsigned long flags; +int ret =0 ; + +mfc_debug_enter (); + + dev->num_inst++;/* It is guarded by mfc_mutex in vfd */ + +/* Allocate memory for context */ + ctx =kzalloc (sizeof *ctx,GFP_KERNEL ); +if (!ctx) { +mfc_err ("Not enough memory.\n" ); + ret = -ENOMEM ; + goto err_alloc; + } + + ret =v4l2_fh_init (&ctx->fh,video_devdata (file)); +if (ret) { +mfc_err ("Failed to init v4l2_fh\n" ); + goto err_fh; + } + + file->private_data =&ctx->fh; +v4l2_fh_add (&ctx->fh); + + ctx->dev = dev; +INIT_LIST_HEAD (&ctx->src_queue); +INIT_LIST_HEAD (&ctx->dst_queue); + ctx->src_queue_cnt =0 ; + ctx->dst_queue_cnt =0 ; +/* Get context number */ + ctx->num =0 ; +while (dev->ctx[ctx->num]) { + ctx->num++; +if (ctx->num>=MFC_NUM_CONTEXTS ) { +mfc_err ("Too many open contexts.\n" ); + ret = -EBUSY ; + goto err_no_ctx; + } + } +/* Mark context as idle */ +spin_lock_irqsave (&dev->condlock, flags); +clear_bit (ctx->num,&dev->ctx_work_bits); +spin_unlock_irqrestore (&dev->condlock, flags); + dev->ctx[ctx->num] = ctx; +if (s5p_mfc_get_node_type (file) ==MFCNODE_DECODER ) { + ctx->type =MFCINST_DECODER ; + ctx->c_ops =get_dec_codec_ops (); +/* Setup ctrl handler */ + ret =s5p_mfc_dec_ctrls_setup (ctx); +if (ret) { +mfc_err ("Failed to setup mfc controls\n" ); + goto err_ctrls_setup; + } + + + }else if (s5p_mfc_get_node_type (file) ==MFCNODE_ENCODER ) { + ctx->type =MFCINST_ENCODER ; + ctx->c_ops =get_enc_codec_ops (); +/* only for encoder */ +INIT_LIST_HEAD (&ctx->ref_queue); + ctx->ref_queue_cnt =0 ; + +/* Setup ctrl handler */ + ret =s5p_mfc_enc_ctrls_setup (ctx); +if (ret) { +mfc_err ("Failed to setup mfc controls\n" ); + goto err_ctrls_setup; + } + }else { + ret = -ENOENT ; + goto err_bad_node; + } + + ctx->fh.ctrl_handler =&ctx->ctrl_handler; + ctx->inst_no =-1 ; +/* Load firmware if this is the first instance */ +if (dev->num_inst ==1 ) { + dev->watchdog_timer.expires = jiffies + +msecs_to_jiffies (MFC_WATCHDOG_INTERVAL ); +add_timer (&dev->watchdog_timer); + +mfc_debug (2 ,"power on\n" ); + ret =s5p_mfc_power_on (); +if (ret<0 ) { +mfc_err ("power on failed\n" ); + goto err_pwr_enable; + } + +s5p_mfc_clock_on (); + +/* Load the FW */ + ret =s5p_mfc_alloc_firmware (dev); +if (ret !=0 ) + goto err_alloc_fw; + ret =s5p_mfc_load_firmware (dev); +if (ret !=0 ) + goto err_load_fw; + +/* Init the FW */ + ret =s5p_mfc_init_hw (dev); +if (ret !=0 ) + goto err_init_hw; + +s5p_mfc_clock_off (); + } + +/* Init videobuf2 queue for CAPTURE */
drivers/media/video/s5p-mfc/s5p_mfc.c line 782
Quoted 10 lines
drivers/media/video/s5p-mfc/s5p_mfc.c new file +10
-0+ q =&ctx->vq_dst; + q->type =V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ; + q->drv_priv =&ctx->fh; +if (s5p_mfc_get_node_type (file) ==MFCNODE_DECODER ) { + q->io_modes =VB2_MMAP ; + q->ops =get_dec_queue_ops (); + }else { + q->io_modes =VB2_MMAP |VB2_USERPTR ; + q->ops =get_enc_queue_ops (); + }
Node type is declared as one of MFCNODE_INVALID = -1,MFCNODE_DECODER = 0, MFCNODE_ENCODER = 1. Hence it would be good to check even for encoder and return error for the invalid case.
Quoted 11 lines
drivers/media/video/s5p-mfc/s5p_mfc.c new file +11
-0+ + q->mem_ops = (struct vb2_mem_ops *)&vb2_dma_contig_memops; + ret =vb2_queue_init (q); +if (ret) { +mfc_err ("Failed to initialize videobuf2 queue(capture)\n" ); + goto err_queue_init; + } + +/* Init videobuf2 queue for OUTPUT */ + q =&ctx->vq_src; + q->type =V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE ;
drivers/media/video/s5p-mfc/s5p_mfc.c line 803
Quoted 10 lines
drivers/media/video/s5p-mfc/s5p_mfc.c new file +10
-0+ q->io_modes =VB2_MMAP ; + q->drv_priv =&ctx->fh; +if (s5p_mfc_get_node_type (file) ==MFCNODE_DECODER ) { + q->io_modes =VB2_MMAP ; + q->ops =get_dec_queue_ops (); + }else { + q->io_modes =VB2_MMAP |VB2_USERPTR ; + q->ops =get_enc_queue_ops (); + } +
Same as above.
Quoted 44 lines
drivers/media/video/s5p-mfc/s5p_mfc.c new file +40
-0+ q->mem_ops = (struct vb2_mem_ops *)&vb2_dma_contig_memops; + ret =vb2_queue_init (q); +if (ret) { +mfc_err ("Failed to initialize videobuf2 queue(output)\n" ); + goto err_queue_init; + } + +init_waitqueue_head (&ctx->queue); +mfc_debug (2 ,"%s-- (via irq_cleanup_hw)\n" , __func__); +return ret; + +/* Deinit when failure occured */ +err_queue_init: +err_init_hw: +err_load_fw: +s5p_mfc_release_firmware (dev); +err_alloc_fw: + dev->ctx[ctx->num] =0 ; +del_timer_sync (&dev->watchdog_timer); +s5p_mfc_clock_off (); +err_pwr_enable: +if (dev->num_inst ==1 ) { +if (s5p_mfc_power_off ()<0 ) +mfc_err ("power off failed\n" ); +s5p_mfc_release_firmware (dev); + } +err_ctrls_setup: +s5p_mfc_dec_ctrls_delete (ctx); +err_bad_node: +err_no_ctx: +v4l2_fh_del (&ctx->fh); +v4l2_fh_exit (&ctx->fh); +err_fh: +kfree (ctx); +err_alloc: + dev->num_inst--; +mfc_debug_leave (); +return ret; +} +drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +0
-0
...
Quoted 12 lines
drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +12
-0+/* Get format */ +static int vidioc_g_fmt (struct file *file,void *priv,struct v4l2_format *f) +{ +struct s5p_mfc_ctx *ctx =fh_to_ctx (priv); +struct v4l2_pix_format_mplane *pix_mp; + +mfc_debug_enter (); + pix_mp =&f->fmt.pix_mp; +mfc_debug (2 ,"f->type = %d ctx->state = %d\n" , f->type, ctx->state); +if (f->type ==V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && + (ctx->state ==MFCINST_GOT_INST || ctx->state == +MFCINST_RES_CHANGE_END )) {
drivers/media/video/s5p-mfc/s5p_mfc_dec.c line 312
Quoted 10 lines
drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +10
-0+/* If the MFC is parsing the header, +* so wait until it is finished */ +s5p_mfc_clean_ctx_int_flags (ctx); +s5p_mfc_wait_for_done_ctx (ctx,S5P_FIMV_R2H_CMD_SEQ_DONE_RET , +0 ); + } +if (f->type ==V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && + ctx->state>=MFCINST_HEAD_PARSED && + ctx->state<MFCINST_ABORT ) { +/* This is run on CAPTURE (deocde output) */
decode
Quoted 35 lines
drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +35
-0+/* Width and height are set to the dimensions +of the movie, the buffer is bigger and +further processing stages should crop to this +rectangle. */ + pix_mp->width = ctx->buf_width; + pix_mp->height = ctx->buf_height; + pix_mp->field =V4L2_FIELD_NONE ; + pix_mp->num_planes =2 ; +/* Set pixelformat to the format in which MFC +outputs the decoded frame */ + pix_mp->pixelformat =V4L2_PIX_FMT_NV12MT ; + pix_mp->plane_fmt[0 ].bytesperline = ctx->buf_width; + pix_mp->plane_fmt[0 ].sizeimage = ctx->luma_size; + pix_mp->plane_fmt[1 ].bytesperline = ctx->buf_width; + pix_mp->plane_fmt[1 ].sizeimage = ctx->chroma_size; + }else if (f->type ==V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE ) { +/* This is run on OUTPUT +The buffer contains compressed image +so width and height have no meaning */ + pix_mp->width =0 ; + pix_mp->height =0 ; + pix_mp->field =V4L2_FIELD_NONE ; + pix_mp->plane_fmt[0 ].bytesperline = ctx->dec_src_buf_size; + pix_mp->plane_fmt[0 ].sizeimage = ctx->dec_src_buf_size; + pix_mp->pixelformat = ctx->src_fmt->fourcc; + pix_mp->num_planes = ctx->src_fmt->num_planes; + }else { +mfc_err ("Format could not be read\n" ); +mfc_debug (2 ,"%s-- with error\n" , __func__); +return -EINVAL ; + } +mfc_debug_leave (); +return 0 ; +} +
...
Quoted 22 lines
drivers/media/video/s5p-mfc/s5p_mfc_mem.h new file +16
-0@@ -0,0 +1,55 @@ +/* +* linux/drivers/media/video/s5p-mfc/s5p_mfc_mem.h +* +* Copyright (c) 2010 Samsung Electronics Co., Ltd. +* http://www.samsung.com/ +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#ifndef __S5P_MFC_MEM_H_ +#define __S5P_MFC_MEM_H_ __FILE__ + +#include <linux/platform_device.h>
drivers/media/video/s5p-mfc/s5p_mfc_mem.h line 26
Quoted 10 lines
drivers/media/video/s5p-mfc/s5p_mfc_mem.h new file +10
-0+#include "s5p_mfc_common.h" + +/* Offset base used to differentiate between CAPTURE and OUTPUT +* while mmaping */ + +#define MFC_OFFSET_SHIFT 11 + +#define DST_QUEUE_OFF_BASE (TASK_SIZE / 2) + +#define FIRMWARE_CODE_SIZE 0x60000/* 384KB */
Instead of hard-coding firware size value, cant we pick it up from .config file? I hope with more codecs being supported, this size will change in future.
drivers/media/video/s5p-mfc/s5p_mfc_mem.h line 36
Quoted 10 lines
drivers/media/video/s5p-mfc/s5p_mfc_mem.h new file +10
-0+#define MFC_H264_CTX_BUF_SIZE 0x96000/* 600KB per H264 instance */ +#define MFC_CTX_BUF_SIZE 0x2800/* 10KB per instance */ +#define DESC_BUF_SIZE 0x20000/* 128KB for DESC buffer */ +#define SHARED_BUF_SIZE 0x1000/* 4KB for shared buffer */ + +#define DEF_CPB_SIZE 0x40000/* 512KB */ + +#define MFC_BANK_A_ALLOC_CTX 0 +#define MFC_BANK_B_ALLOC_CTX 1 +#define MFC_FW_ALLOC_CTX 0
Since we are loading the firmware into bank-0, cant this be #define MFC_FW_ALLOC_CTX MFC_BANK_A_ALLOC_CTX
But what in future, if this needs to be configurable?
Quoted 9 lines
drivers/media/video/s5p-mfc/s5p_mfc_mem.h new file +9
-0+ +#define MFC_BANK1_ALIGN_ORDER 13 +#define MFC_BANK2_ALIGN_ORDER 13 +#define MFC_FW_ALIGN_ORDER 17 + +#define MFC_BASE_ALIGN_ORDER MFC_FW_ALIGN_ORDER + +#include <media/videobuf2-dma-contig.h> +
drivers/media/video/s5p-mfc/s5p_mfc_mem.h line 55
Quoted 10 lines
drivers/media/video/s5p-mfc/s5p_mfc_mem.h new file +10
-0+static inline size_t s5p_mfc_mem_cookie (void *a,void *b) +{ +/* Same functionality as the vb2_dma_contig_plane_paddr */ +dma_addr_t *paddr = vb2_dma_contig_memops.cookie (b); + +return *paddr; +} + + +#endif /* __S5P_MFC_MEM_H_ */
Regards,
Subash
Re: [PATCH 4/4 v9] MFC: Add MFC 5.1 V4L2 driver
In reply to Kamil DebskiQuoted 65 lines · On Tuesday, June 14, 2011 18:36:56 Kamil Debski wrote:
Multi Format Codec 5.1 is a hardware video coding acceleration module found in the S5PV210 and Exynos4 Samsung SoCs. It is capable of handling a range of video codecs and this driver provides a V4L2 interface for video decoding and encoding.
Signed-off-by Kamil Debski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>Cc Jeongtae Park <[email protected]>--- drivers/media/video/Kconfig | 8 + drivers/media/video/Makefile | 1 + drivers/media/video/s5p-mfc/Makefile | 5 + drivers/media/video/s5p-mfc/regs-mfc.h | 385 +++++ drivers/media/video/s5p-mfc/s5p_mfc.c | 1359 +++++++++++++++++ drivers/media/video/s5p-mfc/s5p_mfc_cmd.c | 143 ++ drivers/media/video/s5p-mfc/s5p_mfc_cmd.h | 28 + drivers/media/video/s5p-mfc/s5p_mfc_common.h | 472 ++++++ drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c | 393 +++++ drivers/media/video/s5p-mfc/s5p_mfc_ctrl.h | 27 + drivers/media/video/s5p-mfc/s5p_mfc_debug.h | 48 + drivers/media/video/s5p-mfc/s5p_mfc_dec.c | 1106 ++++++++++++++ drivers/media/video/s5p-mfc/s5p_mfc_dec.h | 23 + drivers/media/video/s5p-mfc/s5p_mfc_enc.c | 2021 ++++++++++++++++++++++++++ drivers/media/video/s5p-mfc/s5p_mfc_enc.h | 23 + drivers/media/video/s5p-mfc/s5p_mfc_inst.c | 52 + drivers/media/video/s5p-mfc/s5p_mfc_inst.h | 19 + drivers/media/video/s5p-mfc/s5p_mfc_intr.c | 94 ++ drivers/media/video/s5p-mfc/s5p_mfc_intr.h | 26 + drivers/media/video/s5p-mfc/s5p_mfc_mem.h | 55 + drivers/media/video/s5p-mfc/s5p_mfc_opr.c | 1588 ++++++++++++++++++++ drivers/media/video/s5p-mfc/s5p_mfc_opr.h | 88 ++ drivers/media/video/s5p-mfc/s5p_mfc_pm.c | 131 ++ drivers/media/video/s5p-mfc/s5p_mfc_pm.h | 24 + drivers/media/video/s5p-mfc/s5p_mfc_reg.c | 30 + drivers/media/video/s5p-mfc/s5p_mfc_reg.h | 126 ++ drivers/media/video/s5p-mfc/s5p_mfc_shm.c | 55 + drivers/media/video/s5p-mfc/s5p_mfc_shm.h | 86 ++ 28 files changed, 8416 insertions(+), 0 deletions(-) create mode 100644 drivers/media/video/s5p-mfc/Makefile create mode 100644 drivers/media/video/s5p-mfc/regs-mfc.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_cmd.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_cmd.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_common.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_ctrl.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_debug.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_dec.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_dec.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_enc.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_enc.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_inst.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_inst.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_intr.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_intr.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_mem.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_opr.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_opr.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_pm.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_pm.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_reg.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_reg.h create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_shm.c create mode 100644 drivers/media/video/s5p-mfc/s5p_mfc_shm.h
...
Quoted 5 lines
drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +0
-0
...
Quoted 23 lines
drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +23
-0+static int s5p_mfc_dec_g_v_ctrl (struct v4l2_ctrl *ctrl) +{ +struct s5p_mfc_ctx *ctx =ctrl_to_ctx (ctrl); +struct s5p_mfc_dev *dev = ctx->dev; + +switch (ctrl->id) { +case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE : +if (ctx->state >=MFCINST_HEAD_PARSED && + ctx->state <MFCINST_ABORT ) { + ctrl->cur.val = ctx->dpb_count; +break ; + }else if (ctx->state !=MFCINST_INIT ) { +v4l2_err (&dev->v4l2_dev,"Decoding not initialised.\n" ); +return -EINVAL ; + } + +/* Should wait for the header to be parsed */ +s5p_mfc_clean_ctx_int_flags (ctx); +s5p_mfc_wait_for_done_ctx (ctx, +S5P_FIMV_R2H_CMD_SEQ_DONE_RET ,0 ); +if (ctx->state >=MFCINST_HEAD_PARSED && + ctx->state <MFCINST_ABORT ) { + ctrl->cur.val = ctx->dpb_count;
drivers/media/video/s5p-mfc/s5p_mfc_dec.c line 719
Quoted 10 lines
drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +10
-0+ }else { +v4l2_err (&dev->v4l2_dev, +"Decoding not initialised.\n" ); +return -EINVAL ; + } +break ; + } + +return 0 ; +}
Just so you know: I have a long patch series pending that changes the way drivers handle volatile controls. The change is that instead of setting ctrl->cur.val the g_volatile_ctrl function will set ctrl->val.
So once my patches are merged this code needs to be changed as well.
Quoted 13 lines
drivers/media/video/s5p-mfc/s5p_mfc_dec.c new file +7
-0+ + +static const struct v4l2_ctrl_ops s5p_mfc_dec_ctrl_ops = { + .s_ctrl = s5p_mfc_dec_s_ctrl, + .g_volatile_ctrl = s5p_mfc_dec_g_v_ctrl, +}; +drivers/media/video/s5p-mfc/s5p_mfc_enc.c new file +0
-0
...
Quoted 65 lines
drivers/media/video/s5p-mfc/s5p_mfc_enc.c new file +65
-0+static int s5p_mfc_enc_s_ctrl (struct v4l2_ctrl *ctrl) +{ +struct s5p_mfc_ctx *ctx =ctrl_to_ctx (ctrl); +struct s5p_mfc_dev *dev = ctx->dev; +struct s5p_mfc_enc_params *p = &ctx->enc_params; +int ret =0 ; + +switch (ctrl->id) { +case V4L2_CID_MPEG_VIDEO_GOP_SIZE : + p->gop_size = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE : + p->slice_mode = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB : + p->slice_mb = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES : + p->slice_bit = ctrl->val *8 ; +break ; +case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB : + p->intra_refresh_mb = ctrl->val; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_PADDING : + p->pad = ctrl->val; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV : + p->pad_luma = (ctrl->val >>16 ) &0xff ; + p->pad_cb = (ctrl->val >>8 ) &0xff ; + p->pad_cr = (ctrl->val >>0 ) &0xff ; +break ; +case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE : + p->rc_frame = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_BITRATE : + p->rc_bitrate = ctrl->val; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF : + p->rc_reaction_coeff = ctrl->val; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE : + ctx->force_frame_type = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_VBV_SIZE : + p->vbv_size = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE : + p->codec.h264.cpb_size = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_HEADER_MODE : + p->seq_hdr_mode = ctrl->val; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE : + p->frame_skip_mode = ctrl->val; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT : + p->fixed_target_bit = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_B_FRAMES : + p->num_b_frame = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_PROFILE : +switch (ctrl->val) { +case V4L2_MPEG_VIDEO_H264_PROFILE_MAIN : + p->codec.h264.profile =
drivers/media/video/s5p-mfc/s5p_mfc_enc.c line 1439
Quoted 10 lines
drivers/media/video/s5p-mfc/s5p_mfc_enc.c new file +10
-0+S5P_FIMV_ENC_PROFILE_H264_MAIN ; +break ; +case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH : + p->codec.h264.profile = +S5P_FIMV_ENC_PROFILE_H264_HIGH ; +break ; +case V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE : + p->codec.h264.profile = +S5P_FIMV_ENC_PROFILE_H264_BASELINE ; +break ;
Note: when you create the menu control with v4l2_ctrl_new_std_menu you can pass a mask telling the control framework which menu items are not supported by the hardware. I strongly recommend setting that mask according to the hardware's capabilities.
Quoted 126 lines
drivers/media/video/s5p-mfc/s5p_mfc_enc.c new file +126
-0+default : + ret = -EINVAL ; + } +break ; +case V4L2_CID_MPEG_VIDEO_H264_LEVEL : + p->codec.h264.level_v4l2 = ctrl->val; + p->codec.h264.level =h264_level (ctrl->val); +if (p->codec.h264.level <0 ) { +mfc_err ("Level number is wrong.\n" ); + ret = p->codec.h264.level; + } +break ; +case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL : + p->codec.mpeg4.level_v4l2 = ctrl->val; + p->codec.mpeg4.level =mpeg4_level (ctrl->val); +if (p->codec.mpeg4.level <0 ) { +mfc_err ("Level number is wrong.\n" ); + ret = p->codec.mpeg4.level; + } +break ; +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE : + p->codec.h264.loop_filter_mode = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA : + p->codec.h264.loop_filter_alpha = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA : + p->codec.h264.loop_filter_beta = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE : + p->codec.h264.entropy_mode = ctrl->val; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P : + p->codec.h264.num_ref_pic_4p = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM : + p->codec.h264._8x8_transform = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE : + p->codec.h264.rc_mb = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP : + p->codec.h264.rc_frame_qp = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_MIN_QP : + p->codec.h264.rc_min_qp = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_MAX_QP : + p->codec.h264.rc_max_qp = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP : + p->codec.h264.rc_p_frame_qp = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP : + p->codec.h264.rc_b_frame_qp = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP : + p->codec.mpeg4.rc_frame_qp = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP : +case V4L2_CID_MPEG_VIDEO_H263_MIN_QP : + p->codec.mpeg4.rc_min_qp = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP : +case V4L2_CID_MPEG_VIDEO_H263_MAX_QP : + p->codec.mpeg4.rc_max_qp = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP : + p->codec.mpeg4.rc_p_frame_qp = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP : +case V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP : + p->codec.mpeg4.rc_b_frame_qp = ctrl->val; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK : + p->codec.h264.rc_mb_dark = ctrl->val; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH : + p->codec.h264.rc_mb_smooth = ctrl->val; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC : + p->codec.h264.rc_mb_static = ctrl->val; +break ; +case V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY : + p->codec.h264.rc_mb_activity = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE : + p->codec.h264.vui_sar = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC : + p->codec.h264.vui_sar_idc =vui_sar_idc (ctrl->val); +break ; +case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH : + p->codec.h264.vui_ext_sar_width = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT : + p->codec.h264.vui_ext_sar_height = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_GOP_CLOSURE : + p->codec.h264.open_gop = !ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_H264_I_PERIOD : + p->codec.h264.open_gop_size = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE : +switch (ctrl->val) { +case V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE : + p->codec.mpeg4.profile = +S5P_FIMV_ENC_PROFILE_MPEG4_SIMPLE ; +break ; +case V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE : + p->codec.mpeg4.profile = +S5P_FIMV_ENC_PROFILE_MPEG4_ADVANCED_SIMPLE ; +break ; +default : + ret = -EINVAL ; + } +break ; +case V4L2_CID_MPEG_VIDEO_MPEG4_QPEL : + p->codec.mpeg4.quarter_pixel = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_RES : + p->codec.mpeg4.vop_time_res = ctrl->val; +break ;
drivers/media/video/s5p-mfc/s5p_mfc_enc.c line 1575
Quoted 10 lines
drivers/media/video/s5p-mfc/s5p_mfc_enc.c new file +10
-0+case V4L2_CID_MPEG_VIDEO_MPEG4_VOP_TIME_INC : + p->codec.mpeg4.vop_frm_delta = ctrl->val; +break ; +default : +v4l2_err (&dev->v4l2_dev,"Invalid control, id=%d, val=%d\n" , ctrl->id, ctrl->val); + ret = -EINVAL ; + } + +return ret; +}
Regards,
Hans