summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/uvc/uvcvideo.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@skynet.be>2009-06-28 13:37:50 +0200
committerLaurent Pinchart <laurent.pinchart@skynet.be>2009-06-28 13:37:50 +0200
commit515fc60834c8e3e51c3fb97e362c74a3324d817e (patch)
treed5b74fcffb26f21cf6b255127a10cfd27d7fd100 /linux/drivers/media/video/uvc/uvcvideo.h
parent0a6ce90779f4a12f8e75009d19209a4ee48707d8 (diff)
downloadmediapointer-dvb-s2-515fc60834c8e3e51c3fb97e362c74a3324d817e.tar.gz
mediapointer-dvb-s2-515fc60834c8e3e51c3fb97e362c74a3324d817e.tar.bz2
uvcvideo: Restructure the driver to support multiple simultaneous streams.
From: Laurent Pinchart <laurent.pinchart@skynet.be> As a first step towards multiple streaming interfaces support, reorganize the driver's data structures to cleanly separate video control and video streaming data. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Diffstat (limited to 'linux/drivers/media/video/uvc/uvcvideo.h')
-rw-r--r--linux/drivers/media/video/uvc/uvcvideo.h86
1 files changed, 42 insertions, 44 deletions
diff --git a/linux/drivers/media/video/uvc/uvcvideo.h b/linux/drivers/media/video/uvc/uvcvideo.h
index e700bdc20..c385b7bde 100644
--- a/linux/drivers/media/video/uvc/uvcvideo.h
+++ b/linux/drivers/media/video/uvc/uvcvideo.h
@@ -362,26 +362,6 @@ struct uvc_streaming_header {
__u8 bTriggerUsage;
};
-struct uvc_streaming {
- struct list_head list;
-
- struct usb_interface *intf;
- int intfnum;
- __u16 maxpsize;
-
- struct uvc_streaming_header header;
- enum v4l2_buf_type type;
-
- unsigned int nformats;
- struct uvc_format *format;
-
- struct uvc_streaming_control ctrl;
- struct uvc_format *cur_format;
- struct uvc_frame *cur_frame;
-
- struct mutex mutex;
-};
-
enum uvc_buffer_state {
UVC_BUF_STATE_IDLE = 0,
UVC_BUF_STATE_QUEUED = 1,
@@ -423,26 +403,31 @@ struct uvc_video_queue {
struct list_head irqqueue;
};
-struct uvc_video_device {
+struct uvc_streaming {
+ struct list_head list;
struct uvc_device *dev;
struct video_device *vdev;
atomic_t active;
- unsigned int frozen : 1;
- struct list_head iterms; /* Input terminals */
- struct uvc_entity *oterm; /* Output terminal */
- struct uvc_entity *sterm; /* USB streaming terminal */
- struct uvc_entity *processing;
- struct uvc_entity *selector;
- struct list_head extensions;
- struct mutex ctrl_mutex;
+ struct usb_interface *intf;
+ int intfnum;
+ __u16 maxpsize;
- struct uvc_video_queue queue;
+ struct uvc_streaming_header header;
+ enum v4l2_buf_type type;
+
+ unsigned int nformats;
+ struct uvc_format *format;
- /* Video streaming object, must always be non-NULL. */
- struct uvc_streaming *streaming;
+ struct uvc_streaming_control ctrl;
+ struct uvc_format *cur_format;
+ struct uvc_frame *cur_frame;
+
+ struct mutex mutex;
- void (*decode) (struct urb *urb, struct uvc_video_device *video,
+ unsigned int frozen : 1;
+ struct uvc_video_queue queue;
+ void (*decode) (struct urb *urb, struct uvc_streaming *video,
struct uvc_buffer *buf);
/* Context data used by the bulk completion handler. */
@@ -462,6 +447,18 @@ struct uvc_video_device {
__u8 last_fid;
};
+struct uvc_video_device {
+ struct uvc_device *dev;
+
+ struct list_head iterms; /* Input terminals */
+ struct uvc_entity *oterm; /* Output terminal */
+ struct uvc_entity *sterm; /* USB streaming terminal */
+ struct uvc_entity *processing;
+ struct uvc_entity *selector;
+ struct list_head extensions;
+ struct mutex ctrl_mutex;
+};
+
enum uvc_device_state {
UVC_DEV_DISCONNECTED = 1,
};
@@ -487,15 +484,15 @@ struct uvc_device {
struct uvc_video_device video;
+ /* Video Streaming interfaces */
+ struct list_head streams;
+
/* Status Interrupt Endpoint */
struct usb_host_endpoint *int_ep;
struct urb *int_urb;
__u8 *status;
struct input_dev *input;
char input_phys[64];
-
- /* Video Streaming interfaces */
- struct list_head streaming;
};
enum uvc_handle_state {
@@ -504,7 +501,8 @@ enum uvc_handle_state {
};
struct uvc_fh {
- struct uvc_video_device *device;
+ struct uvc_video_device *video;
+ struct uvc_streaming *stream;
enum uvc_handle_state state;
};
@@ -601,13 +599,13 @@ static inline int uvc_queue_streaming(struct uvc_video_queue *queue)
extern const struct v4l2_file_operations uvc_fops;
/* Video */
-extern int uvc_video_init(struct uvc_video_device *video);
-extern int uvc_video_suspend(struct uvc_video_device *video);
-extern int uvc_video_resume(struct uvc_video_device *video);
-extern int uvc_video_enable(struct uvc_video_device *video, int enable);
-extern int uvc_probe_video(struct uvc_video_device *video,
+extern int uvc_video_init(struct uvc_streaming *stream);
+extern int uvc_video_suspend(struct uvc_streaming *stream);
+extern int uvc_video_resume(struct uvc_streaming *stream);
+extern int uvc_video_enable(struct uvc_streaming *stream, int enable);
+extern int uvc_probe_video(struct uvc_streaming *stream,
struct uvc_streaming_control *probe);
-extern int uvc_commit_video(struct uvc_video_device *video,
+extern int uvc_commit_video(struct uvc_streaming *stream,
struct uvc_streaming_control *ctrl);
extern int uvc_query_ctrl(struct uvc_device *dev, __u8 query, __u8 unit,
__u8 intfnum, __u8 cs, void *data, __u16 size);
@@ -661,7 +659,7 @@ extern struct usb_host_endpoint *uvc_find_endpoint(
struct usb_host_interface *alts, __u8 epaddr);
/* Quirks support */
-void uvc_video_decode_isight(struct urb *urb, struct uvc_video_device *video,
+void uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream,
struct uvc_buffer *buf);
#endif /* __KERNEL__ */