GNOME Bugzilla – Bug 745564
qtkitvideosrc: fails to build on OSX >= 10.9 and not using cerbero (ex: MacPorts)
Last modified: 2015-12-18 10:47:55 UTC
When compiling applemedia on OSX >= 10.9 you get: " qtkitvideosrc.m:161:25: error: 'QTMediaTypeVideo' is deprecated [-Werror,-Wdeprecated-declarations] NSString *mediaType = QTMediaTypeVideo; /System/Library/Frameworks/QTKit.framework/Headers/QTMedia.h:40:31: note: 'QTMediaTypeVideo' has been explicitly marked deprecated here QTKIT_EXTERN NSString * const QTMediaTypeVideo AVAILABLE_QTKIT_VERSION_7_0_AND_LATER_BUT_DEPRECATED_IN_QTKIT_VERSION_7_7_3; " Indeed QTKit has been deprecated since OS X 10.9 See "Deprecated Frameworks" section in https://developer.apple.com/library/mac/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_9.html
Created attachment 298491 [details] [review] applemedia: disable qtkitvideosrc if OSX is at least 10.9
We should just disable deprecation warnings or make them no errors until we require OSX >= 10.9. Currently we're at >= 10.8.
Ok should I make them no errors only when compiling on OSX >= 10.9 ? Also where does this "we are at 10.8" stand ? Or is it only in cerbero ? I am using Mac Ports. Or this patch can just wait that we require 10.9 Is osxvideosrc currently better than qtkitvideosrc ? As the first one is in good and the later in bad.
Ah osxvideosrc is in bad too and uses deprecated QuickTime. It is set to primary and avfvideosrc is secondary. qtkitvideosrc is secondary too. So still lower than avfvideosrc.
(In reply to Julien Isorce from comment #3) > Ok should I make them no errors only when compiling on OSX >= 10.9 ? > Also where does this "we are at 10.8" stand ? Or is it only in cerbero ? > I am using Mac Ports. cerbero, which basically has the minimum recommended version for all platforms. > Is osxvideosrc currently better than qtkitvideosrc ? As the first one is in > good and the later in bad. I assume avfvideosrc is better than both.
Actually osxvideosrc has been removed: commit bcde1a015cc62c2f2cc1916fb02f042e64f87206 Author: Tim-Philipp Müller <tim@centricular.com> Date: Sat Mar 14 14:43:37 2015 +0000 Remove unported and useless osxvideosrc element There are other elements for this now. So it remains avfvideosrc and qtkitvideosrc which have the same rank. I still think the attached patch is good because on OSX 10.10, one will use avfvideosrc, not qtkitvideosrc. Also it does not make sense to maintain qtkitvideosrc if one has upgraded to OSX 10.10 because QTKit has been deprecated, even from 10.9. If a comparison between the 2 elements is really needed one can still disable deprecation warnings manually.
Created attachment 307033 [details] [review] configure.ac: set mmacosx-version-min to 10.8
This might break with cerbero, which sets the version itself already in the CFLAGS. Not sure what happens if two versions are there. So what's the general plan now with all these elements, how should we proceed?
Ah right, and for all ['CFLAGS', 'CCASFLAGS', 'CXXFLAGS', 'OBJCFLAGS'](http://cgit.freedesktop.org/gstreamer/cerbero/tree/config/darwin.config#n62) I tested different combinations of -mmacosx-version-min=10.a mmacosx-version-min=10.b and it always pick the later. (b no matter a vs b). So we should be safe if we set 10.8 in front: OBJCFLAGS="-mmacosx-version-min=10.8 $OBJCFLAGS". This allow the user or cerbero to override the version. I'll update the patch. (In reply to Sebastian Dröge (slomo) from comment #8) > So what's the general plan now with all these elements, how should we > proceed? I think there are now only 2 avfvideosrc and qtkitvideosrc (see comment #6) to capture video on osx, with same rank but luckily the non-deprecated comes first in alphabetical order.
Ah sorry, avfvideosrc is GST_RANK_PRIMARY and qtkitvideosrc is GST_RANK_SECONDARY.
Created attachment 307055 [details] [review] configure.ac: set -mmacosx-version-min to 10. I checked that it fails to build if: OBJCFLAGS="-mmacosx-version-min=10.10" ./autogen.sh because of the deprecations.
(In reply to Julien Isorce from comment #11) > Created attachment 307055 [details] [review] [review] > configure.ac: set -mmacosx-version-min to 10. 10.10 :)
The attached patch fixes the build error while not overriding version provided by cerbero (or generally from extra OBJCFLAGS)
ping ?
Anyone against attached patch ? See #8, #9, #12
Comment on attachment 307055 [details] [review] configure.ac: set -mmacosx-version-min to 10. This should probably be limited to the qtkitvideosrc Makefile.am instead of having everything built with the older version. Also what will happen if the user already provided -mmacosx-version-min somewhere and it's used multiple times now?
(In reply to Sebastian Dröge (slomo) from comment #16) > Comment on attachment 307055 [details] [review] [review] > configure.ac: set -mmacosx-version-min to 10. > > This should probably be limited to the qtkitvideosrc Makefile.am instead of > having everything built with the older version. You are right I'll try to do that, I do not know why I have not done it in the first place :) > > Also what will happen if the user already provided -mmacosx-version-min > somewhere and it's used multiple times now? See comment #9 :)
Let's do that then in the Makefile.am and finally get rid of this bug ;)
Created attachment 317546 [details] [review] applemedia: set -mmacosx-version-min to 10. This patch works but let me know if you have a better idea for the writing in the Makefile.am
Comment on attachment 317546 [details] [review] applemedia: set -mmacosx-version-min to 10. I would've just done > if !HAVE_IOS > libgstapplemedia_la_OBJCFLAGS += ... > endif but that works too. Merge your version or mine, whatever you prefer :)
(In reply to Sebastian Dröge (slomo) from comment #20) > Comment on attachment 317546 [details] [review] [review] > applemedia: set -mmacosx-version-min to 10. > > I would've just done > > > if !HAVE_IOS > > libgstapplemedia_la_OBJCFLAGS += ... > > endif > > but that works too. Merge your version or mine, whatever you prefer :) But libgstapplemedia_la_OBJCFLAGS += -mmacosx-version-min will not put it at the front if I am not mistaken. And we want it at the front. I tried libgstapplemedia_la_OBJCFLAGS = -mmacosx-version-min $(libgstapplemedia_la_OBJCFLAGS) but autotools was rejecting this syntax. If you have another syntax I can try because I prefer this style actually. Thx
(In reply to Julien Isorce from comment #21) > (In reply to Sebastian Dröge (slomo) from comment #20) > > Comment on attachment 317546 [details] [review] [review] [review] > > applemedia: set -mmacosx-version-min to 10. > > > > I would've just done > > > > > if !HAVE_IOS > > > libgstapplemedia_la_OBJCFLAGS += ... > > > endif > > > > but that works too. Merge your version or mine, whatever you prefer :) > > But libgstapplemedia_la_OBJCFLAGS += -mmacosx-version-min will not put it > at the front if I am not mistaken. And we want it at the front. > > I tried > libgstapplemedia_la_OBJCFLAGS = -mmacosx-version-min > $(libgstapplemedia_la_OBJCFLAGS) > > but autotools was rejecting this syntax. If you have another syntax I can > try because I prefer this style actually. Thx You can use AM_OBJCFLAGS for that, which is added before OBJCFLAGS and libfoo_OBJCFLAGS
Andoni, thx for the idea. I tried but it does not work as expected so what am I missing ? libgstapplemedia_la_OBJCFLAGS = \ -I$(top_srcdir)/gst-libs \ -I$(top_builddir)/gst-libs \ @@ -95,6 +87,11 @@ libgstapplemedia_la_LDFLAGS += \ -Wl,-framework -Wl,QTKit \ -Wl,-framework -Wl,IOSurface +# Add min version in front so the user or cerbero can override it since it +# always picks the last occurence when passing several -mmacosx-version-min. +# Note that AM_OBJCFLAGS is added before OBJCFLAGS and any libfoo_OBJCFLAGS. + AM_OBJCFLAGS = -mmacosx-version-min=10.8 + endif I thought AM_OBJCFLAGS is added automatically.
Just get your commit in :)
Comment on attachment 317546 [details] [review] applemedia: set -mmacosx-version-min to 10. commit 89229bcfede420564f8e2eb9c509f507f046361d Author: Julien Isorce <j.isorce@samsung.com> Date: Fri Dec 18 10:30:25 2015 +0000 applemedia: set -mmacosx-version-min to 10.8 Otherwise qtkitvideosrc fails to build on OSX 10.10.4 because QTKit has been deprecated since OS X 10.9. Also set -mmacosx-version-min=10.8 in front to allow the user or cerbero to override the version. https://bugzilla.gnome.org/show_bug.cgi?id=745564