Zbar not scanning after use of camera - zbar-sdk

I have an app that start with scanning a qr code.
After scanning if I use the camera to take picture and then go back to the
scanning view the scanning does not work.
I dont know the reason, issue is only in IOS7 devices, both iPad and iPhone.
I tried to setSymbology and called [readerView start], but it didn't work.
Please help.

I've found that IOS7 change the video mode for AVCaptureSession after you take a photo. Use this code before you call [readerView start].
if([readerView.session canSetSessionPreset: AVCaptureSessionPreset640x480])
readerView.session.sessionPreset = AVCaptureSessionPreset640x480;

Related

ZBar SDK get freeze while trying open the camera

I am Using ZBAR SDK in our app. but while trying open again and again then ZBarReaderView take more time to alloc in IOS 7 and it get Freeze.
ZBar memory leak on iOS?
Check this out. I've had this problem myself, and this topic pushed me into a solution.

Is there a different way to view the iOS Simulator in Xcode 5 / Am I viewing my button correctly?

So I'm doing the Ray Wenderlich tutorials on iOS, and I'm doing the button tutorial. When I run the app, I get something that looks like this:
I have two questions:
I often see simulators show up in the form of an actual iPhone and was wondering if that was possible, or if that rectangle is the only way to view it?
The reason I'm asking is when I connected the button to an action (It says 'Pressed!'). So, is it supposed to show up in the box (bottom right) only, or should it should up on the simulator itself- mimicking what the user would see on-screen?
Regarding your first question: Probably a problem with screen size. See also here How can I restore the iPad frame around iOS Simulator 5.1?
The output seen in the screenshot is produced with NSLog and won't be seen on the device. You need to add an UILabel or such and set its text.
In the Simulator menu, try selecting Window then Scale and go to 50%. The retina models are far too big on my screen. Also, the old iOS 6 simulator with standard iPhone did look like a real phone, so examples from a while ago will look different.
If you want to support iOS 6.x, you can load it into Xcode. From Xcode main menu, select Xcode and then Preferences, and go to the Downloads tab.

how to show device camera's data on a CCScene when using cocos2d-x on android

In an android game, I want to start device's camera and let player see the camera input inside a CCScene. Does anyone know how to do that?
I am searching for the same thing. I haven't figure it out yet but come across the following:
http://syswerke.com/projects/blog/opencv-camera-capture-in-cocos2d-x-applications/
http://docs.opencv.org/doc/tutorials/ios/video_processing/video_processing.html#opencviosvideoprocessing (iOS)
http://www.cocos2d-iphone.org/forums/topic/using-a-uiimagepickercontroller-and-cocos2d-sample-code/#post-34228 (iOS)
http://www.cocos2d-x.org/forums/6/topics/11524 (suggesting to save to file/buffer and pass to native code)
I've seen example on iOS that works (e.g. https://www.youtube.com/watch?v=TM9EIzB5I-8).
I'll update more if/once I figure it out

Open the iPhone camera?

We need to open the iPhone camera, to take images that will be saved to the camera roll.
I have read many examples here that all of them opens the UIImagePickerView.
Besides the fact that i cant understand why i have to open the picker view in order to open the camera , i just can't do that- i dont want the picker view, because i have my costumed photo album that we build, and we just need to have a little button in it, that opens the camera to take an image . without opening any other views above it .
Is that possible to use the camera without this pickerview that will cover my scene ?
or can i lead the user to the camera app and than take him back to my app ?
Thanks.
Instead of high level (i.e. Apple supplies the UI element) classes, you have to go to a more foundational (lower) level of API's, which would be AVCaptureDevice and AVCaptureDeviceInput.
And Apple has some nice source code available in their AVCam project.
If you want to display camera stream in you app without UIImagePickerController than you should you AVFoundation framework.
Here some some examples and tutorials:
take-photos-with AVFoundation
Custom camera
Displaying camera

How can I format a movie to play through MPMoviePlayerViewController on the iPad?

I've been struggling to make video on the iPad work. I'm using an MPMoviePlayerViewController and it plays fine in the simulator. I've tried several different converters, including ones dedicated to producing iPad-formatted video, but none of the videos play on the device. The MPMoviePlayerViewController loads and the controls appear.
For most of the videos, the spinning progress indicator never goes away. For a few, the video loads but when I press play the video immediately pauses. I know that the video is there because I can scan through and see various frames.
I know the code works because it plays a different movie file perfectly. I just have no idea what I'm doing wrong that's preventing my movie from playing. Does anyone know a good step-by-step process of getting an iPad-formatted video from any .mov or .mp4?
Thanks,
Luke
Also, just for future reference, import target video into iTunes, then highlight it and from the Advanced menu choose "Create iPod or iPhone Version" or "Create iPad or AppleTV Version" depending on your target device.
This guarantees that the right codecs are used and the right bitflags set on the video file.
Fixed - the one that loaded but couldn't play eventually worked. Why? Who knows.