前端之家收集整理的这篇文章主要介绍了
v4l2 buffer,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
vivi.c static int vi
dioc_reqbufs(struct file *file,void *priv,struct v4l2_requestbuffers *p) --> videobuf_reqbufs(&dev->vb_vidq,p); ------->q->ops->buf_setup(q,&count,&size); static int vi
dioc_qbuf(struct file *file,struct v4l2_buffer *p) -->int videobuf_qbuf(struct videobuf_queue *q,struct v4l2_buffer *b) ------> retval = q->ops->buf_prepare(q,buf,field); ------> q->ops->buf_queue(q,buf); struct vb2_queue vb_vidq; //interaction with user space struct vivi_dmaqueue vidq; //interaction with hardware int vb2_qbuf(struct vb2_queue *q,struct v4l2_buffer *b) ---> __enqueue_in_driver(vb); ------->q->ops->buf_queue(vb); static void buffer_queue(struct vb2_buffer *vb) ---->list_add_tail(&buf->list,&vidq->active); //add buffer to dma free buffer queue buf = list_entry(dma_q->active.next,struct vivi_buffer,list);//get a free buffer list_del(&buf->list); vivi_fillbuff(dev,buf);/* Fill buffer */ vb2_buffer_done(&buf->vb,VB2_BUF_STATE_DONE);//send notification to user the buffer is filled
原文链接:https://www.f2er.com/vb/260034.html