Re: [RFCv2 PATCH 09/10] DocBook: document the new v4l2 matrix ioctls.

2013-08-22 Thread Hans Verkuil
On 08/21/2013 11:58 PM, Laurent Pinchart wrote:
 Hi Hans,
 
 Thank you for the patch.
 
 On Monday 12 August 2013 12:58:32 Hans Verkuil wrote:
 From: Hans Verkuil hans.verk...@cisco.com

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 ---
  Documentation/DocBook/media/v4l/v4l2.xml   |   2 +
  .../DocBook/media/v4l/vidioc-g-matrix.xml  | 115 +
  .../DocBook/media/v4l/vidioc-query-matrix.xml  | 178 ++
  3 files changed, 295 insertions(+)
  create mode 100644 Documentation/DocBook/media/v4l/vidioc-g-matrix.xml
  create mode 100644 Documentation/DocBook/media/v4l/vidioc-query-matrix.xml
 
 [snip]
 
 diff --git a/Documentation/DocBook/media/v4l/vidioc-query-matrix.xml
 b/Documentation/DocBook/media/v4l/vidioc-query-matrix.xml new file mode
 100644
 index 000..c2845c7
 --- /dev/null
 +++ b/Documentation/DocBook/media/v4l/vidioc-query-matrix.xml
 @@ -0,0 +1,178 @@
 +refentry id=vidioc-query-matrix
 +  refmeta
 +refentrytitleioctl VIDIOC_QUERY_MATRIX/refentrytitle
 +manvol;
 +  /refmeta
 +
 +  refnamediv
 +refnameVIDIOC_QUERY_MATRIX/refname
 +refpurposeQuery the attributes of a matrix/refpurpose
 +  /refnamediv
 +
 +  refsynopsisdiv
 +funcsynopsis
 +  funcprototype
 +funcdefint functionioctl/function/funcdef
 +paramdefint parameterfd/parameter/paramdef
 +paramdefint parameterrequest/parameter/paramdef
 +paramdefstruct v4l2_query_matrix
 +*parameterargp/parameter/paramdef
 +  /funcprototype
 +/funcsynopsis
 +  /refsynopsisdiv
 +
 +  refsect1
 +titleArguments/title
 +
 +variablelist
 +  varlistentry
 +termparameterfd/parameter/term
 +listitem
 +  parafd;/para
 +/listitem
 +  /varlistentry
 +  varlistentry
 +termparameterrequest/parameter/term
 +listitem
 +  paraVIDIOC_QUERY_MATRIX/para
 +/listitem
 +  /varlistentry
 +  varlistentry
 +termparameterargp/parameter/term
 +listitem
 +  para/para
 +/listitem
 +  /varlistentry
 +/variablelist
 +  /refsect1
 +
 +  refsect1
 +titleDescription/title
 +
 +paraQuery the attributes of a matrix. The application fills in the
 +structfieldtype/structfield and optionally the
 structfieldref/structfield
 +fields of v4l2-query-matrix;. All other fields will be returned by the
 driver.
 +/para
 +
 +table frame=none pgwide=1 id=v4l2-query-matrix
 +  titlestruct structnamev4l2_query_matrix/structname/title
 +  tgroup cols=4
 +cs-str;
 +tbody valign=top
 +  row
 +entry__u32/entry
 +entrystructfieldtype/structfield/entry
 +entry/entry
 +entryType of the matrix, see xref linkend=v4l2-matrix-type
 /./entry +  /row
 +  row
 +entryunion/entry
 +entrystructfieldref/structfield/entry
 +entry/entry
 +entryThis union makes it possible to identify the object owning 
 the
 +matrix. Currently the only defined matrix types are identified
 through
 +the filehandle used to call the ioctl, so this union isn't used
 (yet)./entry
 +  /row
 +  row
 +entry__u32/entry
 +entrystructfieldcolumns/structfield/entry
 +entry/entry
 +entryNumber of columns in the matrix./entry
 +  /row
 +  row
 +entry__u32/entry
 +entrystructfieldrows/structfield/entry
 +entry/entry
 +entryNumber of rows in the matrix./entry
 +  /row
 +  row
 +entryunion/entry
 +entrystructfieldelem_min/structfield/entry
 +entry/entry
 +entry/entry
 +  /row
 +  row
 +entry/entry
 +entry__s64/entry
 +entrystructfieldval/structfield/entry
 +entryThe minimal signed value of each matrix element./entry
 +  /row
 +  row
 +entry/entry
 +entry__u64/entry
 +entrystructfielduval/structfield/entry
 +entryThe minimal unsigned value of each matrix
 element./entry
 +  /row
 +  row
 +entryunion/entry
 +entrystructfieldelem_max/structfield/entry
 +entry/entry
 +entry/entry
 +  /row
 +  row
 +entry/entry
 +entry__s64/entry
 +entrystructfieldval/structfield/entry
 +entryThe maximal signed value of each matrix element./entry
 +  /row
 +  row
 +entry/entry
 +entry__u64/entry
 +entrystructfielduval/structfield/entry
 +entryThe maximal unsigned value of each matrix
 element./entry
 +  /row
 +  row
 +entry__u32/entry
 +entrystructfieldelem_size/structfield/entry
 +entry/entry
 +entryThe size in bytes of a single matrix element.
 +The full matrix size will be structfieldcolumns/structfield *
 +structfieldrows/structfield *
 structfieldelem_size/structfield./entry
 +  /row
 +  row
 +entry__u32/entry
 +  

