GNOME Bugzilla – Bug 765292
gl:cocoa:Fix incompatible type warning
Last modified: 2016-04-21 06:28:24 UTC
Fix incompatible type warning
Created attachment 326378 [details] [review] gl:cocoa:Fix incompatible type warning
commit 6a0b35bf3710240affe119ee362a0805e7a3fa85 Author: Hyunjun Ko <zzoon@igalia.com> Date: Wed Apr 20 16:00:36 2016 +0900 gl/cocoa: Fix incompatible type warning https://bugzilla.gnome.org/show_bug.cgi?id=765292
Created attachment 326381 [details] [review] gl: caopengllayersink: fix a minor warning See commit message:)
Created attachment 326382 [details] [review] applemedia: fix a minor warning see commit message.
Comment on attachment 326381 [details] [review] gl: caopengllayersink: fix a minor warning Attachment 326381 [details] pushed as 7bee220 - gl: caopengllayersink: fix a minor warning
Review of attachment 326382 [details] [review]: ::: sys/applemedia/vtenc.c @@ +840,3 @@ } #ifdef HAVE_VIDEOTOOLBOX_10_9_6 + if (&VTCompressionSessionPrepareToEncodeFrames) { I think this is wrong. We're checking here if that function exists. It will be NULL if it does not exist because of using -weak_framework to link to VideoToolbox. This is to make sure the plugin works against all versions of VT but works better with newer versions.
(In reply to Sebastian Dröge (slomo) from comment #6) > I think this is wrong. We're checking here if that function exists. It will > be NULL if it does not exist because of using -weak_framework to link to > VideoToolbox. This is to make sure the plugin works against all versions of > VT but works better with newer versions. I don't think this patch is not doing check if that function exists. It's just to silence this warning using address-of operator.
(In reply to Hyunjun Ko from comment #7) > (In reply to Sebastian Dröge (slomo) from comment #6) > > > I think this is wrong. We're checking here if that function exists. It will > > be NULL if it does not exist because of using -weak_framework to link to > > VideoToolbox. This is to make sure the plugin works against all versions of > > VT but works better with newer versions. > > I don't think this patch is not doing check if that function exists. > It's just to silence this warning using address-of operator. The problem is that &function is always going to give you something else than NULL AFAIU. See also https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html , it uses the same check for a function without the & operator.
Created attachment 326387 [details] [review] applemedia: vtenc: Fix a warning by weak-link symbol Thanks for the reference. I hope this patch is enough good to fix this warning. Honestly, I hate to re-compile with ERROR_CFLAGS= or something like that. :)
Review of attachment 326387 [details] [review]: I don't like duplicating the headers, but what can we do :) ::: sys/applemedia/vtenc.c @@ +59,3 @@ +#ifdef HAVE_VIDEOTOOLBOX_10_9_6 +extern int VTCompressionSessionPrepareToEncodeFrames () Let's at least give it the correct declaration :) It takes a session as parameter
Created attachment 326403 [details] [review] applemedia: vtenc: Fix a warning by weak-link symbol Following slomo's comment. I agree with you. I don't like extern thing either. Thanks.:)
Attachment 326403 [details] pushed as 5023a7c - applemedia: vtenc: Fix a warning by weak-link symbol
This breaks the iOS build https://ci.gstreamer.net/job/cerbero-ios-universal-7.1/4221/console 15:57:11 vtenc.c:62:1: error: conflicting types for 'VTCompressionSessionPrepareToEncodeFrames' 15:57:11 VTCompressionSessionPrepareToEncodeFrames (VTCompressionSessionRef session) 15:57:11 ^ 15:57:11 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/VideoToolbox.framework/Headers/VTCompressionSession.h:210:1: note: previous declaration is here 15:57:11 VTCompressionSessionPrepareToEncodeFrames( CM_NONNULL VTCompressionSessionRef session ) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_8_0);
Created attachment 326462 [details] [review] applemedia: vtenc: fix build break on iOS Sorry for inconvenience. I doubt that this patch could fix the error. Please someone confirm this is ok.
commit 45b258127c0563b5608d256c094468de02452036 Author: Hyunjun Ko <zzoon@igalia.com> Date: Thu Apr 21 10:06:40 2016 +0900 applemedia: vtenc: fix build break on iOS Fix 'conflicting types' error https://bugzilla.gnome.org/show_bug.cgi?id=765292 Attachment 326462 [details] pushed as 45b2581 - applemedia: vtenc: fix build break on iOS