Beispiel #1
0
static int mm_app_open_video(int cam_id)
{
	mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
	int rc = MM_CAMERA_OK;

	CDBG("%s: BEGIN\n", __func__);
	if(MM_CAMERA_OK != (rc = mm_app_open_ch(cam_id, MM_CAMERA_CH_VIDEO))) {
		CDBG("%s:open video channel err=%d\n", __func__, rc);
		goto end;
	}
end:
CDBG("%s: END, rc = %d\n", __func__, rc);
	return rc;
}
int mm_app_start_raw_snapshot(int cam_id)
{
    int rc = MM_CAMERA_OK;
#if 0
    mm_camera_app_obj_t *pme = mm_app_get_cam_obj(cam_id);
    mm_camera_channel_attr_t attr;


    attr.type = MM_CAMERA_CH_ATTR_RAW_STREAMING_TYPE;
    attr.raw_streaming_mode = MM_CAMERA_RAW_STREAMING_CAPTURE_SINGLE;

    if (MM_CAMERA_OK != (rc = mm_app_set_op_mode(cam_id, MM_CAMERA_OP_MODE_CAPTURE))) {
        CDBG("%s:mm_app_set_op_mode(op_mode=%d) err=%d\n", __func__,
             MM_CAMERA_OP_MODE_CAPTURE, rc);
        goto end;
    }
    if (MM_CAMERA_OK != (rc = mm_app_open_ch(cam_id, MM_CAMERA_CH_RAW))) {
        CDBG("%s:open raw snapshot channel err=%d\n", __func__, rc);
        goto end;
    }
    if (MM_CAMERA_OK != (rc = mm_app_set_raw_snapshot_fmt(cam_id))) {
        CDBG("%s:set raw snapshot format err=%d\n", __func__, rc);
        goto end;
    }
    mm_app_get_dim(cam_id, NULL);
    if (MM_CAMERA_OK != (rc = mm_app_prepare_raw_snapshot_buf(cam_id))) {
        CDBG("%s:reg raw snapshot buf err=%d\n", __func__, rc);
        goto end;
    }
    if (MM_CAMERA_OK != (rc = mm_app_reg_raw_snapshot_data_cb(cam_id, TRUE))) {
        CDBG("%s:reg raw snapshot data cb err=%d\n", __func__, rc);
    }
    if (MM_CAMERA_OK != (rc = pme->cam->ops->ch_set_attr(pme->cam, MM_CAMERA_CH_RAW, &attr))) {
        CDBG("%s:set raw capture attribute err=%d\n", __func__, rc);
        goto end;
    }
    if (MM_CAMERA_OK != (rc = pme->cam->ops->action(pme->cam, TRUE, MM_CAMERA_OPS_RAW, 0))) {
        CDBG("%s:snapshot streaming err=%d\n", __func__, rc);
        goto end;
    }
end:
    CDBG("%s: END, rc=%d\n", __func__, rc);
#endif
    return rc;
}