We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1266

Summary: Uikitvideo calls unimplemented method in 3.1
Product: SDL Reporter: Vittorio Giovara <vitto.giova>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus, kees
Version: HG 2.0   
Hardware: iPhone/iPod touch   
OS: iOS (All)   
Bug Depends on: 1239    
Bug Blocks:    
Attachments: final tweaks for full ios 3 compability
fix the inverted condition check
better version check
uikitviewcontroller update
uikitviewcontroller update updated

Description Vittorio Giovara 2011-08-06 04:03:17 UTC
In uikitvideo.m there a [uiscreen currentMode] call and then a consequent UIScreenMode that were introduced in iOS 3.2
This of course causes a crash when trying to run sdl code on iOS 3.1.* with an unimplemented excepition.

Should this be wrapped in a respondsToSelector or should compatibility with older versions be dropped?
Comment 1 Kees Bakker 2011-10-13 13:35:11 UTC
My repo at https://bitbucket.org/keestux/sdl already has somewhat of
a fix, but it would probably be more Objective-C to use respondsToSelector.
I'll make that change.

Having said that, with my current changes the code does not execute any
UIScreenMode related code if the iOS is older than 3.2. So I would think
it shouldn't crash anymore.
Comment 2 Vittorio Giovara 2011-10-27 18:52:19 UTC
Created attachment 720 [details]
final tweaks for full ios 3 compability

I've atteched some further tweaks
Comment 3 Kees Bakker 2011-10-29 03:16:27 UTC
Hi Vittorio, thanks for the patches

Perhaps we need to split them up.

1. bugfix using the inverted condition
2. using respondsToSelector instead of checking the version
3. the uikitcontroller change

About 3.
Is that change alright? What's the point of computing "frame" if it is not used?
Comment 4 Vittorio Giovara 2011-10-29 06:15:12 UTC
Created attachment 721 [details]
fix the inverted condition check
Comment 5 Vittorio Giovara 2011-10-29 06:15:51 UTC
Created attachment 722 [details]
better version check
Comment 6 Vittorio Giovara 2011-10-29 06:17:08 UTC
Created attachment 723 [details]
uikitviewcontroller update
Comment 7 Vittorio Giovara 2011-10-29 06:19:22 UTC
Kees, you are right about 3, I removed the computation instead.
Also I've split up the patches!
Comment 8 Vittorio Giovara 2011-11-08 01:15:30 UTC
Comment on attachment 721 [details]
fix the inverted condition check

this was applied in 2e4a1b92dc6f
Comment 9 Ryan C. Gordon 2011-11-19 16:23:48 UTC
Attachment #722 [details] is now hg changeset 30d57832687a, thanks!

What's the goal of Attachment #723 [details], though? Should we not check orientation when reporting screen dimensions?

--ryan.
Comment 10 Vittorio Giovara 2011-11-20 08:50:10 UTC
Comment on attachment 722 [details]
better version check

added in 30d57832687a
Comment 11 Vittorio Giovara 2011-11-20 08:52:28 UTC
Created attachment 728 [details]
uikitviewcontroller update updated

actually no, in the previous patch i got code mixed for another bug.
Please consider the version i uploaded now, it basically changes which uiscreen is going to provide teh screen size.
Comment 12 Ryan C. Gordon 2011-11-27 20:31:50 UTC
(In reply to comment #11)
> actually no, in the previous patch i got code mixed for another bug.
> Please consider the version i uploaded now, it basically changes which uiscreen
> is going to provide teh screen size.

This is now hg changeset a8696b259e09, thanks!

Resolving this bug as FIXED now, as I think we got everything taken care of at this point.

--ryan.