finnw
Posts: 24
Joined: Wed May 16, 2012 7:05 pm

Detect whether HDMI or RCA output is active

Mon May 21, 2012 12:42 pm

Is there an API call that will tell you whether the RCA video output is currently in use?

I have noticed that graphics_get_display_size() always returns the full HDMI framebuffer size (typically 1920x1080) - it does not appear to be affected by the the given display ID or by what port is currently active.

If the app knows this then it can render just the visible portion (720x480?), otherwise you only see the top-left corner and much of the rendering work is wasted.

I'm guessing it must be possible because the console adjusts its size to fit the screen whichever output is used.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5424
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Detect whether HDMI or RCA output is active

Mon May 21, 2012 1:11 pm

Latest firmware from github (specifically opt/vc/lib) will return the correct size in graphics_get_display_size.
"/opt/vc/bin/tvservice -s" will also tell you the resolution.

Return to “C/C++”