4

I'm having some issues with AirPlay. The thing is, I'm developing with the ATV3, and my TV set supports 1080p. But when I start screen mirroring and receive the new instance of UIScreen, the bounds and the applicationFrame are both giving me a 720p resolution.

But it gets weird when I actually moved the subviews to a negative value, and the whole screen gets covered. So, technically my iPhone is streaming at 1080p, but the bounds returned by the UIScreen are underscanned.

I've tried modifying the overscanCompensation before getting the bounds or the applicationFrame (tried both with all 3 overscanCompensation values available) but I'm still getting the same result.

Here is a picture of what I'm getting (sorry, it's the worst picture in the planet, I know, but I was using my phone to stream the image to the ATV :) )

Red view is the 720p reported by the bounds property. Red view is the 720p reported by bounds.

It gets even weirder when I actually try this out in my ATV2 (it is supposedly limited to 720p even if it supports 1080p) and the result is exactly the same.

Anyway, if someone knows the method to get the real screen display to avoid putting a settings view in my app, I'll really appreciate it.

Thanks in advance :)

Gonzalo Larralde
  • 3,523
  • 25
  • 30
  • Are you positively certain that you are actually seing 1080p on the ATV2 and not some interpolated results? – Till Feb 26 '13 at 03:28
  • Not really but if you give me a while, I'll try to check. Anyway, the ATV2 supports 1080p resolution (you can check that in preferences) but it can't decode video flawlessly with a resolution bigger than 720p. – Gonzalo Larralde Feb 26 '13 at 03:30
  • 1
    AFAIK AirPlay mirroring is limited on the ATV to 720 - but that may be outdated information - just a hint. Ow there is actually a related question here already; http://stackoverflow.com/questions/9952739/airplay-on-new-apple-tv-3rd-gen-for-second-screen-not-at-1080p – Till Feb 26 '13 at 03:37
  • My TV is so crappy I can't have a 1:1 pixel relation even with an HDMI adapter. Sorry, I think I'll not be able to check this for sure :-/ – Gonzalo Larralde Feb 26 '13 at 03:39

3 Answers3

2

When you mentioned that you tried all 3 overscanCompensation modes, I presume you mean the 3 documented modes:

typedef enum {
UIScreenOverscanCompensationScale,
UIScreenOverscanCompensationInsetBounds,
UIScreenOverscanCompensationInsetApplicationFrame,
} UIScreenOverscanCompensation;

However, there is a fourth mode, which is not there, but should fix your problems: just set your overscanCompensation to 3.

Also, take a look at this SO question.

Community
  • 1
  • 1
nikolovski
  • 4,049
  • 1
  • 31
  • 37
2

The answer of Ivan solved the same issue for me! But I also had the borders when using AirPlay Mirroring. I got rid of the borders without setting the overscanCompensation property by changing a setting on my Apple TV: try setting 'Settings > Audio & Video > Adjust For AirPlay Overscan' to Off (default On).

kjellie
  • 352
  • 3
  • 7
1

The setting that works best for most TVs is:

externalScreen.overscanCompensation = UIScreenOverscanCompensationInsetBounds | UIScreenOverscanCompensationInsetApplicationFrame; // this is the same as setting it to 3

Just setting it to UIScreenOverscanCompensationInsetApplicationFrame can cause misalignment of the UIWindow contents.

3 is a bitmask of UIScreenOverscanCompensationInsetBounds(1) and UIScreenOverscanCompensationInsetApplicationFrame(2) for those wondering where that number comes from and why it works.

Ivan Andriollo
  • 370
  • 1
  • 5