Build GStreamer for Apple TV / Bitcode

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Build GStreamer for Apple TV / Bitcode

jml5qh
Hi all,

Now that VideoToolbox / AVSampleBufferDisplayLayer is marked as available for tvOS starting in Xcode 8.3, I'd like to try and get GStreamer built with Bitcode enabled. I found this tweet from Sebastian: https://twitter.com/sdroege_/status/772728435303120896 referencing some software optimizations that could be hard to get around.

Does anyone have any suggestions on how to tackle this? Sebastian - would you be able to provide some information on the different optimizations and where you think the issues will appear?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Build GStreamer for Apple TV / Bitcode

Nicolas Dufresne-5
Le dimanche 19 février 2017 à 09:46 -0800, jml5qh a écrit :

> Hi all,
>
> Now that VideoToolbox / AVSampleBufferDisplayLayer is marked as
> available
> for tvOS starting in Xcode 8.3, I'd like to try and get GStreamer
> built with
> Bitcode enabled. I found this tweet from Sebastian:
> https://twitter.com/sdroege_/status/772728435303120896 referencing
> some
> software optimizations that could be hard to get around.
>
> Does anyone have any suggestions on how to tackle this? Sebastian -
> would
> you be able to provide some information on the different
> optimizations and
> where you think the issues will appear?
Support for that need to be added in cerbero.

https://bugzilla.gnome.org/show_bug.cgi?id=770875

There is special C-Flags and assembly optimization is apparently not
allowed, so no ORC and recipes need to be update to disable bunch of
things. There will likely be more issues. I'd say, start small, and add
more recipes as you go.

>
> Thanks!
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble
> .com/Build-GStreamer-for-Apple-TV-Bitcode-tp4681934.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Build GStreamer for Apple TV / Bitcode

jml5qh
So adding bitcode actually wasn't too bad. We had to modify a bunch of compiler flags but were able to get through it.

However, on Apple TV there are some APIs that are not available. For example, fork and execvp(). I am getting the following error in glib. Any idea what the best course of action here is? I have seen some other projects run into this issue but most already define a macro for HAVE_FORK.

gbacktrace.c:240:9: error: 'fork' is unavailable: not available on tvOS
  pid = fork ();
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator10.1.sdk/usr/include/unistd.h:446:8: note: 'fork' has been explicitly marked unavailable here
pid_t    fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
gbacktrace.c:293:9: error: 'fork' is unavailable: not available on tvOS
  pid = fork ();
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator10.1.sdk/usr/include/unistd.h:446:8: note: 'fork' has been explicitly marked unavailable here
pid_t    fork(void) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
gbacktrace.c:304:7: error: 'execvp' is unavailable: not available on tvOS
      execvp (args[0], args);      /* exec gdb */
      ^
/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator10.1.sdk/usr/include/unistd.h:445:6: note: 'execvp' has been explicitly marked unavailable here
int      execvp(const char * __file, char * const * __argv) __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
         ^
3 errors generated.
Reply | Threaded
Open this post in threaded view
|

Re: Build GStreamer for Apple TV / Bitcode

Sebastian Dröge-3
On Mon, 2017-03-20 at 21:13 -0700, jml5qh wrote:
> So adding bitcode actually wasn't too bad. We had to modify a bunch of
> compiler flags but were able to get through it. 

Great, can you put your changes into Bugzilla for integration?

> However, on Apple TV there are some APIs that are not available. For
> example, fork and execvp(). I am getting the following error in glib. Any
> idea what the best course of action here is? I have seen some other projects
> run into this issue but most already define a macro for HAVE_FORK.

I would add a configure check for these functions, and make the
relevant GLib APIs that are wrapping them just do a g_error() instead.

For GStreamer, the only usage of these APIs should be the plugin
loader, which you can then just disable if fork is not available and
have plugins loaded in-process.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Build GStreamer for Apple TV / Bitcode

jml5qh
This post was updated on .
Sounds good! I will need to clean up some of the changes before submission but will work on that in parallel with compiling for Apple TV.

Just to confirm before I make a ton of changes, is the attached patch what you were thinking for glib?

0031-Check-for-fork.patch