diff mbox

[RFC,2/5] V4L: Add V4L2_PIX_FMT_S5C_UYVY_JPG fourcc definition

Message ID 1348498546-2652-3-git-send-email-s.nawrocki@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

The V4L2_PIX_FMT_S5C_UYVY_JPG is a two-plane image format used by
Samsung S5C73M3 camera. The first plane contains interleaved UYVY
and JPEG data, followed by meta-data in form of offsets to the UYVU
data blocks.

The second plane contains additional meta-data needed for extracting
JPEG and UYVY data stream from the first plane, in particular an
offset to the first entry of an array of data offsets in the first
plane. The offsets are expressed as 4-byte unsigned integers.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 Documentation/DocBook/media/v4l/pixfmt.xml | 9 +++++++++
 include/linux/videodev2.h                  | 1 +
 2 files changed, 10 insertions(+)

Comments

Laurent Pinchart Sept. 25, 2012, 11:44 a.m. UTC | #1
Hi Sylwester,

On Monday 24 September 2012 16:55:43 Sylwester Nawrocki wrote:
> The V4L2_PIX_FMT_S5C_UYVY_JPG is a two-plane image format used by
> Samsung S5C73M3 camera. The first plane contains interleaved UYVY
> and JPEG data, followed by meta-data in form of offsets to the UYVU
> data blocks.
> 
> The second plane contains additional meta-data needed for extracting
> JPEG and UYVY data stream from the first plane, in particular an
> offset to the first entry of an array of data offsets in the first
> plane. The offsets are expressed as 4-byte unsigned integers.
> 
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  Documentation/DocBook/media/v4l/pixfmt.xml | 9 +++++++++
>  include/linux/videodev2.h                  | 1 +
>  2 files changed, 10 insertions(+)
> 
> diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml
> b/Documentation/DocBook/media/v4l/pixfmt.xml index 1ddbfab..9caed9b 100644
> --- a/Documentation/DocBook/media/v4l/pixfmt.xml
> +++ b/Documentation/DocBook/media/v4l/pixfmt.xml
> @@ -996,6 +996,15 @@ the other bits are set to 0.</entry>
>  	    <entry>Old 6-bit greyscale format. Only the most significant 6 bits 
of
> each byte are used, the other bits are set to 0.</entry>
>  	  </row>
> +	  <row id="V4L2-PIX-FMT-JPG-YUYV-S5C">
> +	    <entry><constant>V4L2_PIX_FMT_S5C_YUYV_JPG</constant></entry>
> +	    <entry>'S5CJ'</entry>
> +	    <entry>Two-planar format used by Samsung S5C73MX cameras.The first
> +plane contains interleaved JPEG and YUYV data, followed by meta data
> describing +layout of the YUYV and JPEG data blocks. The second plane
> contains additional +information about data layout in the first plane, like
> an offset to the array +of offsets to YUVY data chunks.</entry>
> +	  </row>

I think you need to be a bit more precise here. You should document the format 
of the meta data, as that's required for applications to use the format.

>  	</tbody>
>        </tgroup>
>      </table>
> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
> index 4862165..aa6fb4d 100644
> --- a/include/linux/videodev2.h
> +++ b/include/linux/videodev2.h
> @@ -435,6 +435,7 @@ struct v4l2_pix_format {
>  #define V4L2_PIX_FMT_KONICA420  v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420
> planar in blocks of 256 pixels */ #define
> V4L2_PIX_FMT_JPGL	v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */ #define
> V4L2_PIX_FMT_SE401      v4l2_fourcc('S', '4', '0', '1') /* se401 janggu
> compressed rgb */ +#define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5',
> 'C', 'J') /* S5C73M3 interleaved YUYV/JPEG */
> 
>  /*
>   *	F O R M A T   E N U M E R A T I O N
Hi Laurent,

On 09/25/2012 01:44 PM, Laurent Pinchart wrote:
>> diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml
>> b/Documentation/DocBook/media/v4l/pixfmt.xml index 1ddbfab..9caed9b 100644
>> --- a/Documentation/DocBook/media/v4l/pixfmt.xml
>> +++ b/Documentation/DocBook/media/v4l/pixfmt.xml
>> @@ -996,6 +996,15 @@ the other bits are set to 0.</entry>
>>  	    <entry>Old 6-bit greyscale format. Only the most significant 6 bits 
> of
>> each byte are used, the other bits are set to 0.</entry>
>>  	  </row>
>> +	  <row id="V4L2-PIX-FMT-JPG-YUYV-S5C">
>> +	    <entry><constant>V4L2_PIX_FMT_S5C_YUYV_JPG</constant></entry>
>> +	    <entry>'S5CJ'</entry>
>> +	    <entry>Two-planar format used by Samsung S5C73MX cameras.The first
>> +plane contains interleaved JPEG and YUYV data, followed by meta data
>> describing +layout of the YUYV and JPEG data blocks. The second plane
>> contains additional +information about data layout in the first plane, like
>> an offset to the array +of offsets to YUVY data chunks.</entry>
>> +	  </row>
> 
> I think you need to be a bit more precise here. You should document the format 
> of the meta data, as that's required for applications to use the format.

Right, I wasn't sure how detailed this DocBook description should be.
I thought about adding more detailed explanation of this format under
Documentation/video4linux/, but it probably makes more sense to add
a few more sentences here and make it complete and really useful.
Let me correct that in the next iteration.


Regards,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml
index 1ddbfab..9caed9b 100644
--- a/Documentation/DocBook/media/v4l/pixfmt.xml
+++ b/Documentation/DocBook/media/v4l/pixfmt.xml
@@ -996,6 +996,15 @@  the other bits are set to 0.</entry>
 	    <entry>Old 6-bit greyscale format. Only the most significant 6 bits of each byte are used,
 the other bits are set to 0.</entry>
 	  </row>
+	  <row id="V4L2-PIX-FMT-JPG-YUYV-S5C">
+	    <entry><constant>V4L2_PIX_FMT_S5C_YUYV_JPG</constant></entry>
+	    <entry>'S5CJ'</entry>
+	    <entry>Two-planar format used by Samsung S5C73MX cameras.The first
+plane contains interleaved JPEG and YUYV data, followed by meta data describing
+layout of the YUYV and JPEG data blocks. The second plane contains additional
+information about data layout in the first plane, like an offset to the array
+of offsets to YUVY data chunks.</entry>
+	  </row>
 	</tbody>
       </tgroup>
     </table>
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 4862165..aa6fb4d 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -435,6 +435,7 @@  struct v4l2_pix_format {
 #define V4L2_PIX_FMT_KONICA420  v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
 #define V4L2_PIX_FMT_JPGL	v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
 #define V4L2_PIX_FMT_SE401      v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
+#define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'J') /* S5C73M3 interleaved YUYV/JPEG */
 
 /*
  *	F O R M A T   E N U M E R A T I O N