On 7/30/14, 2:51 AM, Jacques-Olivier wrote:
I kept working on getting media_stream to work. I think my understanding of what is happening improved, but I'm still stuck at the same point:

I read some more code and did some research about the Supplement and Supplementable classes. I mainly found this page <http://trac.webkit.org/wiki/Modules> which explains that Supplements are used to extract code from "massive" classes and make then more manageable and maintainable.
Please correct me if I am wrong.
That's right. Supplement are used to manage complexity by encapsulating self contained features behind a separate interfaces.
Anyway, it doesn't change that my program has no Supplement for the key "UserMediaController".
It looks like most of the supplements are being provided in two places:

  * WebKit::WebView::_commonInitializationWithFrameName
  * WebKit2::WebPage 's constructor

is there any other place where it should be done?
+probably another place in the WebKit layer for Windows, you can probably ignore that.
WebView actually contains a call to WebCore::provideUserMediaTo which creates a supplement, but my debugging show that _commonInitializationWithFrameName is never called.
WebPage's constructor does not generate a UserMediaController supplement.

My understanding of the WebView is that it is the rectangle in which the webpages are rendered. Is this assumption correct? I don't understand why _commonInitializationWithFrameName is never called when browsing. From the name of the function, I would expect it to be called right after the memory allocation.
WebKit1's WebView is not used by Safari.

The WebKit project has two "application layers": an old one named WebKit1 that handle web pages in-process, and a new one named WebKit2 that use a multi-process model.
This leaves me with 2 options:
1) Find a way to trigger _commonInitializationWithFrameName.
I have no idea of how to do that at the moment
If you want, you can still use WebKit1 by using the MiniBrowser: Tools/Scripts/run-minibrowser (IIRC it runs WebKit1 by default, but if not there is a way to get it to run WebKit1).
2) Duplicate the call to WebCore::provideUserMediaTo in WebKit2::WebPage.
I understand this is what is being done for the geolocation supplement.
I started to implement this solution, but it requires to translate Objective-C++ code into C++, and I am afraid that the file inclusion might never end.

Does any one of these solutions sound more reliable than the other for you?
Long term, if you want WebRTC to work in WebKit, it will have to work on WebKit2. If you just want to prototype something, it might be easier to use WebKit1 if its implementation is in a better shape.

Can you clarify your goals? Do you intent to provide patches for WebRTC support in WebKit?


Thanks in advance,

Haché Jacques-Olivier
R&D Engineer at Temasys Communications Pte Ltd
Fr : 06 45 85 48 80
Sg : 9086 3673

On 29 Jul 2014, at 17:45, Jacques-Olivier <jo.ha...@temasys.com.sg <mailto:jo.ha...@temasys.com.sg>> wrote:

Hi everyone,

I have some updates regarding my enabling of media_stream and some new question.

I managed to build the project with the following options ON:


For this I had to:
1) copy the content of these folders

  * WebKit/WebKitBuild/Debug/DerivedSources/WebCore
  * WebKit/WebKitBuild/Release/DerivedSources/WebCore

into DerivedSources/WebCore

2) Add some header and source files to the Xcode projects. The files were present in the repo, but not added to the projects.
3) Add some headers to be copied into WebCore.framework

Given those changes, I was able to build the project with both Xcode and the build script;

I tried running a very basic test that only calls navigator.webkitGetUserMedia, but the call fails with the folioing error:

    [Error] NotSupportedError: DOM Exception 9: The implementation
    did not support the requested type of object or operation.

I went into the code with Xcode's debugger and found that the error happens in NavigatorUserMedia::webkitGetUserMedia (basically the function's entrance). My understanding is that the NavigatorUserMedia is trying to get the content of a "supplement" for the key "UserMediaController" The access to the supplement itself is fine, but its map only contains one object with a key value set to NULL. Therefore the supplement returns NULL, and the NavigatorUserMedia triggers an error.

There are some comments in the code about how supplements work, but not what they are for. Can anyone enlighten me about this?
Did I miss an initialisation somewhere?

This was what is blocking me now.
I also have a couple of more generic questions about the project:

1) When I build with the script and then with Xcode, Xcode starts from the beginning, generates new binaries and links against them. Why are the script and Xcode not using the same files? It feels like a waste of time and space.

