hardware: exynos5: update libv4l2 dir
[GitHub/LineageOS/android_hardware_samsung_slsi_exynos5.git] / libv4l2 / exynos_v4l2.c
1 /*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 /*!
18 * \file exynos_v4l2.c
19 * \brief source file for libv4l2
20 * \author Jinsung Yang (jsgood.yang@samsung.com)
21 * \author Sangwoo Park (sw5771.park@samsung.com)
22 * \date 2012/01/17
23 *
24 * <b>Revision History: </b>
25 * - 2012/01/17: Jinsung Yang (jsgood.yang@samsung.com) \n
26 * Initial version
27 *
28 */
29
30 #include <stdio.h>
31 #include <errno.h>
32 #include <stdarg.h>
33 #include <fcntl.h>
34 #include <string.h>
35 #include <sys/types.h>
36 #include <sys/ioctl.h>
37 #include <sys/stat.h>
38
39 #include "exynos_v4l2.h"
40
41 //#define LOG_NDEBUG 0
42 #define LOG_TAG "libexynosv4l2"
43 #include <utils/Log.h>
44 #include "Exynos_log.h"
45
46 #define VIDEODEV_MINOR_MAX 63
47
48 //#define EXYNOS_V4L2_TRACE 0
49 #ifdef EXYNOS_V4L2_TRACE
50 #define Exynos_v4l2_In() Exynos_Log(EXYNOS_DEV_LOG_DEBUG, LOG_TAG, "%s In , Line: %d", __FUNCTION__, __LINE__)
51 #define Exynos_v4l2_Out() Exynos_Log(EXYNOS_DEV_LOG_DEBUG, LOG_TAG, "%s Out , Line: %d", __FUNCTION__, __LINE__)
52 #else
53 #define Exynos_v4l2_In() ((void *)0)
54 #define Exynos_v4l2_Out() ((void *)0)
55 #endif
56
57 static bool __v4l2_check_buf_type(enum v4l2_buf_type type)
58 {
59 bool supported;
60
61 switch (type) {
62 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
63 case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
64 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
65 case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
66 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
67 supported = true;
68 break;
69
70 default:
71 supported = (type >= V4L2_BUF_TYPE_PRIVATE) ? true : false;
72 break;
73 }
74
75 return supported;
76 }
77
78 static int __v4l2_open(const char *filename, int oflag, va_list ap)
79 {
80 mode_t mode = 0;
81 int fd;
82
83 if (oflag & O_CREAT)
84 mode = va_arg(ap, int);
85
86 fd = open(filename, oflag, mode);
87
88 return fd;
89 }
90
91 int exynos_v4l2_open(const char *filename, int oflag, ...)
92 {
93 va_list ap;
94 int fd;
95
96 Exynos_v4l2_In();
97
98 va_start(ap, oflag);
99 fd = __v4l2_open(filename, oflag, ap);
100 va_end(ap);
101
102 Exynos_v4l2_Out();
103
104 return fd;
105 }
106
107 int exynos_v4l2_open_devname(const char *devname, int oflag, ...)
108 {
109 bool found = false;
110 int fd = -1;
111 struct stat s;
112 va_list ap;
113 FILE *stream_fd;
114 char filename[64], name[64];
115 int minor, size, i = 0;
116
117 Exynos_v4l2_In();
118
119 do {
120 if (i > VIDEODEV_MINOR_MAX)
121 break;
122
123 /* video device node */
124 sprintf(filename, "/dev/video%d", i++);
125
126 /* if the node is video device */
127 if ((lstat(filename, &s) == 0) && S_ISCHR(s.st_mode) &&
128 ((int)((unsigned short)(s.st_rdev) >> 8) == 81)) {
129 minor = (int)((unsigned short)(s.st_rdev & 0x3f));
130 ALOGD("try node: %s, minor: %d", filename, minor);
131 /* open sysfs entry */
132 sprintf(filename, "/sys/class/video4linux/video%d/name", minor);
133 stream_fd = fopen(filename, "r");
134 if (stream_fd == NULL) {
135 ALOGE("failed to open sysfs entry for videodev");
136 continue; /* try next */
137 }
138
139 /* read sysfs entry for device name */
140 size = (int)fgets(name, sizeof(name), stream_fd);
141 fclose(stream_fd);
142
143 /* check read size */
144 if (size == 0) {
145 ALOGE("failed to read sysfs entry for videodev");
146 } else {
147 /* matched */
148 if (strncmp(name, devname, strlen(devname)) == 0) {
149 ALOGI("node found for device %s: /dev/video%d", devname, minor);
150 found = true;
151 }
152 }
153 }
154 } while (found == false);
155
156 if (found) {
157 sprintf(filename, "/dev/video%d", minor);
158 va_start(ap, oflag);
159 fd = __v4l2_open(filename, oflag, ap);
160 va_end(ap);
161
162 if (fd > 0)
163 ALOGI("open video device %s", filename);
164 else
165 ALOGE("failed to open video device %s", filename);
166 } else {
167 ALOGE("no video device found");
168 }
169
170 Exynos_v4l2_Out();
171
172 return fd;
173 }
174
175 int exynos_v4l2_close(int fd)
176 {
177 int ret = -1;
178
179 Exynos_v4l2_In();
180
181 if (fd < 0)
182 ALOGE("%s: invalid fd: %d", __func__, fd);
183 else
184 ret = close(fd);
185
186 Exynos_v4l2_Out();
187
188 return ret;
189 }
190
191 bool exynos_v4l2_enuminput(int fd, int index, char *input_name_buf)
192 {
193 int ret = -1;
194 struct v4l2_input input;
195
196 Exynos_v4l2_In();
197
198 if (fd < 0) {
199 ALOGE("%s: invalid fd: %d", __func__, fd);
200 return NULL;
201 }
202
203 input.index = index;
204 ret = ioctl(fd, VIDIOC_ENUMINPUT, &input);
205 if (ret) {
206 ALOGE("%s: no matching index founds", __func__);
207 return false;
208 }
209
210 ALOGI("Name of input channel[%d] is %s", input.index, input.name);
211
212 strcpy(input_name_buf, (const char *)input.name);
213
214 Exynos_v4l2_Out();
215
216 return true;
217 }
218
219 int exynos_v4l2_s_input(int fd, int index)
220 {
221 int ret = -1;
222 struct v4l2_input input;
223
224 Exynos_v4l2_In();
225
226 if (fd < 0) {
227 ALOGE("%s: invalid fd: %d", __func__, fd);
228 return ret;
229 }
230
231 input.index = index;
232
233 ret = ioctl(fd, VIDIOC_S_INPUT, &input);
234 if (ret){
235 ALOGE("failed to ioctl: VIDIOC_S_INPUT (%d)", ret);
236 return ret;
237 }
238
239 Exynos_v4l2_Out();
240
241 return ret;
242 }
243
244 bool exynos_v4l2_querycap(int fd, unsigned int need_caps)
245 {
246 struct v4l2_capability cap;
247 int ret;
248
249 Exynos_v4l2_In();
250
251 if (fd < 0) {
252 ALOGE("%s: invalid fd: %d", __func__, fd);
253 return false;
254 }
255
256 if (!(need_caps & V4L2_CAP_VIDEO_CAPTURE) &&
257 !(need_caps & V4L2_CAP_VIDEO_CAPTURE_MPLANE) &&
258 !(need_caps & V4L2_CAP_VIDEO_OUTPUT) &&
259 !(need_caps & V4L2_CAP_VIDEO_OUTPUT_MPLANE) &&
260 !(need_caps & V4L2_CAP_VIDEO_OVERLAY)) {
261 ALOGE("%s: unsupported capabilities", __func__);
262 return false;
263 }
264
265 memset(&cap, 0, sizeof(cap));
266
267 ret = ioctl(fd, VIDIOC_QUERYCAP, &cap);
268 if (ret) {
269 ALOGE("failed to ioctl: VIDIOC_QUERYCAP (%d)", ret);
270 return false;
271 }
272
273 if ((need_caps & cap.capabilities) != need_caps) {
274 ALOGE("%s: unsupported capabilities", __func__);
275 return false;
276 }
277
278 Exynos_v4l2_Out();
279
280 return true;
281 }
282
283 bool exynos_v4l2_enum_fmt(int fd, enum v4l2_buf_type type, unsigned int fmt)
284 {
285 struct v4l2_fmtdesc fmtdesc;
286 int found = 0;
287
288 Exynos_v4l2_In();
289
290 fmtdesc.type = type;
291 fmtdesc.index = 0;
292
293 while (ioctl(fd, VIDIOC_ENUM_FMT, &fmtdesc) == 0) {
294 if (fmtdesc.pixelformat == fmt) {
295 ALOGE("Passed fmt = %#x found pixel format[%d]: %s", fmt, fmtdesc.index, fmtdesc.description);
296 found = 1;
297 break;
298 }
299
300 fmtdesc.index++;
301 }
302
303 if (!found) {
304 ALOGE("%s: unsupported pixel format", __func__);
305 return false;
306 }
307
308 Exynos_v4l2_Out();
309
310 return true;
311 }
312
313 int exynos_v4l2_g_fmt(int fd, struct v4l2_format *fmt)
314 {
315 int ret = -1;
316
317 Exynos_v4l2_In();
318
319 if (fd < 0) {
320 ALOGE("%s: invalid fd: %d", __func__, fd);
321 return ret;
322 }
323
324 if (!fmt) {
325 ALOGE("%s: fmt is NULL", __func__);
326 return ret;
327 }
328
329 if (__v4l2_check_buf_type(fmt->type) == false) {
330 ALOGE("%s: unsupported buffer type", __func__);
331 return ret;
332 }
333
334 ret = ioctl(fd, VIDIOC_G_FMT, fmt);
335 if (ret) {
336 ALOGE("failed to ioctl: VIDIOC_G_FMT");
337 return ret;
338 }
339
340 Exynos_v4l2_Out();
341
342 return ret;
343 }
344
345 static int __v4l2_s_fmt(int fd, unsigned int request, struct v4l2_format *fmt)
346 {
347 int ret = -1;
348
349 Exynos_v4l2_In();
350
351 if (fd < 0) {
352 ALOGE("%s: invalid fd: %d", __func__, fd);
353 return ret;
354 }
355
356 if (!fmt) {
357 ALOGE("%s: fmt is NULL", __func__);
358 return ret;
359 }
360
361 if (__v4l2_check_buf_type(fmt->type) == false) {
362 ALOGE("%s: unsupported buffer type", __func__);
363 return ret;
364 } else {
365 ret = ioctl(fd, request, fmt);
366 if (ret) {
367 if (request == VIDIOC_TRY_FMT)
368 ALOGE("failed to ioctl: VIDIOC_TRY_FMT (%d)", ret);
369 else
370 ALOGE("failed to ioctl: VIDIOC_S_FMT (%d)", ret);
371
372 return ret;
373 }
374 }
375
376 Exynos_v4l2_Out();
377
378 return ret;
379 }
380
381 int exynos_v4l2_try_fmt(int fd, struct v4l2_format *fmt)
382 {
383 return __v4l2_s_fmt(fd, VIDIOC_TRY_FMT, fmt);
384 }
385
386 int exynos_v4l2_s_fmt(int fd, struct v4l2_format *fmt)
387 {
388 return __v4l2_s_fmt(fd, VIDIOC_S_FMT, fmt);
389 }
390
391 int exynos_v4l2_reqbufs(int fd, struct v4l2_requestbuffers *req)
392 {
393 int ret = -1;
394 unsigned int count;
395
396 Exynos_v4l2_In();
397
398 if (fd < 0) {
399 ALOGE("%s: invalid fd: %d", __func__, fd);
400 return ret;
401 }
402
403 if (!req) {
404 ALOGE("%s: req is NULL", __func__);
405 return ret;
406 }
407
408 if ((req->memory != V4L2_MEMORY_MMAP) && (req->memory != V4L2_MEMORY_USERPTR)) {
409 ALOGE("%s: unsupported memory type", __func__);
410 return ret;
411 }
412
413 if (__v4l2_check_buf_type(req->type) == false) {
414 ALOGE("%s: unsupported buffer type", __func__);
415 return ret;
416 }
417
418 count = req->count;
419
420 ret = ioctl(fd, VIDIOC_REQBUFS, req);
421 if (ret) {
422 ALOGE("failed to ioctl: VIDIOC_REQBUFS (%d)", ret);
423 return ret;
424 }
425
426 if (count != req->count) {
427 ALOGW("number of buffers had been changed: %d => %d", count, req->count);
428 }
429
430 Exynos_v4l2_Out();
431
432 return ret;
433 }
434
435 int exynos_v4l2_querybuf(int fd, struct v4l2_buffer *buf)
436 {
437 int ret = -1;
438
439 Exynos_v4l2_In();
440
441 if (fd < 0) {
442 ALOGE("%s: invalid fd: %d", __func__, fd);
443 return ret;
444 }
445
446 if (!buf) {
447 ALOGE("%s: buf is NULL", __func__);
448 return ret;
449 }
450
451 if (buf->memory != V4L2_MEMORY_MMAP) {
452 ALOGE("%s: unsupported memory type", __func__);
453 return ret;
454 }
455
456 if (__v4l2_check_buf_type(buf->type) == false) {
457 ALOGE("%s: unsupported buffer type", __func__);
458 return ret;
459 }
460
461 ret = ioctl(fd, VIDIOC_QUERYBUF, buf);
462 if (ret) {
463 ALOGE("failed to ioctl: VIDIOC_QUERYBUF (%d)", ret);
464 return ret;
465 }
466
467 Exynos_v4l2_Out();
468
469 return ret;
470 }
471
472 int exynos_v4l2_qbuf(int fd, struct v4l2_buffer *buf)
473 {
474 int ret = -1;
475
476 Exynos_v4l2_In();
477
478 if (fd < 0) {
479 ALOGE("%s: invalid fd: %d", __func__, fd);
480 return ret;
481 }
482
483 if (!buf) {
484 ALOGE("%s: buf is NULL", __func__);
485 return ret;
486 }
487
488 if ((buf->memory != V4L2_MEMORY_MMAP) && (buf->memory != V4L2_MEMORY_USERPTR)) {
489 ALOGE("%s: unsupported memory type", __func__);
490 return ret;
491 }
492
493 if (__v4l2_check_buf_type(buf->type) == false) {
494 ALOGE("%s: unsupported buffer type", __func__);
495 return ret;
496 }
497
498 ret = ioctl(fd, VIDIOC_QBUF, buf);
499 if (ret) {
500 ALOGE("failed to ioctl: VIDIOC_QBUF (%d)", ret);
501 return ret;
502 }
503
504 Exynos_v4l2_Out();
505
506 return ret;
507 }
508
509 int exynos_v4l2_dqbuf(int fd, struct v4l2_buffer *buf)
510 {
511 int ret = -1;
512
513 Exynos_v4l2_In();
514
515 if (fd < 0) {
516 ALOGE("%s: invalid fd: %d", __func__, fd);
517 return ret;
518 }
519
520 if (!buf) {
521 ALOGE("%s: buf is NULL", __func__);
522 return ret;
523 }
524
525 if ((buf->memory != V4L2_MEMORY_MMAP) && (buf->memory != V4L2_MEMORY_USERPTR)) {
526 ALOGE("%s: unsupported memory type", __func__);
527 return ret;
528 }
529
530 if (__v4l2_check_buf_type(buf->type) == false) {
531 ALOGE("%s: unsupported buffer type", __func__);
532 return ret;
533 }
534
535 ret = ioctl(fd, VIDIOC_DQBUF, buf);
536 if (ret) {
537 ALOGE("failed to ioctl: VIDIOC_DQBUF (%d)", ret);
538 return ret;
539 }
540
541 Exynos_v4l2_Out();
542
543 return ret;
544 }
545
546 int exynos_v4l2_streamon(int fd, enum v4l2_buf_type type)
547 {
548 int ret = -1;
549
550 Exynos_v4l2_In();
551
552 if (fd < 0) {
553 ALOGE("%s: invalid fd: %d", __func__, fd);
554 return ret;
555 }
556
557 if (__v4l2_check_buf_type(type) == false) {
558 ALOGE("%s: unsupported buffer type", __func__);
559 return ret;
560 }
561
562 ret = ioctl(fd, VIDIOC_STREAMON, &type);
563 if (ret) {
564 ALOGE("failed to ioctl: VIDIOC_STREAMON (%d)", ret);
565 return ret;
566 }
567
568 Exynos_v4l2_Out();
569
570 return ret;
571 }
572
573 int exynos_v4l2_streamoff(int fd, enum v4l2_buf_type type)
574 {
575 int ret = -1;
576
577 Exynos_v4l2_In();
578
579 if (fd < 0) {
580 ALOGE("%s: invalid fd: %d", __func__, fd);
581 return ret;
582 }
583
584 if (__v4l2_check_buf_type(type) == false) {
585 ALOGE("%s: unsupported buffer type", __func__);
586 return ret;
587 }
588
589 ret = ioctl(fd, VIDIOC_STREAMOFF, &type);
590 if (ret) {
591 ALOGE("failed to ioctl: VIDIOC_STREAMOFF (%d)", ret);
592 return ret;
593 }
594
595 Exynos_v4l2_Out();
596
597 return ret;
598 }
599
600 int exynos_v4l2_cropcap(int fd, struct v4l2_cropcap *crop)
601 {
602 int ret = -1;
603
604 Exynos_v4l2_In();
605
606 if (fd < 0) {
607 ALOGE("%s: invalid fd: %d", __func__, fd);
608 return ret;
609 }
610
611 if (!crop) {
612 ALOGE("%s: crop is NULL", __func__);
613 return ret;
614 }
615
616 if (__v4l2_check_buf_type(crop->type) == false) {
617 ALOGE("%s: unsupported buffer type", __func__);
618 return ret;
619 }
620
621 ret = ioctl(fd, VIDIOC_CROPCAP, crop);
622 if (ret) {
623 ALOGE("failed to ioctl: VIDIOC_CROPCAP (%d)", ret);
624 return ret;
625 }
626
627 Exynos_v4l2_Out();
628
629 return ret;
630 }
631
632 int exynos_v4l2_g_crop(int fd, struct v4l2_crop *crop)
633 {
634 int ret = -1;
635
636 Exynos_v4l2_In();
637
638 if (fd < 0) {
639 ALOGE("%s: invalid fd: %d", __func__, fd);
640 return ret;
641 }
642
643 if (!crop) {
644 ALOGE("%s: crop is NULL", __func__);
645 return ret;
646 }
647
648 if (__v4l2_check_buf_type(crop->type) == false) {
649 ALOGE("%s: unsupported buffer type", __func__);
650 return ret;
651 }
652
653 ret = ioctl(fd, VIDIOC_G_CROP, crop);
654 if (ret) {
655 ALOGE("failed to ioctl: VIDIOC_G_CROP (%d)", ret);
656 return ret;
657 }
658
659 Exynos_v4l2_Out();
660
661 return ret;
662 }
663
664 int exynos_v4l2_s_crop(int fd, struct v4l2_crop *crop)
665 {
666 int ret = -1;
667
668 Exynos_v4l2_In();
669
670 if (fd < 0) {
671 ALOGE("%s: invalid fd: %d", __func__, fd);
672 return ret;
673 }
674
675 if (!crop) {
676 ALOGE("%s: crop is NULL", __func__);
677 return ret;
678 }
679
680 if (__v4l2_check_buf_type(crop->type) == false) {
681 ALOGE("%s: unsupported buffer type", __func__);
682 return ret;
683 }
684
685 ret = ioctl(fd, VIDIOC_S_CROP, crop);
686 if (ret) {
687 ALOGE("failed to ioctl: VIDIOC_S_CROP (%d)", ret);
688 return ret;
689 }
690
691 Exynos_v4l2_Out();
692
693 return ret;
694 }
695
696 int exynos_v4l2_g_ctrl(int fd, unsigned int id, int *value)
697 {
698 int ret = -1;
699 struct v4l2_control ctrl;
700
701 Exynos_v4l2_In();
702
703 ctrl.id = id;
704
705 if (fd < 0) {
706 ALOGE("%s: invalid fd: %d", __func__, fd);
707 return ret;
708 }
709
710 ret = ioctl(fd, VIDIOC_G_CTRL, &ctrl);
711 if (ret) {
712 ALOGE("failed to ioctl: VIDIOC_G_CTRL (%d)", ret);
713 return ret;
714 }
715
716 *value = ctrl.value;
717
718 Exynos_v4l2_Out();
719
720 return ret;
721 }
722
723 int exynos_v4l2_s_ctrl(int fd, unsigned int id, int value)
724 {
725 int ret = -1;
726 struct v4l2_control ctrl;
727
728 Exynos_v4l2_In();
729
730 ctrl.id = id;
731 ctrl.value = value;
732
733 if (fd < 0) {
734 ALOGE("%s: invalid fd: %d", __func__, fd);
735 return ret;
736 }
737
738 ret = ioctl(fd, VIDIOC_S_CTRL, &ctrl);
739 if (ret) {
740 ALOGE("failed to ioctl: VIDIOC_S_CTRL (%d)", ret);
741 return ret;
742 }
743
744 Exynos_v4l2_Out();
745
746 return ret;
747 }
748
749 int exynos_v4l2_g_parm(int fd, struct v4l2_streamparm *streamparm)
750 {
751 int ret = -1;
752
753 Exynos_v4l2_In();
754
755 if (fd < 0) {
756 ALOGE("%s: invalid fd: %d", __func__, fd);
757 return ret;
758 }
759
760 if (__v4l2_check_buf_type(streamparm->type) == false) {
761 ALOGE("%s: unsupported buffer type", __func__);
762 return ret;
763 }
764
765 ret = ioctl(fd, VIDIOC_G_PARM, streamparm);
766 if (ret) {
767 ALOGE("failed to ioctl: VIDIOC_G_PARM (%d)", ret);
768 return ret;
769 }
770
771 Exynos_v4l2_Out();
772
773 return ret;
774 }
775
776 int exynos_v4l2_s_parm(int fd, struct v4l2_streamparm *streamparm)
777 {
778 int ret = -1;
779
780 Exynos_v4l2_In();
781
782 if (fd < 0) {
783 ALOGE("%s: invalid fd: %d", __func__, fd);
784 return ret;
785 }
786
787 if (__v4l2_check_buf_type(streamparm->type) == false) {
788 ALOGE("%s: unsupported buffer type", __func__);
789 return ret;
790 }
791
792 ret = ioctl(fd, VIDIOC_S_PARM, streamparm);
793 if (ret) {
794 ALOGE("failed to ioctl: VIDIOC_S_PARM (%d)", ret);
795 return ret;
796 }
797
798 Exynos_v4l2_Out();
799
800 return ret;
801 }
802
803 int exynos_v4l2_g_ext_ctrl(int fd, struct v4l2_ext_controls *ctrl)
804 {
805 int ret = -1;
806
807 Exynos_v4l2_In();
808
809 if (fd < 0) {
810 ALOGE("%s: invalid fd: %d", __func__, fd);
811 return ret;
812 }
813
814 if (ctrl == NULL) {
815 ALOGE("%s: ctrl is NULL", __func__);
816 return ret;
817 }
818
819 ret = ioctl(fd, VIDIOC_G_EXT_CTRLS, ctrl);
820 if (ret)
821 ALOGE("failed to ioctl: VIDIOC_G_EXT_CTRLS (%d)", ret);
822
823 Exynos_v4l2_Out();
824
825 return ret;
826 }
827
828 int exynos_v4l2_s_ext_ctrl(int fd, struct v4l2_ext_controls *ctrl)
829 {
830 int ret = -1;
831
832 Exynos_v4l2_In();
833
834 if (fd < 0) {
835 ALOGE("%s: invalid fd: %d", __func__, fd);
836 return ret;
837 }
838
839 if (ctrl == NULL) {
840 ALOGE("%s: ctrl is NULL", __func__);
841 return ret;
842 }
843
844 ret = ioctl(fd, VIDIOC_S_EXT_CTRLS, ctrl);
845 if (ret)
846 ALOGE("failed to ioctl: VIDIOC_S_EXT_CTRLS (%d)", ret);
847
848 Exynos_v4l2_Out();
849
850 return ret;
851 }