1 From 2a5b35b90041f190656984ee9299e0edf8e272e2 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Wed, 21 Feb 2018 15:23:35 +0000
4 Subject: [PATCH 397/454] staging: bcm2835-camera: Reduce length of enum names
6 We have numerous lines over 80 chars, or oddly split. Many
7 of these are due to using long enum names such as
9 Reduce the length of these enum names.
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
13 .../bcm2835-camera/bcm2835-camera.c | 163 +++++++++---------
14 .../bcm2835-camera/bcm2835-camera.h | 20 +--
15 .../vc04_services/bcm2835-camera/controls.c | 47 +++--
16 3 files changed, 113 insertions(+), 117 deletions(-)
18 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
19 +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
20 @@ -87,7 +87,7 @@ static struct mmal_fmt formats[] = {
22 .mmal = MMAL_ENCODING_I420,
24 - .mmal_component = MMAL_COMPONENT_CAMERA,
25 + .mmal_component = COMP_CAMERA,
29 @@ -96,7 +96,7 @@ static struct mmal_fmt formats[] = {
31 .mmal = MMAL_ENCODING_YUYV,
33 - .mmal_component = MMAL_COMPONENT_CAMERA,
34 + .mmal_component = COMP_CAMERA,
38 @@ -105,7 +105,7 @@ static struct mmal_fmt formats[] = {
40 .mmal = MMAL_ENCODING_RGB24,
42 - .mmal_component = MMAL_COMPONENT_CAMERA,
43 + .mmal_component = COMP_CAMERA,
47 @@ -114,7 +114,7 @@ static struct mmal_fmt formats[] = {
48 .flags = V4L2_FMT_FLAG_COMPRESSED,
49 .mmal = MMAL_ENCODING_JPEG,
51 - .mmal_component = MMAL_COMPONENT_IMAGE_ENCODE,
52 + .mmal_component = COMP_IMAGE_ENCODE,
56 @@ -123,7 +123,7 @@ static struct mmal_fmt formats[] = {
57 .flags = V4L2_FMT_FLAG_COMPRESSED,
58 .mmal = MMAL_ENCODING_H264,
60 - .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
61 + .mmal_component = COMP_VIDEO_ENCODE,
65 @@ -132,7 +132,7 @@ static struct mmal_fmt formats[] = {
66 .flags = V4L2_FMT_FLAG_COMPRESSED,
67 .mmal = MMAL_ENCODING_MJPEG,
69 - .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE,
70 + .mmal_component = COMP_VIDEO_ENCODE,
74 @@ -141,7 +141,7 @@ static struct mmal_fmt formats[] = {
76 .mmal = MMAL_ENCODING_YVYU,
78 - .mmal_component = MMAL_COMPONENT_CAMERA,
79 + .mmal_component = COMP_CAMERA,
83 @@ -150,7 +150,7 @@ static struct mmal_fmt formats[] = {
85 .mmal = MMAL_ENCODING_VYUY,
87 - .mmal_component = MMAL_COMPONENT_CAMERA,
88 + .mmal_component = COMP_CAMERA,
92 @@ -159,7 +159,7 @@ static struct mmal_fmt formats[] = {
94 .mmal = MMAL_ENCODING_UYVY,
96 - .mmal_component = MMAL_COMPONENT_CAMERA,
97 + .mmal_component = COMP_CAMERA,
101 @@ -168,7 +168,7 @@ static struct mmal_fmt formats[] = {
103 .mmal = MMAL_ENCODING_NV12,
105 - .mmal_component = MMAL_COMPONENT_CAMERA,
106 + .mmal_component = COMP_CAMERA,
110 @@ -177,7 +177,7 @@ static struct mmal_fmt formats[] = {
112 .mmal = MMAL_ENCODING_BGR24,
114 - .mmal_component = MMAL_COMPONENT_CAMERA,
115 + .mmal_component = COMP_CAMERA,
119 @@ -186,7 +186,7 @@ static struct mmal_fmt formats[] = {
121 .mmal = MMAL_ENCODING_YV12,
123 - .mmal_component = MMAL_COMPONENT_CAMERA,
124 + .mmal_component = COMP_CAMERA,
128 @@ -195,7 +195,7 @@ static struct mmal_fmt formats[] = {
130 .mmal = MMAL_ENCODING_NV21,
132 - .mmal_component = MMAL_COMPONENT_CAMERA,
133 + .mmal_component = COMP_CAMERA,
137 @@ -204,7 +204,7 @@ static struct mmal_fmt formats[] = {
139 .mmal = MMAL_ENCODING_BGRA,
141 - .mmal_component = MMAL_COMPONENT_CAMERA,
142 + .mmal_component = COMP_CAMERA,
146 @@ -321,7 +321,7 @@ static inline bool is_capturing(struct b
148 return dev->capture.camera_port ==
150 - component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
151 + component[COMP_CAMERA]->output[CAM_PORT_CAPTURE];
154 static void buffer_cb(struct vchiq_mmal_instance *instance,
155 @@ -443,7 +443,7 @@ static int enable_camera(struct bm2835_m
156 if (!dev->camera_use_count) {
157 ret = vchiq_mmal_port_parameter_set(
159 - &dev->component[MMAL_COMPONENT_CAMERA]->control,
160 + &dev->component[COMP_CAMERA]->control,
161 MMAL_PARAMETER_CAMERA_NUM, &dev->camera_num,
162 sizeof(dev->camera_num));
164 @@ -454,7 +454,7 @@ static int enable_camera(struct bm2835_m
166 ret = vchiq_mmal_component_enable(
168 - dev->component[MMAL_COMPONENT_CAMERA]);
169 + dev->component[COMP_CAMERA]);
171 v4l2_err(&dev->v4l2_dev,
172 "Failed enabling camera, ret %d\n", ret);
173 @@ -486,7 +486,7 @@ static int disable_camera(struct bm2835_
175 vchiq_mmal_component_disable(
177 - dev->component[MMAL_COMPONENT_CAMERA]);
178 + dev->component[COMP_CAMERA]);
180 v4l2_err(&dev->v4l2_dev,
181 "Failed disabling camera, ret %d\n", ret);
182 @@ -494,7 +494,7 @@ static int disable_camera(struct bm2835_
184 vchiq_mmal_port_parameter_set(
186 - &dev->component[MMAL_COMPONENT_CAMERA]->control,
187 + &dev->component[COMP_CAMERA]->control,
188 MMAL_PARAMETER_CAMERA_NUM, &i,
191 @@ -546,7 +546,7 @@ static int start_streaming(struct vb2_qu
192 /* if the preview is not already running, wait for a few frames for AGC
195 - if (!dev->component[MMAL_COMPONENT_PREVIEW]->enabled)
196 + if (!dev->component[COMP_PREVIEW]->enabled)
199 /* enable the connection from camera to encoder (if applicable) */
200 @@ -784,9 +784,9 @@ static int vidioc_s_fmt_vid_overlay(stru
201 vidioc_try_fmt_vid_overlay(file, priv, f);
203 dev->overlay = f->fmt.win;
204 - if (dev->component[MMAL_COMPONENT_PREVIEW]->enabled) {
205 + if (dev->component[COMP_PREVIEW]->enabled) {
206 set_overlay_params(dev,
207 - &dev->component[MMAL_COMPONENT_PREVIEW]->input[0]);
208 + &dev->component[COMP_PREVIEW]->input[0]);
212 @@ -799,13 +799,13 @@ static int vidioc_overlay(struct file *f
213 struct vchiq_mmal_port *src;
214 struct vchiq_mmal_port *dst;
216 - if ((on && dev->component[MMAL_COMPONENT_PREVIEW]->enabled) ||
217 - (!on && !dev->component[MMAL_COMPONENT_PREVIEW]->enabled))
218 + if ((on && dev->component[COMP_PREVIEW]->enabled) ||
219 + (!on && !dev->component[COMP_PREVIEW]->enabled))
220 return 0; /* already in requested state */
223 - &dev->component[MMAL_COMPONENT_CAMERA]->
224 - output[MMAL_CAMERA_PORT_PREVIEW];
225 + &dev->component[COMP_CAMERA]->
226 + output[CAM_PORT_PREVIEW];
229 /* disconnect preview ports and disable component */
230 @@ -817,14 +817,14 @@ static int vidioc_overlay(struct file *f
232 ret = vchiq_mmal_component_disable(
234 - dev->component[MMAL_COMPONENT_PREVIEW]);
235 + dev->component[COMP_PREVIEW]);
241 /* set preview port format and connect it to output */
242 - dst = &dev->component[MMAL_COMPONENT_PREVIEW]->input[0];
243 + dst = &dev->component[COMP_PREVIEW]->input[0];
245 ret = vchiq_mmal_port_set_format(dev->instance, src);
247 @@ -839,7 +839,7 @@ static int vidioc_overlay(struct file *f
249 ret = vchiq_mmal_component_enable(
251 - dev->component[MMAL_COMPONENT_PREVIEW]);
252 + dev->component[COMP_PREVIEW]);
256 @@ -860,8 +860,8 @@ static int vidioc_g_fbuf(struct file *fi
258 struct bm2835_mmal_dev *dev = video_drvdata(file);
259 struct vchiq_mmal_port *preview_port =
260 - &dev->component[MMAL_COMPONENT_CAMERA]->
261 - output[MMAL_CAMERA_PORT_PREVIEW];
262 + &dev->component[COMP_CAMERA]->
263 + output[CAM_PORT_PREVIEW];
265 a->capability = V4L2_FBUF_CAP_EXTERNOVERLAY |
266 V4L2_FBUF_CAP_GLOBAL_ALPHA;
267 @@ -1064,31 +1064,31 @@ static int mmal_setup_components(struct
269 /* format dependent port setup */
270 switch (mfmt->mmal_component) {
271 - case MMAL_COMPONENT_CAMERA:
273 /* Make a further decision on port based on resolution */
274 if (f->fmt.pix.width <= max_video_width
275 && f->fmt.pix.height <= max_video_height)
277 - &dev->component[MMAL_COMPONENT_CAMERA]->
278 - output[MMAL_CAMERA_PORT_VIDEO];
279 + &dev->component[COMP_CAMERA]->
280 + output[CAM_PORT_VIDEO];
283 - &dev->component[MMAL_COMPONENT_CAMERA]->
284 - output[MMAL_CAMERA_PORT_CAPTURE];
285 + &dev->component[COMP_CAMERA]->
286 + output[CAM_PORT_CAPTURE];
288 - case MMAL_COMPONENT_IMAGE_ENCODE:
289 - encode_component = dev->component[MMAL_COMPONENT_IMAGE_ENCODE];
290 - port = &dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->output[0];
291 + case COMP_IMAGE_ENCODE:
292 + encode_component = dev->component[COMP_IMAGE_ENCODE];
293 + port = &dev->component[COMP_IMAGE_ENCODE]->output[0];
295 - &dev->component[MMAL_COMPONENT_CAMERA]->
296 - output[MMAL_CAMERA_PORT_CAPTURE];
297 + &dev->component[COMP_CAMERA]->
298 + output[CAM_PORT_CAPTURE];
300 - case MMAL_COMPONENT_VIDEO_ENCODE:
301 - encode_component = dev->component[MMAL_COMPONENT_VIDEO_ENCODE];
302 - port = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0];
303 + case COMP_VIDEO_ENCODE:
304 + encode_component = dev->component[COMP_VIDEO_ENCODE];
305 + port = &dev->component[COMP_VIDEO_ENCODE]->output[0];
307 - &dev->component[MMAL_COMPONENT_CAMERA]->
308 - output[MMAL_CAMERA_PORT_VIDEO];
309 + &dev->component[COMP_CAMERA]->
310 + output[CAM_PORT_VIDEO];
314 @@ -1130,13 +1130,12 @@ static int mmal_setup_components(struct
318 - &dev->component[MMAL_COMPONENT_CAMERA]->
319 - output[MMAL_CAMERA_PORT_VIDEO]) {
320 + &dev->component[COMP_CAMERA]->
321 + output[CAM_PORT_VIDEO]) {
322 bool overlay_enabled =
323 - !!dev->component[MMAL_COMPONENT_PREVIEW]->enabled;
324 + !!dev->component[COMP_PREVIEW]->enabled;
325 struct vchiq_mmal_port *preview_port =
326 - &dev->component[MMAL_COMPONENT_CAMERA]->
327 - output[MMAL_CAMERA_PORT_PREVIEW];
328 + &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW];
329 /* Preview and encode ports need to match on resolution */
330 if (overlay_enabled) {
331 /* Need to disable the overlay before we can update
332 @@ -1167,7 +1166,7 @@ static int mmal_setup_components(struct
333 ret = vchiq_mmal_port_connect_tunnel(
336 - &dev->component[MMAL_COMPONENT_PREVIEW]->input[0]);
337 + &dev->component[COMP_PREVIEW]->input[0]);
339 ret = vchiq_mmal_port_enable(dev->instance,
341 @@ -1221,11 +1220,11 @@ static int mmal_setup_components(struct
342 port->format.encoding_variant = 0;
343 /* Set any encoding specific parameters */
344 switch (mfmt->mmal_component) {
345 - case MMAL_COMPONENT_VIDEO_ENCODE:
346 + case COMP_VIDEO_ENCODE:
347 port->format.bitrate =
348 dev->capture.encode_bitrate;
350 - case MMAL_COMPONENT_IMAGE_ENCODE:
351 + case COMP_IMAGE_ENCODE:
352 /* Could set EXIF parameters here */
355 @@ -1597,12 +1596,12 @@ static int __init mmal_init(struct bm283
357 /* get the camera component ready */
358 ret = vchiq_mmal_component_init(dev->instance, "ril.camera",
359 - &dev->component[MMAL_COMPONENT_CAMERA]);
360 + &dev->component[COMP_CAMERA]);
364 - camera = dev->component[MMAL_COMPONENT_CAMERA];
365 - if (camera->outputs < MMAL_CAMERA_PORT_COUNT) {
366 + camera = dev->component[COMP_CAMERA];
367 + if (camera->outputs < CAM_PORT_COUNT) {
371 @@ -1621,7 +1620,7 @@ static int __init mmal_init(struct bm283
372 dev->rgb_bgr_swapped = true;
373 param_size = sizeof(supported_encodings);
374 ret = vchiq_mmal_port_parameter_get(dev->instance,
375 - &camera->output[MMAL_CAMERA_PORT_CAPTURE],
376 + &camera->output[CAM_PORT_CAPTURE],
377 MMAL_PARAMETER_SUPPORTED_ENCODINGS,
378 &supported_encodings,
380 @@ -1642,7 +1641,7 @@ static int __init mmal_init(struct bm283
384 - format = &camera->output[MMAL_CAMERA_PORT_PREVIEW].format;
385 + format = &camera->output[CAM_PORT_PREVIEW].format;
387 format->encoding = MMAL_ENCODING_OPAQUE;
388 format->encoding_variant = MMAL_ENCODING_I420;
389 @@ -1656,7 +1655,7 @@ static int __init mmal_init(struct bm283
390 format->es->video.frame_rate.num = 0; /* Rely on fps_range */
391 format->es->video.frame_rate.den = 1;
393 - format = &camera->output[MMAL_CAMERA_PORT_VIDEO].format;
394 + format = &camera->output[CAM_PORT_VIDEO].format;
396 format->encoding = MMAL_ENCODING_OPAQUE;
397 format->encoding_variant = MMAL_ENCODING_I420;
398 @@ -1670,7 +1669,7 @@ static int __init mmal_init(struct bm283
399 format->es->video.frame_rate.num = 0; /* Rely on fps_range */
400 format->es->video.frame_rate.den = 1;
402 - format = &camera->output[MMAL_CAMERA_PORT_CAPTURE].format;
403 + format = &camera->output[CAM_PORT_CAPTURE].format;
405 format->encoding = MMAL_ENCODING_OPAQUE;
407 @@ -1694,28 +1693,28 @@ static int __init mmal_init(struct bm283
408 /* get the preview component ready */
409 ret = vchiq_mmal_component_init(
410 dev->instance, "ril.video_render",
411 - &dev->component[MMAL_COMPONENT_PREVIEW]);
412 + &dev->component[COMP_PREVIEW]);
416 - if (dev->component[MMAL_COMPONENT_PREVIEW]->inputs < 1) {
417 + if (dev->component[COMP_PREVIEW]->inputs < 1) {
419 pr_debug("too few input ports %d needed %d\n",
420 - dev->component[MMAL_COMPONENT_PREVIEW]->inputs, 1);
421 + dev->component[COMP_PREVIEW]->inputs, 1);
425 /* get the image encoder component ready */
426 ret = vchiq_mmal_component_init(
427 dev->instance, "ril.image_encode",
428 - &dev->component[MMAL_COMPONENT_IMAGE_ENCODE]);
429 + &dev->component[COMP_IMAGE_ENCODE]);
433 - if (dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->inputs < 1) {
434 + if (dev->component[COMP_IMAGE_ENCODE]->inputs < 1) {
436 v4l2_err(&dev->v4l2_dev, "too few input ports %d needed %d\n",
437 - dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->inputs,
438 + dev->component[COMP_IMAGE_ENCODE]->inputs,
440 goto unreg_image_encoder;
442 @@ -1723,21 +1722,21 @@ static int __init mmal_init(struct bm283
443 /* get the video encoder component ready */
444 ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode",
446 - component[MMAL_COMPONENT_VIDEO_ENCODE]);
447 + component[COMP_VIDEO_ENCODE]);
449 goto unreg_image_encoder;
451 - if (dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->inputs < 1) {
452 + if (dev->component[COMP_VIDEO_ENCODE]->inputs < 1) {
454 v4l2_err(&dev->v4l2_dev, "too few input ports %d needed %d\n",
455 - dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->inputs,
456 + dev->component[COMP_VIDEO_ENCODE]->inputs,
458 goto unreg_vid_encoder;
462 struct vchiq_mmal_port *encoder_port =
463 - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0];
464 + &dev->component[COMP_VIDEO_ENCODE]->output[0];
465 encoder_port->format.encoding = MMAL_ENCODING_H264;
466 ret = vchiq_mmal_port_set_format(dev->instance,
468 @@ -1748,12 +1747,12 @@ static int __init mmal_init(struct bm283
470 vchiq_mmal_port_parameter_set(
472 - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->control,
473 + &dev->component[COMP_VIDEO_ENCODE]->control,
474 MMAL_PARAMETER_VIDEO_IMMUTABLE_INPUT,
475 &enable, sizeof(enable));
477 vchiq_mmal_port_parameter_set(dev->instance,
478 - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->control,
479 + &dev->component[COMP_VIDEO_ENCODE]->control,
480 MMAL_PARAMETER_MINIMISE_FRAGMENTATION,
483 @@ -1768,23 +1767,23 @@ unreg_vid_encoder:
484 pr_err("Cleanup: Destroy video encoder\n");
485 vchiq_mmal_component_finalise(
487 - dev->component[MMAL_COMPONENT_VIDEO_ENCODE]);
488 + dev->component[COMP_VIDEO_ENCODE]);
491 pr_err("Cleanup: Destroy image encoder\n");
492 vchiq_mmal_component_finalise(
494 - dev->component[MMAL_COMPONENT_IMAGE_ENCODE]);
495 + dev->component[COMP_IMAGE_ENCODE]);
498 pr_err("Cleanup: Destroy video render\n");
499 vchiq_mmal_component_finalise(dev->instance,
500 - dev->component[MMAL_COMPONENT_PREVIEW]);
501 + dev->component[COMP_PREVIEW]);
504 pr_err("Cleanup: Destroy camera\n");
505 vchiq_mmal_component_finalise(dev->instance,
506 - dev->component[MMAL_COMPONENT_CAMERA]);
507 + dev->component[COMP_CAMERA]);
510 vchiq_mmal_finalise(dev->instance);
511 @@ -1840,21 +1839,21 @@ static void bcm2835_cleanup_instance(str
512 dev->capture.encode_component);
514 vchiq_mmal_component_disable(dev->instance,
515 - dev->component[MMAL_COMPONENT_CAMERA]);
516 + dev->component[COMP_CAMERA]);
518 vchiq_mmal_component_finalise(dev->instance,
520 - component[MMAL_COMPONENT_VIDEO_ENCODE]);
521 + component[COMP_VIDEO_ENCODE]);
523 vchiq_mmal_component_finalise(dev->instance,
525 - component[MMAL_COMPONENT_IMAGE_ENCODE]);
526 + component[COMP_IMAGE_ENCODE]);
528 vchiq_mmal_component_finalise(dev->instance,
529 - dev->component[MMAL_COMPONENT_PREVIEW]);
530 + dev->component[COMP_PREVIEW]);
532 vchiq_mmal_component_finalise(dev->instance,
533 - dev->component[MMAL_COMPONENT_CAMERA]);
534 + dev->component[COMP_CAMERA]);
536 v4l2_ctrl_handler_free(&dev->ctrl_handler);
538 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
539 +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
541 #define V4L2_CTRL_COUNT 29 /* number of v4l controls */
544 - MMAL_COMPONENT_CAMERA = 0,
545 - MMAL_COMPONENT_PREVIEW,
546 - MMAL_COMPONENT_IMAGE_ENCODE,
547 - MMAL_COMPONENT_VIDEO_ENCODE,
548 - MMAL_COMPONENT_COUNT
557 - MMAL_CAMERA_PORT_PREVIEW = 0,
558 - MMAL_CAMERA_PORT_VIDEO,
559 - MMAL_CAMERA_PORT_CAPTURE,
560 - MMAL_CAMERA_PORT_COUNT
561 + CAM_PORT_PREVIEW = 0,
567 #define PREVIEW_LAYER 2
568 @@ -64,7 +64,7 @@ struct bm2835_mmal_dev {
570 /* allocated mmal instance and components */
571 struct vchiq_mmal_instance *instance;
572 - struct vchiq_mmal_component *component[MMAL_COMPONENT_COUNT];
573 + struct vchiq_mmal_component *component[COMP_COUNT];
574 int camera_use_count;
576 struct v4l2_window overlay;
577 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c
578 +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c
579 @@ -179,7 +179,7 @@ static int ctrl_set_rational(struct bm28
580 struct mmal_parameter_rational rational_value;
581 struct vchiq_mmal_port *control;
583 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
584 + control = &dev->component[COMP_CAMERA]->control;
586 rational_value.num = ctrl->val;
587 rational_value.den = 100;
588 @@ -197,7 +197,7 @@ static int ctrl_set_value(struct bm2835_
590 struct vchiq_mmal_port *control;
592 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
593 + control = &dev->component[COMP_CAMERA]->control;
595 u32_value = ctrl->val;
597 @@ -222,7 +222,7 @@ static int ctrl_set_iso(struct bm2835_mm
598 dev->manual_iso_enabled =
599 (ctrl->val == V4L2_ISO_SENSITIVITY_MANUAL);
601 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
602 + control = &dev->component[COMP_CAMERA]->control;
604 if (dev->manual_iso_enabled)
605 u32_value = dev->iso;
606 @@ -241,7 +241,7 @@ static int ctrl_set_value_ev(struct bm28
608 struct vchiq_mmal_port *control;
610 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
611 + control = &dev->component[COMP_CAMERA]->control;
613 s32_value = (ctrl->val - 12) * 2; /* Convert from index to 1/6ths */
615 @@ -258,7 +258,7 @@ static int ctrl_set_rotate(struct bm2835
617 struct vchiq_mmal_component *camera;
619 - camera = dev->component[MMAL_COMPONENT_CAMERA];
620 + camera = dev->component[COMP_CAMERA];
622 u32_value = ((ctrl->val % 360) / 90) * 90;
624 @@ -294,7 +294,7 @@ static int ctrl_set_flip(struct bm2835_m
626 dev->vflip = ctrl->val;
628 - camera = dev->component[MMAL_COMPONENT_CAMERA];
629 + camera = dev->component[COMP_CAMERA];
631 if (dev->hflip && dev->vflip)
632 u32_value = MMAL_PARAM_MIRROR_BOTH;
633 @@ -333,7 +333,7 @@ static int ctrl_set_exposure(struct bm28
634 struct vchiq_mmal_port *control;
637 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
638 + control = &dev->component[COMP_CAMERA]->control;
640 if (mmal_ctrl->mmal_id == MMAL_PARAMETER_SHUTTER_SPEED) {
641 /* V4L2 is in 100usec increments.
642 @@ -408,7 +408,7 @@ static int ctrl_set_metering_mode(struct
643 struct vchiq_mmal_port *control;
644 u32 u32_value = dev->metering_mode;
646 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
647 + control = &dev->component[COMP_CAMERA]->control;
649 return vchiq_mmal_port_parameter_set(dev->instance, control,
651 @@ -424,7 +424,7 @@ static int ctrl_set_flicker_avoidance(st
653 struct vchiq_mmal_port *control;
655 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
656 + control = &dev->component[COMP_CAMERA]->control;
659 case V4L2_CID_POWER_LINE_FREQUENCY_DISABLED:
660 @@ -453,7 +453,7 @@ static int ctrl_set_awb_mode(struct bm28
662 struct vchiq_mmal_port *control;
664 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
665 + control = &dev->component[COMP_CAMERA]->control;
668 case V4L2_WHITE_BALANCE_MANUAL:
669 @@ -509,7 +509,7 @@ static int ctrl_set_awb_gains(struct bm2
670 struct vchiq_mmal_port *control;
671 struct mmal_parameter_awbgains gains;
673 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
674 + control = &dev->component[COMP_CAMERA]->control;
676 if (ctrl->id == V4L2_CID_RED_BALANCE)
677 dev->red_gain = ctrl->val;
678 @@ -557,7 +557,7 @@ static int ctrl_set_image_effect(struct
679 v4l2_to_mmal_effects_values[i].v;
682 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
683 + control = &dev->component[COMP_CAMERA]->control;
685 ret = vchiq_mmal_port_parameter_set(
686 dev->instance, control,
687 @@ -590,7 +590,7 @@ static int ctrl_set_colfx(struct bm2835_
689 struct vchiq_mmal_port *control;
691 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
692 + control = &dev->component[COMP_CAMERA]->control;
694 dev->colourfx.enable = (ctrl->val & 0xff00) >> 8;
695 dev->colourfx.enable = ctrl->val & 0xff;
696 @@ -616,7 +616,7 @@ static int ctrl_set_bitrate(struct bm283
698 dev->capture.encode_bitrate = ctrl->val;
700 - encoder_out = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0];
701 + encoder_out = &dev->component[COMP_VIDEO_ENCODE]->output[0];
703 ret = vchiq_mmal_port_parameter_set(dev->instance, encoder_out,
705 @@ -632,7 +632,7 @@ static int ctrl_set_bitrate_mode(struct
707 struct vchiq_mmal_port *encoder_out;
709 - encoder_out = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0];
710 + encoder_out = &dev->component[COMP_VIDEO_ENCODE]->output[0];
712 dev->capture.encode_bitrate_mode = ctrl->val;
714 @@ -659,7 +659,7 @@ static int ctrl_set_image_encode_output(
716 struct vchiq_mmal_port *jpeg_out;
718 - jpeg_out = &dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->output[0];
719 + jpeg_out = &dev->component[COMP_IMAGE_ENCODE]->output[0];
721 u32_value = ctrl->val;
723 @@ -675,7 +675,7 @@ static int ctrl_set_video_encode_param_o
725 struct vchiq_mmal_port *vid_enc_ctl;
727 - vid_enc_ctl = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0];
728 + vid_enc_ctl = &dev->component[COMP_VIDEO_ENCODE]->output[0];
730 u32_value = ctrl->val;
732 @@ -788,7 +788,7 @@ static int ctrl_set_video_encode_profile
735 ret = vchiq_mmal_port_parameter_set(dev->instance,
736 - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0],
737 + &dev->component[COMP_VIDEO_ENCODE]->output[0],
739 ¶m, sizeof(param));
741 @@ -806,7 +806,7 @@ static int ctrl_set_scene_mode(struct bm
742 v4l2_dbg(0, bcm2835_v4l2_debug, &dev->v4l2_dev,
743 "scene mode selected %d, was %d\n", ctrl->val,
745 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
746 + control = &dev->component[COMP_CAMERA]->control;
748 if (ctrl->val == dev->scene_mode)
750 @@ -1224,18 +1224,15 @@ int set_framerate_params(struct bm2835_m
751 fps_range.fps_high.den);
753 ret = vchiq_mmal_port_parameter_set(dev->instance,
754 - &dev->component[MMAL_COMPONENT_CAMERA]->
755 - output[MMAL_CAMERA_PORT_PREVIEW],
756 + &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW],
757 MMAL_PARAMETER_FPS_RANGE,
758 &fps_range, sizeof(fps_range));
759 ret += vchiq_mmal_port_parameter_set(dev->instance,
760 - &dev->component[MMAL_COMPONENT_CAMERA]->
761 - output[MMAL_CAMERA_PORT_VIDEO],
762 + &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO],
763 MMAL_PARAMETER_FPS_RANGE,
764 &fps_range, sizeof(fps_range));
765 ret += vchiq_mmal_port_parameter_set(dev->instance,
766 - &dev->component[MMAL_COMPONENT_CAMERA]->
767 - output[MMAL_CAMERA_PORT_CAPTURE],
768 + &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE],
769 MMAL_PARAMETER_FPS_RANGE,
770 &fps_range, sizeof(fps_range));