2) I had to do a number of modifications to the project to get here. At some point I will send pull requests, but I understand most of the people do not want to have media_stream enabled by default. Does that mean that for each pull request, I will have to remove my changes, send the pull request and do them again?What is the right way of handling this situation?


Haché Jacques-Olivier
R&D Engineer at Temasys Communications Pte Ltd
Fr : 06 45 85 48 80
Sg : 9086 3673

On 23 Jul 2014, at 16:49, Alexandre GOUAILLARD <agouaill...@gmail.com <mailto:agouaill...@gmail.com>> wrote:

Hi benjamain, thanks for the answers,

Cmake is not a build system in itself, it is a cross platform build generator. i.e. you can generate a make file, an VS solution file and a Xcode file from CMakeLists.txt (cmake -G).

So you mean to say that the committed make files and Xcode files are not generated from CMake, is that correct? Also, do you have any insight what the people using cmake end up using for building (is it make/gcc/ld, make/clang/ld, other flavors of build/compiler/linker) ?



On Wed, Jul 23, 2014 at 4:24 PM, Benjamin Poulain <benja...@webkit.org <mailto:benja...@webkit.org>> wrote:

    On 7/22/14, 12:48 AM, Jacques-Olivier wrote:
    HI Benjamin,

    Thanks for you answer.

    I just deleted the XCodeBuild folder and added a couple of
    files in the project manually.
    My computer is re-building the project, I will see how it goes.
    A couple of extra questions:

    1) After deleting the XCodeBuild folder, I cannot make my first
    build using Xcode. I end up with a file not found on
    #include <llvm-c/Analysis.h>
    in JavaScriptCore/llvm/LLVMHeaders.h
    I actually had the same issue on my first build. After a
    successful build from build-webkit, I can build again using
    Xcode (not clean and build).
    Any lead regarding why?
    No idea, I only use build-webkit and make for building.
    A lot of people use Xcode so there must be a way to get it to work.

    2) The Xcode projects is versioned on the repo. Is there anyway
    to re-generate it automatically?
    Having the Xcode project shared sounds very unsafe. What is
    someone introduces a bug in it someday?
    The Xcode project files are not generated, they are real project
    files created by Xcode. WebKit contributors maintain 3 build
    systems in parallel: Xcode, CMake, and VS.
    J-O H

    Haché Jacques-Olivier
    R&D Engineer at Temasys Communications Pte Ltd
    Fr : 06 45 85 48 80
    Sg : 9086 3673

    On 22 Jul 2014, at 15:16, Benjamin Poulain <benja...@webkit.org
    <mailto:benja...@webkit.org>> wrote:

    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

    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


    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 {
            virtual void didAddOrRemoveTrack() = 0;
          virtual ~Observer() {};

    and tried to build again.

    I now have a linking error when building WebCore with Xcode.

    normal x86_64
    -arch x86_64 -dynamiclib -isysroot
    -Xlinker --no-demangle -exported_symbols_list
    -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

    Undefined symbols for architecture x86_64:
    referenced from:
    in JSNavigator.o
    referenced from:
    in RTCPeerConnection.o
    referenced from:
    in MockMediaStreamCenter.o
    in MockMediaStreamCenter.o
    referenced from:
    in RTCPeerConnection.o
    referenced from:
    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
    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
    Base.xcconfig line 24: Unable to find included file

    normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
        export LANG=en_US.US-ASCII
    -x c++ -arch x86_64 -fmessage-length=204
    -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
    -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
    -IForwardingHeaders -Iicu
    -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
    -MMD -MT dependencies -MF
    fatal error: file
    has been modified since the precompiled header
    was built
    1 error generated.

    ** BUILD FAILED **

    The following build commands failed:
    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!
    webkit-dev mailing list
    webkit-dev@lists.webkit.org <mailto:webkit-dev@lists.webkit.org>

    webkit-dev mailing list
    webkit-dev@lists.webkit.org <mailto:webkit-dev@lists.webkit.org>

Alex. Gouaillard, PhD, PhD, MBA
CTO - Temasys Communications, S'pore / Mountain View
President - CoSMo Software, Cambridge, MA
sg.linkedin.com/agouaillard <http://sg.linkedin.com/agouaillard>


webkit-dev mailing list

webkit-dev mailing list

Reply via email to