AVCaptureSessionPresetHigh resolution on iPad? - objective-c

I need to know what the AVCaptureSessionPresetHigh resolution is for the newest iPad, and for all various devices for that matter. Apple's documentation has a chart that explains what the various resolutions are for the different presets, but only for the iPhone 3, 3GS, and 4. That chart is here: http://developer.apple.com/library/mac/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html
Is there somewhere else where this is recorded for the rest of the devices? I haven't been able to find it anywhere.

I've tested the AVCaptureSessionPresetHigh and with iPad 4 it returns me the resolution of 1280x720!
Cheers

I tested with iPad 3 (Retina) and it returns 1280x720.
BTW, the AVCaptureSessionPresetHigh is the default for AVCaptureSession.

Related

How do I get my iPhone-only app to run on iPads? (constraint question?)

My iPhone-only Objective-C app (iPad not checked) runs correctly on SE 2nd up to iPhone 12 Pro Max, properly centered, fully functional, but is stretched and clipped on any iPad (in Simulator--I blanked center content below re privacy), and on some I get black screens. Every element is constrained ultimately centered on Superview X and Y centers (nothing absolute); is that the problem? Is there a typical problem that keeps iPhone-only apps from appearing properly on iPads? The app in no way does anything special for iPads. Is there a good tutorial about this subject? Thanks
The answer is simply that constraints sufficient for all iPhones are not necessarily sufficient for iPhone in iPad. Just because the app is sized correctly for all iPhones doesn't mean it's correct for iPhone in iPad. That's what this newbie learned!

SKSpriteNodes are showing up different sizes on a real iPhone

I am making an app, and recently, out of the blue there has been a problem.
When I ran my app on my iPhone, (which I have been doing fine for the last few weeks) the images show up at completely different sizes.
For example:
The start button on the Xcode simulator is xScale 2.0f. On the iPhone it shows to be roughly half that size. I keep all the images in a .atlas file, and they are all .png. I am using sprite kit as well, and the iPhone I am using is on iOS 7.
Here is what I'm getting:
Unwanted result (As is on iPhone)
Here is what I would like:
Desired Result (As is on simulator)
This has also happened throughout the app, with other sprite nodes. Does anyone know how I can fix this problem? Thank you in advance, and I would have posted screenshots if it wasn't for the 10 rep limit.
Edit:
I have now got most of the images working, by creating a #2x version of all the images.
But there is still one graphic that is this time TOO LARGE on the iPhone. Thank you for all your help so far, does anyone know how I can make that one image smaller on the iPhone?
Your PNGs need to be labeled with a 2x or 3x. This is Apples way of accounting for the retina screens.
"ImageFileName#2x.png"
for Iphone 4,5,6
"ImageFileName#3x.png"
for Iphone 6 Plus
If you have no extension, Apple will assume it should make your image 2 or 3 times bigger to account for the extra pixels in the retina displays. If you add the #2x or #3x, Apple assumes you provided the image already accounting for the retina pixel count.

what is image size(resolution) for iPad 3 application development?

As we know iPad 3 have 2048×1536 resolution.
for iPhone 4 with retina display we put big image with name #2X and one normal image in our bundle.
so for iPad 3 application development we also need to put two images one is normal size and other with big size with #2X name..?
Any one know please reply.
With the iPad 3, you also simply need to name your retina images foo#2x.png. It needs to be exactly two times the resolution of the corresponding foo.png. So, say foo.png is 10x10, then your foo#2x.png needs to be 20x20.
You can also make version specifically for iPhone/iPod or iPad and iOS will automatically chose the correct version. For this, you can use the ~iphone and ~ipad modifiers:
foo.png for all devices with non-retina display
foo~iphone.png specifically for iPhone/iPod non-retina
foo~ipad.png specifically for iPad non-retina
foo#2x.png for all devices with retina display
foo#2x~iphone.png specifically for iPhone/iPad retina
foo#2x~ipad.png specifically for iPad retina
You can mix them in any combination, as long as there's always a version for all your supported devices (if you're doing an iPad-only app there's no need to provide images for iPhone, of course). So it's OK to provide for example foo~iphone.png, foo~ipad.png and then foo#2x.png.
I think it would be "image~ipad" & "image#2x~ipad" for iPad with Retina Display if you are writing a Universal app (since "image" & "image#2x" are for iPhone/iPod images).
Otherwise I guess "image" & "image#2x" is OK.
Refer to How to support both iPad and iPhone retina graphics in universal apps .

