<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: [GTK] Add MediaEndpointOwr - an OpenWebRTC WebRTC backend"
   href="https://bugs.webkit.org/show_bug.cgi?id=163327#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: [GTK] Add MediaEndpointOwr - an OpenWebRTC WebRTC backend"
   href="https://bugs.webkit.org/show_bug.cgi?id=163327">bug 163327</a>
              from <span class="vcard"><a class="email" href="mailto:adam.bergkvist&#64;ericsson.com" title="Adam Bergkvist &lt;adam.bergkvist&#64;ericsson.com&gt;"> <span class="fn">Adam Bergkvist</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=163327#c3">comment #3</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=292061&amp;action=diff" name="attach_292061" title="Proposed patch">attachment 292061</a> <a href="attachment.cgi?id=292061&amp;action=edit" title="Proposed patch">[details]</a></span>
&gt; Proposed patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=292061&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=292061&amp;action=review</a>
&gt; 
&gt; Nice patch! Looking forward having it in trunk :) Was this tested with a
&gt; debug build too? Please also check the comments inline!</span >

Thanks for reviewing. (Now) it's successfully tested with a debug build. :)

<span class="quote">&gt; &gt; Source/WebCore/ChangeLog:10
&gt; &gt; +        is till done with MockMediaEndpoint.
&gt; 
&gt; typo: till</span >

Fixed.

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:88
&gt; &gt; +    g_free(m_dtlsPrivateKey);
&gt; &gt; +    g_free(m_dtlsCertificate);
&gt; &gt; +
&gt; &gt; +    g_regex_unref(m_helperServerRegEx);
&gt; 
&gt; Could we use smart pointers for those?</span >

Fixed first two (using WTFString).

The third can't directly be put into a unique_ptr and I'm not sure it's worth going the length to fix it since it's a temporary solution until WebKit's URL class can handle the ICE helper server urls properly.

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:113
&gt; &gt; +    payload-&gt;setEncodingName(&quot;OPUS&quot;);
&gt; 
&gt; What if we don't have the Opus gst plugin? I suspect we should build the
&gt; vector depending on the codecs and (de)payloaders available. Maybe open a
&gt; new bug about this and link it here.</span >

True. Added FIXME and bug.

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:141
&gt; &gt; +    payload-&gt;setEncodingName(&quot;H264&quot;);
&gt; 
&gt; Ditto :)</span >

See above.

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:260
&gt; &gt; +            printf(&quot;updateSendConfiguration: BAD missing configuration element for %d\n&quot;, i);
&gt; 
&gt; Replace with an ASSERT ?</span >

Removed (was debug logging)

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:288
&gt; &gt; +            printf(&quot;updateSendConfiguration: no payloads\n&quot;);
&gt; 
&gt; Remove this one or ASSERT ?</span >

Removed (was debug logging)

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:356
&gt; &gt; +    // FIXME: An OWR bug prevents this from succeeding
&gt; 
&gt; details? Is there a github OWR issue for this?</span >

Yes. Added a link.

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:478
&gt; &gt; +    bool useRtpMux = !isInitiator &amp;&amp; mediaDescription-&gt;rtcpMux();
&gt; 
&gt; useRtcpMux</span >

Fixed.

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:557
&gt; &gt; +                parseHelperServerUrl(m_helperServerRegEx, webkitUrl, url);
&gt; 
&gt; I suppose the regex could be managed here locally instead of having it as
&gt; class member?</span >

Having it as class member has the benefit that we only need to compile the regex once instead of every time the parseHelperServerUrl is called. I don't have a strong preference though. Left as is for now.

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:559
&gt; &gt; +                unsigned short port = url.port ? url.port : 3478;
&gt; 
&gt; Use a define for the default port</span >

Fixed.

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:658
&gt; &gt; +    iceCandidate-&gt;setPort(port ? port : 9);
&gt; 
&gt; ditto?</span >

Fixed.

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:669
&gt; &gt; +        iceCandidate-&gt;setRelatedPort(relatedPort ? relatedPort : 9);
&gt; 
&gt; :)</span >

Fixed.

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:680
&gt; &gt; +    g_free(foundation);
&gt; &gt; +    g_free(address);
&gt; &gt; +    g_free(relatedAddress);
&gt; 
&gt; Smart pointers could be used for these, I think.</span >

We could put these in WTFString objects, but that would imply copying the data and still freeing the gchar* strings, since it doesn't seem possible to String::adopt() a plain char*. This would also require alternative names for the WTFString versions. I think it would be worth the extra work if the function had multiple exit points (to avoid forgetting a free), but it probably never will since it's just a bunch of set-operations. 

<span class="quote">&gt; &gt; Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.h:37
&gt; &gt; +#include &lt;owr/owr_media_session.h&gt;
&gt; &gt; +#include &lt;owr/owr_transport_agent.h&gt;
&gt; 
&gt; Maybe use forward declarations of the structs needed and move includes to
&gt; the .cpp file, if possible :)</span >

It made a try, but it gets a bit messy since all the OWR types are typedefs (of structs).</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>