3 ** Copyright 2014, Samsung Electronics Co. LTD
5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at
9 ** http://www.apache.org/licenses/LICENSE-2.0
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
18 /* #define LOG_NDEBUG 0 */
19 #define LOG_TAG "ExynosCameraFrameFactoryFront"
20 #include <cutils/log.h>
22 #include "ExynosCameraFrameFactoryFront.h"
26 ExynosCameraFrameFactoryFront::~ExynosCameraFrameFactoryFront()
32 CLOGE("ERR(%s[%d]):destroy fail", __FUNCTION__
, __LINE__
);
35 status_t
ExynosCameraFrameFactoryFront::create(__unused
bool active
)
37 CLOGI("INFO(%s[%d])", __FUNCTION__
, __LINE__
);
42 int32_t nodeNums
[MAX_NODE
];
43 for (int i
= 0; i
< MAX_NODE
; i
++)
46 m_pipes
[INDEX(PIPE_FLITE
)] = (ExynosCameraPipe
*)new ExynosCameraPipeFlite(m_cameraId
, m_parameters
, false, m_nodeNums
[INDEX(PIPE_FLITE
)]);
47 m_pipes
[INDEX(PIPE_FLITE
)]->setPipeId(PIPE_FLITE
);
48 m_pipes
[INDEX(PIPE_FLITE
)]->setPipeName("PIPE_FLITE");
50 m_pipes
[INDEX(PIPE_3AA
)] = (ExynosCameraPipe
*)new ExynosCameraMCPipe(m_cameraId
, m_parameters
, false, &m_deviceInfo
[INDEX(PIPE_3AA
)]);
51 m_pipes
[INDEX(PIPE_3AA
)]->setPipeId(PIPE_3AA
);
52 m_pipes
[INDEX(PIPE_3AA
)]->setPipeName("PIPE_3AA");
54 m_pipes
[INDEX(PIPE_ISP
)] = (ExynosCameraPipe
*)new ExynosCameraMCPipe(m_cameraId
, m_parameters
, false, &m_deviceInfo
[INDEX(PIPE_ISP
)]);
55 m_pipes
[INDEX(PIPE_ISP
)]->setPipeId(PIPE_ISP
);
56 m_pipes
[INDEX(PIPE_ISP
)]->setPipeName("PIPE_ISP");
58 m_pipes
[INDEX(PIPE_GSC
)] = (ExynosCameraPipe
*)new ExynosCameraPipeGSC(m_cameraId
, m_parameters
, true, m_nodeNums
[INDEX(PIPE_GSC
)]);
59 m_pipes
[INDEX(PIPE_GSC
)]->setPipeId(PIPE_GSC
);
60 m_pipes
[INDEX(PIPE_GSC
)]->setPipeName("PIPE_GSC");
62 m_pipes
[INDEX(PIPE_GSC_VIDEO
)] = (ExynosCameraPipe
*)new ExynosCameraPipeGSC(m_cameraId
, m_parameters
, false, m_nodeNums
[INDEX(PIPE_GSC_VIDEO
)]);
63 m_pipes
[INDEX(PIPE_GSC_VIDEO
)]->setPipeId(PIPE_GSC_VIDEO
);
64 m_pipes
[INDEX(PIPE_GSC_VIDEO
)]->setPipeName("PIPE_GSC_VIDEO");
66 if (m_supportReprocessing
== false) {
67 m_pipes
[INDEX(PIPE_GSC_PICTURE
)] = (ExynosCameraPipe
*)new ExynosCameraPipeGSC(m_cameraId
, m_parameters
, true, m_nodeNums
[INDEX(PIPE_GSC_PICTURE
)]);
68 m_pipes
[INDEX(PIPE_GSC_PICTURE
)]->setPipeId(PIPE_GSC_PICTURE
);
69 m_pipes
[INDEX(PIPE_GSC_PICTURE
)]->setPipeName("PIPE_GSC_PICTURE");
71 m_pipes
[INDEX(PIPE_JPEG
)] = (ExynosCameraPipe
*)new ExynosCameraPipeJpeg(m_cameraId
, m_parameters
, true, m_nodeNums
[INDEX(PIPE_JPEG
)]);
72 m_pipes
[INDEX(PIPE_JPEG
)]->setPipeId(PIPE_JPEG
);
73 m_pipes
[INDEX(PIPE_JPEG
)]->setPipeName("PIPE_JPEG");
76 /* flite pipe initialize */
77 ret
= m_pipes
[INDEX(PIPE_FLITE
)]->create(m_sensorIds
[INDEX(PIPE_FLITE
)]);
79 CLOGE("ERR(%s[%d]):FLITE create fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
80 /* TODO: exception handling */
81 return INVALID_OPERATION
;
83 CLOGD("DEBUG(%s):Pipe(%d) created", __FUNCTION__
, INDEX(PIPE_FLITE
));
85 /* ISP pipe initialize */
86 ret
= m_pipes
[INDEX(PIPE_ISP
)]->create();
88 CLOGE("ERR(%s[%d]):ISP create fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
89 /* TODO: exception handling */
90 return INVALID_OPERATION
;
92 CLOGD("DEBUG(%s):Pipe(%d) created", __FUNCTION__
, INDEX(PIPE_ISP
));
94 /* 3AA pipe initialize */
95 ret
= m_pipes
[INDEX(PIPE_3AA
)]->create();
97 CLOGE("ERR(%s[%d]):3AA create fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
98 /* TODO: exception handling */
99 return INVALID_OPERATION
;
101 CLOGD("DEBUG(%s):Pipe(%d) created", __FUNCTION__
, INDEX(PIPE_3AA
));
103 /* GSC_PREVIEW pipe initialize */
104 ret
= m_pipes
[INDEX(PIPE_GSC
)]->create();
106 CLOGE("ERR(%s[%d]):GSC create fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
107 /* TODO: exception handling */
108 return INVALID_OPERATION
;
110 CLOGD("DEBUG(%s):Pipe(%d) created", __FUNCTION__
, INDEX(PIPE_GSC
));
112 ret
= m_pipes
[INDEX(PIPE_GSC_VIDEO
)]->create();
114 CLOGE("ERR(%s[%d]):PIPE_GSC_VIDEO create fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
115 /* TODO: exception handling */
116 return INVALID_OPERATION
;
118 CLOGD("DEBUG(%s):Pipe(%d) created", __FUNCTION__
, INDEX(PIPE_GSC_VIDEO
));
120 if (m_supportReprocessing
== false) {
121 /* GSC_PICTURE pipe initialize */
122 ret
= m_pipes
[INDEX(PIPE_GSC_PICTURE
)]->create();
124 CLOGE("ERR(%s[%d]):GSC_PICTURE create fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
125 /* TODO: exception handling */
126 return INVALID_OPERATION
;
128 CLOGD("DEBUG(%s):Pipe(%d) created", __FUNCTION__
, INDEX(PIPE_GSC_PICTURE
));
130 /* JPEG pipe initialize */
131 ret
= m_pipes
[INDEX(PIPE_JPEG
)]->create();
133 CLOGE("ERR(%s[%d]):JPEG create fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
134 /* TODO: exception handling */
135 return INVALID_OPERATION
;
137 CLOGD("DEBUG(%s):Pipe(%d) created", __FUNCTION__
, INDEX(PIPE_JPEG
));
141 ret
= m_pipes
[INDEX(PIPE_3AA
)]->setControl(V4L2_CID_IS_END_OF_STREAM
, 1);
143 CLOGE("ERR(%s[%d]):PIPE_%d V4L2_CID_IS_END_OF_STREAM fail, ret(%d)", __FUNCTION__
, __LINE__
, PIPE_3AA
, ret
);
144 /* TODO: exception handling */
145 return INVALID_OPERATION
;
153 status_t
ExynosCameraFrameFactoryFront::m_fillNodeGroupInfo(ExynosCameraFrame
*frame
)
155 camera2_node_group node_group_info_3aa
, node_group_info_isp
, node_group_info_dis
;
156 int zoom
= m_parameters
->getZoomLevel();
157 int previewW
= 0, previewH
= 0;
158 int pictureW
= 0, pictureH
= 0;
159 ExynosRect bnsSize
; /* == bayerCropInputSize */
160 ExynosRect bayerCropSize
;
166 m_parameters
->getHwPreviewSize(&previewW
, &previewH
);
167 m_parameters
->getPictureSize(&pictureW
, &pictureH
);
168 m_parameters
->getPreviewBayerCropSize(&bnsSize
, &bayerCropSize
);
169 m_parameters
->getPreviewBdsSize(&bdsSize
);
171 memset(&node_group_info_3aa
, 0x0, sizeof(camera2_node_group
));
172 memset(&node_group_info_isp
, 0x0, sizeof(camera2_node_group
));
173 memset(&node_group_info_dis
, 0x0, sizeof(camera2_node_group
));
175 /* should add this request value in FrameFactory */
177 node_group_info_3aa
.leader
.request
= 1;
180 perFramePos
= (m_cameraId
== CAMERA_ID_BACK
) ? PERFRAME_BACK_3AC_POS
: PERFRAME_FRONT_3AC_POS
;
181 node_group_info_3aa
.capture
[perFramePos
].request
= frame
->getRequest(PIPE_3AC
);
184 perFramePos
= (m_cameraId
== CAMERA_ID_BACK
) ? PERFRAME_BACK_3AP_POS
: PERFRAME_FRONT_3AP_POS
;
185 node_group_info_3aa
.capture
[perFramePos
].request
= frame
->getRequest(PIPE_3AP
);
187 /* should add this request value in FrameFactory */
189 node_group_info_isp
.leader
.request
= 1;
192 perFramePos
= (m_cameraId
== CAMERA_ID_BACK
) ? PERFRAME_BACK_SCC_POS
: PERFRAME_FRONT_SCC_POS
;
194 if (m_supportSCC
== true)
195 node_group_info_isp
.capture
[perFramePos
].request
= frame
->getRequest(PIPE_SCC
);
197 node_group_info_isp
.capture
[perFramePos
].request
= frame
->getRequest(PIPE_ISPC
);
199 memcpy(&node_group_info_dis
, &node_group_info_isp
, sizeof (camera2_node_group
));
201 if (m_requestISPC
== true) {
202 perFramePos
= (m_cameraId
== CAMERA_ID_BACK
) ? PERFRAME_BACK_ISPC_POS
: PERFRAME_FRONT_ISPC_POS
;
203 node_group_info_3aa
.capture
[perFramePos
].request
= frame
->getRequest(PIPE_ISPC
);
206 ExynosCameraNodeGroup3AA::updateNodeGroupInfo(
208 &node_group_info_3aa
,
214 ExynosCameraNodeGroupISP::updateNodeGroupInfo(
216 &node_group_info_isp
,
223 ExynosCameraNodeGroupDIS::updateNodeGroupInfo(
225 &node_group_info_dis
,
231 if (m_requestISPC
== true) {
232 perFramePos
= (m_cameraId
== CAMERA_ID_BACK
) ? PERFRAME_BACK_SCP_POS
: PERFRAME_FRONT_SCP_POS
;
233 for(int i
=0 ; i
< 4 ; i
++) {
234 node_group_info_3aa
.capture
[PERFRAME_FRONT_ISPC_POS
].input
.cropRegion
[i
] = node_group_info_3aa
.capture
[perFramePos
].input
.cropRegion
[i
];
235 node_group_info_3aa
.capture
[PERFRAME_FRONT_ISPC_POS
].output
.cropRegion
[i
] = node_group_info_3aa
.capture
[perFramePos
].input
.cropRegion
[i
];
239 frame
->storeNodeGroupInfo(&node_group_info_3aa
, PERFRAME_INFO_3AA
, zoom
);
240 frame
->storeNodeGroupInfo(&node_group_info_isp
, PERFRAME_INFO_ISP
, zoom
);
241 frame
->storeNodeGroupInfo(&node_group_info_dis
, PERFRAME_INFO_DIS
, zoom
);
246 ExynosCameraFrame
*ExynosCameraFrameFactoryFront::createNewFrame(void)
249 ExynosCameraFrameEntity
*newEntity
[MAX_NUM_PIPES
] = {0};
250 ExynosCameraFrame
*frame
= m_frameMgr
->createFrame(m_parameters
, m_frameCount
, FRAME_TYPE_PREVIEW
);
252 int requestEntityCount
= 0;
253 bool dzoomScaler
= false;
254 dzoomScaler
= m_parameters
->getZoomPreviewWIthScaler();
256 ret
= m_initFrameMetadata(frame
);
258 CLOGE("(%s[%d]): frame(%d) metadata initialize fail", __FUNCTION__
, __LINE__
, m_frameCount
);
260 if (m_requestFLITE
) {
261 /* set flite pipe to linkageList */
262 newEntity
[INDEX(PIPE_FLITE
)] = new ExynosCameraFrameEntity(PIPE_FLITE
, ENTITY_TYPE_OUTPUT_ONLY
, ENTITY_BUFFER_FIXED
);
263 frame
->addSiblingEntity(NULL
, newEntity
[INDEX(PIPE_FLITE
)]);
264 requestEntityCount
++;
267 /* set 3AA_ISP pipe to linkageList */
268 newEntity
[INDEX(PIPE_3AA
)] = new ExynosCameraFrameEntity(PIPE_3AA
, ENTITY_TYPE_INPUT_ONLY
, ENTITY_BUFFER_FIXED
);
269 frame
->addSiblingEntity(NULL
, newEntity
[INDEX(PIPE_3AA
)]);
270 requestEntityCount
++;
272 if (m_supportReprocessing
== false) {
273 /* set GSC-Picture pipe to linkageList */
274 newEntity
[INDEX(PIPE_GSC_PICTURE
)] = new ExynosCameraFrameEntity(PIPE_GSC_PICTURE
, ENTITY_TYPE_INPUT_OUTPUT
, ENTITY_BUFFER_FIXED
);
275 frame
->addSiblingEntity(NULL
, newEntity
[INDEX(PIPE_GSC_PICTURE
)]);
278 /* set GSC pipe to linkageList */
279 newEntity
[INDEX(PIPE_GSC
)] = new ExynosCameraFrameEntity(PIPE_GSC
, ENTITY_TYPE_INPUT_OUTPUT
, ENTITY_BUFFER_FIXED
);
280 frame
->addSiblingEntity(NULL
, newEntity
[INDEX(PIPE_GSC
)]);
282 requestEntityCount
++;
285 newEntity
[INDEX(PIPE_GSC_VIDEO
)] = new ExynosCameraFrameEntity(PIPE_GSC_VIDEO
, ENTITY_TYPE_INPUT_OUTPUT
, ENTITY_BUFFER_FIXED
);
286 frame
->addSiblingEntity(NULL
, newEntity
[INDEX(PIPE_GSC_VIDEO
)]);
288 if (m_supportReprocessing
== false) {
289 /* set JPEG pipe to linkageList */
290 newEntity
[INDEX(PIPE_JPEG
)] = new ExynosCameraFrameEntity(PIPE_JPEG
, ENTITY_TYPE_INPUT_OUTPUT
, ENTITY_BUFFER_FIXED
);
291 frame
->addSiblingEntity(NULL
, newEntity
[INDEX(PIPE_JPEG
)]);
294 ret
= m_initPipelines(frame
);
296 CLOGE("ERR(%s):m_initPipelines fail, ret(%d)", __FUNCTION__
, ret
);
299 /* TODO: make it dynamic */
300 frame
->setNumRequestPipe(requestEntityCount
);
302 m_fillNodeGroupInfo(frame
);
308 status_t
ExynosCameraFrameFactoryFront::initPipes(void)
310 CLOGI("INFO(%s[%d]) IN", __FUNCTION__
, __LINE__
);
313 camera_pipe_info_t pipeInfo
[MAX_NODE
];
314 camera_pipe_info_t nullPipeInfo
;
316 int32_t nodeNums
[MAX_NODE
];
317 int32_t sensorIds
[MAX_NODE
];
318 int32_t secondarySensorIds
[MAX_NODE
];
319 for (int i
= 0; i
< MAX_NODE
; i
++) {
322 secondarySensorIds
[i
] = -1;
326 int maxSensorW
= 0, maxSensorH
= 0, hwSensorW
= 0, hwSensorH
= 0;
327 int maxPreviewW
= 0, maxPreviewH
= 0, hwPreviewW
= 0, hwPreviewH
= 0;
328 int maxPictureW
= 0, maxPictureH
= 0, hwPictureW
= 0, hwPictureH
= 0;
329 int bayerFormat
= CAMERA_BAYER_FORMAT
;
330 int previewFormat
= m_parameters
->getHwPreviewFormat();
331 int pictureFormat
= m_parameters
->getHwPictureFormat();
332 int hwVdisformat
= m_parameters
->getHWVdisFormat();
333 bool hwVdis
= m_parameters
->getTpuEnabledMode();
334 struct ExynosConfigInfo
*config
= m_parameters
->getConfig();
340 if (m_parameters
->checkBayerDumpEnable()) {
341 bayerFormat
= CAMERA_DUMP_BAYER_FORMAT
;
345 m_parameters
->getMaxSensorSize(&maxSensorW
, &maxSensorH
);
346 m_parameters
->getHwSensorSize(&hwSensorW
, &hwSensorH
);
348 m_parameters
->getMaxPreviewSize(&maxPreviewW
, &maxPreviewH
);
349 m_parameters
->getHwPreviewSize(&hwPreviewW
, &hwPreviewH
);
351 m_parameters
->getMaxPictureSize(&maxPictureW
, &maxPictureH
);
352 m_parameters
->getHwPictureSize(&hwPictureW
, &hwPictureH
);
354 m_parameters
->getPreviewBdsSize(&bdsSize
);
356 /* When high speed recording mode, hw sensor size is fixed.
357 * So, maxPreview size cannot exceed hw sensor size
359 if (m_parameters
->getHighSpeedRecording()) {
360 maxPreviewW
= hwSensorW
;
361 maxPreviewH
= hwSensorH
;
364 CLOGI("INFO(%s[%d]): MaxSensorSize(%dx%d), HWSensorSize(%dx%d)", __FUNCTION__
, __LINE__
, maxSensorW
, maxSensorH
, hwSensorW
, hwSensorH
);
365 CLOGI("INFO(%s[%d]): MaxPreviewSize(%dx%d), HwPreviewSize(%dx%d)", __FUNCTION__
, __LINE__
, maxPreviewW
, maxPreviewH
, hwPreviewW
, hwPreviewH
);
366 CLOGI("INFO(%s[%d]): HWPictureSize(%dx%d)", __FUNCTION__
, __LINE__
, hwPictureW
, hwPictureH
);
371 if (m_parameters
->checkBayerDumpEnable()) {
372 bayerFormat
= CAMERA_DUMP_BAYER_FORMAT
;
376 m_parameters
->getMaxSensorSize(&maxSensorW
, &maxSensorH
);
377 m_parameters
->getHwSensorSize(&hwSensorW
, &hwSensorH
);
379 CLOGI("INFO(%s[%d]): MaxSensorSize(%dx%d), HWSensorSize(%dx%d)", __FUNCTION__
, __LINE__
, maxSensorW
, maxSensorH
, hwSensorW
, hwSensorH
);
382 for (int i
= 0; i
< MAX_NODE
; i
++)
383 pipeInfo
[i
] = nullPipeInfo
;
385 /* setParam for Frame rate : must after setInput on Flite */
386 uint32_t min
, max
, frameRate
;
387 struct v4l2_streamparm streamParam
;
389 memset(&streamParam
, 0x0, sizeof(v4l2_streamparm
));
390 m_parameters
->getPreviewFpsRange(&min
, &max
);
392 if (m_parameters
->getScalableSensorMode() == true)
397 streamParam
.type
= V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
;
398 streamParam
.parm
.capture
.timeperframe
.numerator
= 1;
399 streamParam
.parm
.capture
.timeperframe
.denominator
= frameRate
;
400 CLOGI("INFO(%s[%d]:set framerate (denominator=%d)", __FUNCTION__
, __LINE__
, frameRate
);
401 ret
= setParam(&streamParam
, PIPE_FLITE
);
403 CLOGE("ERR(%s[%d]):FLITE setParam fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
404 return INVALID_OPERATION
;
407 #ifdef FIXED_SENSOR_SIZE
408 tempRect
.fullW
= maxSensorW
;
409 tempRect
.fullH
= maxSensorH
;
411 tempRect
.fullW
= hwSensorW
;
412 tempRect
.fullH
= hwSensorH
;
414 tempRect
.colorFormat
= bayerFormat
;
416 pipeInfo
[0].rectInfo
= tempRect
;
417 pipeInfo
[0].bufInfo
.type
= V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
;
418 pipeInfo
[0].bufInfo
.memory
= V4L2_CAMERA_MEMORY_TYPE
;
419 pipeInfo
[0].bufInfo
.count
= config
->current
->bufInfo
.num_bayer_buffers
;
421 pipeInfo
[0].perFrameNodeGroupInfo
.perframeSupportNodeNum
= 0;
422 pipeInfo
[0].perFrameNodeGroupInfo
.perFrameLeaderInfo
.perFrameNodeType
= PERFRAME_NODE_TYPE_NONE
;
424 #ifdef CAMERA_PACKED_BAYER_ENABLE
426 if (m_parameters
->checkBayerDumpEnable()) {
427 /* packed bayer bytesPerPlane */
428 pipeInfo
[0].bytesPerPlane
[0] = ROUND_UP(pipeInfo
[0].rectInfo
.fullW
, 10) * 2;
433 /* packed bayer bytesPerPlane */
434 pipeInfo
[0].bytesPerPlane
[0] = ROUND_UP(pipeInfo
[0].rectInfo
.fullW
, 10) * 8 / 5;
438 ret
= m_pipes
[INDEX(PIPE_FLITE
)]->setupPipe(pipeInfo
, m_sensorIds
[INDEX(PIPE_FLITE
)]);
440 CLOGE("ERR(%s[%d]):FLITE setupPipe fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
441 /* TODO: exception handling */
442 return INVALID_OPERATION
;
447 int bnsScaleRatio
= 0;
449 if( m_parameters
->getHighSpeedRecording()
450 #ifdef USE_BINNING_MODE
451 || m_parameters
->getBinningMode()
454 bnsScaleRatio
= 1000;
456 bnsScaleRatio
= m_parameters
->getBnsScaleRatio();
458 ret
= m_pipes
[INDEX(PIPE_FLITE
)]->setControl(V4L2_CID_IS_S_BNS
, bnsScaleRatio
);
460 CLOGE("ERR(%s[%d]): set BNS(%d) fail, ret(%d)", __FUNCTION__
, __LINE__
, bnsScaleRatio
, ret
);
462 ret
= m_pipes
[INDEX(PIPE_FLITE
)]->getControl(V4L2_CID_IS_G_BNS_SIZE
, &bnsSize
);
464 CLOGE("ERR(%s[%d]): get BNS size fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
472 bnsHeight
= bnsSize
& 0xffff;
473 bnsWidth
= bnsSize
>> 16;
475 CLOGI("INFO(%s[%d]): BNS scale down ratio(%.1f), size (%dx%d)", __FUNCTION__
, __LINE__
, (float)(bnsScaleRatio
/ 1000), bnsWidth
, bnsHeight
);
476 m_parameters
->setBnsSize(bnsWidth
, bnsHeight
);
480 enum NODE_TYPE t3asNodeType
= getNodeType(PIPE_3AA
);
482 for (int i
= 0; i
< MAX_NODE
; i
++)
483 pipeInfo
[i
] = nullPipeInfo
;
485 for (int i
= 0; i
< MAX_NODE
; i
++) {
486 ret
= m_pipes
[INDEX(PIPE_3AA
)]->setPipeId((enum NODE_TYPE
)i
, m_deviceInfo
[PIPE_3AA
].pipeId
[i
]);
488 CLOGE("ERR(%s[%d]):setPipeId(%d, %d) fail, ret(%d)", __FUNCTION__
, __LINE__
, i
, m_deviceInfo
[PIPE_3AA
].pipeId
[i
], ret
);
492 sensorIds
[i
] = m_sensorIds
[INDEX(PIPE_3AA
)][i
];
493 secondarySensorIds
[i
] = m_secondarySensorIds
[INDEX(PIPE_3AA
)][i
];
496 if (m_flagFlite3aaOTF
== true) {
499 tempRect
.colorFormat
= bayerFormat
;
501 pipeInfo
[t3asNodeType
].bufInfo
.count
= config
->current
->bufInfo
.num_3aa_buffers
;
503 tempRect
.fullW
= maxSensorW
;
504 tempRect
.fullH
= maxSensorH
;
505 tempRect
.colorFormat
= bayerFormat
;
507 #ifdef CAMERA_PACKED_BAYER_ENABLE
509 if (m_parameters
->checkBayerDumpEnable()) {
510 /* packed bayer bytesPerPlane */
511 pipeInfo
[t3asNodeType
].bytesPerPlane
[0] = ROUND_UP(tempRect
.fullW
, 10) * 2;
516 /* packed bayer bytesPerPlane */
517 pipeInfo
[t3asNodeType
].bytesPerPlane
[0] = ROUND_UP(tempRect
.fullW
, 10) * 8 / 5;
521 pipeInfo
[t3asNodeType
].bufInfo
.count
= config
->current
->bufInfo
.num_bayer_buffers
;
524 pipeInfo
[t3asNodeType
].rectInfo
= tempRect
;
525 pipeInfo
[t3asNodeType
].bufInfo
.type
= V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
;
526 pipeInfo
[t3asNodeType
].bufInfo
.memory
= V4L2_CAMERA_MEMORY_TYPE
;
529 pipeInfo
[t3asNodeType
].perFrameNodeGroupInfo
.perframeSupportNodeNum
= CAPTURE_NODE_MAX
;
530 pipeInfo
[t3asNodeType
].perFrameNodeGroupInfo
.perFrameLeaderInfo
.perframeInfoIndex
= PERFRAME_INFO_3AA
;
532 pipeInfo
[t3asNodeType
].perFrameNodeGroupInfo
.perFrameLeaderInfo
.perFrameNodeType
= PERFRAME_NODE_TYPE_LEADER
;
533 pipeInfo
[t3asNodeType
].perFrameNodeGroupInfo
.perFrameLeaderInfo
.perFrameVideoID
= (m_deviceInfo
[INDEX(PIPE_3AA
)].nodeNum
[t3asNodeType
] - FIMC_IS_VIDEO_BAS_NUM
);
536 enum NODE_TYPE t3apNodeType
= getNodeType(PIPE_3AP
);
538 perFramePos
= (m_cameraId
== CAMERA_ID_BACK
) ? PERFRAME_BACK_3AP_POS
: PERFRAME_FRONT_3AP_POS
;
539 pipeInfo
[t3asNodeType
].perFrameNodeGroupInfo
.perFrameCaptureInfo
[perFramePos
].perFrameNodeType
= PERFRAME_NODE_TYPE_CAPTURE
;
540 pipeInfo
[t3asNodeType
].perFrameNodeGroupInfo
.perFrameCaptureInfo
[perFramePos
].perFrameVideoID
= (m_deviceInfo
[INDEX(PIPE_3AA
)].secondaryNodeNum
[t3apNodeType
] - FIMC_IS_VIDEO_BAS_NUM
);
542 tempRect
.fullW
= maxSensorW
;
543 tempRect
.fullH
= maxSensorH
;
544 tempRect
.colorFormat
= bayerFormat
;
545 pipeInfo
[t3apNodeType
].rectInfo
= tempRect
;
546 pipeInfo
[t3apNodeType
].bufInfo
.type
= V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
;
547 pipeInfo
[t3apNodeType
].bufInfo
.memory
= V4L2_CAMERA_MEMORY_TYPE
;
549 pipeInfo
[t3apNodeType
].perFrameNodeGroupInfo
.perframeSupportNodeNum
= 0;
550 pipeInfo
[t3apNodeType
].perFrameNodeGroupInfo
.perFrameLeaderInfo
.perFrameNodeType
= PERFRAME_NODE_TYPE_NONE
;
553 enum NODE_TYPE ispsNodeType
= getNodeType(PIPE_ISP
);
555 tempRect
.fullW
= bdsSize
.w
;
556 tempRect
.fullH
= bdsSize
.h
;
557 tempRect
.colorFormat
= bayerFormat
;
558 #ifdef CAMERA_PACKED_BAYER_ENABLE
560 if (m_parameters
->checkBayerDumpEnable()) {
561 /* packed bayer bytesPerPlane */
562 pipeInfo
[ispsNodeType
].bytesPerPlane
[0] = ROUND_UP(tempRect
.fullW
* 2, 16);
567 /* packed bayer bytesPerPlane */
568 pipeInfo
[ispsNodeType
].bytesPerPlane
[0] = ROUND_UP(tempRect
.fullW
* 3 / 2, 16);
572 pipeInfo
[ispsNodeType
].rectInfo
= tempRect
;
573 pipeInfo
[ispsNodeType
].bufInfo
.type
= V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
;
574 pipeInfo
[ispsNodeType
].bufInfo
.memory
= V4L2_CAMERA_MEMORY_TYPE
;
575 pipeInfo
[ispsNodeType
].bufInfo
.count
= config
->current
->bufInfo
.num_3aa_buffers
;
577 pipeInfo
[ispsNodeType
].perFrameNodeGroupInfo
.perframeSupportNodeNum
= 0;
578 pipeInfo
[ispsNodeType
].perFrameNodeGroupInfo
.perFrameLeaderInfo
.perframeInfoIndex
= PERFRAME_INFO_ISP
;
579 pipeInfo
[ispsNodeType
].perFrameNodeGroupInfo
.perFrameLeaderInfo
.perFrameNodeType
= PERFRAME_NODE_TYPE_LEADER
;
580 pipeInfo
[ispsNodeType
].perFrameNodeGroupInfo
.perFrameLeaderInfo
.perFrameVideoID
= (m_deviceInfo
[INDEX(PIPE_3AA
)].secondaryNodeNum
[ispsNodeType
] - FIMC_IS_VIDEO_BAS_NUM
);
583 enum NODE_TYPE ispcNodeType
= getNodeType(PIPE_ISPC
);
585 perFramePos
= (m_cameraId
== CAMERA_ID_BACK
) ? PERFRAME_BACK_ISPC_POS
: PERFRAME_FRONT_ISPC_POS
;
586 pipeInfo
[t3asNodeType
].perFrameNodeGroupInfo
.perFrameCaptureInfo
[perFramePos
].perFrameNodeType
= PERFRAME_NODE_TYPE_CAPTURE
;
587 pipeInfo
[t3asNodeType
].perFrameNodeGroupInfo
.perFrameCaptureInfo
[perFramePos
].perFrameVideoID
= (m_deviceInfo
[PIPE_3AA
].nodeNum
[ispcNodeType
] - FIMC_IS_VIDEO_BAS_NUM
);
589 tempRect
.fullW
= bdsSize
.w
;
590 tempRect
.fullH
= bdsSize
.h
;
591 tempRect
.colorFormat
= hwVdisformat
;
593 #ifdef USE_BUFFER_WITH_STRIDE
594 /* to use stride for preview buffer, set the bytesPerPlane */
595 pipeInfo
[ispcNodeType
].bytesPerPlane
[0] = bdsSize
.w
;
598 pipeInfo
[ispcNodeType
].rectInfo
= tempRect
;
599 pipeInfo
[ispcNodeType
].bufInfo
.type
= V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
;
600 pipeInfo
[ispcNodeType
].bufInfo
.memory
= V4L2_CAMERA_MEMORY_TYPE
;
601 pipeInfo
[ispcNodeType
].bufInfo
.count
= config
->current
->bufInfo
.num_hwdis_buffers
;
603 pipeInfo
[ispcNodeType
].perFrameNodeGroupInfo
.perframeSupportNodeNum
= 0;
604 pipeInfo
[ispcNodeType
].perFrameNodeGroupInfo
.perFrameLeaderInfo
.perFrameNodeType
= PERFRAME_NODE_TYPE_NONE
;
606 ret
= m_pipes
[INDEX(PIPE_3AA
)]->setupPipe(pipeInfo
, sensorIds
, secondarySensorIds
);
608 CLOGE("ERR(%s[%d]):3AA setupPipe fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
609 /* TODO: exception handling */
610 return INVALID_OPERATION
;
613 CLOGI("INFO(%s[%d]) OUT", __FUNCTION__
, __LINE__
);
619 status_t
ExynosCameraFrameFactoryFront::preparePipes(void)
623 /* NOTE: Prepare for 3AA is moved after ISP stream on */
625 if (m_requestFLITE
) {
626 ret
= m_pipes
[INDEX(PIPE_FLITE
)]->prepare();
628 CLOGE("ERR(%s[%d]):FLITE prepare fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
629 /* TODO: exception handling */
630 return INVALID_OPERATION
;
634 if (m_supportSCC
== true) {
635 enum pipeline pipe
= (m_supportSCC
== true) ? PIPE_SCC
: PIPE_ISPC
;
637 ret
= m_pipes
[INDEX(pipe
)]->prepare();
639 CLOGE("ERR(%s[%d]):%s prepare fail, ret(%d)", __FUNCTION__
, __LINE__
, m_pipes
[INDEX(pipe
)]->getPipeName(), ret
);
640 /* TODO: exception handling */
641 return INVALID_OPERATION
;
648 status_t
ExynosCameraFrameFactoryFront::startPipes(void)
652 if (m_supportSCC
== true) {
653 enum pipeline pipe
= (m_supportSCC
== true) ? PIPE_SCC
: PIPE_ISPC
;
655 ret
= m_pipes
[INDEX(pipe
)]->start();
657 CLOGE("ERR(%s[%d]):%s start fail, ret(%d)", __FUNCTION__
, __LINE__
, m_pipes
[INDEX(pipe
)]->getPipeName(), ret
);
658 /* TODO: exception handling */
659 return INVALID_OPERATION
;
663 if (m_flag3aaIspOTF
== false) {
664 ret
= m_pipes
[INDEX(PIPE_ISP
)]->start();
666 CLOGE("ERR(%s[%d]):ISP start fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
667 /* TODO: exception handling */
668 return INVALID_OPERATION
;
672 ret
= m_pipes
[INDEX(PIPE_3AA
)]->start();
674 CLOGE("ERR(%s[%d]):3AA start fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
675 /* TODO: exception handling */
676 return INVALID_OPERATION
;
679 ret
= m_pipes
[INDEX(PIPE_FLITE
)]->start();
681 CLOGE("ERR(%s[%d]):FLITE start fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
682 /* TODO: exception handling */
683 return INVALID_OPERATION
;
686 if (m_flagFlite3aaOTF
== true) {
687 /* Here is doing 3AA prepare(qbuf) */
688 ret
= m_pipes
[INDEX(PIPE_3AA
)]->prepare();
690 CLOGE("ERR(%s[%d]):3AA prepare fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
691 /* TODO: exception handling */
692 return INVALID_OPERATION
;
696 ret
= m_pipes
[INDEX(PIPE_FLITE
)]->sensorStream(true);
698 CLOGE("ERR(%s[%d]):FLITE sensorStream on fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
699 /* TODO: exception handling */
700 return INVALID_OPERATION
;
703 CLOGI("INFO(%s[%d]):Starting Success!", __FUNCTION__
, __LINE__
);
708 status_t
ExynosCameraFrameFactoryFront::startInitialThreads(void)
712 CLOGI("INFO(%s[%d]):start pre-ordered initial pipe thread", __FUNCTION__
, __LINE__
);
714 if (m_requestFLITE
) {
715 ret
= startThread(PIPE_FLITE
);
720 ret
= startThread(PIPE_3AA
);
724 if (m_flag3aaIspOTF
== false) {
725 ret
= startThread(PIPE_ISP
);
730 if (m_parameters
->getTpuEnabledMode() == true) {
731 ret
= startThread(PIPE_DIS
);
737 enum pipeline pipe
= (m_supportSCC
== true) ? PIPE_SCC
: PIPE_ISPC
;
739 ret
= startThread(pipe
);
747 status_t
ExynosCameraFrameFactoryFront::setStopFlag(void)
749 CLOGI("INFO(%s[%d]):", __FUNCTION__
, __LINE__
);
753 ret
= m_pipes
[INDEX(PIPE_FLITE
)]->setStopFlag();
755 if (m_pipes
[INDEX(PIPE_3AA
)]->flagStart() == true)
756 ret
= m_pipes
[INDEX(PIPE_3AA
)]->setStopFlag();
758 if (m_pipes
[INDEX(PIPE_ISP
)]->flagStart() == true)
759 ret
= m_pipes
[INDEX(PIPE_ISP
)]->setStopFlag();
761 if (m_supportSCC
== true) {
762 enum pipeline pipe
= (m_supportSCC
== true) ? PIPE_SCC
: PIPE_ISPC
;
764 ret
= m_pipes
[INDEX(pipe
)]->setStopFlag();
770 status_t
ExynosCameraFrameFactoryFront::stopPipes(void)
773 if (m_supportSCC
== true) {
774 enum pipeline pipe
= (m_supportSCC
== true) ? PIPE_SCC
: PIPE_ISPC
;
776 ret
= m_pipes
[INDEX(pipe
)]->stopThread();
778 CLOGE("ERR(%s[%d]):%s stopThread fail, ret(%d)", __FUNCTION__
, __LINE__
, m_pipes
[INDEX(pipe
)]->getPipeName(), ret
);
779 /* TODO: exception handling */
780 return INVALID_OPERATION
;
784 if (m_pipes
[INDEX(PIPE_3AA
)]->isThreadRunning() == true) {
785 ret
= m_pipes
[INDEX(PIPE_3AA
)]->stopThread();
787 CLOGE("ERR(%s[%d]):3AA stopThread fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
788 /* TODO: exception handling */
789 return INVALID_OPERATION
;
793 /* stream off for ISP */
794 if (m_pipes
[INDEX(PIPE_ISP
)]->isThreadRunning() == true) {
795 ret
= m_pipes
[INDEX(PIPE_ISP
)]->stopThread();
797 CLOGE("ERR(%s[%d]):ISP stopThread fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
798 /* TODO: exception handling */
799 return INVALID_OPERATION
;
803 if (m_requestFLITE
) {
804 ret
= m_pipes
[INDEX(PIPE_FLITE
)]->stopThread();
806 CLOGE("ERR(%s[%d]):FLITE stopThread fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
807 /* TODO: exception handling */
808 return INVALID_OPERATION
;
812 if (m_pipes
[INDEX(PIPE_GSC
)]->isThreadRunning() == true) {
813 ret
= stopThread(INDEX(PIPE_GSC
));
815 CLOGE("ERR(%s[%d]):PIPE_GSC stopThread fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
816 return INVALID_OPERATION
;
819 ret
= m_pipes
[INDEX(PIPE_FLITE
)]->sensorStream(false);
821 CLOGE("ERR(%s[%d]):FLITE sensorStream off fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
822 /* TODO: exception handling */
823 return INVALID_OPERATION
;
826 ret
= m_pipes
[INDEX(PIPE_FLITE
)]->stop();
828 CLOGE("ERR(%s[%d]):FLITE stop fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
829 /* TODO: exception handling */
830 return INVALID_OPERATION
;
834 ret
= m_pipes
[INDEX(PIPE_3AA
)]->forceDone(V4L2_CID_IS_FORCE_DONE
, 0x1000);
836 CLOGE("ERR(%s[%d]):PIPE_3AA force done fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
837 /* TODO: exception handling */
838 /* return INVALID_OPERATION; */
841 /* stream off for 3AA */
842 ret
= m_pipes
[INDEX(PIPE_3AA
)]->stop();
844 CLOGE("ERR(%s[%d]):3AA stop fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
845 /* TODO: exception handling */
846 return INVALID_OPERATION
;
850 if (m_pipes
[INDEX(PIPE_ISP
)]->flagStart() == true) {
851 ret
= m_pipes
[INDEX(PIPE_ISP
)]->forceDone(V4L2_CID_IS_FORCE_DONE
, 0x1000);
853 CLOGE("ERR(%s[%d]):PIPE_ISP force done fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
854 /* TODO: exception handling */
855 /* return INVALID_OPERATION; */
858 /* stream off for ISP */
859 ret
= m_pipes
[INDEX(PIPE_ISP
)]->stop();
861 CLOGE("ERR(%s[%d]):ISP stop fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
862 /* TODO: exception handling */
863 return INVALID_OPERATION
;
867 if (m_supportSCC
== true) {
868 enum pipeline pipe
= (m_supportSCC
== true) ? PIPE_SCC
: PIPE_ISPC
;
870 ret
= m_pipes
[INDEX(pipe
)]->stop();
872 CLOGE("ERR(%s[%d]):%s stop fail, ret(%d)", __FUNCTION__
, __LINE__
, m_pipes
[INDEX(pipe
)]->getPipeName(), ret
);
873 /* TODO: exception handling */
874 return INVALID_OPERATION
;
878 ret
= stopThreadAndWait(INDEX(PIPE_GSC
));
880 CLOGE("ERR(%s[%d]):PIPE_GSC stopThreadAndWait fail, ret(%d)", __FUNCTION__
, __LINE__
, ret
);
882 CLOGI("INFO(%s[%d]):Stopping Success!", __FUNCTION__
, __LINE__
);
887 void ExynosCameraFrameFactoryFront::m_init(void)
889 m_supportReprocessing
= false;
890 m_flagFlite3aaOTF
= false;
891 m_supportSCC
= false;
892 m_supportPureBayerReprocessing
= false;
893 m_flagReprocessing
= false;
897 status_t
ExynosCameraFrameFactoryFront::m_setupConfig()
899 CLOGI("INFO(%s[%d])", __FUNCTION__
, __LINE__
);
901 status_t ret
= NO_ERROR
;
903 int32_t *nodeNums
= NULL
;
904 int32_t *controlId
= NULL
;
905 int32_t *secondaryControlId
= NULL
;
906 int32_t *prevNode
= NULL
;
908 enum NODE_TYPE nodeType
= INVALID_NODE
;
911 int t3aaNums
[MAX_NODE
];
912 int ispNums
[MAX_NODE
];
914 m_flagFlite3aaOTF
= (m_cameraId
== CAMERA_ID_BACK
)?MAIN_CAMERA_DUAL_FLITE_3AA_OTF
:FRONT_CAMERA_DUAL_FLITE_3AA_OTF
;
915 m_flag3aaIspOTF
= (m_cameraId
== CAMERA_ID_BACK
)?MAIN_CAMERA_DUAL_3AA_ISP_OTF
:FRONT_CAMERA_DUAL_3AA_ISP_OTF
;
916 m_supportReprocessing
= m_parameters
->isReprocessing();
917 m_supportSCC
= m_parameters
->isOwnScc(m_cameraId
);
918 m_supportPureBayerReprocessing
= (m_cameraId
== CAMERA_ID_BACK
) ? USE_PURE_BAYER_REPROCESSING_ON_DUAL
: USE_PURE_BAYER_REPROCESSING_FRONT_ON_DUAL
;
920 m_flagReprocessing
= false;
922 if (m_supportReprocessing
== false) {
923 if (m_supportSCC
== true)
929 if (m_flag3aaIspOTF
== true)
934 nodeNums
= m_nodeNums
[INDEX(PIPE_FLITE
)];
935 nodeNums
[OUTPUT_NODE
] = -1;
936 nodeNums
[CAPTURE_NODE_1
] = (m_cameraId
== CAMERA_ID_BACK
) ? MAIN_CAMERA_FLITE_NUM
: FRONT_CAMERA_FLITE_NUM
;
937 nodeNums
[CAPTURE_NODE_2
] = -1;
938 controlId
= m_sensorIds
[INDEX(PIPE_FLITE
)];
939 controlId
[CAPTURE_NODE_1
] = m_getSensorId(nodeNums
[CAPTURE_NODE_1
], m_flagReprocessing
);
943 t3aaNums
[OUTPUT_NODE
] = FIMC_IS_VIDEO_30S_NUM
;
944 t3aaNums
[CAPTURE_NODE_1
] = -1;
945 t3aaNums
[CAPTURE_NODE_2
] = FIMC_IS_VIDEO_30P_NUM
;
947 t3aaNums
[OUTPUT_NODE
] = FIMC_IS_VIDEO_31S_NUM
;
948 t3aaNums
[CAPTURE_NODE_1
] = -1;
949 t3aaNums
[CAPTURE_NODE_2
] = FIMC_IS_VIDEO_31P_NUM
;
951 ispNums
[OUTPUT_NODE
] = FIMC_IS_VIDEO_I1S_NUM
;
952 ispNums
[CAPTURE_NODE_1
] = -1;
953 ispNums
[CAPTURE_NODE_2
] = FIMC_IS_VIDEO_I1C_NUM
;
956 pipeId
= INDEX(PIPE_3AA
);
957 nodeType
= getNodeType(PIPE_3AA
);
958 m_deviceInfo
[pipeId
].nodeNum
[nodeType
] = t3aaNums
[OUTPUT_NODE
];
959 strncpy(m_deviceInfo
[pipeId
].nodeName
[nodeType
], "3AA_OUTPUT", EXYNOS_CAMERA_NAME_STR_SIZE
- 1);
960 m_sensorIds
[pipeId
][nodeType
] = m_getSensorId(m_nodeNums
[INDEX(PIPE_FLITE
)][getNodeType(PIPE_FLITE
)], m_flagFlite3aaOTF
, true, m_flagReprocessing
);
961 m_deviceInfo
[pipeId
].pipeId
[nodeType
] = PIPE_3AA
;
965 nodeType
= getNodeType(PIPE_3AP
);
966 m_deviceInfo
[pipeId
].secondaryNodeNum
[nodeType
] = t3aaNums
[CAPTURE_NODE_2
];
967 strncpy(m_deviceInfo
[pipeId
].secondaryNodeName
[nodeType
], "3AA_PREVIEW", EXYNOS_CAMERA_NAME_STR_SIZE
- 1);
968 m_secondarySensorIds
[pipeId
][nodeType
] = -1;
969 m_secondarySensorIds
[pipeId
][nodeType
] = m_getSensorId(m_deviceInfo
[pipeId
].nodeNum
[getNodeType(PIPE_3AA
)], true, false, m_flagReprocessing
);
970 m_deviceInfo
[pipeId
].pipeId
[nodeType
] = PIPE_3AP
;
973 nodeType
= getNodeType(PIPE_ISP
);
974 m_deviceInfo
[pipeId
].secondaryNodeNum
[nodeType
] = ispNums
[OUTPUT_NODE
];
975 strncpy(m_deviceInfo
[pipeId
].secondaryNodeName
[nodeType
], "ISP_OUTPUT", EXYNOS_CAMERA_NAME_STR_SIZE
- 1);
976 m_secondarySensorIds
[pipeId
][nodeType
] = m_getSensorId(m_deviceInfo
[pipeId
].secondaryNodeNum
[getNodeType(PIPE_3AP
)], m_flag3aaIspOTF
, false, m_flagReprocessing
);
977 m_deviceInfo
[pipeId
].pipeId
[nodeType
] = PIPE_ISP
;
980 nodeType
= getNodeType(PIPE_ISPC
);
981 m_deviceInfo
[pipeId
].nodeNum
[nodeType
] = ispNums
[CAPTURE_NODE_2
];
982 strncpy(m_deviceInfo
[pipeId
].nodeName
[nodeType
], "ISP_PREVIEW", EXYNOS_CAMERA_NAME_STR_SIZE
- 1);
983 m_sensorIds
[pipeId
][nodeType
] = -1;
984 m_sensorIds
[pipeId
][nodeType
] = m_getSensorId(m_deviceInfo
[pipeId
].nodeNum
[getNodeType(PIPE_ISP
)], true, false, m_flagReprocessing
);
985 m_deviceInfo
[pipeId
].pipeId
[nodeType
] = PIPE_ISPC
;
987 nodeNums
= m_nodeNums
[INDEX(PIPE_GSC
)];
988 nodeNums
[OUTPUT_NODE
] = PREVIEW_GSC_NODE_NUM
;
989 nodeNums
[CAPTURE_NODE_1
] = -1;
990 nodeNums
[CAPTURE_NODE_2
] = -1;
992 nodeNums
= m_nodeNums
[INDEX(PIPE_GSC_VIDEO
)];
993 nodeNums
[OUTPUT_NODE
] = VIDEO_GSC_NODE_NUM
;
994 nodeNums
[CAPTURE_NODE_1
] = -1;
995 nodeNums
[CAPTURE_NODE_2
] = -1;
997 nodeNums
= m_nodeNums
[INDEX(PIPE_GSC_PICTURE
)];
998 nodeNums
[OUTPUT_NODE
] = PICTURE_GSC_NODE_NUM
;
999 nodeNums
[CAPTURE_NODE_1
] = -1;
1000 nodeNums
[CAPTURE_NODE_2
] = -1;
1002 nodeNums
= m_nodeNums
[INDEX(PIPE_JPEG
)];
1003 nodeNums
[OUTPUT_NODE
] = -1;
1004 nodeNums
[CAPTURE_NODE_1
] = -1;
1005 nodeNums
[CAPTURE_NODE_2
] = -1;
1007 for (int i
= 0; i
< MAX_NODE
; i
++)
1008 m_nodeNums
[pipeId
][i
] = m_deviceInfo
[pipeId
].nodeNum
[i
];
1010 if (m_checkNodeSetting(pipeId
) != NO_ERROR
) {
1011 CLOGE("ERR(%s[%d]):m_checkNodeSetting(%d) fail", __FUNCTION__
, __LINE__
, pipeId
);
1012 return INVALID_OPERATION
;
1018 enum NODE_TYPE
ExynosCameraFrameFactoryFront::getNodeType(uint32_t pipeId
)
1020 enum NODE_TYPE nodeType
= INVALID_NODE
;
1024 nodeType
= CAPTURE_NODE_1
;
1027 nodeType
= OUTPUT_NODE
;
1030 nodeType
= CAPTURE_NODE_1
;
1033 nodeType
= CAPTURE_NODE_2
;
1036 nodeType
= CAPTURE_NODE_3
;
1039 nodeType
= OTF_NODE_1
;
1042 nodeType
= CAPTURE_NODE_5
;
1045 nodeType
= CAPTURE_NODE_6
;
1048 nodeType
= CAPTURE_NODE_7
;
1051 android_printAssert(NULL
, LOG_TAG
, "ASSERT(%s[%d]):Unexpected pipe_id(%d), assert!!!!",
1052 __FUNCTION__
, __LINE__
, pipeId
);
1059 }; /* namespace android */