Lines Matching refs:pme
114 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
117 fmt->fmt = pme->dim.prev_format;
118 fmt->width = pme->dim.display_width;
119 fmt->height = pme->dim.display_height;
178 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
180 if (pme->cam_mode == CAMERA_MODE) {
189 pme->cam->ops->set_parm(pme->cam->camera_handle,MM_CAMERA_PARM_RECORDING_HINT, &value);
196 pme->cam_mode = CAMERA_MODE;
207 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
209 if (pme->cam_mode == ZSL_MODE) {
218 pme->cam->ops->set_parm(pme->cam->camera_handle,MM_CAMERA_PARM_RECORDING_HINT, &value);
224 pme->cam_mode = ZSL_MODE;
236 mm_camera_app_obj_t *pme = (mm_camera_app_obj_t *)user_data;
238 rc = my_cam_app.hal_lib.mm_camera_do_munmap_ion (pme->ionfd, &(pme->preview_buf.frame[i].fd_data),
239 (void *)pme->preview_buf.frame[i].buffer, bufs[i].frame_len);
245 close(pme->ionfd);
261 mm_camera_app_obj_t *pme = (mm_camera_app_obj_t *)user_data;
276 pme->preview_buf.reg[i] = 1;
279 pme->preview_buf.frame_len = frame_len;
280 pme->preview_buf.frame[i].ion_alloc.len = pme->preview_buf.frame_len;
281 pme->preview_buf.frame[i].ion_alloc.flags =
283 pme->preview_buf.frame[i].ion_alloc.align = 4096;
285 pmem_addr = (unsigned long) my_cam_app.hal_lib.mm_camera_do_mmap_ion(pme->ionfd,
286 &(pme->preview_buf.frame[i].ion_alloc), &(pme->preview_buf.frame[i].fd_data),
287 &pme->preview_buf.frame[i].fd);
289 pme->preview_buf.frame[i].buffer = pmem_addr;
290 pme->preview_buf.frame[i].path = OUTPUT_TYPE_P;
291 pme->preview_buf.frame[i].y_off = 0;
292 pme->preview_buf.frame[i].cbcr_off = planes[0];
293 pme->preview_buf.frame[i].phy_offset = 0;
295 CDBG("Buffer allocated Successfully fd = %d",pme->preview_buf.frame[i].fd);
297 bufs[i].fd = pme->preview_buf.frame[i].fd;
299 bufs[i].frame_len = pme->preview_buf.frame[i].ion_alloc.len;
302 bufs[i].frame = &pme->preview_buf.frame[i];
339 mm_camera_app_obj_t *pme = (mm_camera_app_obj_t *)user_data;
353 pme->ionfd = open("/dev/ion", O_RDONLY);
354 if (pme->ionfd < 0) {
362 //if(pme->cam_mode != RECORDER_MODE || pme->fullSizeSnapshot) {
373 /*bufs[i].buffer = my_cam_app.hal_lib.mm_camera_do_mmap_ion(pme->ionfd,
377 bufs[i].buffer = mm_camera_do_mmap_ion(pme->ionfd,
418 mm_camera_app_obj_t *pme = (mm_camera_app_obj_t *)user_data;
423 if (pme->stream[i].id == stream_id) {
482 mm_camera_app_obj_t *pme = (mm_camera_app_obj_t *)user_data;
487 /*rc = my_cam_app.hal_lib.mm_camera_do_munmap_ion (pme->ionfd, &bufs[i].fd,
489 rc = mm_camera_do_munmap_ion (pme->ionfd, &bufs[i].fd,
492 close(pme->ionfd);
505 mm_camera_app_obj_t *pme = (mm_camera_app_obj_t *)user_data;
509 if (pme->stream[i].id == stream_id) {
551 void preview_cb_signal(mm_camera_app_obj_t *pme)
553 if (pme->cam_state == CAMERA_STATE_PREVIEW) {
563 mm_camera_app_obj_t *pme = NULL;
566 pme = (mm_camera_app_obj_t *)user_data;
570 //dumpFrameToFile(frame->frame,pme->dim.display_width,pme->dim.display_height,"preview", 1);
571 dumpFrameToFile(frame,pme->dim.display_width,pme->dim.display_height,"preview", 1);
581 if (MM_CAMERA_OK != pme->cam->ops->qbuf(pme->cam->camera_handle,pme->ch_id,frame)) {
586 preview_cb_signal(pme);
600 mm_camera_app_obj_t *pme = NULL;
603 pme = (mm_camera_app_obj_t *)user_data;
610 //dumpFrameToFile(preview_frame->frame,pme->dim.display_width,pme->dim.display_height,"preview", 1);
611 dumpFrameToFile(preview_frame,pme->dim.display_width,pme->dim.display_height,"zsl_preview", 1);
621 //dumpFrameToFile(main_frame->frame,pme->dim.picture_width,pme->dim.picture_height,"main", 1);
622 //dumpFrameToFile(thumb_frame->frame,pme->dim.thumbnail_width,pme->dim.thumbnail_height,"thumb", 1);
624 dumpFrameToFile(main_frame,pme->dim.picture_width,pme->dim.picture_height,"zsl_main", 1);
625 dumpFrameToFile(thumb_frame,pme->dim.thumbnail_width,pme->dim.thumbnail_height,"zsl_thumb", 1);
627 if (MM_CAMERA_OK != pme->cam->ops->qbuf(pme->cam->camera_handle,pme->ch_id,main_frame)) {
632 if (MM_CAMERA_OK != pme->cam->ops->qbuf(pme->cam->camera_handle,pme->ch_id,preview_frame)) {
644 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
646 pme->mem_cam->get_buf = mm_stream_initbuf;
647 pme->mem_cam->put_buf = mm_stream_deinitbuf;
648 pme->mem_cam->user_data = pme;
651 if (MM_CAMERA_OK != (rc = pme->cam->ops->set_parm(
652 pme->cam->camera_handle,MM_CAMERA_PARM_OP_MODE, &op_mode))) {
657 pme->stream[MM_CAMERA_PREVIEW].id = pme->cam->ops->add_stream(pme->cam->camera_handle,pme->ch_id,
658 mm_app_preview_notify_cb,pme,
661 if (!pme->stream[MM_CAMERA_PREVIEW].id) {
667 CDBG("%s :Add stream is successfull stream ID = %d",__func__,pme->stream[MM_CAMERA_PREVIEW].id);
669 mm_app_set_preview_fmt(cam_id,&pme->stream[MM_CAMERA_PREVIEW].str_config.fmt);
670 pme->stream[MM_CAMERA_PREVIEW].str_config.need_stream_on = 1;
671 pme->stream[MM_CAMERA_PREVIEW].str_config.num_of_bufs = PREVIEW_BUF_NUM;
673 if (MM_CAMERA_OK != (rc = pme->cam->ops->config_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_PREVIEW].id,
674 &pme->stream[MM_CAMERA_PREVIEW].str_config))) {
692 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
695 stream[0] = pme->stream[MM_CAMERA_PREVIEW].id;
698 pme->cam->ops->get_stream_parm(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_PREVIEW].id,MM_CAMERA_STREAM_OFFSET,&frame_offset_info);
700 if (MM_CAMERA_OK != (rc = pme->cam->ops->start_streams(pme->cam->camera_handle,pme->ch_id,1,&stream))) {
704 pme->cam_state = CAMERA_STATE_PREVIEW;
716 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
720 if (MM_CAMERA_OK != (rc = pme->cam->ops->set_parm(
721 pme->cam->camera_handle,MM_CAMERA_PARM_OP_MODE, &op_mode))) {
726 pme->stream[MM_CAMERA_PREVIEW].id = pme->cam->ops->add_stream(pme->cam->camera_handle,pme->ch_id,
727 mm_app_preview_notify_cb,pme,
730 if (!pme->stream[MM_CAMERA_PREVIEW].id) {
735 CDBG("%s :Add stream is successfull stream ID = %d",__func__,pme->stream[MM_CAMERA_PREVIEW].id);
737 mm_app_set_preview_fmt(cam_id,&pme->stream[MM_CAMERA_PREVIEW].str_config.fmt);
738 pme->stream[MM_CAMERA_PREVIEW].str_config.need_stream_on = 1;
739 pme->stream[MM_CAMERA_PREVIEW].str_config.num_of_bufs = PREVIEW_BUF_NUM;
741 if (MM_CAMERA_OK != (rc = pme->cam->ops->config_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_PREVIEW].id,
742 &pme->stream[MM_CAMERA_PREVIEW].str_config))) {
747 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id = pme->cam->ops->add_stream(pme->cam->camera_handle,pme->ch_id,
748 NULL,pme,
751 CDBG("Add Snapshot main is successfull stream ID = %d",pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id);
752 if (!pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id) {
758 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config.need_stream_on = 1;
759 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config.num_of_bufs = 7;
761 mm_app_set_snapshot_fmt(cam_id,&pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config.fmt);
764 if (MM_CAMERA_OK != (rc = pme->cam->ops->config_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id,
765 &pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config))) {
780 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
784 stream[0] = pme->stream[MM_CAMERA_PREVIEW].id;
785 stream[1] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
793 if (MM_CAMERA_OK != (rc = pme->cam->ops->init_stream_bundle(
794 pme->cam->camera_handle,pme->ch_id,mm_app_zsl_notify_cb,pme,&attr,2,stream))) {
800 if (MM_CAMERA_OK != (rc = pme->cam->ops->start_streams(pme->cam->camera_handle,pme->ch_id,
806 pme->cam_state = CAMERA_STATE_PREVIEW;
837 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
840 CDBG("pme = %p, pme->cam =%p, pme->cam->camera_handle = %d",
841 pme,pme->cam,pme->cam->camera_handle);
843 if (pme->cam_state == CAMERA_STATE_PREVIEW) {
873 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
875 CDBG("pme = %p, pme->cam =%p, pme->cam->camera_handle = %d",
876 pme,pme->cam,pme->cam->camera_handle);
885 pme->mem_cam->get_buf = mm_stream_initbuf;
886 pme->mem_cam->put_buf = mm_stream_deinitbuf;
887 pme->mem_cam->user_data = pme;
914 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
916 stream[0] = pme->stream[MM_CAMERA_PREVIEW].id;
919 if (MM_CAMERA_OK != (rc = pme->cam->ops->stop_streams(pme->cam->camera_handle,pme->ch_id,1,&stream))) {
924 if (MM_CAMERA_OK != (rc = pme->cam->ops->del_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_PREVIEW].id))) {
929 pme->cam_state = CAMERA_STATE_OPEN;
941 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
943 stream[0] = pme->stream[MM_CAMERA_PREVIEW].id;
944 stream[1] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
946 if (MM_CAMERA_OK != (rc = pme->cam->ops->destroy_stream_bundle(pme->cam->camera_handle,pme->ch_id))) {
951 if (MM_CAMERA_OK != (rc = pme->cam->ops->stop_streams(pme->cam->camera_handle,pme->ch_id,2,&stream))) {
956 if (MM_CAMERA_OK != (rc = pme->cam->ops->del_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_PREVIEW].id))) {
961 if (MM_CAMERA_OK != (rc = pme->cam->ops->del_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id))) {
966 pme->cam_state = CAMERA_STATE_OPEN;
977 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
981 if (pme->cam_mode == ZSL_MODE || pme->cam_mode == RECORDER_MODE) {
982 switch (pme->cam_state) {
998 } else if (pme->cam_mode == CAMERA_MODE && pme->cam_state == CAMERA_STATE_OPEN) {
1012 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1014 CDBG("%s : pme->cam_mode = %d, pme->cam_state = %d",__func__,pme->cam_mode,pme->cam_state);
1016 if (pme->cam_mode == CAMERA_MODE && pme->cam_state == CAMERA_STATE_PREVIEW) {
1021 } else if (pme->cam_mode == ZSL_MODE && pme->cam_state == CAMERA_STATE_PREVIEW) {
1026 } else if (pme->cam_mode == RECORDER_MODE && pme->cam_state == CAMERA_STATE_PREVIEW) {
1041 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1062 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);