[webkit-dev] Trying to turn WebRTC's code on - MEDIA_STREAM flags
Benjamin Poulain
benjamin at webkit.org
Tue Jul 22 00:16:46 PDT 2014
Quick answers inline:
On 7/21/14, 9:22 PM, Jacques-Olivier wrote:
> Note: I already sent this email, but I didn't get any answer, nor can
> I see the thread in the archives. Therefore I think it was blocked,
> maybe because of the attachment that I remove this time.
>
> I'm new on this mailing so I'll start by introducing myself:
> My name Jacques-Olivier Haché (J-O), I'm working for Temasys
> Communication, and I'm entering the WebKit project to work on the
> implementation of WebRTC inside WebKit.
> For those who would be following the WebRTC's news, I'm also the main
> developer of the WebRTC plugin released by Temasys.
>
> Back to business:
>
> I was able to download the project, build it and run it inside Safari.
> I did not try to run it in a different browser yet.
>
> My configuration:
>
> * Macbook Air 2012
> * Mac OS X 10.9.4
> * Revision 171167
> * I'm on master
> * I suppose I'm using the regular Mac port as I didn't see where to
> change from one port to another yet.
> * building for debug mode
>
> I am now trying to enable the WebRTC related features to get a better
> understanding of the current state of this part of the project.
> I have to say that I faced a lack of documentation on this area. I
> found the features list <https://trac.webkit.org/wiki/FeatureFlags>, a
> document about how to add a new feature
> <https://trac.webkit.org/wiki/AddingFeatures> but nothing about how to
> turn a feature on and off (there is actually a TODO about that in the
> second link).
>
> I looked into the files that one needs to change to add a new feature
> and found two interesting files:
>
> * Source/WTF/wtf/FeatureDefines.h - where the WebRTC related
> contants were set to 0 instead of 1
> * Source/cmake/WebKitFeatures.cmake - where the contants were set to OFF
>
> I listed the following definitions that look related to WebRTC
>
> * ENABLE_MEDIA_CAPTURE
> * ENABLE_MEDIA_CONTROLS_SCRIPT
> * ENABLE_MEDIA_SOURCE
> * ENABLE_MEDIA_STATISTICS
> * ENABLE_MEDIA_STREAM
> * ENABLE_VIDEO
> * ENABLE_VIDEO_TRACK
>
> I turned those definitions to 1 and ON in the respective file and
> tried to build.
> The code in the header WebCore/Modules/mediastream/mediastream.h could
> not compile apparently because the observer did not have a destructor.
> I created one:
> class Observer {
> public:
> virtual void didAddOrRemoveTrack() = 0;
> virtual ~Observer() {};
> };
>
> and tried to build again.
>
> I now have a linking error when building WebCore with Xcode.
>
> Ld
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug/WebCore.framework/Versions/A/WebCore
> normal x86_64
> cd
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/Source/WebCore
> export MACOSX_DEPLOYMENT_TARGET=10.9
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
> -arch x86_64 -dynamiclib -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
> -L/Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug
> -F/Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug
> -filelist
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/WebCore.LinkFileList
> -Xlinker --no-demangle -exported_symbols_list
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug/DerivedSources/WebCore/WebCore.LP64.exp
> -install_name
> /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore
> -mmacosx-version-min=10.9 -lsqlite3 -lobjc -lANGLE -sub_library
> libobjc -umbrella WebKit -allowable_client WebCoreTestSupport
> -allowable_client WebKit2 -allowable_client WebKitLegacy -framework
> ApplicationServices -framework AudioUnit -framework Carbon -framework
> Cocoa -framework IOSurface -framework OpenGL -stdlib=libc++
> -fobjc-link-runtime -framework Accelerate -framework AudioToolbox
> -framework CoreAudio -framework IOKit -framework JavaScriptCore
> -licucore -lobjc -lxml2 -lz -framework QuartzCore -framework Security
> -framework SystemConfiguration -single_module -compatibility_version 1
> -current_version 600.1 -Xlinker -dependency_info -Xlinker
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/WebCore_dependency_info.dat
> -o
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug/WebCore.framework/Versions/A/WebCore
>
> Undefined symbols for architecture x86_64:
> "__ZN7WebCore11JSNavigator18webkitGetUserMediaEPN3JSC9ExecStateE",
> referenced from:
> __ZN7WebCore46jsNavigatorPrototypeFunctionWebkitGetUserMediaEPN3JSC9ExecStateE
> in JSNavigator.o
> "__ZN7WebCore15RTCOfferOptions6createERKNS_10DictionaryERi",
> referenced from:
> __ZN7WebCore17RTCPeerConnection11createOfferEN3WTF10PassRefPtrINS_29RTCSessionDescriptionCallbackEEENS2_INS_30RTCPeerConnectionErrorCallbackEEERKNS_10DictionaryERi
> in RTCPeerConnection.o
> "__ZN7WebCore20MediaConstraintsMock17verifyConstraintsEN3WTF10PassRefPtrINS_16MediaConstraintsEEE",
> referenced from:
> __ZN7WebCore21MockMediaStreamCenter26validateRequestConstraintsEN3WTF10PassRefPtrINS_25MediaStreamCreationClientEEENS2_INS_16MediaConstraintsEEES6_
> in MockMediaStreamCenter.o
> __ZN7WebCore21MockMediaStreamCenter17createMediaStreamEN3WTF10PassRefPtrINS_25MediaStreamCreationClientEEENS2_INS_16MediaConstraintsEEES6_
> in MockMediaStreamCenter.o
> "__ZN7WebCore21RTCOfferAnswerOptions6createERKNS_10DictionaryERi",
> referenced from:
> __ZN7WebCore17RTCPeerConnection12createAnswerEN3WTF10PassRefPtrINS_29RTCSessionDescriptionCallbackEEENS2_INS_30RTCPeerConnectionErrorCallbackEEERKNS_10DictionaryERi
> in RTCPeerConnection.o
> "__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_16RTCConfigurationE",
> referenced from:
> __ZN7WebCore52jsRTCPeerConnectionPrototypeFunctionGetConfigurationEPN3JSC9ExecStateE
> in JSRTCPeerConnection.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
> I found that these strange names actually meant
> WebCore::JSNavigator::webkitGetUserMedia(execState *) - and same for
> the others.
> Xcode will not find the definition of these functions, but
> Sublime_Text will. It looks like Xcode projects don't include the
> files containing these definitions.
> Am I supposed to run a script to re-generate the projects once I
> enable new features? If yes, I cannot find such a script.
> I tried running cmake, but got this message:
> Please choose which WebKit port to build (one of
> Efl;WinCE;GTK;AppleWin;WinCairo)
> When what I want is the AppleMac port
>
> If I build using build-webkit, I get a different stack
>
>
> === BUILD TARGET WebCoreExportFileGenerator OF PROJECT WebCore WITH
> CONFIGURATION Debug ===
>
> Check dependencies
> iOS.xcconfig line 1: Unable to find included file
> "<DEVELOPER_DIR>/AppleInternal/XcodeConfig/AspenFamily.xcconfig"
> Base.xcconfig line 24: Unable to find included file
> "../../../../Internal/Configurations/UseInternalSDK.xcconfig"
>
> CompileC
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/WebCore.build/Debug/WebCoreExportFileGenerator.build/Objects-normal/x86_64/ExportFileGenerator.o
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug/DerivedSources/WebCore/ExportFileGenerator.cpp
> normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
> cd
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/Source/WebCore
> export LANG=en_US.US-ASCII
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
> -x c++ -arch x86_64 -fmessage-length=204
> -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0
> -fcolor-diagnostics -std=gnu++11 -stdlib=libc++ -Wno-trigraphs
> -fno-exceptions -fno-rtti -fpascal-strings -O0 -Werror
> -Wno-missing-field-initializers -Wmissing-prototypes
> -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors
> -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function
> -Wno-unused-label -Wno-unused-parameter -Wunused-variable
> -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas
> -Wno-shadow -Wno-four-char-constants -Wno-conversion
> -Wconstant-conversion -Wint-conversion -Wbool-conversion
> -Wenum-conversion -Wsign-compare -Wno-shorten-64-to-32 -Wnewline-eof
> -Wno-c++11-extensions -DDISABLE_THREAD_CHECK -DENABLE_3D_RENDERING
> -DENABLE_CACHE_PARTITIONING -DENABLE_CANVAS_PATH
> -DENABLE_CHANNEL_MESSAGING -DENABLE_CSS_BOX_DECORATION_BREAK
> -DENABLE_CSS_COMPOSITING -DENABLE_CSS_EXCLUSIONS -DENABLE_CSS_FILTERS
> -DENABLE_CSS_GRID_LAYOUT -DENABLE_CSS_REGIONS -DENABLE_CSS_SHAPES
> -DENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED
> -DENABLE_CSS3_CONDITIONAL_RULES -DENABLE_CURSOR_VISIBILITY
> -DENABLE_DASHBOARD_SUPPORT -DENABLE_DETAILS_ELEMENT
> -DENABLE_DOM4_EVENTS_CONSTRUCTOR -DENABLE_ENCRYPTED_MEDIA
> -DENABLE_ENCRYPTED_MEDIA_V2 -DENABLE_FILTERS -DENABLE_FULLSCREEN_API
> -DENABLE_GAMEPAD -DENABLE_GEOLOCATION
> -DENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING -DENABLE_ICONDATABASE
> -DENABLE_INDEXED_DATABASE -DENABLE_INDIE_UI -DENABLE_INPUT_TYPE_COLOR
> -DENABLE_INPUT_TYPE_COLOR_POPOVER -DENABLE_INSPECTOR
> -DENABLE_LEGACY_CSS_VENDOR_PREFIXES -DENABLE_LEGACY_NOTIFICATIONS
> -DENABLE_LEGACY_VENDOR_PREFIXES -DENABLE_LEGACY_WEB_AUDIO
> -DENABLE_MATHML -DENABLE_MEDIA_CONTROLS_SCRIPT -DENABLE_METER_ELEMENT
> -DENABLE_MOUSE_CURSOR_SCALE -DENABLE_NAVIGATOR_CONTENT_UTILS
> -DENABLE_NAVIGATOR_HWCONCURRENCY -DENABLE_NOTIFICATIONS
> -DENABLE_PDFKIT_PLUGIN -DENABLE_PROMISES -DENABLE_PUBLIC_SUFFIX_LIST
> -DENABLE_REQUEST_ANIMATION_FRAME -DENABLE_SHARED_WORKERS
> -DENABLE_SPEECH_SYNTHESIS -DENABLE_SQL_DATABASE
> -DENABLE_SUBPIXEL_LAYOUT -DENABLE_SUBTLE_CRYPTO -DENABLE_SVG_FONTS
> -DENABLE_TEMPLATE_ELEMENT -DENABLE_USERSELECT_ALL -DENABLE_VIDEO
> -DENABLE_VIDEO_TRACK -DENABLE_DATACUE_VALUE -DENABLE_WEBGL
> -DENABLE_WEB_AUDIO -DENABLE_WEB_REPLAY -DENABLE_WEB_SOCKETS
> -DENABLE_PICTURE_SIZES -DENABLE_WEBVTT_REGIONS -DENABLE_XHR_TIMEOUT
> -DENABLE_XSLT -DENABLE_FTL_JIT
> -DWEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
> -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations
> -Winvalid-offsetof -mmacosx-version-min=10.9 -g -fvisibility=hidden
> -fvisibility-inlines-hidden -fno-threadsafe-statics
> -Wno-sign-conversion
> -I/Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/WebCore.build/Debug/WebCoreExportFileGenerator.build/WebCoreExportFileGenerator.hmap
> -I/Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug/include
> -IForwardingHeaders -Iicu
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxslt
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2
> -I/Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug/DerivedSources/WebCore
> -I/Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug/usr/local/include
> -I/Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug/usr/local/include/WebKitAdditions
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/local/include/WebKitAdditions
> -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
> -I/Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/WebCore.build/Debug/WebCoreExportFileGenerator.build/DerivedSources/x86_64
> -I/Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/WebCore.build/Debug/WebCoreExportFileGenerator.build/DerivedSources
> -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2
> -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked
> -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings
> -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare
> -Wimplicit-fallthrough
> -F/Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug
> -include
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/PrecompiledHeaders/WebCorePrefix-gcoyowpevvvzkbecqfhdngvxbkag/WebCorePrefix.h
> -MMD -MT dependencies -MF
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/WebCore.build/Debug/WebCoreExportFileGenerator.build/Objects-normal/x86_64/ExportFileGenerator.d
> --serialize-diagnostics
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/WebCore.build/Debug/WebCoreExportFileGenerator.build/Objects-normal/x86_64/ExportFileGenerator.dia
> -c
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug/DerivedSources/WebCore/ExportFileGenerator.cpp
> -o
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/WebCore.build/Debug/WebCoreExportFileGenerator.build/Objects-normal/x86_64/ExportFileGenerator.o
> fatal error: file
> '/Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug/usr/local/include/wtf/FeatureDefines.h'
> has been modified since the precompiled header
> '/Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/PrecompiledHeaders/WebCorePrefix-gcoyowpevvvzkbecqfhdngvxbkag/WebCorePrefix.h.pch'
> was built
> 1 error generated.
>
> ** BUILD FAILED **
>
>
> The following build commands failed:
> CompileC
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/WebCore.build/Debug/WebCoreExportFileGenerator.build/Objects-normal/x86_64/ExportFileGenerator.o
> /Users/jacquesolivierhache/Workspace/Temasys/WebKitProject/WebKit/WebKitBuild/Debug/DerivedSources/WebCore/ExportFileGenerator.cpp
> normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
> (1 failure)
>
>
>
> Is anyone used to turn the WebRTC code on and off?
This code has not been updated in a while, you will have to fix some
stuff here and there to get it to do anything.
> Did I miss an important step?
Probably not.
> Do you understand these errors?
The first error could simply be because the files defining those symbols
are not included in the XCode project file. Nobody has worked on WebRTC
for a while, it probably only builds for GTK.
The second error is likely a problem with the incremental build. I would
just delete WebKitBuild and start a clean build.
> Why is the precompiled header not re-built when there are changes in
> the headers?
Yep, that's weird. I only run into problems with precompiled headers
when I change my SDK.
But after changing feature flags you often have to do a clean build
anyway. There are too many code generators that are not tracking these
kind of dependencies.
Good luck!
Benjamin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20140722/aaf0eb73/attachment.html>
More information about the webkit-dev
mailing list