How do I stop Cocos2D from requiring standard definition resources (SD images)?

I am developing an iPhone game with Cocos2d-iphone.
I want my game to only be available to the iPhone 4 AND iPad. Retina enabled for iPhone 4. I don't want the game to run on older devices.
Cocos2d will always ask me for -hd and non-hd files. If I don't provide the SD files, I get errors. I don't want that: is there a way to disable Cocos2d from trying to retrieve SD files, and only get -hd suffixed files by default?
Oh, and when the game is run by an iPad, the graphics will be the -hd ones as well. So the point is, I only want to have -hd files in my project.
What are the proper steps to edit Cocos2d's source for such?
If you are using cocos2d version >= 2.0, then you can change the value of a global variable found in CCFileUtils.h:
static NSString *__suffixiPad =#"-hd";
(Its default value is #"-ipad".)
If you are using cocos2d version < 2.0, then you can find here a category that I wrote to be able to transparently use -hd images created for the iPhone 4 on the iPad 1/2.
Actually, it does more than that, but if you add it to your project, then "-hd" images will be "automagically" used on the iPad 1/2 instead of their SD versions (which you could also not include in your project).
Let me know if you have any issues integrating this code.
If I would have been at your place.. I would have played with a trick.. Don't down vote the answer if you don't like.. But Its just a thing in my mind.
Use -hd images in the code directly.. iPhone 4 will handle it easily.. Older iPhones will show it much larger and it doesn't matter as you are not supporting them...
So instead of using Background.png , directly use Background-hd.png as it will work fine for iPhone 4.. Instead of wasting time on all these SD stuff.. I will directly use my -hd images for my work...
I can not say about new iPad.. But old iPad can easily use -hd images in code as you want.. For iPad I have directly used in my code earlier..
Hope this helps.. :)
This tutorial might help.
If you only provide -hd assets, you should only get errors regarding missing SD assets when running on iPad. The iPad doesn't have a Retina display, but it certainly is high resolution enough to be treated like one.
Since cocos2d passes all filename requests through the fullPathFromRelativePath function in CCFileUtils it may be enough to modify this function to treat the iPad like an HD device and force it to load -hd assets on iPad.
the 1st idea i can think of is to use #2x suffix for images (UIKit style) and you wont need to enable retina display in app.The problem is that on the ipad you'll have to write your own method to remove #2x suffix
the 2nd idea was to make a SD image..but only 1x1 pixels... it takes virtually no space at all ( 119 bytes with white pixel). Should work on ipad as-is
3rd idea:don't enable (or enable..doesn't make any difference) retina display but have the HD images as SD images.I've tested this on cocos2d v1.0.1 and it seems to work.Also..it should work on ipad
4th idea forcefully enable retina display in ccConfig.h (so that director won't ask you for the SD images on ipad) .I'm not sure about this one because there are quite a few tests that check for resolution, device and if it's retina and you'd have to edit all of them
these are just ideas off the top of my head..they may be wrong..but they're just ideas

360 degree video in MPMoviePlayerController

I am trying to develop an iphone application which needs to show a 360 degree video like the one and rotate the video as per the phone movement. How can i do this? Is it possible to do this with normal MPMovieplayer controller?
I don't think you can do this with a normal MPMoviePlayerController, but there are several libraries out there to achieve this. Have a look here:
PanoramaGL
Panorama 360
They work with OpenGL and you can embed them in your Objective-C code.
EDIT:
As #Mangesh Vyas kindly pointed out those are intended to use with fixed images only. However they might be a suitable starting point for embedding video as well, if you modify the code accordingly. They already do the handling of direction, accelerometer etc. so you don't have to implement all that yourself.