您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ v4l2_event_queue函数代码示例

51自学网 2021-06-03 09:29:37
  C++
这篇教程C++ v4l2_event_queue函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中v4l2_event_queue函数的典型用法代码示例。如果您正苦于以下问题:C++ v4l2_event_queue函数的具体用法?C++ v4l2_event_queue怎么用?C++ v4l2_event_queue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了v4l2_event_queue函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: msm_mctl_pp_notify

int msm_mctl_pp_notify(struct msm_cam_media_controller *p_mctl,			struct msm_mctl_pp_frame_info *pp_frame_info){		struct msm_mctl_pp_frame_cmd *pp_frame_cmd;		pp_frame_cmd = &pp_frame_info->pp_frame_cmd;		D("%s: msm_cam_evt_divert_frame=%d",			__func__, sizeof(struct msm_mctl_pp_event_info));		if ((MSM_MCTL_PP_VPE_FRAME_TO_APP &			pp_frame_cmd->vpe_output_action)) {			struct msm_free_buf done_frame;			int msg_type =				msm_mctl_pp_path_to_msg_type(					pp_frame_cmd->path);			done_frame.ch_paddr[0] =				pp_frame_info->dest_frame.sp.phy_addr;			done_frame.vb =				pp_frame_info->dest_frame.handle;			msm_mctl_buf_done_pp(				p_mctl, msg_type, &done_frame, 0);			pr_info("%s: vpe done to app, vb=0x%x, path=%d, phy=0x%x",				__func__, done_frame.vb,				pp_frame_cmd->path, done_frame.ch_paddr[0]);		}		if ((MSM_MCTL_PP_VPE_FRAME_ACK &			pp_frame_cmd->vpe_output_action)) {			struct v4l2_event v4l2_evt;			struct msm_mctl_pp_event_info *pp_event_info;			struct msm_isp_event_ctrl *isp_event;			isp_event = kzalloc(sizeof(struct msm_isp_event_ctrl),								GFP_ATOMIC);			if (!isp_event) {				pr_err("%s Insufficient memory.", __func__);				return -ENOMEM;			}			memset(&v4l2_evt, 0, sizeof(v4l2_evt));			*((uint32_t *)v4l2_evt.u.data) = (uint32_t)isp_event;			/* Get hold of pp event info struct inside event ctrl.*/			pp_event_info = &(isp_event->isp_data.pp_event_info);			pp_event_info->event = MCTL_PP_EVENT_CMD_ACK;			pp_event_info->ack.cmd = pp_frame_info->user_cmd;			pp_event_info->ack.status = 0;			pp_event_info->ack.cookie = pp_frame_cmd->cookie;			v4l2_evt.type = V4L2_EVENT_PRIVATE_START +						MSM_CAM_RESP_MCTL_PP_EVENT;			v4l2_event_queue(				p_mctl->config_device->					config_stat_event_queue.pvdev,				&v4l2_evt);			D("%s: ack to daemon, cookie=0x%x, event = 0x%x",				__func__, pp_frame_info->pp_frame_cmd.cookie,				v4l2_evt.type);		}		kfree(pp_frame_info); /* free mem */		return 0;}
开发者ID:KernelStalker,项目名称:GalaxyS3_Tmo-Att_Kernel,代码行数:60,


示例2: msm_cpp_notify_frame_done

static int msm_cpp_notify_frame_done(struct cpp_device *cpp_dev){	struct v4l2_event v4l2_evt;	struct msm_queue_cmd *frame_qcmd;	struct msm_queue_cmd *event_qcmd;	struct msm_cpp_frame_info_t *processed_frame;	struct msm_device_queue *queue = &cpp_dev->processing_q;	if (queue->len > 0) {		frame_qcmd = msm_dequeue(queue, list_frame);		processed_frame = frame_qcmd->command;		event_qcmd = kzalloc(sizeof(struct msm_queue_cmd), GFP_KERNEL);		if (!event_qcmd) {			pr_err("%s Insufficient memory. return", __func__);			return -ENOMEM;		}		atomic_set(&event_qcmd->on_heap, 1);		event_qcmd->command = processed_frame;		CPP_DBG("fid %d/n", processed_frame->frame_id);		msm_enqueue(&cpp_dev->eventData_q, &event_qcmd->list_eventdata);		v4l2_evt.id = processed_frame->inst_id;		v4l2_evt.type = V4L2_EVENT_CPP_FRAME_DONE;		v4l2_event_queue(cpp_dev->subdev.devnode, &v4l2_evt);	}	return 0;}
开发者ID:Hadramos,项目名称:android_sony_xperiaz_kernel_sources,代码行数:28,


