Document that video frames rotate

We recently changed the behaviour in InputReader to adjust the video
frame data based on the current orientation.
Update the HAL documentation to reflect that.

Also, rearrange the order of width and height, because it is more
natural to have the format of num of rows x num of columns. So
currently, it is reversed, and not as natural.
More information about this is in ag/6414079.

Bug: 123241238
Test: none
Change-Id: I69f184794bd7684e5c0981a6db66542ab914eff2
This commit is contained in:
Siarhei Vishniakou 2019-02-21 15:38:26 -06:00
parent fa4333b8e5
commit e4c310fdc9
2 changed files with 27 additions and 10 deletions

View file

@ -487,7 +487,7 @@ c3f831a66d5815baf74f5b82fe79cf099542ddae4dfab3f388e1d41828e794fc android.hardwar
dd1ec219f5d2e2b33c6c0bcb92e63bbedb36f7c716413462848f6b6ae74fc864 android.hardware.health.storage@1.0::IStorage
2b4a14661e6a38617b7dd0c6ebb66a56a90e564674ac7697a14cb8a0cab92b2f android.hardware.health.storage@1.0::types
30006fde4cb1f255f2530208728bff692100411b20af5b66fa31a9196d51f00b android.hardware.input.classifier@1.0::IInputClassifier
97d8757bb05eb23d6a218bda374e095dfbb064c47714e2f859963c11f433e822 android.hardware.input.common@1.0::types
0300c7667030da36c3de585f176ce18ff4b0d2615446d4930f331097378c06ef android.hardware.input.common@1.0::types
24ae089981d58bc4cc74d75a6055bf357338ae6744ce1b467c5b4a9c470aba6d android.hardware.media.bufferpool@2.0::IAccessor
897f45ee7db24ef227dea83ca3e4de72d53ff6bb7adc7983c90a650a1a6ff576 android.hardware.media.bufferpool@2.0::IClientManager
aee53b2865b4f7939fb3df6fae758d9750c14f93dd454b479fc74aa7978fda4f android.hardware.media.bufferpool@2.0::IConnection

View file

@ -685,20 +685,20 @@ enum Flag : int32_t {
* Touch heatmap.
*
* The array is a 2-D row-major matrix with dimensions (height, width).
* The heatmap data does not rotate when device orientation changes.
* The heatmap data is rotated when device orientation changes.
*
* Example:
*
* If the data in the array is:
* data[i] = i for i in 0 .. 59,
* then it can be represented as follows:
* then it can be represented as a 10 x 6 matrix:
*
* <-- width -- >
* <-- width -->
* 0 1 2 3 4 5 ^
* 6 7 8 9 10 11 |
* 12 12 14 15 16 17 |
* 18 ... 23 | height
* 24 ... 29 |
* 12 13 14 15 16 17 |
* 18 ... 23 |
* 24 ... 29 | height
* 30 ... 35 |
* 36 ... 41 |
* 42 ... 47 |
@ -708,16 +708,33 @@ enum Flag : int32_t {
* Looking at the device in standard portrait orientation,
* the element "0" is the top left of the screen,
* "5" is at the top right, and "59" is the bottom right.
* Here width=6, and height=10.
* Here height=10 and width=6.
*
* If the screen orientation changes to landscape (a 90 degree orientation
* change), the frame's dimensions will become 6 x 10
* and the data will look as follows:
* 54 48 42 36 30 24 18 12 6 0 ^
* ... 13 7 1 |
* ... 14 8 2 | height
* ... 15 9 3 |
* ... 16 10 4 |
* 59 53 47 41 35 29 23 17 11 5 v
* <-- width -->
*
* Here the element "0" is at the physical top left of the unrotated screen.
*
* Since the coordinates of a MotionEvent are also adjusted based on the
* orientation, the rotation of the video frame data ensures that
* the axes for MotionEvent and VideoFrame data are consistent.
*/
struct VideoFrame {
/**
* Video frame data.
* Size of the data is width * height.
* Size of the data is height * width.
*/
vec<int16_t> data;
uint32_t width;
uint32_t height;
uint32_t width;
/**
* Time at which the frame was collected, in nanoseconds.
* Measured with the same clock that is used to populate MotionEvent times.