Re: [RFCv2 PATCH 09/10] DocBook: document the new v4l2 matrix ioctls.

2013-08-22 Thread Laurent Pinchart
Hi Hans,

On Thursday 22 August 2013 08:56:00 Hans Verkuil wrote:
 On 08/21/2013 11:58 PM, Laurent Pinchart wrote:
  On Monday 12 August 2013 12:58:32 Hans Verkuil wrote:
  From: Hans Verkuil hans.verk...@cisco.com
  
  Signed-off-by: Hans Verkuil hans.verk...@cisco.com
  ---
  
   Documentation/DocBook/media/v4l/v4l2.xml   |   2 +
   .../DocBook/media/v4l/vidioc-g-matrix.xml  | 115 +
   .../DocBook/media/v4l/vidioc-query-matrix.xml  | 178 +++
   3 files changed, 295 insertions(+)
   create mode 100644 Documentation/DocBook/media/v4l/vidioc-g-matrix.xml
   create mode 100644
   Documentation/DocBook/media/v4l/vidioc-query-matrix.xml
  
  [snip]
  
  diff --git a/Documentation/DocBook/media/v4l/vidioc-query-matrix.xml
  b/Documentation/DocBook/media/v4l/vidioc-query-matrix.xml new file mode
  100644
  index 000..c2845c7
  --- /dev/null
  +++ b/Documentation/DocBook/media/v4l/vidioc-query-matrix.xml

[snip]

  +table pgwide=1 frame=none id=v4l2-matrix-type
  +  titleMatrix Types/title
  +  tgroup cols=2 align=left
  +  colspec colwidth=30* /
  +  colspec colwidth=55* /
  +  thead
  +row
  +  entryType/entry
  +  entryDescription/entry
  +/row
  +  /thead
  +  tbody valign=top
  +row
  +  entryconstantV4L2_MATRIX_T_MD_REGION/constant/entry
  +  entryHardware motion detection often divides the image into
  several
  +  regions, and each region can have its own motion detection
  thresholds.
  +  This matrix assigns a region number to each element. Each element
  is
  a __u8.
  +  Generally each element refers to a block of pixels in the image.
  
  From the description I have trouble understanding what the matrix type is
  for. Do you think we could make the explanation more detailed ?
 
 How about this:
 
 Hardware motion detection divides the image up into cells. If the image
 resolution is WxH and the matrix size is COLSxROWS, then each cell is a
 rectangle of (W/COLS)x(H/ROWS) pixels (approximately as there may be some
 rounding involved). Depending on the hardware each cell can have its own
 properties. This matrix type sets the 'region' property which is a __u8.
 Each region will typically have its own set of motion detection parameters
 such as a threshold that determines the motion detection sensitivity. By
 assigning each cell a region you can create regions with lower and regions
 with higher motion sensitivity.

That sounds good to me. One more question, however: if the hardware divides 
the sub-sampled image into regions, how do you configure per-region thresholds 
? The V4L2_MATRIX_T_MD_THRESHOLD matrix only configures per-cell thresholds.

   + /entry
   +   /row
   +   row
   + entryconstantV4L2_MATRIX_T_MD_THRESHOLD/constant/entry
   + entryHardware motion detection can assign motion detection
   threshold +   values to each element of an image. Each element is 
   a
   __u16. +   Generally each element refers to a block of pixels in
   the image.
 This would be improved as well along the same lines:
 
 Hardware motion detection divides the image up into cells. If the image
 resolution is WxH and the matrix size is COLSxROWS, then each cell is a
 rectangle of (W/COLS)x(H/ROWS) pixels (approximately as there may be some
 rounding involved). Depending on the hardware each cell can have its own
 motion detection sensitivity threshold. This matrix type sets the motion
 detection threshold property which is a __u16.
   + /entry
   +   /row
   + /tbody
   +  /tgroup
   +/table
   +
   +  /refsect1
   +  refsect1
   +return-value;
   +  /refsect1
   +/refentry

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFCv2 PATCH 09/10] DocBook: document the new v4l2 matrix ioctls.

