1 From bc36f52a49bbb49b7770b57e32d2ec439a02aaa3 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 246/773] 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 | 165 +++++++++---------
14 .../bcm2835-camera/bcm2835-camera.h | 20 +--
15 .../vc04_services/bcm2835-camera/controls.c | 47 +++--
16 3 files changed, 114 insertions(+), 118 deletions(-)
18 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
19 +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
20 @@ -80,7 +80,7 @@ static struct mmal_fmt formats[] = {
22 .mmal = MMAL_ENCODING_I420,
24 - .mmal_component = MMAL_COMPONENT_CAMERA,
25 + .mmal_component = COMP_CAMERA,
29 @@ -89,7 +89,7 @@ static struct mmal_fmt formats[] = {
31 .mmal = MMAL_ENCODING_YUYV,
33 - .mmal_component = MMAL_COMPONENT_CAMERA,
34 + .mmal_component = COMP_CAMERA,
38 @@ -98,7 +98,7 @@ static struct mmal_fmt formats[] = {
40 .mmal = MMAL_ENCODING_RGB24,
42 - .mmal_component = MMAL_COMPONENT_CAMERA,
43 + .mmal_component = COMP_CAMERA,
47 @@ -107,7 +107,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 @@ -116,7 +116,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 @@ -125,7 +125,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 @@ -134,7 +134,7 @@ static struct mmal_fmt formats[] = {
76 .mmal = MMAL_ENCODING_YVYU,
78 - .mmal_component = MMAL_COMPONENT_CAMERA,
79 + .mmal_component = COMP_CAMERA,
83 @@ -143,7 +143,7 @@ static struct mmal_fmt formats[] = {
85 .mmal = MMAL_ENCODING_VYUY,
87 - .mmal_component = MMAL_COMPONENT_CAMERA,
88 + .mmal_component = COMP_CAMERA,
92 @@ -152,7 +152,7 @@ static struct mmal_fmt formats[] = {
94 .mmal = MMAL_ENCODING_UYVY,
96 - .mmal_component = MMAL_COMPONENT_CAMERA,
97 + .mmal_component = COMP_CAMERA,
101 @@ -161,7 +161,7 @@ static struct mmal_fmt formats[] = {
103 .mmal = MMAL_ENCODING_NV12,
105 - .mmal_component = MMAL_COMPONENT_CAMERA,
106 + .mmal_component = COMP_CAMERA,
110 @@ -170,7 +170,7 @@ static struct mmal_fmt formats[] = {
112 .mmal = MMAL_ENCODING_BGR24,
114 - .mmal_component = MMAL_COMPONENT_CAMERA,
115 + .mmal_component = COMP_CAMERA,
119 @@ -179,7 +179,7 @@ static struct mmal_fmt formats[] = {
121 .mmal = MMAL_ENCODING_YV12,
123 - .mmal_component = MMAL_COMPONENT_CAMERA,
124 + .mmal_component = COMP_CAMERA,
128 @@ -188,7 +188,7 @@ static struct mmal_fmt formats[] = {
130 .mmal = MMAL_ENCODING_NV21,
132 - .mmal_component = MMAL_COMPONENT_CAMERA,
133 + .mmal_component = COMP_CAMERA,
137 @@ -197,7 +197,7 @@ static struct mmal_fmt formats[] = {
139 .mmal = MMAL_ENCODING_BGRA,
141 - .mmal_component = MMAL_COMPONENT_CAMERA,
142 + .mmal_component = COMP_CAMERA,
146 @@ -314,7 +314,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 @@ -439,7 +439,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 @@ -450,7 +450,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 @@ -482,7 +482,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 @@ -490,7 +490,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 @@ -542,7 +542,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 @@ -775,9 +775,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 @@ -790,13 +790,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 @@ -808,14 +808,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 @@ -832,7 +832,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 @@ -853,8 +853,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 @@ -1057,31 +1057,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 @@ -1123,13 +1123,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 @@ -1160,7 +1159,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 @@ -1214,11 +1213,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 @@ -1593,14 +1592,14 @@ static int mmal_init(struct bm2835_mmal_
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) {
368 v4l2_err(&dev->v4l2_dev, "%s: too few camera outputs %d needed %d\n",
369 - __func__, camera->outputs, MMAL_CAMERA_PORT_COUNT);
370 + __func__, camera->outputs, CAM_PORT_COUNT);
374 @@ -1622,7 +1621,7 @@ static int mmal_init(struct bm2835_mmal_
375 dev->rgb_bgr_swapped = true;
376 param_size = sizeof(supported_encodings);
377 ret = vchiq_mmal_port_parameter_get(dev->instance,
378 - &camera->output[MMAL_CAMERA_PORT_CAPTURE],
379 + &camera->output[CAM_PORT_CAPTURE],
380 MMAL_PARAMETER_SUPPORTED_ENCODINGS,
381 &supported_encodings,
383 @@ -1643,7 +1642,7 @@ static int mmal_init(struct bm2835_mmal_
387 - format = &camera->output[MMAL_CAMERA_PORT_PREVIEW].format;
388 + format = &camera->output[CAM_PORT_PREVIEW].format;
390 format->encoding = MMAL_ENCODING_OPAQUE;
391 format->encoding_variant = MMAL_ENCODING_I420;
392 @@ -1657,7 +1656,7 @@ static int mmal_init(struct bm2835_mmal_
393 format->es->video.frame_rate.num = 0; /* Rely on fps_range */
394 format->es->video.frame_rate.den = 1;
396 - format = &camera->output[MMAL_CAMERA_PORT_VIDEO].format;
397 + format = &camera->output[CAM_PORT_VIDEO].format;
399 format->encoding = MMAL_ENCODING_OPAQUE;
400 format->encoding_variant = MMAL_ENCODING_I420;
401 @@ -1671,7 +1670,7 @@ static int mmal_init(struct bm2835_mmal_
402 format->es->video.frame_rate.num = 0; /* Rely on fps_range */
403 format->es->video.frame_rate.den = 1;
405 - format = &camera->output[MMAL_CAMERA_PORT_CAPTURE].format;
406 + format = &camera->output[CAM_PORT_CAPTURE].format;
408 format->encoding = MMAL_ENCODING_OPAQUE;
410 @@ -1695,28 +1694,28 @@ static int mmal_init(struct bm2835_mmal_
411 /* get the preview component ready */
412 ret = vchiq_mmal_component_init(
413 dev->instance, "ril.video_render",
414 - &dev->component[MMAL_COMPONENT_PREVIEW]);
415 + &dev->component[COMP_PREVIEW]);
419 - if (dev->component[MMAL_COMPONENT_PREVIEW]->inputs < 1) {
420 + if (dev->component[COMP_PREVIEW]->inputs < 1) {
422 v4l2_err(&dev->v4l2_dev, "%s: too few input ports %d needed %d\n",
423 - __func__, dev->component[MMAL_COMPONENT_PREVIEW]->inputs, 1);
424 + __func__, dev->component[COMP_PREVIEW]->inputs, 1);
428 /* get the image encoder component ready */
429 ret = vchiq_mmal_component_init(
430 dev->instance, "ril.image_encode",
431 - &dev->component[MMAL_COMPONENT_IMAGE_ENCODE]);
432 + &dev->component[COMP_IMAGE_ENCODE]);
436 - if (dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->inputs < 1) {
437 + if (dev->component[COMP_IMAGE_ENCODE]->inputs < 1) {
439 v4l2_err(&dev->v4l2_dev, "%s: too few input ports %d needed %d\n",
440 - __func__, dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->inputs,
441 + __func__, dev->component[COMP_IMAGE_ENCODE]->inputs,
443 goto unreg_image_encoder;
445 @@ -1724,21 +1723,21 @@ static int mmal_init(struct bm2835_mmal_
446 /* get the video encoder component ready */
447 ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode",
449 - component[MMAL_COMPONENT_VIDEO_ENCODE]);
450 + component[COMP_VIDEO_ENCODE]);
452 goto unreg_image_encoder;
454 - if (dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->inputs < 1) {
455 + if (dev->component[COMP_VIDEO_ENCODE]->inputs < 1) {
457 v4l2_err(&dev->v4l2_dev, "%s: too few input ports %d needed %d\n",
458 - __func__, dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->inputs,
459 + __func__, dev->component[COMP_VIDEO_ENCODE]->inputs,
461 goto unreg_vid_encoder;
465 struct vchiq_mmal_port *encoder_port =
466 - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0];
467 + &dev->component[COMP_VIDEO_ENCODE]->output[0];
468 encoder_port->format.encoding = MMAL_ENCODING_H264;
469 ret = vchiq_mmal_port_set_format(dev->instance,
471 @@ -1749,12 +1748,12 @@ static int mmal_init(struct bm2835_mmal_
473 vchiq_mmal_port_parameter_set(
475 - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->control,
476 + &dev->component[COMP_VIDEO_ENCODE]->control,
477 MMAL_PARAMETER_VIDEO_IMMUTABLE_INPUT,
478 &enable, sizeof(enable));
480 vchiq_mmal_port_parameter_set(dev->instance,
481 - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->control,
482 + &dev->component[COMP_VIDEO_ENCODE]->control,
483 MMAL_PARAMETER_MINIMISE_FRAGMENTATION,
486 @@ -1772,23 +1771,23 @@ unreg_vid_encoder:
487 pr_err("Cleanup: Destroy video encoder\n");
488 vchiq_mmal_component_finalise(
490 - dev->component[MMAL_COMPONENT_VIDEO_ENCODE]);
491 + dev->component[COMP_VIDEO_ENCODE]);
494 pr_err("Cleanup: Destroy image encoder\n");
495 vchiq_mmal_component_finalise(
497 - dev->component[MMAL_COMPONENT_IMAGE_ENCODE]);
498 + dev->component[COMP_IMAGE_ENCODE]);
501 pr_err("Cleanup: Destroy video render\n");
502 vchiq_mmal_component_finalise(dev->instance,
503 - dev->component[MMAL_COMPONENT_PREVIEW]);
504 + dev->component[COMP_PREVIEW]);
507 pr_err("Cleanup: Destroy camera\n");
508 vchiq_mmal_component_finalise(dev->instance,
509 - dev->component[MMAL_COMPONENT_CAMERA]);
510 + dev->component[COMP_CAMERA]);
513 vchiq_mmal_finalise(dev->instance);
514 @@ -1844,21 +1843,21 @@ static void bcm2835_cleanup_instance(str
515 dev->capture.encode_component);
517 vchiq_mmal_component_disable(dev->instance,
518 - dev->component[MMAL_COMPONENT_CAMERA]);
519 + dev->component[COMP_CAMERA]);
521 vchiq_mmal_component_finalise(dev->instance,
523 - component[MMAL_COMPONENT_VIDEO_ENCODE]);
524 + component[COMP_VIDEO_ENCODE]);
526 vchiq_mmal_component_finalise(dev->instance,
528 - component[MMAL_COMPONENT_IMAGE_ENCODE]);
529 + component[COMP_IMAGE_ENCODE]);
531 vchiq_mmal_component_finalise(dev->instance,
532 - dev->component[MMAL_COMPONENT_PREVIEW]);
533 + dev->component[COMP_PREVIEW]);
535 vchiq_mmal_component_finalise(dev->instance,
536 - dev->component[MMAL_COMPONENT_CAMERA]);
537 + dev->component[COMP_CAMERA]);
539 v4l2_ctrl_handler_free(&dev->ctrl_handler);
541 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
542 +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h
544 #define V4L2_CTRL_COUNT 29 /* number of v4l controls */
547 - MMAL_COMPONENT_CAMERA = 0,
548 - MMAL_COMPONENT_PREVIEW,
549 - MMAL_COMPONENT_IMAGE_ENCODE,
550 - MMAL_COMPONENT_VIDEO_ENCODE,
551 - MMAL_COMPONENT_COUNT
560 - MMAL_CAMERA_PORT_PREVIEW = 0,
561 - MMAL_CAMERA_PORT_VIDEO,
562 - MMAL_CAMERA_PORT_CAPTURE,
563 - MMAL_CAMERA_PORT_COUNT
564 + CAM_PORT_PREVIEW = 0,
570 #define PREVIEW_LAYER 2
571 @@ -61,7 +61,7 @@ struct bm2835_mmal_dev {
573 /* allocated mmal instance and components */
574 struct vchiq_mmal_instance *instance;
575 - struct vchiq_mmal_component *component[MMAL_COMPONENT_COUNT];
576 + struct vchiq_mmal_component *component[COMP_COUNT];
577 int camera_use_count;
579 struct v4l2_window overlay;
580 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c
581 +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c
582 @@ -176,7 +176,7 @@ static int ctrl_set_rational(struct bm28
583 struct mmal_parameter_rational rational_value;
584 struct vchiq_mmal_port *control;
586 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
587 + control = &dev->component[COMP_CAMERA]->control;
589 rational_value.num = ctrl->val;
590 rational_value.den = 100;
591 @@ -194,7 +194,7 @@ static int ctrl_set_value(struct bm2835_
593 struct vchiq_mmal_port *control;
595 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
596 + control = &dev->component[COMP_CAMERA]->control;
598 u32_value = ctrl->val;
600 @@ -219,7 +219,7 @@ static int ctrl_set_iso(struct bm2835_mm
601 dev->manual_iso_enabled =
602 (ctrl->val == V4L2_ISO_SENSITIVITY_MANUAL);
604 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
605 + control = &dev->component[COMP_CAMERA]->control;
607 if (dev->manual_iso_enabled)
608 u32_value = dev->iso;
609 @@ -238,7 +238,7 @@ static int ctrl_set_value_ev(struct bm28
611 struct vchiq_mmal_port *control;
613 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
614 + control = &dev->component[COMP_CAMERA]->control;
616 s32_value = (ctrl->val - 12) * 2; /* Convert from index to 1/6ths */
618 @@ -255,7 +255,7 @@ static int ctrl_set_rotate(struct bm2835
620 struct vchiq_mmal_component *camera;
622 - camera = dev->component[MMAL_COMPONENT_CAMERA];
623 + camera = dev->component[COMP_CAMERA];
625 u32_value = ((ctrl->val % 360) / 90) * 90;
627 @@ -291,7 +291,7 @@ static int ctrl_set_flip(struct bm2835_m
629 dev->vflip = ctrl->val;
631 - camera = dev->component[MMAL_COMPONENT_CAMERA];
632 + camera = dev->component[COMP_CAMERA];
634 if (dev->hflip && dev->vflip)
635 u32_value = MMAL_PARAM_MIRROR_BOTH;
636 @@ -330,7 +330,7 @@ static int ctrl_set_exposure(struct bm28
637 struct vchiq_mmal_port *control;
640 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
641 + control = &dev->component[COMP_CAMERA]->control;
643 if (mmal_ctrl->mmal_id == MMAL_PARAMETER_SHUTTER_SPEED) {
644 /* V4L2 is in 100usec increments.
645 @@ -405,7 +405,7 @@ static int ctrl_set_metering_mode(struct
646 struct vchiq_mmal_port *control;
647 u32 u32_value = dev->metering_mode;
649 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
650 + control = &dev->component[COMP_CAMERA]->control;
652 return vchiq_mmal_port_parameter_set(dev->instance, control,
654 @@ -421,7 +421,7 @@ static int ctrl_set_flicker_avoidance(st
656 struct vchiq_mmal_port *control;
658 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
659 + control = &dev->component[COMP_CAMERA]->control;
662 case V4L2_CID_POWER_LINE_FREQUENCY_DISABLED:
663 @@ -450,7 +450,7 @@ static int ctrl_set_awb_mode(struct bm28
665 struct vchiq_mmal_port *control;
667 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
668 + control = &dev->component[COMP_CAMERA]->control;
671 case V4L2_WHITE_BALANCE_MANUAL:
672 @@ -506,7 +506,7 @@ static int ctrl_set_awb_gains(struct bm2
673 struct vchiq_mmal_port *control;
674 struct mmal_parameter_awbgains gains;
676 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
677 + control = &dev->component[COMP_CAMERA]->control;
679 if (ctrl->id == V4L2_CID_RED_BALANCE)
680 dev->red_gain = ctrl->val;
681 @@ -554,7 +554,7 @@ static int ctrl_set_image_effect(struct
682 v4l2_to_mmal_effects_values[i].v;
685 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
686 + control = &dev->component[COMP_CAMERA]->control;
688 ret = vchiq_mmal_port_parameter_set(
689 dev->instance, control,
690 @@ -587,7 +587,7 @@ static int ctrl_set_colfx(struct bm2835_
692 struct vchiq_mmal_port *control;
694 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
695 + control = &dev->component[COMP_CAMERA]->control;
697 dev->colourfx.enable = (ctrl->val & 0xff00) >> 8;
698 dev->colourfx.enable = ctrl->val & 0xff;
699 @@ -613,7 +613,7 @@ static int ctrl_set_bitrate(struct bm283
701 dev->capture.encode_bitrate = ctrl->val;
703 - encoder_out = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0];
704 + encoder_out = &dev->component[COMP_VIDEO_ENCODE]->output[0];
706 ret = vchiq_mmal_port_parameter_set(dev->instance, encoder_out,
708 @@ -629,7 +629,7 @@ static int ctrl_set_bitrate_mode(struct
710 struct vchiq_mmal_port *encoder_out;
712 - encoder_out = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0];
713 + encoder_out = &dev->component[COMP_VIDEO_ENCODE]->output[0];
715 dev->capture.encode_bitrate_mode = ctrl->val;
717 @@ -656,7 +656,7 @@ static int ctrl_set_image_encode_output(
719 struct vchiq_mmal_port *jpeg_out;
721 - jpeg_out = &dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->output[0];
722 + jpeg_out = &dev->component[COMP_IMAGE_ENCODE]->output[0];
724 u32_value = ctrl->val;
726 @@ -672,7 +672,7 @@ static int ctrl_set_video_encode_param_o
728 struct vchiq_mmal_port *vid_enc_ctl;
730 - vid_enc_ctl = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0];
731 + vid_enc_ctl = &dev->component[COMP_VIDEO_ENCODE]->output[0];
733 u32_value = ctrl->val;
735 @@ -785,7 +785,7 @@ static int ctrl_set_video_encode_profile
738 ret = vchiq_mmal_port_parameter_set(dev->instance,
739 - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0],
740 + &dev->component[COMP_VIDEO_ENCODE]->output[0],
742 ¶m, sizeof(param));
744 @@ -803,7 +803,7 @@ static int ctrl_set_scene_mode(struct bm
745 v4l2_dbg(0, bcm2835_v4l2_debug, &dev->v4l2_dev,
746 "scene mode selected %d, was %d\n", ctrl->val,
748 - control = &dev->component[MMAL_COMPONENT_CAMERA]->control;
749 + control = &dev->component[COMP_CAMERA]->control;
751 if (ctrl->val == dev->scene_mode)
753 @@ -1221,18 +1221,15 @@ int set_framerate_params(struct bm2835_m
754 fps_range.fps_high.den);
756 ret = vchiq_mmal_port_parameter_set(dev->instance,
757 - &dev->component[MMAL_COMPONENT_CAMERA]->
758 - output[MMAL_CAMERA_PORT_PREVIEW],
759 + &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW],
760 MMAL_PARAMETER_FPS_RANGE,
761 &fps_range, sizeof(fps_range));
762 ret += vchiq_mmal_port_parameter_set(dev->instance,
763 - &dev->component[MMAL_COMPONENT_CAMERA]->
764 - output[MMAL_CAMERA_PORT_VIDEO],
765 + &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO],
766 MMAL_PARAMETER_FPS_RANGE,
767 &fps_range, sizeof(fps_range));
768 ret += vchiq_mmal_port_parameter_set(dev->instance,
769 - &dev->component[MMAL_COMPONENT_CAMERA]->
770 - output[MMAL_CAMERA_PORT_CAPTURE],
771 + &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE],
772 MMAL_PARAMETER_FPS_RANGE,
773 &fps_range, sizeof(fps_range));