GithubHelp home page GithubHelp logo

Comments (19)

jrosssavant avatar jrosssavant commented on August 11, 2024

Ok, I got the Swift example application working, and added the .swift helper classes and bridging header to the OwrHelpers directory. Was there anything else you had in mind for this task?

from openwebrtc-examples.

stefanalund avatar stefanalund commented on August 11, 2024

Thanks @jrosssavant, merged #29.

from openwebrtc-examples.

jrosssavant avatar jrosssavant commented on August 11, 2024

No problem. I'm taking a look at SelfieSwift as well, but it's turning out to be a bit trickier. The best approach for this (and other native implementations) may be to create an Obj-C wrapper which can then be called from Swift.

from openwebrtc-examples.

stefanalund avatar stefanalund commented on August 11, 2024

Interesting. This is the design pattern Apple promotes for Swift <-> C++ interworking. What creates the problems, the callbacks?

from openwebrtc-examples.

jrosssavant avatar jrosssavant commented on August 11, 2024

Yes, and the type mismatch messages it gives are sometimes unhelpful or misleading. I'll keep working on it for a bit. If I get stuck, I'll push a branch and let you take a look.

from openwebrtc-examples.

jrosssavant avatar jrosssavant commented on August 11, 2024

After working on this a bit more, I can't seem to find a way to register a Swift function as a C function pointer callback. There are a number of StackOverflow topics that seem to confirm this is currently not possible:

http://stackoverflow.com/questions/25514176/using-swift-cfunctionpointer-to-pass-a-callback-to-coremidi-api
http://stackoverflow.com/questions/24107099/function-callback-from-c-to-swift
http://stackoverflow.com/questions/25346563/address-book-external-change-callback-in-swift-with-c-function-pointers

Until/if Apple updates Swift to support this, an Objective-C wrapper for these callbacks will most likely be required.

from openwebrtc-examples.

jrosssavant avatar jrosssavant commented on August 11, 2024

I pushed the branch with my work here: https://github.com/jrosssavant/openwebrtc-examples/tree/selfie-swift-attempt, just in case you'd like to take a look.

from openwebrtc-examples.

sentiasa avatar sentiasa commented on August 11, 2024

Hi @jrosssavant, when I try to build your selfie-swift-attempt, I received:

/Users/Bertug/Downloads/openwebrtc-examples-selfie-swift-attempt/ios/OwrHelpers/OpenWebRTC-BridgingHeader.h:30:9: error: 'owr.h' file not found
#import "owr.h"
^
:0: error: failed to import bridging header '/Users/Bertug/Downloads/openwebrtc-examples-selfie-swift-attempt/ios/OwrHelpers/OpenWebRTC-BridgingHeader.h'

Am I doing something wrong or missing out something? Or did you stop working on it?

from openwebrtc-examples.

superdump avatar superdump commented on August 11, 2024

@sentiasa This example uses the OpenWebRTC.framework installed from the iOS package. If you have not installed it, owr.h will not be found. How are you trying to build it?

from openwebrtc-examples.

superdump avatar superdump commented on August 11, 2024

@sentiasa If you want to use the OpenWebRTC pod, try changing the include to <owr/owr.h>

from openwebrtc-examples.

sentiasa avatar sentiasa commented on August 11, 2024

@superdump When I followed "https://github.com/EricssonResearch/openwebrtc/wiki/Building-OpenWebRTC" this documentation, I have done everything successfully until 'Using the Results - iOS Framework' but when I installed openwebrtc-devel-0.1.0-ios-universal.pkg (just to clear that my file is devel-0.1.0-ios-universal.pkg rather than devel-0.3.0-ios-universal.pkgeven though I just updated) , no folder and files are created in ' ~/Library/Developer/OpenWebRTC/' in my case. So I ended up dragging the framework from Library/Frameworks/ and manually added into SelfieSwift demo. So I also stuck in adding the header because I don't have ~/Library/Developer/OpenWebRTC/iPhone.sdk/OpenWebRTC.framework/Headers either.

Then I gave up in the previous step and I tried the pod. However whatever I've tried, <owr/owr.h> cannot be found. Can I achieve what I am trying to achieve with podfile? Can you help me what I should write in the Podfile? But I want to highlight again that ~/Library/Developer/OpenWebRTC/iPhone.sdk/OpenWebRTC.framework/Headers folder doesn't exist for me whatever I have done.

Is there any simpler way for me to start this? Like creating a Podfile as same as I use to run NativeDemo? If so, what should I write in the Podfile? Again, NativeDemo works perfectly for me.

from openwebrtc-examples.

jrosssavant avatar jrosssavant commented on August 11, 2024

@sentiasa: As you guessed I have not worked on the SelfieSwift app in some time, but it was working at the time I last committed (8f2ccaf). At that time the OpenWebRTC libraries were linked into the demo app under the assumption that the openwebrtc repository was fully built for iOS, and that the openwebrtc repository was adjacent to the openwebrtc-examples repository. It looks like some changes have been made since that time to use the OpenWebRTC.framework - which I think is a great step forward. But I can't tell you how to get the correct framework into ~/Library/Developer/OpenWebRTC/iPhone.sdk/; that framework is not present on my machine (nor even ~/Library/Developer/OpenWebRTC). @superdump: is there a set of instructions that describes how to build and install the OpenWebRTC framework into that location? I have an old cerbero-based build which installs into /Library/Frameworks/OpenWebRTC.framework, but not into ~/Library.

from openwebrtc-examples.

superdump avatar superdump commented on August 11, 2024

If you build the iOS package according to the build instructions and then install the the .pkg file as instructed, it will land there.

Another alternative is to move it to use cocoapods instead.

from openwebrtc-examples.

superdump avatar superdump commented on August 11, 2024

Oh, and the appropriate package file is available in the OpenWebRTC release.

from openwebrtc-examples.

jrosssavant avatar jrosssavant commented on August 11, 2024

Thanks for pointing this out - I downloaded the .pkg from the release and now the SimpleDemoSwift project compiles just fine. I was trying to do the cerbero build from scratch but was running into this error when building the Mac OS X host build:

$ ./cerbero-uninstalled -c config/osx-x86-64.cbc package -f openwebrtc
...
checking for xmlcatalog... /Library/Frameworks/OpenWebRTC.framework/Versions/0.3/bin/xmlcatalog
checking for DocBook XML DTD V4.3 in XML catalog... not found
configure: error: could not find DocBook XML DTD V4.3 in XML catalog

from openwebrtc-examples.

superdump avatar superdump commented on August 11, 2024

That's something I broke yesterday and didn't manage to fix before I had to stop. First priority when I get to the office. 😄

from openwebrtc-examples.

superdump avatar superdump commented on August 11, 2024

I was getting this working: http://ericssonresearch.github.io/openwebrtc/docs/gtk-doc/dev/

from openwebrtc-examples.

superdump avatar superdump commented on August 11, 2024

The docbook issue should now be fixed.

from openwebrtc-examples.

jrosssavant avatar jrosssavant commented on August 11, 2024

Thanks, after a pull the build completed successfully and generated the package as expected.

from openwebrtc-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.