2013-08-22 Thread Hans Verkuil
On Thu 22 August 2013 12:34:56 Laurent Pinchart wrote:
 Hi Hans,
 
 On Thursday 22 August 2013 08:56:00 Hans Verkuil wrote:
  On 08/21/2013 11:58 PM, Laurent Pinchart wrote:
   On Monday 12 August 2013 12:58:32 Hans Verkuil wrote:
   From: Hans Verkuil hans.verk...@cisco.com
   
   Signed-off-by: Hans Verkuil hans.verk...@cisco.com
   ---
   
Documentation/DocBook/media/v4l/v4l2.xml   |   2 +
.../DocBook/media/v4l/vidioc-g-matrix.xml  | 115 +
.../DocBook/media/v4l/vidioc-query-matrix.xml  | 178 +++
3 files changed, 295 insertions(+)
create mode 100644 Documentation/DocBook/media/v4l/vidioc-g-matrix.xml
create mode 100644
Documentation/DocBook/media/v4l/vidioc-query-matrix.xml
   
   [snip]
   
   diff --git a/Documentation/DocBook/media/v4l/vidioc-query-matrix.xml
   b/Documentation/DocBook/media/v4l/vidioc-query-matrix.xml new file mode
   100644
   index 000..c2845c7
   --- /dev/null
   +++ b/Documentation/DocBook/media/v4l/vidioc-query-matrix.xml
 
 [snip]
 
   +table pgwide=1 frame=none id=v4l2-matrix-type
   +  titleMatrix Types/title
   +  tgroup cols=2 align=left
   +colspec colwidth=30* /
   +colspec colwidth=55* /
   +thead
   +  row
   +entryType/entry
   +entryDescription/entry
   +  /row
   +/thead
   +tbody valign=top
   +  row
   +entryconstantV4L2_MATRIX_T_MD_REGION/constant/entry
   +entryHardware motion detection often divides the image 
   into
   several
   +regions, and each region can have its own motion detection
   thresholds.
   +This matrix assigns a region number to each element. Each 
   element
   is
   a __u8.
   +Generally each element refers to a block of pixels in the 
   image.
   
   From the description I have trouble understanding what the matrix type is
   for. Do you think we could make the explanation more detailed ?
  
  How about this:
  
  Hardware motion detection divides the image up into cells. If the image
  resolution is WxH and the matrix size is COLSxROWS, then each cell is a
  rectangle of (W/COLS)x(H/ROWS) pixels (approximately as there may be some
  rounding involved). Depending on the hardware each cell can have its own
  properties. This matrix type sets the 'region' property which is a __u8.
  Each region will typically have its own set of motion detection parameters
  such as a threshold that determines the motion detection sensitivity. By
  assigning each cell a region you can create regions with lower and regions
  with higher motion sensitivity.
 
 That sounds good to me. One more question, however: if the hardware divides 
 the sub-sampled image into regions, how do you configure per-region 
 thresholds 
 ? The V4L2_MATRIX_T_MD_THRESHOLD matrix only configures per-cell thresholds.

That's hardware dependent. The go7007 has four different threshold parameters
per region, so that's a total of 16 controls for all four regions.

If we get more drivers doing motion detection in the future, then some of those
parameters might become standardized, but at the moment I have only one driver
and I don't want to standardize that as long as I don't know if it can be
standardized in the first place.

Regards,

Hans

 
+   /entry
+ /row
+ row
+   
entryconstantV4L2_MATRIX_T_MD_THRESHOLD/constant/entry
+   entryHardware motion detection can assign motion detection
threshold + values to each element of an image. Each element is 
a
__u16. +   Generally each element refers to a block of pixels in
the image.
  This would be improved as well along the same lines:
  
  Hardware motion detection divides the image up into cells. If the image
  resolution is WxH and the matrix size is COLSxROWS, then each cell is a
  rectangle of (W/COLS)x(H/ROWS) pixels (approximately as there may be some
  rounding involved). Depending on the hardware each cell can have its own
  motion detection sensitivity threshold. This matrix type sets the motion
  detection threshold property which is a __u16.
+   /entry
+ /row
+   /tbody
+  /tgroup
+/table
+
+  /refsect1
+  refsect1
+return-value;
+  /refsect1
+/refentry
 
 
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFCv2 PATCH 09/10] DocBook: document the new v4l2 matrix ioctls.

2013-08-21 Thread Laurent Pinchart
Hi Hans,

Thank you for the patch.

On Monday 12 August 2013 12:58:32 Hans Verkuil wrote:
 From: Hans Verkuil hans.verk...@cisco.com
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 ---
  Documentation/DocBook/media/v4l/v4l2.xml   |   2 +
  .../DocBook/media/v4l/vidioc-g-matrix.xml  | 115 +
  .../DocBook/media/v4l/vidioc-query-matrix.xml  | 178 ++
  3 files changed, 295 insertions(+)
  create mode 100644 Documentation/DocBook/media/v4l/vidioc-g-matrix.xml
  create mode 100644 Documentation/DocBook/media/v4l/vidioc-query-matrix.xml