示例3: vpe_send_outmsg

static void vpe_send_outmsg(void){	unsigned long flags;	struct v4l2_event v4l2_evt;	struct msm_queue_cmd *event_qcmd;	spin_lock_irqsave(&vpe_ctrl->lock, flags);	if (vpe_ctrl->state == VPE_STATE_IDLE) {		pr_err("%s VPE is in IDLE state. Ignore the ack msg", __func__);		spin_unlock_irqrestore(&vpe_ctrl->lock, flags);		return;	}	event_qcmd = kzalloc(sizeof(struct msm_queue_cmd), GFP_ATOMIC);	atomic_set(&event_qcmd->on_heap, 1);	event_qcmd->command = (void *)vpe_ctrl->pp_frame_info;	vpe_ctrl->pp_frame_info = NULL;	vpe_ctrl->state = VPE_STATE_INIT;   /* put it back to idle. */	/* Enqueue the event payload. */	msm_enqueue(&vpe_ctrl->eventData_q, &event_qcmd->list_eventdata);	/* Now queue the event. */	v4l2_evt.type = V4L2_EVENT_PRIVATE_START + MSM_CAM_RESP_MCTL_PP_EVENT;	v4l2_evt.id = 0;	v4l2_event_queue(vpe_ctrl->subdev.devnode, &v4l2_evt);	spin_unlock_irqrestore(&vpe_ctrl->lock, flags);}
开发者ID:DSMKexec,项目名称:kexec-kernel-a850s,代码行数:25,


示例4: uvc_function_setup

static intuvc_function_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl){	struct uvc_device *uvc = to_uvc(f);	struct v4l2_event v4l2_event;	struct uvc_event *uvc_event = (void *)&v4l2_event.u.data;	/* printk(KERN_INFO "setup request %02x %02x value %04x index %04x %04x/n",	 *	ctrl->bRequestType, ctrl->bRequest, le16_to_cpu(ctrl->wValue),	 *	le16_to_cpu(ctrl->wIndex), le16_to_cpu(ctrl->wLength));	 */	if ((ctrl->bRequestType & USB_TYPE_MASK) != USB_TYPE_CLASS) {		INFO(f->config->cdev, "invalid request type/n");		return -EINVAL;	}	/* Stall too big requests. */	if (le16_to_cpu(ctrl->wLength) > UVC_MAX_REQUEST_SIZE)		return -EINVAL;	memset(&v4l2_event, 0, sizeof(v4l2_event));	v4l2_event.type = UVC_EVENT_SETUP;	memcpy(&uvc_event->req, ctrl, sizeof(uvc_event->req));	v4l2_event_queue(uvc->vdev, &v4l2_event);	return 0;}
开发者ID:7799,项目名称:linux,代码行数:28,


示例5: uvc_function_setup

static intuvc_function_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl){	struct uvc_device *uvc = to_uvc(f);	struct v4l2_event v4l2_event;	struct uvc_event *uvc_event = (void *)&v4l2_event.u.data;	/* printk(KERN_INFO "setup request %02x %02x value %04x index %04x %04x/n",	 *	ctrl->bRequestType, ctrl->bRequest, le16_to_cpu(ctrl->wValue),	 *	le16_to_cpu(ctrl->wIndex), le16_to_cpu(ctrl->wLength));	 */	if ((ctrl->bRequestType & USB_TYPE_MASK) != USB_TYPE_CLASS) {		INFO(f->config->cdev, "invalid request type/n");		return -EINVAL;	}	/* Stall too big requests. */	if (le16_to_cpu(ctrl->wLength) > UVC_MAX_REQUEST_SIZE)		return -EINVAL;	/* Tell the complete callback to generate an event for the next request	 * that will be enqueued by UVCIOC_SEND_RESPONSE.	 */	uvc->event_setup_out = !(ctrl->bRequestType & USB_DIR_IN);	uvc->event_length = le16_to_cpu(ctrl->wLength);	memset(&v4l2_event, 0, sizeof(v4l2_event));	v4l2_event.type = UVC_EVENT_SETUP;	memcpy(&uvc_event->req, ctrl, sizeof(uvc_event->req));	v4l2_event_queue(&uvc->vdev, &v4l2_event);	return 0;}
开发者ID:asmalldev,项目名称:linux,代码行数:34,


示例6: msm_mctl_pp_buf_divert

