.release = vb2_req_release,
};
+bool vb2_request_object_is_buffer(struct media_request_object *obj)
+{
+ return obj->ops == &vb2_core_req_ops;
+}
+EXPORT_SYMBOL_GPL(vb2_request_object_is_buffer);
+
+bool vb2_request_has_buffers(struct media_request *req)
+{
+ struct media_request_object *obj;
+ unsigned long flags;
+ bool has_buffers = false;
+
+ spin_lock_irqsave(&req->lock, flags);
+ list_for_each_entry(obj, &req->objects, list) {
+ if (vb2_request_object_is_buffer(obj)) {
+ has_buffers = true;
+ break;
+ }
+ }
+ spin_unlock_irqrestore(&req->lock, flags);
+ return has_buffers;
+}
+EXPORT_SYMBOL_GPL(vb2_request_has_buffers);
+
int vb2_core_prepare_buf(struct vb2_queue *q, unsigned int index, void *pb)
{
struct vb2_buffer *vb;
*/
int vb2_verify_memory_type(struct vb2_queue *q,
enum vb2_memory memory, unsigned int type);
+
+/**
+ * vb2_request_object_is_buffer() - return true if the object is a buffer
+ *
+ * @obj: the request object.
+ */
+bool vb2_request_object_is_buffer(struct media_request_object *obj);
+
+/**
+ * vb2_request_has_buffers() - return true if the request contains buffers
+ *
+ * @req: the request.
+ */
+bool vb2_request_has_buffers(struct media_request *req);
+
#endif /* _MEDIA_VIDEOBUF2_CORE_H */