aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorJunghak Sung <jh1009.sung@samsung.com>2015-11-03 05:16:42 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-12-18 10:58:09 -0500
commitaf3bac1a7c8a21ff4f4edede397cba8e3f8ee503 (patch)
tree1e147baf338d5173bb588b05501ddb5be3e0733c /include/media
parent70433a152f0058404afb5496a9329e4e26b127df (diff)
[media] media: videobuf2: Move vb2_fileio_data and vb2_thread to core part
Move things related with vb2 file I/O and vb2_thread without doing any functional changes. After that, videobuf2-internal.h is removed because it is not necessary any more. Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/videobuf2-core.h43
-rw-r--r--include/media/videobuf2-v4l2.h38
2 files changed, 45 insertions, 36 deletions
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index 67da1433b6a7..cc94c9d1c2c4 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -541,6 +541,42 @@ unsigned long vb2_get_unmapped_area(struct vb2_queue *q,
541 unsigned long pgoff, 541 unsigned long pgoff,
542 unsigned long flags); 542 unsigned long flags);
543#endif 543#endif
544unsigned int vb2_core_poll(struct vb2_queue *q, struct file *file,
545 poll_table *wait);
546size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count,
547 loff_t *ppos, int nonblock);
548size_t vb2_write(struct vb2_queue *q, const char __user *data, size_t count,
549 loff_t *ppos, int nonblock);
550
551/*
552 * vb2_thread_fnc - callback function for use with vb2_thread
553 *
554 * This is called whenever a buffer is dequeued in the thread.
555 */
556typedef int (*vb2_thread_fnc)(struct vb2_buffer *vb, void *priv);
557
558/**
559 * vb2_thread_start() - start a thread for the given queue.
560 * @q: videobuf queue
561 * @fnc: callback function
562 * @priv: priv pointer passed to the callback function
563 * @thread_name:the name of the thread. This will be prefixed with "vb2-".
564 *
565 * This starts a thread that will queue and dequeue until an error occurs
566 * or @vb2_thread_stop is called.
567 *
568 * This function should not be used for anything else but the videobuf2-dvb
569 * support. If you think you have another good use-case for this, then please
570 * contact the linux-media mailinglist first.
571 */
572int vb2_thread_start(struct vb2_queue *q, vb2_thread_fnc fnc, void *priv,
573 const char *thread_name);
574
575/**
576 * vb2_thread_stop() - stop the thread for the given queue.
577 * @q: videobuf queue
578 */
579int vb2_thread_stop(struct vb2_queue *q);
544 580
545/** 581/**
546 * vb2_is_streaming() - return streaming status of the queue 582 * vb2_is_streaming() - return streaming status of the queue
@@ -645,4 +681,11 @@ static inline void vb2_clear_last_buffer_dequeued(struct vb2_queue *q)
645 q->last_buffer_dequeued = false; 681 q->last_buffer_dequeued = false;
646} 682}
647 683
684/*
685 * The following functions are not part of the vb2 core API, but are useful
686 * functions for videobuf2-*.
687 */
688bool vb2_buffer_in_use(struct vb2_queue *q, struct vb2_buffer *vb);
689int vb2_verify_memory_type(struct vb2_queue *q,
690 enum vb2_memory memory, unsigned int type);
648#endif /* _MEDIA_VIDEOBUF2_CORE_H */ 691#endif /* _MEDIA_VIDEOBUF2_CORE_H */
diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h
index 110062ea9f0d..3cc836f76675 100644
--- a/include/media/videobuf2-v4l2.h
+++ b/include/media/videobuf2-v4l2.h
@@ -63,42 +63,8 @@ int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type);
63 63
64int __must_check vb2_queue_init(struct vb2_queue *q); 64int __must_check vb2_queue_init(struct vb2_queue *q);
65void vb2_queue_release(struct vb2_queue *q); 65void vb2_queue_release(struct vb2_queue *q);
66 66unsigned int vb2_poll(struct vb2_queue *q, struct file *file,
67unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait); 67 poll_table *wait);
68size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count,
69 loff_t *ppos, int nonblock);
70size_t vb2_write(struct vb2_queue *q, const char __user *data, size_t count,
71 loff_t *ppos, int nonblock);
72
73/*
74 * vb2_thread_fnc - callback function for use with vb2_thread
75 *
76 * This is called whenever a buffer is dequeued in the thread.
77 */
78typedef int (*vb2_thread_fnc)(struct vb2_buffer *vb, void *priv);
79
80/**
81 * vb2_thread_start() - start a thread for the given queue.
82 * @q: videobuf queue
83 * @fnc: callback function
84 * @priv: priv pointer passed to the callback function
85 * @thread_name:the name of the thread. This will be prefixed with "vb2-".
86 *
87 * This starts a thread that will queue and dequeue until an error occurs
88 * or @vb2_thread_stop is called.
89 *
90 * This function should not be used for anything else but the videobuf2-dvb
91 * support. If you think you have another good use-case for this, then please
92 * contact the linux-media mailinglist first.
93 */
94int vb2_thread_start(struct vb2_queue *q, vb2_thread_fnc fnc, void *priv,
95 const char *thread_name);
96
97/**
98 * vb2_thread_stop() - stop the thread for the given queue.
99 * @q: videobuf queue
100 */
101int vb2_thread_stop(struct vb2_queue *q);
102 68
103/* 69/*
104 * The following functions are not part of the vb2 core API, but are simple 70 * The following functions are not part of the vb2 core API, but are simple