0

I have to support VideoConfiguration,(1280 X 720, 800 X 480) Our car display size is 1024 X 600. After android auto is started , the cellphone(or MD) is sending the video output of 1280X 720px. Based on the HUIG doc calculation we need to set margin since we cannot downscale the video. After setting the width Margin of 256 and height margin of 120 , arbitary content is visible and touch coordinate are not working properly. My question is, how can I adjust my parameters so that the video contents from MD is rendered properly.

Car Display size =1024x600

To support 1280 x720 width Margin =1280-1024=256 height Margin=720-600=120

Found this answer https://stackoverflow.com/a/68028928/4722613 , but need some code snippet or detailed explanation.

1 Answers1

0

I have wrapped up things by myself. In order to support 1280*720px resolution, follow the below steps

  1. surface view need to be scaled up in x and y axis. In my case its 1.25 in x axis and 1.2 in y axis.

SurfaceView.setScaleX(1.25f); SurfaceView.setScaleY(1.2f);

  1. we need to subtract the applied margins from the touch coordinates before applying the scaling factor to touch coordinates.