Lines Matching refs:pme
58 extern int mm_stream_alloc_bufs(mm_camera_app_obj_t *pme,
62 extern int mm_stream_release_bufs(mm_camera_app_obj_t *pme,
64 extern int mm_stream_invalid_cache(mm_camera_app_obj_t *pme,
125 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
128 fmt->fmt = pme->dim.thumb_format;
129 fmt->width = pme->dim.thumbnail_width;
130 fmt->height = pme->dim.thumbnail_height;
143 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
145 fmt->fmt = pme->dim.main_img_format;
146 fmt->width = pme->dim.picture_width;
147 fmt->height = pme->dim.picture_height;
159 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
161 fmt->fmt = pme->dim.enc_format;
162 fmt->width = pme->dim.video_width;
163 fmt->height = pme->dim.video_height;
171 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
174 fmt->fmt = pme->dim.raw_img_format;
175 fmt->width = pme->dim.raw_picture_width;
176 fmt->height = pme->dim.raw_picture_height;
181 CDBG("%s: Raw Snapshot Dimension = %d X %d",__func__,pme->dim.raw_picture_width,pme->dim.raw_picture_height);
198 mm_camera_app_obj_t *pme = NULL;
201 pme = (mm_camera_app_obj_t *)userData;
202 if (jobId != pme->current_job_id || !pme->current_job_frames) {
204 __func__, jobId, pme->current_job_id);
212 mm_app_dump_jpeg_frame(out_data, data_size, "jpeg_dump", "jpg", pme->my_id);
216 pme->current_job_id = 0;
217 for (i=0; i<pme->current_job_frames->num_bufs; i++) {
218 if (MM_CAMERA_OK != pme->cam->ops->qbuf(pme->current_job_frames->camera_handle,
219 pme->current_job_frames->ch_id,
220 pme->current_job_frames->bufs[i])) {
224 free(pme->current_job_frames);
225 pme->current_job_frames = NULL;
231 static int encodeData(mm_camera_app_obj_t *pme,
247 if (pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id == recvd_frame->bufs[i]->stream_id) {
250 dumpFrameToFile(main_frame,pme->dim.picture_width,pme->dim.picture_height,"main", 1,"yuv");
251 } else if (pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id == recvd_frame->bufs[i]->stream_id){
254 dumpFrameToFile(thumb_frame,pme->dim.thumbnail_width,pme->dim.thumbnail_height,"thumb", 1,"yuv");
264 pme->current_job_frames =
266 if (!pme->current_job_frames) {
270 memcpy(pme->current_job_frames, recvd_frame, sizeof(mm_camera_super_buf_t));
275 job.encode_job.userdata = (void*)pme;
281 if (pme->my_id == 0) {
291 main_buf_info->src_dim.width = pme->dim.picture_width;
292 main_buf_info->src_dim.height = pme->dim.picture_height;
293 main_buf_info->out_dim.width = pme->dim.picture_width;
294 main_buf_info->out_dim.height = pme->dim.picture_height;
295 main_buf_info->crop.width = pme->dim.picture_width;
296 main_buf_info->crop.height = pme->dim.picture_height;
303 pme->cam->ops->get_stream_parm(pme->cam->camera_handle,
304 pme->ch_id,
305 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id,
314 mm_stream_clear_invalid_cache(pme,main_frame);
322 thumb_buf_info->src_dim.width = pme->dim.thumbnail_width;
323 thumb_buf_info->src_dim.height = pme->dim.thumbnail_height;
324 thumb_buf_info->out_dim.width = pme->dim.thumbnail_width;
325 thumb_buf_info->out_dim.height = pme->dim.thumbnail_height;
326 thumb_buf_info->crop.width = pme->dim.thumbnail_width;
327 thumb_buf_info->crop.height = pme->dim.thumbnail_height;
334 pme->cam->ops->get_stream_parm(pme->cam->camera_handle,
335 pme->ch_id,
336 pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id,
342 job.encode_job.encode_parm.buf_info.sink_img.buf_len = pme->jpeg_buf.bufs[0].frame_len;
343 job.encode_job.encode_parm.buf_info.sink_img.buf_vaddr = pme->jpeg_buf.bufs[0].buffer;
344 job.encode_job.encode_parm.buf_info.sink_img.fd = pme->jpeg_buf.bufs[0].fd;
346 mm_stream_clear_invalid_cache(pme,thumb_frame);
348 rc = pme->jpeg_ops.start_job(pme->jpeg_hdl, &job, &pme->current_job_id);
350 free(pme->current_job_frames);
351 pme->current_job_frames = NULL;
365 mm_camera_app_obj_t *pme = NULL;
370 pme = (mm_camera_app_obj_t *)user_data;
373 pme->cam->ops->send_command(bufs->camera_handle,
380 rc = encodeData(pme, bufs);
385 if (MM_CAMERA_OK != pme->cam->ops->qbuf(bufs->camera_handle,
390 mm_stream_invalid_cache(pme,bufs->bufs[i]);
399 rc = pme->jpeg_ops.abort_job(pme->jpeg_hdl, pme->current_job_id);
400 if (NULL != pme->current_job_frames) {
401 free(pme->current_job_frames);
402 pme->current_job_frames = NULL;
406 if (MM_CAMERA_OK != pme->cam->ops->qbuf(bufs->camera_handle,
411 mm_stream_invalid_cache(pme,bufs->bufs[i]);
429 mm_camera_app_obj_t *pme = NULL;
433 pme = (mm_camera_app_obj_t *)user_data;
435 if (pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id == recvd_frame->bufs[i]->stream_id) {
438 dumpFrameToFile(main_frame,pme->dim.raw_picture_width,pme->dim.raw_picture_height,"raw_main", 1,"raw");
440 if (MM_CAMERA_OK != pme->cam->ops->qbuf(pme->cam->camera_handle,pme->ch_id,
449 int enqueued, mm_camera_app_obj_t *pme)
456 ret = encodeData(recvd_frame, pme->snapshot_buf.frame_len,
457 enqueued, pme);
470 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
472 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id = pme->cam->ops->add_stream(pme->cam->camera_handle,pme->ch_id,
473 NULL,pme,
476 CDBG("Add Snapshot main is successfull stream ID = %d",pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id);
477 if (!pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id) {
483 pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id = pme->cam->ops->add_stream(pme->cam->camera_handle,pme->ch_id,
484 NULL,pme,
486 if (!pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id) {
499 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
500 pme->cam->ops->set_parm(pme->cam->camera_handle,MM_CAMERA_PARM_OP_MODE, &op_mode);
506 // pme->cam->ops->set_parm(pme->cam->camera_handle, MM_CAMERA_PARM_WAVELET_DENOISE, &wnr);
512 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
516 mm_app_set_raw_snapshot_fmt(cam_id,&pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config.fmt);
518 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config.need_stream_on = 1;
519 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config.num_of_bufs = 1;
521 if (MM_CAMERA_OK != (rc = pme->cam->ops->config_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id,
522 &pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config))) {
536 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
538 mm_app_set_snapshot_fmt(cam_id,&pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config.fmt);
540 mm_app_set_thumbnail_fmt(cam_id,&pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].str_config.fmt);
542 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config.need_stream_on = 1;
543 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config.num_of_bufs = 1;
545 if (MM_CAMERA_OK != (rc = pme->cam->ops->config_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id,
546 &pme->stream[MM_CAMERA_SNAPSHOT_MAIN].str_config))) {
551 pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].str_config.need_stream_on = 1;
552 pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].str_config.num_of_bufs = 1;
554 if (MM_CAMERA_OK != (rc = pme->cam->ops->config_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id,
555 &pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].str_config))) {
571 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
573 stream[0] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
574 stream[1] = pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id;
582 if (MM_CAMERA_OK != (rc = pme->cam->ops->init_stream_bundle(
583 pme->cam->camera_handle,pme->ch_id,snapshot_yuv_cb,pme,&attr,2,stream))) {
588 if (MM_CAMERA_OK != (rc = pme->cam->ops->start_streams(pme->cam->camera_handle,pme->ch_id,
594 if (MM_CAMERA_OK != (rc =pme->cam->ops->request_super_buf(pme->cam->camera_handle,pme->ch_id, attr.burst_num))) {
598 pme->cam_state = CAMERA_STATE_SNAPSHOT;
610 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
612 stream[0] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
620 if (MM_CAMERA_OK != (rc = pme->cam->ops->init_stream_bundle(
621 pme->cam->camera_handle,pme->ch_id,snapshot_raw_cb,pme,&attr,1,stream))) {
626 if (MM_CAMERA_OK != (rc = pme->cam->ops->start_streams(pme->cam->camera_handle,pme->ch_id,
632 if (MM_CAMERA_OK != (rc =pme->cam->ops->request_super_buf(pme->cam->camera_handle,pme->ch_id, attr.burst_num))) {
636 pme->cam_state = CAMERA_STATE_SNAPSHOT;
647 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
649 stream[0] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
650 stream[1] = pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id;
652 if (MM_CAMERA_OK != (rc = pme->cam->ops->stop_streams(pme->cam->camera_handle,pme->ch_id,2,stream))) {
658 if (MM_CAMERA_OK != (rc = pme->cam->ops->destroy_stream_bundle(pme->cam->camera_handle,pme->ch_id))) {
663 if (MM_CAMERA_OK != (rc = pme->cam->ops->del_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id))) {
669 if (MM_CAMERA_OK != (rc = pme->cam->ops->del_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_SNAPSHOT_THUMBNAIL].id))) {
690 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
699 // pme->cam->ops->prepare_snapshot(pme->cam->camera_handle,pme->ch_id,0);
717 pme->cam->ops->get_stream_parm(pme->cam->camera_handle,
718 pme->ch_id,
719 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id,
723 rc = mm_stream_alloc_bufs(pme,
724 &pme->jpeg_buf,
741 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
748 pme->cam->ops->set_parm(pme->cam->camera_handle,MM_CAMERA_PARM_OP_MODE, &op_mode);
751 pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id = pme->cam->ops->add_stream(pme->cam->camera_handle,pme->ch_id,
752 NULL,pme,
755 CDBG("Add RAW main is successfull stream ID = %d",pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id);
756 if (!pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id) {
781 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
783 if (pme->current_job_id) {
785 if (pme->jpeg_ops.abort_job) {
786 pme->jpeg_ops.abort_job(pme->jpeg_hdl, pme->current_job_id);
787 pme->current_job_id = 0;
790 if (pme->current_job_frames) {
791 for (i=0; i<pme->current_job_frames->num_bufs; i++) {
792 if (MM_CAMERA_OK != pme->cam->ops->qbuf(pme->current_job_frames->camera_handle,
793 pme->current_job_frames->ch_id,
794 pme->current_job_frames->bufs[i])) {
797 mm_stream_invalid_cache(pme,pme->current_job_frames->bufs[i]);
799 free(pme->current_job_frames);
800 pme->current_job_frames = NULL;
807 pme->cam_state = CAMERA_STATE_OPEN;
810 rc = mm_stream_release_bufs(pme,
811 &pme->jpeg_buf);
824 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
826 stream[0] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
828 if (MM_CAMERA_OK != (rc = pme->cam->ops->stop_streams(pme->cam->camera_handle,pme->ch_id,1,stream))) {
834 if (MM_CAMERA_OK != (rc = pme->cam->ops->destroy_stream_bundle(pme->cam->camera_handle,pme->ch_id))) {
839 if (MM_CAMERA_OK != (rc = pme->cam->ops->del_stream(pme->cam->camera_handle,pme->ch_id,pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id))) {
845 pme->cam_state = CAMERA_STATE_OPEN;
867 mm_camera_app_obj_t *pme = NULL;
870 pme = (mm_camera_app_obj_t *)user_data;
879 //dumpFrameToFile(main_frame->frame,pme->dim.picture_width,pme->dim.picture_height,"main", 1);
881 dumpFrameToFile(main_frame,pme->dim.picture_width,pme->dim.picture_height,"liveshot_main", 1,"yuv");
883 if (MM_CAMERA_OK != pme->cam->ops->qbuf(pme->cam->camera_handle,pme->ch_id,main_frame)) {
886 mm_stream_invalid_cache(pme,main_frame);
887 /*if(MM_CAMERA_OK != pme->cam->ops->qbuf(pme->cam->camera_handle,pme->ch_id,thumb_frame))
905 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
908 stream[0] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
909 //stream[1] = pme->stream[MM_CAMERA_PREVIEW].id; //Need to clarify
918 if (MM_CAMERA_OK != (rc = pme->cam->ops->set_parm(
919 pme->cam->camera_handle,MM_CAMERA_PARM_FULL_LIVESHOT, (void *)&value))) {
923 if (MM_CAMERA_OK != (rc = pme->cam->ops->init_stream_bundle(
924 pme->cam->camera_handle,pme->ch_id,mm_app_live_notify_cb,pme,&attr,1,stream))) {
930 if (MM_CAMERA_OK != (rc = pme->cam->ops->start_streams(pme->cam->camera_handle,pme->ch_id,
948 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
951 stream[0] = pme->stream[MM_CAMERA_SNAPSHOT_MAIN].id;
952 if (MM_CAMERA_OK != (rc = pme->cam->ops->stop_streams(pme->cam->camera_handle,pme->ch_id,1,stream))) {
957 if (MM_CAMERA_OK != (rc = pme->cam->ops->destroy_stream_bundle(pme->cam->camera_handle,pme->ch_id))) {
971 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
975 if (pme->cam_mode == RECORDER_MODE &&
976 pme->cam_state == CAMERA_STATE_RECORD) {
982 if (MM_CAMERA_OK != (rc =pme->cam->ops->request_super_buf(pme->cam->camera_handle,pme->ch_id, 1))) {
1003 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1035 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1039 if (MM_CAMERA_OK != (rc =pme->cam->ops->request_super_buf(pme->cam->camera_handle,pme->ch_id, 1))) {
1054 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1084 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1088 if (pme->cam_mode == RECORDER_MODE) {
1089 switch (pme->cam_state) {
1106 } else if (pme->cam_mode == CAMERA_MODE) {
1107 switch (pme->cam_state) {
1120 if (pme->cam_mode == ZSL_MODE && pme->cam_state == CAMERA_STATE_PREVIEW) {
1130 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1134 if (pme->cam_mode == RECORDER_MODE) {
1135 switch (pme->cam_state) {
1152 } else if (pme->cam_mode == ZSL_MODE) {
1153 switch (pme->cam_state) {
1166 CDBG("%s : Takepicture : mode = %d state = %d, rc = %d",__func__,pme->cam_mode,pme->cam_state,rc);
1167 if (pme->cam_mode == CAMERA_MODE && pme->cam_state == CAMERA_STATE_PREVIEW) {
1178 mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
1182 if (pme->cam_mode == RECORDER_MODE) {
1183 switch (pme->cam_state) {
1200 } else if (pme->cam_mode == ZSL_MODE) {
1201 switch (pme->cam_state) {
1214 CDBG("%s : Takepicture RAW: mode = %d state = %d, rc = %d",__func__,pme->cam_mode,pme->cam_state,rc);
1215 if (pme->cam_mode == CAMERA_MODE && pme->cam_state == CAMERA_STATE_PREVIEW) {