开发者

Is it possible to show different content on the Android's screen and the screen connected via HDMI?

I'm wondering if I can develop an application, where I can have the main content displayed on a big screen connected to my An开发者_StackOverflow社区droid via HDMI and use the Android's touchscreen as a controller displaying different content.

So far the videos I've seen about Android's HDMI feature only mirror the phone's screen to the big screen.


You can use the Android Presentation API (API 17). Works very well.

Your presentation is connected to an Activity, which lets you display e.g a Live Stream on the TV (through e.g HDMI) and use phone's display as a remote. I've done this in an app, and also out of laziness added a second app for a second phone which is used as a bluetooth remote control.

Hope this answers your question.


Surface flinger only sees two different kind of graphic buffers, frame buffers for normal ui display and overlay buffers for videos and camera previews. So frames buffers (or overlay buffers) should be transferred to hdmi by display controller when hdmi cable is plugged in. But unfortunately there isn't public api to control this kind of data flow. It is highly dependent on how hardware overlay or hdmi device drivers are implemented by chipset vendor or device manufacturer.


I dont think you can do this, unless you develop for a device for which vendor published HDMI API, like for some Motorola devices. For the rest, they typically have some hdmi OS service (not accessible to apps) that uses ioctls and /dev/ access for hdmi control (again, not accessible to unsigned apps).


You can exploit the flaw in HDMI overlay communication to achieve this. Your video input goes directly to the android output but you can use another layout for the screen which will not be visible in HDMI due to overlay issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