mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
Add ioctl interface used in v4l2m2m
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
This commit is contained in:
@@ -427,7 +427,6 @@ static int v4l2_ioctl(FAR struct file *filep,
|
|||||||
|
|
||||||
return v4l2->vops->enum_fmt(v4l2,
|
return v4l2->vops->enum_fmt(v4l2,
|
||||||
(FAR struct v4l2_fmtdesc *)arg);
|
(FAR struct v4l2_fmtdesc *)arg);
|
||||||
break;
|
|
||||||
|
|
||||||
case VIDIOC_ENUM_FRAMEINTERVALS:
|
case VIDIOC_ENUM_FRAMEINTERVALS:
|
||||||
if (v4l2->vops->enum_frminterval == NULL)
|
if (v4l2->vops->enum_frminterval == NULL)
|
||||||
@@ -437,7 +436,6 @@ static int v4l2_ioctl(FAR struct file *filep,
|
|||||||
|
|
||||||
return v4l2->vops->enum_frminterval(v4l2,
|
return v4l2->vops->enum_frminterval(v4l2,
|
||||||
(FAR struct v4l2_frmivalenum *)arg);
|
(FAR struct v4l2_frmivalenum *)arg);
|
||||||
break;
|
|
||||||
|
|
||||||
case VIDIOC_ENUM_FRAMESIZES:
|
case VIDIOC_ENUM_FRAMESIZES:
|
||||||
if (v4l2->vops->enum_frmsize == NULL)
|
if (v4l2->vops->enum_frmsize == NULL)
|
||||||
@@ -447,7 +445,51 @@ static int v4l2_ioctl(FAR struct file *filep,
|
|||||||
|
|
||||||
return v4l2->vops->enum_frmsize(v4l2,
|
return v4l2->vops->enum_frmsize(v4l2,
|
||||||
(FAR struct v4l2_frmsizeenum *)arg);
|
(FAR struct v4l2_frmsizeenum *)arg);
|
||||||
break;
|
|
||||||
|
case VIDIOC_CROPCAP:
|
||||||
|
if (v4l2->vops->cropcap == NULL)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return v4l2->vops->cropcap(v4l2,
|
||||||
|
(FAR struct v4l2_cropcap *)arg);
|
||||||
|
|
||||||
|
case VIDIOC_DQEVENT:
|
||||||
|
if (v4l2->vops->dqevent == NULL)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return v4l2->vops->dqevent(v4l2,
|
||||||
|
(FAR struct v4l2_event *)arg);
|
||||||
|
|
||||||
|
case VIDIOC_SUBSCRIBE_EVENT:
|
||||||
|
if (v4l2->vops->subscribe_event == NULL)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return v4l2->vops->subscribe_event(v4l2,
|
||||||
|
(FAR struct v4l2_event_subscription *)arg);
|
||||||
|
|
||||||
|
case VIDIOC_DECODER_CMD:
|
||||||
|
if (v4l2->vops->decoder_cmd == NULL)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return v4l2->vops->decoder_cmd(v4l2,
|
||||||
|
(FAR struct v4l2_decoder_cmd *)arg);
|
||||||
|
|
||||||
|
case VIDIOC_ENCODER_CMD:
|
||||||
|
if (v4l2->vops->encoder_cmd == NULL)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return v4l2->vops->encoder_cmd(v4l2,
|
||||||
|
(FAR struct v4l2_encoder_cmd *)arg);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
verr("Unrecognized cmd: %d\n", cmd);
|
verr("Unrecognized cmd: %d\n", cmd);
|
||||||
|
|||||||
@@ -144,6 +144,16 @@ struct v4l2_ops_s
|
|||||||
FAR struct v4l2_frmivalenum *f);
|
FAR struct v4l2_frmivalenum *f);
|
||||||
CODE int (*enum_frmsize)(FAR struct v4l2_s *ctx,
|
CODE int (*enum_frmsize)(FAR struct v4l2_s *ctx,
|
||||||
FAR struct v4l2_frmsizeenum *f);
|
FAR struct v4l2_frmsizeenum *f);
|
||||||
|
CODE int (*cropcap)(FAR struct v4l2_s *ctx,
|
||||||
|
FAR struct v4l2_cropcap *cropcap);
|
||||||
|
CODE int (*dqevent)(FAR struct v4l2_s *ctx,
|
||||||
|
FAR struct v4l2_event *event);
|
||||||
|
CODE int (*subscribe_event)(FAR struct v4l2_s *ctx,
|
||||||
|
FAR struct v4l2_event_subscription *sub);
|
||||||
|
CODE int (*decoder_cmd)(FAR struct v4l2_s *ctx,
|
||||||
|
FAR struct v4l2_decoder_cmd *cmd);
|
||||||
|
CODE int (*encoder_cmd)(FAR struct v4l2_s *ctx,
|
||||||
|
FAR struct v4l2_encoder_cmd *cmd);
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -518,6 +518,8 @@ enum v4l2_buf_type
|
|||||||
|| (type) == V4L2_BUF_TYPE_SDR_OUTPUT \
|
|| (type) == V4L2_BUF_TYPE_SDR_OUTPUT \
|
||||||
|| (type) == V4L2_BUF_TYPE_META_OUTPUT)
|
|| (type) == V4L2_BUF_TYPE_META_OUTPUT)
|
||||||
|
|
||||||
|
#define V4L2_TYPE_IS_CAPTURE(type) (!V4L2_TYPE_IS_OUTPUT(type))
|
||||||
|
|
||||||
/* Memory I/O method. Currently, support only V4L2_MEMORY_USERPTR. */
|
/* Memory I/O method. Currently, support only V4L2_MEMORY_USERPTR. */
|
||||||
|
|
||||||
enum v4l2_memory
|
enum v4l2_memory
|
||||||
|
|||||||
Reference in New Issue
Block a user