iOS SDK V2 Swift

The place to discuss development topics.
Discussions on the RICOH THETA API and SDK, image processing of spherical images, other hardware related topics, introduction of useful libraries, etc.

iOS SDK V2 Swift

Postby piginhat » 21 Jan 2016, 13:27

Is there any intention to release a Swift version of the SDK?

Finding the current one in Obj-C when been using Swift for over a year now a bit of a bummer!
piginhat
 
Posts: 12
Joined: 29 Nov 2015, 14:20

Re: iOS SDK V2 Swift

Postby kosso » 22 Jan 2016, 09:38

I implemented my own API methods in Objective-C around the time just before the SDK v2 was released, after learning about how MJPEG works. (I had to use Obj-C).

But while learning how it all works, Swift did look considerably easier to write.

It all very basic network requests and downloads. The tricky bit was the live MJPEG preview. But once you read the data stream from _livePreview() and look for the JPEG start and end markers, you can then pump the data to update a UIImageView.
kosso
 
Posts: 18
Joined: 10 Sep 2015, 12:16

Re: iOS SDK V2 Swift

Postby piginhat » 22 Jan 2016, 12:33

just kinda put me off see a plethora of .m and .h files...when now fully converted to the Swift way of doing things... :(
piginhat
 
Posts: 12
Joined: 29 Nov 2015, 14:20

Re: iOS SDK V2 Swift

Postby kosso » 23 Jan 2016, 16:21

I hear you ;)

I'm an Objective-C novice myself. And Swift looks far easier. But in order to build a Titanium Module to read the MJPEG bytestream for iOS, I still have to do it the *old* way. Sigh. I have it working now though.

Btw: Here's some useful Swift code I found while learning how to look for the JPEG markers in the bytestream : https://gist.github.com/jeffmcfadden/4970e952466d50eaf533#file-ipcameraview-swift

I looked in to how the v2 SDK does it, and they have a lot of things I don't need for now in my module. But it (and lots of googling) taught me enough about NSURLSession and delegating the dataTask to write it from scratch and understand how it works.

I had to make it deal with a _camera.getLivePreview() command in a different way to all other requests, since it never completes the request, like the other ones which return either JSON or a JPEG.


I've actually just modified it to work with any IP-based MJPEG streaming camera. Like a Raspberry Pi. Which (as well as any other Linux machine) I can also plug the Ricoh Theta S in to and stream the live dual-fisheye stream.

My biggest issue now, is dealing with the dual-fisheye video stream. It seems to be a dark art to convert it to equirectangular video. (Which the Theta+ app does and also the desktop 'dualfishblender' in the desktop Air app. Air? srsly Ricoh?? )

I'm also building an iOS app which connects to the Theta S, takes a photo then publishes it in an HTML5 format which, with some nifty JavaScript, supports Google Cardboard when the browser is tilted in landscape. ;) - This required converting the Equirectanglular photo to a Gnomonic 'cube map'. (The theta360.com viewer uses the equi. and a sphere. And Flash. )

Fun Fun Fun. Keep digging!
kosso
 
Posts: 18
Joined: 10 Sep 2015, 12:16

Re: iOS SDK V2 Swift

Postby piginhat » 01 Feb 2016, 15:55

For now I have decided to go the Unity way which at leat allows me to export to both iOS and Android.

Currently have the app loading dynamic content from camera into fully immersive VR for photos and videos.

I like Swift way to much now to even bother looking at anything Obj-c ... odd as before Swift ... I loved Obj-c...but love affair over lol
piginhat
 
Posts: 12
Joined: 29 Nov 2015, 14:20

Re: iOS SDK V2 Swift

Postby MichaelWillis » 03 Apr 2016, 11:13

Hi,

Did you manage to find anymore information on this? A swift version would help a lot!
MichaelWillis
 
Posts: 1
Joined: 03 Apr 2016, 11:05

Re: iOS SDK V2 Swift

Postby AkkiDude78 » 28 Apr 2016, 16:39

Guys - I am attempting to get live 360 Video Feed on iPhone and hoping to see it immersive experience via Google Cardboard. I do not see live view option in SDK App, was wondering if anyone has done it yet - and willing to share the code / app ??
AkkiDude78
 
Posts: 3
Joined: 28 Apr 2016, 15:22


Return to Development



All times are UTC