*参照元 [#l6e6e36f] #backlinks *説明 [#d83e9ee4] -パス: [[linux-4.4.1/drivers/media/v4l2-core/videobuf2-v4l2.c]] -FIXME: これは何? --説明 **引数 [#w07ed0a5] -struct vb2_queue *q -- --[[linux-4.4.1/vb2_queue]] **返り値 [#ra313073] -int -- **参考 [#t905dff7] *実装 [#h54985e8] /** * vb2_queue_init() - initialize a videobuf2 queue * @q: videobuf2 queue; this structure should be allocated in driver * * The vb2_queue structure should be allocated by the driver. The driver is * responsible of clearing it's content and setting initial values for some * required entries before calling this function. * q->ops, q->mem_ops, q->type and q->io_modes are mandatory. Please refer * to the struct vb2_queue description in include/media/videobuf2-core.h * for more information. */ int vb2_queue_init(struct vb2_queue *q) { /* * Sanity check */ if (WARN_ON(!q) || WARN_ON(q->timestamp_flags & ~(V4L2_BUF_FLAG_TIMESTAMP_MASK | V4L2_BUF_FLAG_TSTAMP_SRC_MASK))) return -EINVAL; - --[[linux-4.4.1/WARN_ON()]] /* Warn that the driver should choose an appropriate timestamp type */ WARN_ON((q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) == V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN); /* Warn that vb2_memory should match with v4l2_memory */ if (WARN_ON(VB2_MEMORY_MMAP != (int)V4L2_MEMORY_MMAP) || WARN_ON(VB2_MEMORY_USERPTR != (int)V4L2_MEMORY_USERPTR) || WARN_ON(VB2_MEMORY_DMABUF != (int)V4L2_MEMORY_DMABUF)) return -EINVAL; if (q->buf_struct_size == 0) q->buf_struct_size = sizeof(struct vb2_v4l2_buffer); q->buf_ops = &v4l2_buf_ops; q->is_multiplanar = V4L2_TYPE_IS_MULTIPLANAR(q->type); q->is_output = V4L2_TYPE_IS_OUTPUT(q->type); - --[[linux-4.4.1/v4l2_buf_ops(global)]] --[[linux-4.4.1/V4L2_TYPE_IS_MULTIPLANAR()]] --[[linux-4.4.1/V4L2_TYPE_IS_OUTPUT()]] return vb2_core_queue_init(q); - --[[linux-4.4.1/vb2_core_queue_init()]] } EXPORT_SYMBOL_GPL(vb2_queue_init); - --[[linux-4.4.1/EXPORT_SYMBOL_GPL()]] *コメント [#hfef4c7e]