diff options
| author | Sakari Ailus <sakari.ailus@iki.fi> | 2011-07-18 07:40:03 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-08-29 11:37:15 -0400 |
| commit | eab00a0da292fa7118aaf20da78e834866de00ae (patch) | |
| tree | 7e5be2825c3859c39114050a731d97c51d546e48 | |
| parent | c9f88aa976b79a26561fb7754a1e0e00ff7626fe (diff) | |
[media] v4l: events: Define V4L2_EVENT_FRAME_SYNC
Define a frame sync event to tell user space when the reception of a frame
starts.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
| -rw-r--r-- | Documentation/DocBook/media/v4l/vidioc-dqevent.xml | 22 | ||||
| -rw-r--r-- | Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml | 16 | ||||
| -rw-r--r-- | include/linux/videodev2.h | 12 |
3 files changed, 47 insertions, 3 deletions
diff --git a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml index 5200b6874654..e8714aa16433 100644 --- a/Documentation/DocBook/media/v4l/vidioc-dqevent.xml +++ b/Documentation/DocBook/media/v4l/vidioc-dqevent.xml | |||
| @@ -88,6 +88,12 @@ | |||
| 88 | </row> | 88 | </row> |
| 89 | <row> | 89 | <row> |
| 90 | <entry></entry> | 90 | <entry></entry> |
| 91 | <entry>&v4l2-event-frame-sync;</entry> | ||
| 92 | <entry><structfield>frame</structfield></entry> | ||
| 93 | <entry>Event data for event V4L2_EVENT_FRAME_SYNC.</entry> | ||
| 94 | </row> | ||
| 95 | <row> | ||
| 96 | <entry></entry> | ||
| 91 | <entry>__u8</entry> | 97 | <entry>__u8</entry> |
| 92 | <entry><structfield>data</structfield>[64]</entry> | 98 | <entry><structfield>data</structfield>[64]</entry> |
| 93 | <entry>Event data. Defined by the event type. The union | 99 | <entry>Event data. Defined by the event type. The union |
| @@ -220,6 +226,22 @@ | |||
| 220 | </tgroup> | 226 | </tgroup> |
| 221 | </table> | 227 | </table> |
| 222 | 228 | ||
| 229 | <table frame="none" pgwide="1" id="v4l2-event-frame-sync"> | ||
| 230 | <title>struct <structname>v4l2_event_frame_sync</structname></title> | ||
| 231 | <tgroup cols="3"> | ||
| 232 | &cs-str; | ||
| 233 | <tbody valign="top"> | ||
| 234 | <row> | ||
| 235 | <entry>__u32</entry> | ||
| 236 | <entry><structfield>frame_sequence</structfield></entry> | ||
| 237 | <entry> | ||
| 238 | The sequence number of the frame being received. | ||
| 239 | </entry> | ||
| 240 | </row> | ||
| 241 | </tbody> | ||
| 242 | </tgroup> | ||
| 243 | </table> | ||
| 244 | |||
| 223 | <table pgwide="1" frame="none" id="changes-flags"> | 245 | <table pgwide="1" frame="none" id="changes-flags"> |
| 224 | <title>Changes</title> | 246 | <title>Changes</title> |
| 225 | <tgroup cols="3"> | 247 | <tgroup cols="3"> |
diff --git a/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml b/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml index 275be9689d88..5c70b616d818 100644 --- a/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml +++ b/Documentation/DocBook/media/v4l/vidioc-subscribe-event.xml | |||
| @@ -139,6 +139,22 @@ | |||
| 139 | </entry> | 139 | </entry> |
| 140 | </row> | 140 | </row> |
| 141 | <row> | 141 | <row> |
| 142 | <entry><constant>V4L2_EVENT_FRAME_SYNC</constant></entry> | ||
| 143 | <entry>4</entry> | ||
| 144 | <entry> | ||
| 145 | <para>Triggered immediately when the reception of a | ||
| 146 | frame has begun. This event has a | ||
| 147 | &v4l2-event-frame-sync; associated with it.</para> | ||
| 148 | |||
| 149 | <para>If the hardware needs to be stopped in the case of a | ||
| 150 | buffer underrun it might not be able to generate this event. | ||
| 151 | In such cases the <structfield>frame_sequence</structfield> | ||
| 152 | field in &v4l2-event-frame-sync; will not be incremented. This | ||
| 153 | causes two consecutive frame sequence numbers to have n times | ||
| 154 | frame interval in between them.</para> | ||
| 155 | </entry> | ||
| 156 | </row> | ||
| 157 | <row> | ||
| 142 | <entry><constant>V4L2_EVENT_PRIVATE_START</constant></entry> | 158 | <entry><constant>V4L2_EVENT_PRIVATE_START</constant></entry> |
| 143 | <entry>0x08000000</entry> | 159 | <entry>0x08000000</entry> |
| 144 | <entry>Base event number for driver-private events.</entry> | 160 | <entry>Base event number for driver-private events.</entry> |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index fca24cc50436..a5359c6e7577 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
| @@ -2006,6 +2006,7 @@ struct v4l2_streamparm { | |||
| 2006 | #define V4L2_EVENT_VSYNC 1 | 2006 | #define V4L2_EVENT_VSYNC 1 |
| 2007 | #define V4L2_EVENT_EOS 2 | 2007 | #define V4L2_EVENT_EOS 2 |
| 2008 | #define V4L2_EVENT_CTRL 3 | 2008 | #define V4L2_EVENT_CTRL 3 |
| 2009 | #define V4L2_EVENT_FRAME_SYNC 4 | ||
| 2009 | #define V4L2_EVENT_PRIVATE_START 0x08000000 | 2010 | #define V4L2_EVENT_PRIVATE_START 0x08000000 |
| 2010 | 2011 | ||
| 2011 | /* Payload for V4L2_EVENT_VSYNC */ | 2012 | /* Payload for V4L2_EVENT_VSYNC */ |
| @@ -2032,12 +2033,17 @@ struct v4l2_event_ctrl { | |||
| 2032 | __s32 default_value; | 2033 | __s32 default_value; |
| 2033 | }; | 2034 | }; |
| 2034 | 2035 | ||
| 2036 | struct v4l2_event_frame_sync { | ||
| 2037 | __u32 frame_sequence; | ||
| 2038 | }; | ||
| 2039 | |||
| 2035 | struct v4l2_event { | 2040 | struct v4l2_event { |
| 2036 | __u32 type; | 2041 | __u32 type; |
| 2037 | union { | 2042 | union { |
| 2038 | struct v4l2_event_vsync vsync; | 2043 | struct v4l2_event_vsync vsync; |
| 2039 | struct v4l2_event_ctrl ctrl; | 2044 | struct v4l2_event_ctrl ctrl; |
| 2040 | __u8 data[64]; | 2045 | struct v4l2_event_frame_sync frame_sync; |
| 2046 | __u8 data[64]; | ||
| 2041 | } u; | 2047 | } u; |
| 2042 | __u32 pending; | 2048 | __u32 pending; |
| 2043 | __u32 sequence; | 2049 | __u32 sequence; |
