From patchwork Wed Apr 27 11:41:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Debski X-Patchwork-Id: 735581 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3RCfO65007265 for ; Wed, 27 Apr 2011 12:51:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758737Ab1D0Ll5 (ORCPT ); Wed, 27 Apr 2011 07:41:57 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:16892 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758700Ab1D0Llz (ORCPT ); Wed, 27 Apr 2011 07:41:55 -0400 Received: from eu_spt1 (mailout2.w1.samsung.com [210.118.77.12]) by mailout2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0LKB00JLF75U1D@mailout2.w1.samsung.com> for linux-media@vger.kernel.org; Wed, 27 Apr 2011 12:41:54 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LKB00KRP75TSJ@spt1.w1.samsung.com> for linux-media@vger.kernel.org; Wed, 27 Apr 2011 12:41:53 +0100 (BST) Received: from localhost.localdomain (davsrvsmtp01.bs.local [106.116.38.10]) by linux.samsung.com (Postfix) with ESMTP id C1FD0270003; Wed, 27 Apr 2011 13:42:47 +0200 (CEST) Date: Wed, 27 Apr 2011 13:41:42 +0200 From: Kamil Debski Subject: [RFC/PATCH 1/3 v8] v4l: add fourcc definitions for compressed formats. In-reply-to: <1303904504-11610-1-git-send-email-k.debski@samsung.com> To: linux-media@vger.kernel.org Cc: m.szyprowski@samsung.com, kyungmin.park@samsung.com, k.debski@samsung.com, jaeryul.oh@samsung.com, kgene.kim@samsung.com, jtp.park@samsung.com Message-id: <1303904504-11610-2-git-send-email-k.debski@samsung.com> MIME-version: 1.0 X-Mailer: git-send-email 1.7.2.5 Content-type: TEXT/PLAIN Content-transfer-encoding: 7BIT References: <1303904504-11610-1-git-send-email-k.debski@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Apr 2011 12:51:40 +0000 (UTC) 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 Signed-off-by: Kyungmin Park --- Documentation/DocBook/v4l/controls.xml | 7 ++- Documentation/DocBook/v4l/pixfmt.xml | 67 +++++++++++++++++++++++++++++++- include/linux/videodev2.h | 21 ++++++++-- 3 files changed, 88 insertions(+), 7 deletions(-) diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml index a920ee8..6880798 100644 --- a/Documentation/DocBook/v4l/controls.xml +++ b/Documentation/DocBook/v4l/controls.xml @@ -670,7 +670,8 @@ caption of a Tab page in a GUI, for example. 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: +stream types. This control is specific to multiplexed MPEG streams. +The currently defined stream types are: @@ -800,6 +801,7 @@ frequency. Possible values are: V4L2_CID_MPEG_AUDIO_ENCODING  enum v4l2_mpeg_audio_encoding MPEG Audio encoding. +This control is specific to multiplexed MPEG streams. Possible values are: @@ -1250,7 +1252,8 @@ and reproducible audio bitstream. 0 = unmuted, 1 = muted. V4L2_CID_MPEG_VIDEO_ENCODING  enum v4l2_mpeg_video_encoding MPEG Video encoding -method. Possible values are: +method. This control is specific to multiplexed MPEG streams. +Possible values are: diff --git a/Documentation/DocBook/v4l/pixfmt.xml b/Documentation/DocBook/v4l/pixfmt.xml index c6fdcbb..d19cbae 100644 --- a/Documentation/DocBook/v4l/pixfmt.xml +++ b/Documentation/DocBook/v4l/pixfmt.xml @@ -737,10 +737,75 @@ information. V4L2_PIX_FMT_MPEG 'MPEG' - MPEG stream. The actual format is determined by + MPEG multiplexed stream. The actual format is determined by extended control V4L2_CID_MPEG_STREAM_TYPE, see . + + V4L2_PIX_FMT_H264 + 'H264' + H264 video elementary stream with start codes. + + + V4L2_PIX_FMT_H264_NO_SC + 'AVC1' + H264 video elementary stream without start codes. + + + V4L2_PIX_FMT_H263 + 'H263' + H263 video elementary stream. + + + V4L2_PIX_FMT_MPEG1 + 'MPG1' + MPEG1 video elementary stream. + + + V4L2_PIX_FMT_MPEG2 + 'MPG2' + MPEG2 video elementary stream. + + + V4L2_PIX_FMT_MPEG4 + 'MPG4' + MPEG4 video elementary stream. + + + V4L2_PIX_FMT_DIVX3 + 'DIV3' + Divx 3.11 video elementary stream. + + + V4L2_PIX_FMT_DIVX4 + 'DIV4' + Divx 4 video elementary stream. + + + V4L2_PIX_FMT_DIVX500 + 'DX50' + Divx 5.0-5.0.2 video elementary stream. + + + V4L2_PIX_FMT_DIVX5 + 'DIV5' + Divx 5.0.3+ video elementary stream. + + + V4L2_PIX_FMT_XVID + 'XVID' + Xvid video elementary stream. + + + V4L2_PIX_FMT_VC1 + 'WMV3' + VC1 simple and main profile video elementary stream. + + + V4L2_PIX_FMT_VC1_AP + 'WVC1' + VC1 advanced profile video elementary stream. + diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index aa6c393..c30981b 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -371,7 +371,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 */ @@ -1146,7 +1159,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 */ @@ -1168,7 +1181,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, @@ -1284,7 +1297,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,