aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/uvc/uvcvideo.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@skynet.be>2009-06-28 08:37:50 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 12:18:32 -0300
commit35f02a681b72ece756cf005e17f305a72329c140 (patch)
treece566b9875213470d355a50bd8c6f9edeb1dd8dd /drivers/media/video/uvc/uvcvideo.h
parent6c428b578b15a1dbf40832d3aeed43761940b81f (diff)
V4L/DVB (12378): uvcvideo: Restructure the driver to support multiple simultaneous streams.
As a first step towards multiple streaming interfaces support, reorganize the driver's data structures to cleanly separate video control and video streaming data. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvcvideo.h')
-rw-r--r--drivers/media/video/uvc/uvcvideo.h86
1 files changed, 42 insertions, 44 deletions
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
index fcccf9c9b7b..3cd9041e22a 100644
--- a/drivers/media/video/uvc/uvcvideo.h
+++ b/drivers/media/video/uvc/uvcvideo.h
@@ -361,26 +361,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,
@@ -422,26 +402,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. */
@@ -461,6 +446,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,
};
@@ -486,15 +483,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 {
@@ -503,7 +500,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;
};
@@ -600,13 +598,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);
@@ -660,7 +658,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__ */