static int msm_mctl_pp_buf_divert(			struct msm_cam_media_controller *pmctl,			struct msm_cam_v4l2_dev_inst *pcam_inst,			struct msm_cam_evt_divert_frame *div){	struct v4l2_event v4l2_evt;	struct msm_isp_event_ctrl *isp_event;	isp_event = kzalloc(sizeof(struct msm_isp_event_ctrl),						GFP_ATOMIC);	if (!isp_event) {		pr_err("%s Insufficient memory. return", __func__);		return -ENOMEM;	}	D("%s: msm_cam_evt_divert_frame=%d",		__func__, sizeof(struct msm_cam_evt_divert_frame));	memset(&v4l2_evt, 0, sizeof(v4l2_evt));	v4l2_evt.type = V4L2_EVENT_PRIVATE_START +			MSM_CAM_RESP_DIV_FRAME_EVT_MSG;	*((uint32_t *)v4l2_evt.u.data) = (uint32_t)isp_event;	/* Copy the divert frame struct into event ctrl struct. */	isp_event->isp_data.div_frame = *div;	D("%s inst=%p, img_mode=%d, frame_id=%d/n", __func__,		pcam_inst, pcam_inst->image_mode, div->frame.frame_id);	v4l2_event_queue(		pmctl->config_device->config_stat_event_queue.pvdev,		&v4l2_evt);	return 0;}
开发者ID:KernelStalker,项目名称:GalaxyS3_Tmo-Att_Kernel,代码行数:29,


示例7: hwcam_dev_notify

static voidhwcam_dev_notify(        hwcam_dev_intf_t* intf,        struct v4l2_event* ev){    hwcam_dev_t* cam = I2DEV(intf);    v4l2_event_queue(cam->vdev, ev);}
开发者ID:herryfan,项目名称:kernel-huawei-h60,代码行数:8,


示例8: rvin_notify

static void rvin_notify(struct v4l2_subdev *sd,			unsigned int notification, void *arg){	struct rvin_dev *vin =		container_of(sd->v4l2_dev, struct rvin_dev, v4l2_dev);	switch (notification) {	case V4L2_DEVICE_NOTIFY_EVENT:		v4l2_event_queue(&vin->vdev, arg);		break;	default:		break;	}}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:14,


示例9: uvc_function_disable

static voiduvc_function_disable(struct usb_function *f){	struct uvc_device *uvc = to_uvc(f);	struct v4l2_event v4l2_event;	INFO(f->config->cdev, "uvc_function_disable/n");	memset(&v4l2_event, 0, sizeof(v4l2_event));	v4l2_event.type = UVC_EVENT_DISCONNECT;	v4l2_event_queue(uvc->vdev, &v4l2_event);	uvc->state = UVC_STATE_DISCONNECTED;}
开发者ID:7799,项目名称:linux,代码行数:14,


示例10: isp_stat_queue_event

static void isp_stat_queue_event(struct ispstat *stat, int err){	struct video_device *vdev = stat->subdev.devnode;	struct v4l2_event event;	struct omap3isp_stat_event_status *status = (void *)event.u.data;	memset(&event, 0, sizeof(event));	if (!err) {		status->frame_number = stat->frame_number;		status->config_counter = stat->config_counter;	} else {		status->buf_err = 1;	}	event.type = stat->event_type;	v4l2_event_queue(vdev, &event);}
开发者ID:Astralix,项目名称:mainline-dss11,代码行数:16,


示例11: uvc_function_ep0_complete

static voiduvc_function_ep0_complete(struct usb_ep *ep, struct usb_request *req){	struct uvc_device *uvc = req->context;	struct v4l2_event v4l2_event;	struct uvc_event *uvc_event = (void *)&v4l2_event.u.data;	if (uvc->event_setup_out) {		uvc->event_setup_out = 0;		memset(&v4l2_event, 0, sizeof(v4l2_event));		v4l2_event.type = UVC_EVENT_DATA;		uvc_event->data.length = req->actual;		memcpy(&uvc_event->data.data, req->buf, req->actual);		v4l2_event_queue(uvc->vdev, &v4l2_event);	}}
开发者ID:7799,项目名称:linux,代码行数:17,


示例12: uvc_function_setup

static intuvc_function_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl){	struct uvc_device *uvc = to_uvc(f);	struct v4l2_event v4l2_event;	struct uvc_event *uvc_event = (void *)&v4l2_event.u.data;	if ((ctrl->bRequestType & USB_TYPE_MASK) != USB_TYPE_CLASS) {		INFO(f->config->cdev, "invalid request type/n");		return -EINVAL;	}		if (le16_to_cpu(ctrl->wLength) > UVC_MAX_REQUEST_SIZE)		return -EINVAL;	memset(&v4l2_event, 0, sizeof(v4l2_event));	v4l2_event.type = UVC_EVENT_SETUP;	memcpy(&uvc_event->req, ctrl, sizeof(uvc_event->req));	v4l2_event_queue(uvc->vdev, &v4l2_event);	return 0;}
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:24,


