vidioc-g-jpegcomp.rst 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: V4L
  3. .. _VIDIOC_G_JPEGCOMP:
  4. ******************************************
  5. ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP
  6. ******************************************
  7. Name
  8. ====
  9. VIDIOC_G_JPEGCOMP - VIDIOC_S_JPEGCOMP
  10. Synopsis
  11. ========
  12. .. c:macro:: VIDIOC_G_JPEGCOMP
  13. ``int ioctl(int fd, VIDIOC_G_JPEGCOMP, v4l2_jpegcompression *argp)``
  14. .. c:macro:: VIDIOC_S_JPEGCOMP
  15. ``int ioctl(int fd, VIDIOC_S_JPEGCOMP, const v4l2_jpegcompression *argp)``
  16. Arguments
  17. =========
  18. ``fd``
  19. File descriptor returned by :c:func:`open()`.
  20. ``argp``
  21. Pointer to struct :c:type:`v4l2_jpegcompression`.
  22. Description
  23. ===========
  24. These ioctls are **deprecated**. New drivers and applications should use
  25. :ref:`JPEG class controls <jpeg-controls>` for image quality and JPEG
  26. markers control.
  27. [to do]
  28. Ronald Bultje elaborates:
  29. APP is some application-specific information. The application can set it
  30. itself, and it'll be stored in the JPEG-encoded fields (eg; interlacing
  31. information for in an AVI or so). COM is the same, but it's comments,
  32. like 'encoded by me' or so.
  33. jpeg_markers describes whether the huffman tables, quantization tables
  34. and the restart interval information (all JPEG-specific stuff) should be
  35. stored in the JPEG-encoded fields. These define how the JPEG field is
  36. encoded. If you omit them, applications assume you've used standard
  37. encoding. You usually do want to add them.
  38. .. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{13.1cm}|
  39. .. c:type:: v4l2_jpegcompression
  40. .. flat-table:: struct v4l2_jpegcompression
  41. :header-rows: 0
  42. :stub-columns: 0
  43. :widths: 1 1 2
  44. * - int
  45. - ``quality``
  46. - Deprecated. If
  47. :ref:`V4L2_CID_JPEG_COMPRESSION_QUALITY <jpeg-quality-control>`
  48. control is exposed by a driver applications should use it instead
  49. and ignore this field.
  50. * - int
  51. - ``APPn``
  52. -
  53. * - int
  54. - ``APP_len``
  55. -
  56. * - char
  57. - ``APP_data``\ [60]
  58. -
  59. * - int
  60. - ``COM_len``
  61. -
  62. * - char
  63. - ``COM_data``\ [60]
  64. -
  65. * - __u32
  66. - ``jpeg_markers``
  67. - See :ref:`jpeg-markers`. Deprecated. If
  68. :ref:`V4L2_CID_JPEG_ACTIVE_MARKER <jpeg-active-marker-control>`
  69. control is exposed by a driver applications should use it instead
  70. and ignore this field.
  71. .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|
  72. .. _jpeg-markers:
  73. .. flat-table:: JPEG Markers Flags
  74. :header-rows: 0
  75. :stub-columns: 0
  76. :widths: 3 1 4
  77. * - ``V4L2_JPEG_MARKER_DHT``
  78. - (1<<3)
  79. - Define Huffman Tables
  80. * - ``V4L2_JPEG_MARKER_DQT``
  81. - (1<<4)
  82. - Define Quantization Tables
  83. * - ``V4L2_JPEG_MARKER_DRI``
  84. - (1<<5)
  85. - Define Restart Interval
  86. * - ``V4L2_JPEG_MARKER_COM``
  87. - (1<<6)
  88. - Comment segment
  89. * - ``V4L2_JPEG_MARKER_APP``
  90. - (1<<7)
  91. - App segment, driver will always use APP0
  92. Return Value
  93. ============
  94. On success 0 is returned, on error -1 and the ``errno`` variable is set
  95. appropriately. The generic error codes are described at the
  96. :ref:`Generic Error Codes <gen-errors>` chapter.