]> err.no Git - linux-2.6/commitdiff
V4L/DVB (4203): Explicitly set the enum values.
authorHans Verkuil <hverkuil@xs4all.nl>
Fri, 23 Jun 2006 18:52:50 +0000 (15:52 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 25 Jun 2006 05:05:24 +0000 (02:05 -0300)
It's better to use explicit enums. It reduces the chance of someone
inserting new enums in the middle which would break things.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
include/linux/videodev2.h
include/media/cx2341x.h

index 260ff6787ad4103d190ca967606510a803166e92..4f428547ec090ac7752d80b86b792538d5d491c3 100644 (file)
@@ -808,12 +808,12 @@ struct v4l2_querymenu
 /*  MPEG streams */
 #define V4L2_CID_MPEG_STREAM_TYPE              (V4L2_CID_MPEG_BASE+0)
 enum v4l2_mpeg_stream_type {
-       V4L2_MPEG_STREAM_TYPE_MPEG2_PS,   /* MPEG-2 program stream */
-       V4L2_MPEG_STREAM_TYPE_MPEG2_TS,   /* MPEG-2 transport stream */
-       V4L2_MPEG_STREAM_TYPE_MPEG1_SS,   /* MPEG-1 system stream */
-       V4L2_MPEG_STREAM_TYPE_MPEG2_DVD /* MPEG-2 DVD-compatible stream */
-       V4L2_MPEG_STREAM_TYPE_MPEG1_VCD /* MPEG-1 VCD-compatible stream */
-       V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD, /* MPEG-2 SVCD-compatible stream */
+       V4L2_MPEG_STREAM_TYPE_MPEG2_PS   = 0, /* MPEG-2 program stream */
+       V4L2_MPEG_STREAM_TYPE_MPEG2_TS   = 1, /* MPEG-2 transport stream */
+       V4L2_MPEG_STREAM_TYPE_MPEG1_SS   = 2, /* MPEG-1 system stream */
+       V4L2_MPEG_STREAM_TYPE_MPEG2_DVD  = 3, /* MPEG-2 DVD-compatible stream */
+       V4L2_MPEG_STREAM_TYPE_MPEG1_VCD  = 4, /* MPEG-1 VCD-compatible stream */
+       V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
 };
 #define V4L2_CID_MPEG_STREAM_PID_PMT           (V4L2_CID_MPEG_BASE+1)
 #define V4L2_CID_MPEG_STREAM_PID_AUDIO                 (V4L2_CID_MPEG_BASE+2)
@@ -825,105 +825,105 @@ enum v4l2_mpeg_stream_type {
 /*  MPEG audio */
 #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ      (V4L2_CID_MPEG_BASE+100)
 enum v4l2_mpeg_audio_sampling_freq {
-       V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100,
-       V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000,
-       V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000,
+       V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
+       V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
+       V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
 };
 #define V4L2_CID_MPEG_AUDIO_ENCODING           (V4L2_CID_MPEG_BASE+101)
 enum v4l2_mpeg_audio_encoding {
-       V4L2_MPEG_AUDIO_ENCODING_LAYER_1,
-       V4L2_MPEG_AUDIO_ENCODING_LAYER_2,
-       V4L2_MPEG_AUDIO_ENCODING_LAYER_3,
+       V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
+       V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
+       V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
 };
 #define V4L2_CID_MPEG_AUDIO_L1_BITRATE                 (V4L2_CID_MPEG_BASE+102)
 enum v4l2_mpeg_audio_l1_bitrate {
-       V4L2_MPEG_AUDIO_L1_BITRATE_32K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_64K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_96K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_128K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_160K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_192K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_224K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_256K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_288K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_320K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_352K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_384K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_416K,
-       V4L2_MPEG_AUDIO_L1_BITRATE_448K,
+       V4L2_MPEG_AUDIO_L1_BITRATE_32K  = 0,
+       V4L2_MPEG_AUDIO_L1_BITRATE_64K  = 1,
+       V4L2_MPEG_AUDIO_L1_BITRATE_96K  = 2,
+       V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
+       V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
+       V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
+       V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
+       V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
+       V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
+       V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
+       V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
+       V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
+       V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
+       V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
 };
 #define V4L2_CID_MPEG_AUDIO_L2_BITRATE                 (V4L2_CID_MPEG_BASE+103)
 enum v4l2_mpeg_audio_l2_bitrate {
-       V4L2_MPEG_AUDIO_L2_BITRATE_32K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_48K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_56K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_64K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_80K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_96K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_112K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_128K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_160K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_192K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_224K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_256K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_320K,
-       V4L2_MPEG_AUDIO_L2_BITRATE_384K,
+       V4L2_MPEG_AUDIO_L2_BITRATE_32K  = 0,
+       V4L2_MPEG_AUDIO_L2_BITRATE_48K  = 1,
+       V4L2_MPEG_AUDIO_L2_BITRATE_56K  = 2,
+       V4L2_MPEG_AUDIO_L2_BITRATE_64K  = 3,
+       V4L2_MPEG_AUDIO_L2_BITRATE_80K  = 4,
+       V4L2_MPEG_AUDIO_L2_BITRATE_96K  = 5,
+       V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
+       V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
+       V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
+       V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
+       V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
+       V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
+       V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
+       V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
 };
 #define V4L2_CID_MPEG_AUDIO_L3_BITRATE                 (V4L2_CID_MPEG_BASE+104)
 enum v4l2_mpeg_audio_l3_bitrate {
-       V4L2_MPEG_AUDIO_L3_BITRATE_32K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_40K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_48K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_56K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_64K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_80K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_96K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_112K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_128K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_160K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_192K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_224K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_256K,
-       V4L2_MPEG_AUDIO_L3_BITRATE_320K,
+       V4L2_MPEG_AUDIO_L3_BITRATE_32K  = 0,
+       V4L2_MPEG_AUDIO_L3_BITRATE_40K  = 1,
+       V4L2_MPEG_AUDIO_L3_BITRATE_48K  = 2,
+       V4L2_MPEG_AUDIO_L3_BITRATE_56K  = 3,
+       V4L2_MPEG_AUDIO_L3_BITRATE_64K  = 4,
+       V4L2_MPEG_AUDIO_L3_BITRATE_80K  = 5,
+       V4L2_MPEG_AUDIO_L3_BITRATE_96K  = 6,
+       V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
+       V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
+       V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
+       V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
+       V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
+       V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
+       V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
 };
 #define V4L2_CID_MPEG_AUDIO_MODE               (V4L2_CID_MPEG_BASE+105)
 enum v4l2_mpeg_audio_mode {
-       V4L2_MPEG_AUDIO_MODE_STEREO,
-       V4L2_MPEG_AUDIO_MODE_JOINT_STEREO,
-       V4L2_MPEG_AUDIO_MODE_DUAL,
-       V4L2_MPEG_AUDIO_MODE_MONO,
+       V4L2_MPEG_AUDIO_MODE_STEREO       = 0,
+       V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
+       V4L2_MPEG_AUDIO_MODE_DUAL         = 2,
+       V4L2_MPEG_AUDIO_MODE_MONO         = 3,
 };
 #define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION     (V4L2_CID_MPEG_BASE+106)
 enum v4l2_mpeg_audio_mode_extension {
-       V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4,
-       V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8,
-       V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12,
-       V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16,
+       V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4  = 0,
+       V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8  = 1,
+       V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
+       V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
 };
 #define V4L2_CID_MPEG_AUDIO_EMPHASIS           (V4L2_CID_MPEG_BASE+107)
 enum v4l2_mpeg_audio_emphasis {
-       V4L2_MPEG_AUDIO_EMPHASIS_NONE,
-       V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS,
-       V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17,
+       V4L2_MPEG_AUDIO_EMPHASIS_NONE         = 0,
+       V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
+       V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17    = 2,
 };
 #define V4L2_CID_MPEG_AUDIO_CRC                (V4L2_CID_MPEG_BASE+108)
 enum v4l2_mpeg_audio_crc {
-       V4L2_MPEG_AUDIO_CRC_NONE,
-       V4L2_MPEG_AUDIO_CRC_CRC16,
+       V4L2_MPEG_AUDIO_CRC_NONE  = 0,
+       V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
 };
 
 /*  MPEG video */
 #define V4L2_CID_MPEG_VIDEO_ENCODING           (V4L2_CID_MPEG_BASE+200)
 enum v4l2_mpeg_video_encoding {
-       V4L2_MPEG_VIDEO_ENCODING_MPEG_1,
-       V4L2_MPEG_VIDEO_ENCODING_MPEG_2,
+       V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
+       V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
 };
 #define V4L2_CID_MPEG_VIDEO_ASPECT             (V4L2_CID_MPEG_BASE+201)
 enum v4l2_mpeg_video_aspect {
-       V4L2_MPEG_VIDEO_ASPECT_1x1,
-       V4L2_MPEG_VIDEO_ASPECT_4x3,
-       V4L2_MPEG_VIDEO_ASPECT_16x9,
-       V4L2_MPEG_VIDEO_ASPECT_221x100,
+       V4L2_MPEG_VIDEO_ASPECT_1x1     = 0,
+       V4L2_MPEG_VIDEO_ASPECT_4x3     = 1,
+       V4L2_MPEG_VIDEO_ASPECT_16x9    = 2,
+       V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
 };
 #define V4L2_CID_MPEG_VIDEO_B_FRAMES           (V4L2_CID_MPEG_BASE+202)
 #define V4L2_CID_MPEG_VIDEO_GOP_SIZE           (V4L2_CID_MPEG_BASE+203)
@@ -931,8 +931,8 @@ enum v4l2_mpeg_video_aspect {
 #define V4L2_CID_MPEG_VIDEO_PULLDOWN           (V4L2_CID_MPEG_BASE+205)
 #define V4L2_CID_MPEG_VIDEO_BITRATE_MODE       (V4L2_CID_MPEG_BASE+206)
 enum v4l2_mpeg_video_bitrate_mode {
-       V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,
-       V4L2_MPEG_VIDEO_BITRATE_MODE_CBR,
+       V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
+       V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
 };
 #define V4L2_CID_MPEG_VIDEO_BITRATE            (V4L2_CID_MPEG_BASE+207)
 #define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK       (V4L2_CID_MPEG_BASE+208)
@@ -942,36 +942,36 @@ enum v4l2_mpeg_video_bitrate_mode {
 #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)
 enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
-       V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL,
-       V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO,
+       V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
+       V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO   = 1,
 };
 #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER             (V4L2_CID_MPEG_CX2341X_BASE+1)
 #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE   (V4L2_CID_MPEG_CX2341X_BASE+2)
 enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
-       V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF,
-       V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR,
-       V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT,
-       V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE,
-       V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE,
+       V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF                  = 0,
+       V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR               = 1,
+       V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT              = 2,
+       V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE      = 3,
+       V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
 };
 #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE         (V4L2_CID_MPEG_CX2341X_BASE+3)
 enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
-       V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF,
-       V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR,
+       V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF    = 0,
+       V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
 };
 #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE       (V4L2_CID_MPEG_CX2341X_BASE+4)
 enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
-       V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL,
-       V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO,
+       V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
+       V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO   = 1,
 };
 #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER            (V4L2_CID_MPEG_CX2341X_BASE+5)
 #define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE                 (V4L2_CID_MPEG_CX2341X_BASE+6)
 enum v4l2_mpeg_cx2341x_video_median_filter_type {
-       V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF,
-       V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR,
-       V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT,
-       V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT,
-       V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG,
+       V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF      = 0,
+       V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR      = 1,
+       V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT     = 2,
+       V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
+       V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG     = 4,
 };
 #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM  (V4L2_CID_MPEG_CX2341X_BASE+7)
 #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP     (V4L2_CID_MPEG_CX2341X_BASE+8)
index fb170d4b5235e9b6c4fac4aa37ede212e5a79028..51fb06b4c3948cafb2c712a6fbd2a6fcfcf0b033 100644 (file)
@@ -20,9 +20,9 @@
 #define CX2341X_H
 
 enum cx2341x_port {
-       CX2341X_PORT_MEMORY,
-       CX2341X_PORT_STREAMING,
-       CX2341X_PORT_SERIAL
+       CX2341X_PORT_MEMORY    = 0,
+       CX2341X_PORT_STREAMING = 1,
+       CX2341X_PORT_SERIAL    = 2
 };
 
 struct cx2341x_mpeg_params {