After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 745564 - qtkitvideosrc: fails to build on OSX >= 10.9 and not using cerbero (ex: MacPorts)
qtkitvideosrc: fails to build on OSX >= 10.9 and not using cerbero (ex: MacPo...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Mac OS
: Normal normal
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-03 23:10 UTC by Julien Isorce
Modified: 2015-12-18 10:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
applemedia: disable qtkitvideosrc if OSX is at least 10.9 (2.82 KB, patch)
2015-03-03 23:12 UTC, Julien Isorce
none Details | Review
configure.ac: set mmacosx-version-min to 10.8 (1.04 KB, patch)
2015-07-07 19:33 UTC, Julien Isorce
none Details | Review
configure.ac: set -mmacosx-version-min to 10. (1.14 KB, patch)
2015-07-08 09:09 UTC, Julien Isorce
reviewed Details | Review
applemedia: set -mmacosx-version-min to 10. (1.38 KB, patch)
2015-12-17 08:24 UTC, Julien Isorce
committed Details | Review

Description Julien Isorce 2015-03-03 23:10:22 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
Comment 1 Julien Isorce 2015-03-03 23:12:01 UTC
Created attachment 298491 [details] [review]
applemedia: disable qtkitvideosrc if OSX is at least 10.9
Comment 2 Sebastian Dröge (slomo) 2015-03-04 08:38:15 UTC
We should just disable deprecation warnings or make them no errors until we require OSX >= 10.9. Currently we're at >= 10.8.
Comment 3 Julien Isorce 2015-03-06 08:31:30 UTC
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.
Comment 4 Julien Isorce 2015-03-06 08:43:46 UTC
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.
Comment 5 Sebastian Dröge (slomo) 2015-03-06 08:45:20 UTC
(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.
Comment 6 Julien Isorce 2015-03-25 08:45:01 UTC
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.
Comment 7 Julien Isorce 2015-07-07 19:33:04 UTC
Created attachment 307033 [details] [review]
configure.ac: set mmacosx-version-min to 10.8
Comment 8 Sebastian Dröge (slomo) 2015-07-08 07:55:44 UTC
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?
Comment 9 Julien Isorce 2015-07-08 08:51:05 UTC
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.
Comment 10 Julien Isorce 2015-07-08 08:55:53 UTC
Ah sorry, avfvideosrc is GST_RANK_PRIMARY and qtkitvideosrc is GST_RANK_SECONDARY.
Comment 11 Julien Isorce 2015-07-08 09:09:38 UTC
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.
Comment 12 Julien Isorce 2015-07-08 09:10:33 UTC
(In reply to Julien Isorce from comment #11)
> Created attachment 307055 [details] [review] [review]
> configure.ac: set -mmacosx-version-min to 10.
10.10 :)
Comment 13 Julien Isorce 2015-07-28 07:30:35 UTC
The attached patch fixes the build error while not overriding version provided by cerbero (or generally from extra OBJCFLAGS)
Comment 14 Julien Isorce 2015-08-21 07:24:28 UTC
ping ?
Comment 15 Julien Isorce 2015-12-11 06:08:21 UTC
Anyone against attached patch ? See #8, #9, #12
Comment 16 Sebastian Dröge (slomo) 2015-12-11 08:12:55 UTC
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?
Comment 17 Julien Isorce 2015-12-15 14:52:07 UTC
(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 :)
Comment 18 Sebastian Dröge (slomo) 2015-12-16 08:32:37 UTC
Let's do that then in the Makefile.am and finally get rid of this bug ;)
Comment 19 Julien Isorce 2015-12-17 08:24:13 UTC
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 20 Sebastian Dröge (slomo) 2015-12-17 09:36:35 UTC
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 :)
Comment 21 Julien Isorce 2015-12-17 11:14:15 UTC
(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
Comment 22 Andoni Morales 2015-12-17 12:14:46 UTC
(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
Comment 23 Julien Isorce 2015-12-18 08:05:22 UTC
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.
Comment 24 Sebastian Dröge (slomo) 2015-12-18 10:19:18 UTC
Just get your commit in :)
Comment 25 Julien Isorce 2015-12-18 10:33:50 UTC
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