Lines Matching refs:pme
110 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
113 fmt->fmt = pme->dim.thumb_format;
114 fmt->width = pme->dim.thumbnail_width;
115 fmt->height = pme->dim.thumbnail_height;
124 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
126 fmt->fmt = pme->dim.main_img_format;
127 fmt->width = pme->dim.picture_width;
128 fmt->height = pme->dim.picture_height;
136 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
138 fmt->fmt = pme->dim.enc_format;
139 fmt->width = pme->dim.video_width;
140 fmt->height = pme->dim.video_height;
150 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
158 fmt.def.dim.width = pme->dim.raw_picture_width;
159 fmt.def.dim.height = pme->dim.raw_picture_height;
160 rc = pme->cam->cfg->set_parm(pme->cam, MM_CAMERA_PARM_CH_IMAGE_FMT, &fmt);
175 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
182 __func__, pme->dim.raw_picture_width, pme->dim.raw_picture_height);
192 memset(&pme->raw_snapshot_buf, 0, sizeof(pme->raw_snapshot_buf));
193 pme->raw_snapshot_buf.num = 1;
194 pme->raw_snapshot_buf.frame_len =
197 pme->dim.raw_picture_width,
198 pme->dim.raw_picture_height,
203 pme->raw_snapshot_buf.frame[0].ion_alloc.len = pme->raw_snapshot_buf.frame_len;
204 pme->raw_snapshot_buf.frame[0].ion_alloc.flags = (0x1 << CAMERA_ION_HEAP_ID);
205 pme->raw_snapshot_buf.frame[0].ion_alloc.align = 4096;
207 pme->raw_snapshot_buf.frame[0].buffer = (unsigned long) my_cam_app.hal_lib.mm_camera_do_mmap(
208 pme->raw_snapshot_buf.frame_len, &pme->raw_snapshot_buf.frame[0].fd);
211 if (!pme->raw_snapshot_buf.frame[0].buffer) {
216 pme->raw_snapshot_buf.frame[0].path = OUTPUT_TYPE_S;
217 pme->preview_buf.frame[0].y_off = 0;
218 pme->raw_snapshot_buf.frame[0].cbcr_off = planes_main[0];
221 reg_buf.def.buf.mp[0].frame = pme->raw_snapshot_buf.frame[0];
226 reg_buf.def.buf.mp[0].planes[0].m.userptr = pme->raw_snapshot_buf.frame[0].fd;
231 reg_buf.def.buf.mp[0].planes[j].m.userptr = pme->raw_snapshot_buf.frame[0].fd;
238 reg_buf.def.num = pme->raw_snapshot_buf.num;
239 rc = pme->cam->cfg->prepare_buf(pme->cam, ®_buf);
255 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
258 rc = pme->cam->cfg->unprepare_buf(pme->cam, MM_CAMERA_CH_RAW);
259 rc = my_cam_app.hal_lib.mm_camera_do_munmap(pme->raw_snapshot_buf.frame[0].fd,
260 (void *)pme->raw_snapshot_buf.frame[0].buffer,
261 pme->raw_snapshot_buf.frame_len);
262 rc = my_cam_app.hal_lib.mm_camera_do_munmap(pme->jpeg_buf.frame[0].fd,
263 (void *)pme->jpeg_buf.frame[0].buffer,
264 pme->jpeg_buf.frame_len);
266 memset(&pme->raw_snapshot_buf, 0, sizeof(pme->raw_snapshot_buf));
267 memset(&pme->jpeg_buf, 0, sizeof(pme->jpeg_buf));
284 mm_camera_app_obj_t *pme = user_data;
287 if (pme) {
288 memcpy((uint8_t *)((uint32_t)pme->jpeg_buf.frame[0].buffer + JpegOffset), ptr, size);
304 mm_camera_app_obj_t *pme = NULL;
307 pme = (mm_camera_app_obj_t *)user_data;
316 //dumpFrameToFile(main_frame->frame,pme->dim.picture_width,pme->dim.picture_height,"main", 1);
317 //dumpFrameToFile(thumb_frame->frame,pme->dim.thumbnail_width,pme->dim.thumbnail_height,"thumb", 1);
319 dumpFrameToFile(main_frame,pme->dim.picture_width,pme->dim.picture_height,"main", 1);
320 dumpFrameToFile(thumb_frame,pme->dim.thumbnail_width,pme->dim.thumbnail_height,"thumb", 1);
322 if (MM_CAMERA_OK != pme->cam->ops->qbuf(pme->cam->camera_handle,pme->ch_id,main_frame)) {
325 if (MM_CAMERA_OK != pme->cam->ops->qbuf(pme->cam->camera_handle,pme->ch_id,thumb_frame)) {
339 mm_camera_app_obj_t *pme)
357 dimension.orig_picture_dx = pme->dim.picture_width;
358 dimension.orig_picture_dy = pme->dim.picture_height;
359 dimension.thumbnail_width = pme->dim.ui_thumbnail_width;
360 dimension.thumbnail_height = pme->dim.ui_thumbnail_height;
361 dimension.main_img_format = pme->dim.main_img_format;
362 dimension.thumb_format = pme->dim.thumb_format;
365 my_cam_app.hal_lib.set_callbacks(snapshot_jpeg_fragment_cb, snapshot_jpeg_cb, pme,
366 (void *)pme->jpeg_buf.frame[0].buffer, &JpegOffset);
408 int enqueued, mm_camera_app_obj_t *pme)
415 ret = encodeData(recvd_frame, pme->snapshot_buf.frame_len,
416 enqueued, pme);
430 mm_camera_app_obj_t *pme = user_data;
435 mm_app_dump_snapshot_frame(bufs->snapshot.main.frame, pme->snapshot_buf.frame_len, TRUE, 0);
436 mm_app_dump_snapshot_frame(bufs->snapshot.thumbnail.frame, pme->thumbnail_buf.frame_len, FALSE, 0);
449 rc = encodeDisplayAndSave(frame, 0, pme);
456 pme->cam->evt->buf_done(pme->cam, bufs);
468 pme->cam->evt->buf_done(pme->cam, bufs);
478 mm_camera_app_obj_t *pme = user_data;
483 mm_app_dump_snapshot_frame(bufs->def.frame, pme->raw_snapshot_buf.frame_len, TRUE, 1);
485 pme->cam->evt->buf_done(pme->cam, bufs);
495 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
500 rc = pme->cam->evt->register_buf_notify(pme->cam,
504 pme);
511 rc = pme->cam->evt->register_buf_notify(pme->cam,
515 0, pme);
531 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
536 rc = pme->cam->evt->register_buf_notify(pme->cam,
540 pme);
547 rc = pme->cam->evt->register_buf_notify(pme->cam,
550 (mm_camera_register_buf_cb_type_t)NULL, 0, pme);
566 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
568 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id = pme->cam->ops->add_stream(pme->cam->camera_handle,pme->ch_id,
569 NULL,pme,
572 CDBG("Add Snapshot main is successfull stream ID = %d",pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id);
573 if (!pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id) {
579 pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id = pme->cam->ops->add_stream(pme->cam->camera_handle,pme->ch_id,
580 NULL,pme,
582 if (!pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id) {
594 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
595 pme->cam->ops->set_parm(pme->cam->camera_handle,MM_CAMERA_PARM_OP_MODE, &op_mode);
602 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
604 mm_app_set_snapshot_fmt(cam_id,&pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config.fmt);
606 mm_app_set_thumbnail_fmt(cam_id,&pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].str_config.fmt);
608 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config.need_stream_on = 1;
609 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config.num_of_bufs = 1;
611 if (MM_CAMERA_OK != (rc = pme->cam->ops->config_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id,
612 &pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config))) {
617 pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].str_config.need_stream_on = 1;
618 pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].str_config.num_of_bufs = 1;
620 if (MM_CAMERA_OK != (rc = pme->cam->ops->config_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id,
621 &pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].str_config))) {
637 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
639 stream[0] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
640 stream[1] = pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id;
648 if (MM_CAMERA_OK != (rc = pme->cam->ops->init_stream_bundle(
649 pme->cam->camera_handle,pme->ch_id,snapshot_raw_cb,pme,&attr,2,stream))) {
654 if (MM_CAMERA_OK != (rc = pme->cam->ops->start_streams(pme->cam->camera_handle,pme->ch_id,
660 if (MM_CAMERA_OK != (rc =pme->cam->ops->request_super_buf(pme->cam->camera_handle,pme->ch_id))) {
664 pme->cam_state = CAMERA_STATE_SNAPSHOT;
675 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
677 stream[0] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
678 stream[1] = pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id;
680 if (MM_CAMERA_OK != (rc = pme->cam->ops->stop_streams(pme->cam->camera_handle,pme->ch_id,2,&stream))) {
686 if (MM_CAMERA_OK != (rc = pme->cam->ops->destroy_stream_bundle(pme->cam->camera_handle,pme->ch_id))) {
691 if (MM_CAMERA_OK != (rc = pme->cam->ops->del_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id))) {
697 if (MM_CAMERA_OK != (rc = pme->cam->ops->del_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id))) {
716 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
726 pme->cam->ops->prepare_snapshot(pme->cam->camera_handle,pme->ch_id,0);
759 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
761 stream[0] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
762 stream[1] = pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id;
767 pme->cam_state = CAMERA_STATE_OPEN;
783 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
811 if (MM_CAMERA_OK != (rc = pme->cam->ops->ch_set_attr(pme->cam, MM_CAMERA_CH_RAW, &attr))) {
815 if (MM_CAMERA_OK != (rc = pme->cam->ops->action(pme->cam, TRUE, MM_CAMERA_OPS_RAW, 0))) {
829 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
833 if (MM_CAMERA_OK != (rc = pme->cam->ops->action(pme->cam, FALSE, MM_CAMERA_OPS_RAW, 0))) {
869 mm_camera_app_obj_t *pme = (mm_camera_app_obj_t *)user_data;
872 rc = my_cam_app.hal_lib.mm_camera_do_munmap_ion (pme->ionfd, &(pme->thumbnail_buf.frame[i].fd_data),
873 (void *)pme->thumbnail_buf.frame[i].buffer, pme->thumbnail_buf.frame_len);
888 mm_camera_app_obj_t *pme = (mm_camera_app_obj_t *)user_data;
891 rc = my_cam_app.hal_lib.mm_camera_do_munmap_ion (pme->ionfd, &(pme->snapshot_buf.frame[i].fd_data),
892 (void *)pme->snapshot_buf.frame[i].buffer, pme->snapshot_buf.frame_len);
913 mm_camera_app_obj_t *pme = (mm_camera_app_obj_t *)user_data;
928 if (pme->cam_mode != RECORDER_MODE || pme->fullSizeSnapshot) {
929 pme->snapshot_buf.reg[i] = 1;
932 pme->snapshot_buf.reg[i] = 0;
936 pme->snapshot_buf.frame_len = frame_len;
938 pme->snapshot_buf.frame[i].ion_alloc.len = pme->snapshot_buf.frame_len;
939 pme->snapshot_buf.frame[i].ion_alloc.flags =
941 pme->snapshot_buf.frame[i].ion_alloc.align = 4096;
943 pmem_addr = (unsigned long) my_cam_app.hal_lib.mm_camera_do_mmap_ion(pme->ionfd,
944 &(pme->snapshot_buf.frame[i].ion_alloc), &(pme->snapshot_buf.frame[i].fd_data),
945 &pme->snapshot_buf.frame[i].fd);
947 pme->snapshot_buf.frame[i].buffer = pmem_addr;
948 pme->snapshot_buf.frame[i].path = OUTPUT_TYPE_S;
949 pme->snapshot_buf.frame[i].y_off = 0;
950 pme->snapshot_buf.frame[i].cbcr_off = planes[0];
951 pme->snapshot_buf.frame[i].phy_offset = 0;
953 CDBG("Buffer allocated Successfully fd = %d",pme->snapshot_buf.frame[i].fd);
955 bufs[i].fd = pme->snapshot_buf.frame[i].fd;
957 bufs[i].frame_len = pme->snapshot_buf.frame[i].ion_alloc.len;
960 bufs[i].frame = &pme->snapshot_buf.frame[i];
993 mm_camera_app_obj_t *pme = (mm_camera_app_obj_t *)user_data;
1008 pme->thumbnail_buf.reg[i] = 1;
1011 pme->thumbnail_buf.frame_len = frame_len;
1012 pme->thumbnail_buf.frame[i].ion_alloc.len = pme->thumbnail_buf.frame_len;
1013 pme->thumbnail_buf.frame[i].ion_alloc.flags =
1015 pme->thumbnail_buf.frame[i].ion_alloc.align = 4096;
1017 pmem_addr = (unsigned long) my_cam_app.hal_lib.mm_camera_do_mmap_ion(pme->ionfd,
1018 &(pme->thumbnail_buf.frame[i].ion_alloc), &(pme->thumbnail_buf.frame[i].fd_data),
1019 &pme->thumbnail_buf.frame[i].fd);
1021 pme->thumbnail_buf.frame[i].buffer = pmem_addr;
1022 pme->thumbnail_buf.frame[i].path = OUTPUT_TYPE_S;
1023 pme->thumbnail_buf.frame[i].y_off = 0;
1024 pme->thumbnail_buf.frame[i].cbcr_off = planes[0];
1025 pme->thumbnail_buf.frame[i].phy_offset = 0;
1027 CDBG("Buffer allocated Successfully fd = %d",pme->thumbnail_buf.frame[i].fd);
1029 bufs[i].fd = pme->thumbnail_buf.frame[i].fd;
1031 bufs[i].frame_len = pme->thumbnail_buf.frame[i].ion_alloc.len;
1034 bufs[i].frame = &pme->thumbnail_buf.frame[i];
1062 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1064 stream[0] = pme->stream[MM_CAMERA_PREVIEW].id;
1065 stream[1] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
1073 if (MM_CAMERA_OK != (rc = pme->cam->ops->init_stream_bundle(
1074 pme->cam->camera_handle,pme->ch_id,mm_app_zsl_notify_cb,pme,&attr,2,stream))) {
1080 if (MM_CAMERA_OK != (rc = pme->cam->ops->start_streams(pme->cam->camera_handle,pme->ch_id,
1098 mm_camera_app_obj_t *pme = NULL;
1101 pme = (mm_camera_app_obj_t *)user_data;
1110 //dumpFrameToFile(main_frame->frame,pme->dim.picture_width,pme->dim.picture_height,"main", 1);
1112 dumpFrameToFile(main_frame,pme->dim.picture_width,pme->dim.picture_height,"liveshot_main", 1);
1114 if (MM_CAMERA_OK != pme->cam->ops->qbuf(pme->cam->camera_handle,pme->ch_id,main_frame)) {
1117 /*if(MM_CAMERA_OK != pme->cam->ops->qbuf(pme->cam->camera_handle,pme->ch_id,thumb_frame))
1135 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1138 stream[0] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
1139 //stream[1] = pme->stream[MM_CAMERA_PREVIEW].id; //Need to clarify
1148 if (MM_CAMERA_OK != (rc = pme->cam->ops->set_parm(
1149 pme->cam->camera_handle,MM_CAMERA_PARM_FULL_LIVESHOT, (void *)&value))) {
1153 if (MM_CAMERA_OK != (rc = pme->cam->ops->init_stream_bundle(
1154 pme->cam->camera_handle,pme->ch_id,mm_app_live_notify_cb,pme,&attr,1,stream))) {
1160 if (MM_CAMERA_OK != (rc = pme->cam->ops->start_streams(pme->cam->camera_handle,pme->ch_id,
1178 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1181 stream[0] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
1182 if (MM_CAMERA_OK != (rc = pme->cam->ops->stop_streams(pme->cam->camera_handle,pme->ch_id,1,&stream))) {
1187 if (MM_CAMERA_OK != (rc = pme->cam->ops->destroy_stream_bundle(pme->cam->camera_handle,pme->ch_id))) {
1201 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1205 if (pme->cam_mode == RECORDER_MODE &&
1206 pme->cam_state == CAMERA_STATE_RECORD) {
1212 if (MM_CAMERA_OK != (rc =pme->cam->ops->request_super_buf(pme->cam->camera_handle,pme->ch_id))) {
1235 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1239 if (MM_CAMERA_OK != (rc =pme->cam->ops->request_super_buf(pme->cam->camera_handle,pme->ch_id))) {
1254 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1284 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1288 if (pme->cam_mode == RECORDER_MODE) {
1289 switch (pme->cam_state) {
1306 } else if (pme->cam_mode == CAMERA_MODE) {
1307 switch (pme->cam_state) {
1320 if (pme->cam_mode == ZSL_MODE && pme->cam_state == CAMERA_STATE_PREVIEW) {
1330 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1334 if (pme->cam_mode == RECORDER_MODE) {
1335 switch (pme->cam_state) {
1352 } else if (pme->cam_mode == ZSL_MODE) {
1353 switch (pme->cam_state) {
1366 CDBG("%s : Takepicture : mode = %d state = %d, rc = %d",__func__,pme->cam_mode,pme->cam_state,rc);
1367 if (pme->cam_mode == CAMERA_MODE && pme->cam_state == CAMERA_STATE_PREVIEW) {
1377 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1381 if (MM_CAMERA_OK != (rc = pme->cam->ops->action(pme->cam, TRUE, MM_CAMERA_OPS_PREPARE_SNAPSHOT, 0))) {