示例13: msm_isp_notify_vfe

//.........这里部分代码省略.........		stats->aec.buff = msm_pmem_stats_ptov_lookup(pmctl,					stats->aec.buff, &(stats->aec.fd));		stats->awb.buff = msm_pmem_stats_ptov_lookup(pmctl,					stats->awb.buff, &(stats->awb.fd));		stats->af.buff = msm_pmem_stats_ptov_lookup(pmctl,					stats->af.buff, &(stats->af.fd));		stats->ihist.buff = msm_pmem_stats_ptov_lookup(pmctl,					stats->ihist.buff, &(stats->ihist.fd));		stats->rs.buff = msm_pmem_stats_ptov_lookup(pmctl,					stats->rs.buff, &(stats->rs.fd));		stats->cs.buff = msm_pmem_stats_ptov_lookup(pmctl,					stats->cs.buff, &(stats->cs.fd));		stats_buf = kmalloc(sizeof(struct msm_stats_buf), GFP_ATOMIC);		if (!stats_buf) {			pr_err("%s: out of memory./n", __func__);			rc = -ENOMEM;		} else {			*stats_buf = *stats;			isp_event->isp_data.isp_msg.len	=				sizeof(struct msm_stats_buf);			isp_event->isp_data.isp_msg.data = stats_buf;		}		}		break;	case NOTIFY_VFE_MSG_STATS: {		struct msm_stats_buf stats;		struct isp_msg_stats *isp_stats = (struct isp_msg_stats *)arg;		isp_event->isp_data.isp_msg.msg_id = isp_stats->id;		isp_event->isp_data.isp_msg.frame_id =			isp_stats->frameCounter;		stats.buffer = msm_pmem_stats_ptov_lookup(pmctl,						isp_stats->buffer,						&(stats.fd));		switch (isp_stats->id) {		case MSG_ID_STATS_AEC:			stats.aec.buff = stats.buffer;			stats.aec.fd = stats.fd;			break;		case MSG_ID_STATS_AF:			stats.af.buff = stats.buffer;			stats.af.fd = stats.fd;			break;		case MSG_ID_STATS_AWB:			stats.awb.buff = stats.buffer;			stats.awb.fd = stats.fd;			break;		case MSG_ID_STATS_IHIST:			stats.ihist.buff = stats.buffer;			stats.ihist.fd = stats.fd;			break;		case MSG_ID_STATS_RS:			stats.rs.buff = stats.buffer;			stats.rs.fd = stats.fd;			break;		case MSG_ID_STATS_CS:			stats.cs.buff = stats.buffer;			stats.cs.fd = stats.fd;			break;		case MSG_ID_STATS_AWB_AEC:			break;		default:			pr_err("%s: Invalid msg type", __func__);			break;		}		if (!stats.buffer) {			pr_err("%s: msm_pmem_stats_ptov_lookup error/n",							__func__);			isp_event->isp_data.isp_msg.len = 0;			rc = -EFAULT;		} else {			struct msm_stats_buf *stats_buf =				kmalloc(sizeof(struct msm_stats_buf),							GFP_ATOMIC);			if (!stats_buf) {				pr_err("%s: out of memory./n",							__func__);				rc = -ENOMEM;			} else {				*stats_buf = stats;				isp_event->isp_data.isp_msg.len	=					sizeof(struct msm_stats_buf);				isp_event->isp_data.isp_msg.data = stats_buf;			}		}		}		break;	default:		pr_err("%s: Unsupport isp notification %d/n",			__func__, notification);		rc = -EINVAL;		break;	}	v4l2_event_queue(pmctl->config_device->config_stat_event_queue.pvdev,			 &v4l2_evt);	return rc;}
开发者ID:JmzTaylor,项目名称:android_kernel_htc_totemc2,代码行数:101,


示例14: v4l2_subdev_notify_event

/** * v4l2_subdev_notify_event() - Delivers event notification for subdevice * @sd: The subdev for which to deliver the event * @ev: The event to deliver * * Will deliver the specified event to all userspace event listeners which are * subscribed to the v42l subdev event queue as well as to the bridge driver * using the notify callback. The notification type for the notify callback * will be V4L2_DEVICE_NOTIFY_EVENT. */void v4l2_subdev_notify_event(struct v4l2_subdev *sd,			      const struct v4l2_event *ev){	v4l2_event_queue(sd->devnode, ev);	v4l2_subdev_notify(sd, V4L2_DEVICE_NOTIFY_EVENT, (void *)ev);}
开发者ID:OSPro,项目名称:wpj344_compatwireless,代码行数:16,