[snip]

 diff --git a/Documentation/DocBook/media/v4l/vidioc-query-matrix.xml
 b/Documentation/DocBook/media/v4l/vidioc-query-matrix.xml new file mode
 100644
 index 000..c2845c7
 --- /dev/null
 +++ b/Documentation/DocBook/media/v4l/vidioc-query-matrix.xml
 @@ -0,0 +1,178 @@
 +refentry id=vidioc-query-matrix
 +  refmeta
 +refentrytitleioctl VIDIOC_QUERY_MATRIX/refentrytitle
 +manvol;
 +  /refmeta
 +
 +  refnamediv
 +refnameVIDIOC_QUERY_MATRIX/refname
 +refpurposeQuery the attributes of a matrix/refpurpose
 +  /refnamediv
 +
 +  refsynopsisdiv
 +funcsynopsis
 +  funcprototype
 + funcdefint functionioctl/function/funcdef
 + paramdefint parameterfd/parameter/paramdef
 + paramdefint parameterrequest/parameter/paramdef
 + paramdefstruct v4l2_query_matrix
 +*parameterargp/parameter/paramdef
 +  /funcprototype
 +/funcsynopsis
 +  /refsynopsisdiv
 +
 +  refsect1
 +titleArguments/title
 +
 +variablelist
 +  varlistentry
 + termparameterfd/parameter/term
 + listitem
 +   parafd;/para
 + /listitem
 +  /varlistentry
 +  varlistentry
 + termparameterrequest/parameter/term
 + listitem
 +   paraVIDIOC_QUERY_MATRIX/para
 + /listitem
 +  /varlistentry
 +  varlistentry
 + termparameterargp/parameter/term
 + listitem
 +   para/para
 + /listitem
 +  /varlistentry
 +/variablelist
 +  /refsect1
 +
 +  refsect1
 +titleDescription/title
 +
 +paraQuery the attributes of a matrix. The application fills in the
 +structfieldtype/structfield and optionally the
 structfieldref/structfield
 +fields of v4l2-query-matrix;. All other fields will be returned by the
 driver.
 +/para
 +
 +table frame=none pgwide=1 id=v4l2-query-matrix
 +  titlestruct structnamev4l2_query_matrix/structname/title
 +  tgroup cols=4
 + cs-str;
 + tbody valign=top
 +   row
 + entry__u32/entry
 + entrystructfieldtype/structfield/entry
 +entry/entry
 + entryType of the matrix, see xref linkend=v4l2-matrix-type
 /./entry +   /row
 +   row
 + entryunion/entry
 + entrystructfieldref/structfield/entry
 +entry/entry
 + entryThis union makes it possible to identify the object owning 
 the
 + matrix. Currently the only defined matrix types are identified
 through
 + the filehandle used to call the ioctl, so this union isn't used
 (yet)./entry
 +   /row
 +   row
 + entry__u32/entry
 + entrystructfieldcolumns/structfield/entry
 +entry/entry
 + entryNumber of columns in the matrix./entry
 +   /row
 +   row
 + entry__u32/entry
 + entrystructfieldrows/structfield/entry
 +entry/entry
 + entryNumber of rows in the matrix./entry
 +   /row
 +   row
 + entryunion/entry
 + entrystructfieldelem_min/structfield/entry
 +entry/entry
 +entry/entry
 +   /row
 +   row
 + entry/entry
 +entry__s64/entry
 + entrystructfieldval/structfield/entry
 +entryThe minimal signed value of each matrix element./entry
 +   /row
 +   row
 + entry/entry
 +entry__u64/entry
 + entrystructfielduval/structfield/entry
 +entryThe minimal unsigned value of each matrix
 element./entry
 +   /row
 +   row
 + entryunion/entry
 + entrystructfieldelem_max/structfield/entry
 +entry/entry
 +entry/entry
 +   /row
 +   row
 + entry/entry
 +entry__s64/entry
 + entrystructfieldval/structfield/entry
 +entryThe maximal signed value of each matrix element./entry
 +   /row
 +   row
 + entry/entry
 +entry__u64/entry
 + entrystructfielduval/structfield/entry
 +entryThe maximal unsigned value of each matrix
 element./entry
 +   /row
 +   row
 + entry__u32/entry
 + entrystructfieldelem_size/structfield/entry
 +entry/entry
 + entryThe size in bytes of a single matrix element.
 + The full matrix size will be structfieldcolumns/structfield *
 + structfieldrows/structfield *
 structfieldelem_size/structfield./entry
 +   /row
 +   row
 +