示例15: uvc_function_set_alt

static intuvc_function_set_alt(struct usb_function *f, unsigned interface, unsigned alt){	struct uvc_device *uvc = to_uvc(f);	struct v4l2_event v4l2_event;	struct uvc_event *uvc_event = (void *)&v4l2_event.u.data;	INFO(f->config->cdev, "uvc_function_set_alt(%u, %u)/n", interface, alt);	if (interface == uvc->control_intf) {		if (alt)			return -EINVAL;		if (uvc->state == UVC_STATE_DISCONNECTED) {			memset(&v4l2_event, 0, sizeof(v4l2_event));			v4l2_event.type = UVC_EVENT_CONNECT;			uvc_event->speed = f->config->cdev->gadget->speed;			v4l2_event_queue(uvc->vdev, &v4l2_event);			uvc->state = UVC_STATE_CONNECTED;		}		return 0;	}	if (interface != uvc->streaming_intf)		return -EINVAL;	switch (alt) {	case 0:		if (uvc->state != UVC_STATE_STREAMING)			return 0;		if (uvc->video.ep)			usb_ep_disable(uvc->video.ep);		memset(&v4l2_event, 0, sizeof(v4l2_event));		v4l2_event.type = UVC_EVENT_STREAMOFF;		v4l2_event_queue(uvc->vdev, &v4l2_event);		uvc->state = UVC_STATE_CONNECTED;		break;	case 1:		if (uvc->state != UVC_STATE_CONNECTED)			return 0;		if (uvc->video.ep) {			uvc->video.ep->desc = &uvc_streaming_ep;			usb_ep_enable(uvc->video.ep);		}		memset(&v4l2_event, 0, sizeof(v4l2_event));		v4l2_event.type = UVC_EVENT_STREAMON;		v4l2_event_queue(uvc->vdev, &v4l2_event);		uvc->state = UVC_STATE_STREAMING;		break;	default:		return -EINVAL;	}	return 0;}
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:66,


示例16: vivid_send_source_change

void vivid_send_source_change(struct vivid_dev *dev, unsigned type){	struct v4l2_event ev = {		.type = V4L2_EVENT_SOURCE_CHANGE,		.u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION,	};	unsigned i;	for (i = 0; i < dev->num_inputs; i++) {		ev.id = i;		if (dev->input_type[i] == type) {			if (video_is_registered(&dev->vid_cap_dev) && dev->has_vid_cap)				v4l2_event_queue(&dev->vid_cap_dev, &ev);			if (video_is_registered(&dev->vbi_cap_dev) && dev->has_vbi_cap)				v4l2_event_queue(&dev->vbi_cap_dev, &ev);		}	}}/* * Conversion function that converts a single-planar format to a * single-plane multiplanar format. */void fmt_sp2mp(const struct v4l2_format *sp_fmt, struct v4l2_format *mp_fmt){	struct v4l2_pix_format_mplane *mp = &mp_fmt->fmt.pix_mp;	struct v4l2_plane_pix_format *ppix = &mp->plane_fmt[0];	const struct v4l2_pix_format *pix = &sp_fmt->fmt.pix;	bool is_out = sp_fmt->type == V4L2_BUF_TYPE_VIDEO_OUTPUT;	memset(mp->reserved, 0, sizeof(mp->reserved));	mp_fmt->type = is_out ? V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE :			   V4L2_CAP_VIDEO_CAPTURE_MPLANE;	mp->width = pix->width;	mp->height = pix->height;	mp->pixelformat = pix->pixelformat;	mp->field = pix->field;	mp->colorspace = pix->colorspace;	mp->xfer_func = pix->xfer_func;	mp->ycbcr_enc = pix->ycbcr_enc;	mp->quantization = pix->quantization;	mp->num_planes = 1;	mp->flags = pix->flags;	ppix->sizeimage = pix->sizeimage;	ppix->bytesperline = pix->bytesperline;	memset(ppix->reserved, 0, sizeof(ppix->reserved));}int fmt_sp2mp_func(struct file *file, void *priv,		struct v4l2_format *f, fmtfunc func){	struct v4l2_format fmt;	struct v4l2_pix_format_mplane *mp = &fmt.fmt.pix_mp;	struct v4l2_plane_pix_format *ppix = &mp->plane_fmt[0];	struct v4l2_pix_format *pix = &f->fmt.pix;	int ret;	/* Converts to a mplane format */	fmt_sp2mp(f, &fmt);	/* Passes it to the generic mplane format function */	ret = func(file, priv, &fmt);	/* Copies back the mplane data to the single plane format */	pix->width = mp->width;	pix->height = mp->height;	pix->pixelformat = mp->pixelformat;	pix->field = mp->field;	pix->colorspace = mp->colorspace;	pix->xfer_func = mp->xfer_func;	pix->ycbcr_enc = mp->ycbcr_enc;	pix->quantization = mp->quantization;	pix->sizeimage = ppix->sizeimage;	pix->bytesperline = ppix->bytesperline;	pix->flags = mp->flags;	return ret;}int vivid_vid_adjust_sel(unsigned flags, struct v4l2_rect *r){	unsigned w = r->width;	unsigned h = r->height;	/* sanitize w and h in case someone passes ~0 as the value */	w &= 0xffff;	h &= 0xffff;	if (!(flags & V4L2_SEL_FLAG_LE)) {		w++;		h++;		if (w < 2)			w = 2;		if (h < 2)			h = 2;	}	if (!(flags & V4L2_SEL_FLAG_GE)) {		if (w > MAX_WIDTH)			w = MAX_WIDTH;		if (h > MAX_HEIGHT)			h = MAX_HEIGHT;	}	w = w & ~1;	h = h & ~1;//.........这里部分代码省略.........
开发者ID:513855417,项目名称:linux,代码行数:101,


示例17: msm_isp_notify_vfe

//.........这里部分代码省略.........			break;		case MSG_ID_STATS_BF:		    newWidth = 0;		    newHeight = 0;		    stats.htc_af_info.af_input.af_use_sw_sharpness = false;		    if (pmctl->htc_af_info.af_input.af_use_sw_sharpness) {			    pphy = msm_pmem_stats_ptov_lookup_2(pmctl,						isp_stats->buffer,						&(stats.fd));			    memset((uint8_t *)(pphy+BAYER_FOCUS_BUF_SIZE), 0x00, SW_FOCUS_BUF_SIZE);			    rc = swfa_Transform2((uint8_t *)(pphy+BAYER_FOCUS_BUF_SIZE),			                          &newWidth,			                          &newHeight);			    if(!rc)				    stats.htc_af_info.af_input.af_use_sw_sharpness = false;			    else				    stats.htc_af_info.af_input.af_use_sw_sharpness = pmctl->htc_af_info.af_input.af_use_sw_sharpness;			}			stats.htc_af_info.af_input.preview_width = pmctl->htc_af_info.af_input.preview_width;			stats.htc_af_info.af_input.preview_height = pmctl->htc_af_info.af_input.preview_height;			stats.htc_af_info.af_input.roi_x = pmctl->htc_af_info.af_input.roi_x;			stats.htc_af_info.af_input.roi_y = pmctl->htc_af_info.af_input.roi_y;			stats.htc_af_info.af_input.roi_width = newWidth;			stats.htc_af_info.af_input.roi_height = newHeight;			stats.af.buff = stats.buffer;			stats.af.fd = stats.fd;			break;		case MSG_ID_STATS_AWB:			stats.awb.buff = stats.buffer;			stats.awb.fd = stats.fd;			break;		case MSG_ID_STATS_IHIST:			stats.ihist.buff = stats.buffer;			stats.ihist.fd = stats.fd;			break;		case MSG_ID_STATS_RS:			stats.rs.buff = stats.buffer;			stats.rs.fd = stats.fd;			break;		case MSG_ID_STATS_CS:			stats.cs.buff = stats.buffer;			stats.cs.fd = stats.fd;			break;		case MSG_ID_STATS_BHIST:			stats.skin.buff = stats.buffer;			stats.skin.fd = stats.fd;			break;		case MSG_ID_STATS_AWB_AEC:			break;		default:			pr_err("%s: Invalid msg type", __func__);			break;		}		if (!stats.buffer) {			pr_err("%s: msm_pmem_stats_ptov_lookup error/n",							__func__);			isp_event->isp_data.isp_msg.len = 0;			rc = -EFAULT;		} else {			struct msm_stats_buf *stats_buf =				kmalloc(sizeof(struct msm_stats_buf),							GFP_ATOMIC);			if (!stats_buf) {				pr_err("%s: out of memory./n",							__func__);				rc = -ENOMEM;			} else {				*stats_buf = stats;				isp_event->isp_data.isp_msg.len	=					sizeof(struct msm_stats_buf);				isp_event->isp_data.isp_msg.data = stats_buf;			}		}		}		break;	default:		pr_err("%s: Unsupport isp notification %d/n",			__func__, notification);		rc = -EINVAL;		break;	}	if (!pmctl->config_device) {		pr_err("%s: null pointer check, line(%d)", __func__, __LINE__);		rc = -EINVAL;		return rc;	}	v4l2_event_queue(pmctl->config_device->config_stat_event_queue.pvdev,			 &v4l2_evt);	return rc;}
开发者ID:InvisiSource,项目名称:Haunted,代码行数:101,


示例18: uvc_function_set_alt

static intuvc_function_set_alt(struct usb_function *f, unsigned interface, unsigned alt){	struct uvc_device *uvc = to_uvc(f);	struct v4l2_event v4l2_event;	struct uvc_event *uvc_event = (void *)&v4l2_event.u.data;	int ret;	INFO(f->config->cdev, "uvc_function_set_alt(%u, %u)/n", interface, alt);	if (interface == uvc->control_intf) {		if (alt)			return -EINVAL;		if (uvc->state == UVC_STATE_DISCONNECTED) {			memset(&v4l2_event, 0, sizeof(v4l2_event));			v4l2_event.type = UVC_EVENT_CONNECT;			uvc_event->speed = f->config->cdev->gadget->speed;			v4l2_event_queue(uvc->vdev, &v4l2_event);			uvc->state = UVC_STATE_CONNECTED;		}		return 0;	}	if (interface != uvc->streaming_intf)		return -EINVAL;	/* TODO	if (usb_endpoint_xfer_bulk(&uvc->desc.vs_ep))		return alt ? -EINVAL : 0;	*/	switch (alt) {	case 0:		if (uvc->state != UVC_STATE_STREAMING)			return 0;		if (uvc->video.ep)			usb_ep_disable(uvc->video.ep);		memset(&v4l2_event, 0, sizeof(v4l2_event));		v4l2_event.type = UVC_EVENT_STREAMOFF;		v4l2_event_queue(uvc->vdev, &v4l2_event);		uvc->state = UVC_STATE_CONNECTED;		return 0;	case 1:		if (uvc->state != UVC_STATE_CONNECTED)			return 0;		if (uvc->video.ep) {			ret = config_ep_by_speed(f->config->cdev->gadget,					&(uvc->func), uvc->video.ep);			if (ret)				return ret;			usb_ep_enable(uvc->video.ep);		}		memset(&v4l2_event, 0, sizeof(v4l2_event));		v4l2_event.type = UVC_EVENT_STREAMON;		v4l2_event_queue(uvc->vdev, &v4l2_event);		return USB_GADGET_DELAYED_STATUS;	default:		return -EINVAL;	}}
开发者ID:7799,项目名称:linux,代码行数:70,


示例19: msm_isp_notify_vfe

//.........这里部分代码省略.........	if (!isp_event) {		pr_err("%s Insufficient memory. return", __func__);		return -ENOMEM;	}	v4l2_evt.type = V4L2_EVENT_PRIVATE_START +					MSM_CAM_RESP_STAT_EVT_MSG;	*((uint32_t *)v4l2_evt.u.data) = (uint32_t)isp_event;	isp_event->resptype = MSM_CAM_RESP_STAT_EVT_MSG;	isp_event->isp_data.isp_msg.type = MSM_CAMERA_MSG;	isp_event->isp_data.isp_msg.len = 0;	switch (notification) {	case NOTIFY_ISP_MSG_EVT: {		struct isp_msg_event *isp_msg = (struct isp_msg_event *)arg;		isp_event->isp_data.isp_msg.msg_id = isp_msg->msg_id;		isp_event->isp_data.isp_msg.frame_id = isp_msg->sof_count;		break;	}	case NOTIFY_VFE_MSG_OUT: {		uint8_t msgid;		struct isp_msg_output *isp_output =				(struct isp_msg_output *)arg;		switch (isp_output->output_id) {		case MSG_ID_OUTPUT_P:			msgid = VFE_MSG_OUTPUT_P;			break;		case MSG_ID_OUTPUT_V:			msgid = VFE_MSG_OUTPUT_V;			break;		case MSG_ID_OUTPUT_T:			msgid = VFE_MSG_OUTPUT_T;			break;		case MSG_ID_OUTPUT_S:			msgid = VFE_MSG_OUTPUT_S;			break;		default:			pr_err("%s: Invalid VFE output id: %d/n",				__func__, isp_output->output_id);			rc = -EINVAL;			break;		}		if (!rc) {			isp_event->isp_data.isp_msg.msg_id =				isp_output->output_id;			isp_event->isp_data.isp_msg.frame_id =				isp_output->frameCounter;			buf = isp_output->buf;			msm_mctl_buf_done(pmctl, msgid,				&buf, isp_output->frameCounter);		}		}		break;	case NOTIFY_VFE_MSG_STATS: {		struct msm_stats_buf stats;		struct isp_msg_stats *isp_stats = (struct isp_msg_stats *)arg;		isp_event->isp_data.isp_msg.msg_id = isp_stats->id;		isp_event->isp_data.isp_msg.frame_id =			isp_stats->frameCounter;		stats.buffer = msm_pmem_stats_ptov_lookup(&pmctl->sync,						isp_stats->buffer,						&(stats.fd));		if (!stats.buffer) {			pr_err("%s: msm_pmem_stats_ptov_lookup error/n",							__func__);			isp_event->isp_data.isp_msg.len = 0;			rc = -EFAULT;		} else {			struct msm_stats_buf *stats_buf =				kmalloc(sizeof(struct msm_stats_buf),							GFP_ATOMIC);			if (!stats_buf) {				pr_err("%s: out of memory./n",							__func__);				rc = -ENOMEM;			} else {				*stats_buf = stats;				isp_event->isp_data.isp_msg.len	=					sizeof(struct msm_stats_buf);				isp_event->isp_data.isp_msg.data = stats_buf;			}		}		}		break;	default:		pr_err("%s: Unsupport isp notification %d/n",			__func__, notification);		rc = -EINVAL;		break;	}	v4l2_event_queue(pmctl->config_device->config_stat_event_queue.pvdev,			 &v4l2_evt);	return rc;}
开发者ID:AnDr0id,项目名称:SGH-I747,代码行数:101,


示例20: vivid_send_source_change

void vivid_send_source_change(struct vivid_dev *dev, unsigned type){	struct v4l2_event ev = {		.type = V4L2_EVENT_SOURCE_CHANGE,		.u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION,	};	unsigned i;	for (i = 0; i < dev->num_inputs; i++) {		ev.id = i;		if (dev->input_type[i] == type) {			if (video_is_registered(&dev->vid_cap_dev) && dev->has_vid_cap)				v4l2_event_queue(&dev->vid_cap_dev, &ev);			if (video_is_registered(&dev->vbi_cap_dev) && dev->has_vbi_cap)				v4l2_event_queue(&dev->vbi_cap_dev, &ev);		}	}}/* * Conversion function that converts a single-planar format to a * single-plane multiplanar format. */void fmt_sp2mp(const struct v4l2_format *sp_fmt, struct v4l2_format *mp_fmt){	struct v4l2_pix_format_mplane *mp = &mp_fmt->fmt.pix_mp;	struct v4l2_plane_pix_format *ppix = &mp->plane_fmt[0];	const struct v4l2_pix_format *pix = &sp_fmt->fmt.pix;	bool is_out = sp_fmt->type == V4L2_BUF_TYPE_VIDEO_OUTPUT;	memset(mp->reserved, 0, sizeof(mp->reserved));	mp_fmt->type = is_out ? V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE :			   V4L2_CAP_VIDEO_CAPTURE_MPLANE;	mp->width = pix->width;	mp->height = pix->height;	mp->pixelformat = pix->pixelformat;	mp->field = pix->field;	mp->colorspace = pix->colorspace;	mp->ycbcr_enc = pix->ycbcr_enc;	mp->quantization = pix->quantization;	mp->num_planes = 1;	mp->flags = pix->flags;	ppix->sizeimage = pix->sizeimage;	ppix->bytesperline = pix->bytesperline;	memset(ppix->reserved, 0, sizeof(ppix->reserved));}int fmt_sp2mp_func(struct file *file, void *priv,		struct v4l2_format *f, fmtfunc func){	struct v4l2_format fmt;	struct v4l2_pix_format_mplane *mp = &fmt.fmt.pix_mp;	struct v4l2_plane_pix_format *ppix = &mp->plane_fmt[0];	struct v4l2_pix_format *pix = &f->fmt.pix;	int ret;	/* Converts to a mplane format */	fmt_sp2mp(f, &fmt);	/* Passes it to the generic mplane format function */	ret = func(file, priv, &fmt);	/* Copies back the mplane data to the single plane format */	pix->width = mp->width;	pix->height = mp->height;	pix->pixelformat = mp->pixelformat;	pix->field = mp->field;	pix->colorspace = mp->colorspace;	pix->ycbcr_enc = mp->ycbcr_enc;	pix->quantization = mp->quantization;	pix->sizeimage = ppix->sizeimage;	pix->bytesperline = ppix->bytesperline;	pix->flags = mp->flags;	return ret;}/* v4l2_rect helper function: copy the width/height values */void rect_set_size_to(struct v4l2_rect *r, const struct v4l2_rect *size){	r->width = size->width;	r->height = size->height;}
开发者ID:168519,项目名称:linux,代码行数:80,



注:本文中的v4l2_event_queue函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ v4l2_fh_add函数代码示例
C++ v4l2_device_unregister_subdev函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。