<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:bfulgham&#64;webkit.org" title="Brent Fulgham &lt;bfulgham&#64;webkit.org&gt;"> <span class="fn">Brent Fulgham</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [WinCairo][Video][MediaFoundation] Video should be rendered in provided graphics context."
   href="https://bugs.webkit.org/show_bug.cgi?id=150941">bug 150941</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #265074 Flags</td>
           <td>review?
           </td>
           <td>review+, commit-queue-
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [WinCairo][Video][MediaFoundation] Video should be rendered in provided graphics context."
   href="https://bugs.webkit.org/show_bug.cgi?id=150941#c16">Comment # 16</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [WinCairo][Video][MediaFoundation] Video should be rendered in provided graphics context."
   href="https://bugs.webkit.org/show_bug.cgi?id=150941">bug 150941</a>
              from <span class="vcard"><a class="email" href="mailto:bfulgham&#64;webkit.org" title="Brent Fulgham &lt;bfulgham&#64;webkit.org&gt;"> <span class="fn">Brent Fulgham</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=265074&amp;action=diff" name="attach_265074" title="Patch">attachment 265074</a> <a href="attachment.cgi?id=265074&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=265074&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=265074&amp;action=review</a>

This looks great! I have a few suggestions before landing, but I think it looks good.

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:834
&gt; +ULONG STDMETHODCALLTYPE MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::AddRef()</span >

Please remove the STDMETHODCALLTYPE stuff from the *.cpp file.

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:840
&gt; +ULONG STDMETHODCALLTYPE MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::Release()</span >

Ditto.

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:1081
&gt; +        *ppv = static_cast&lt;IMFVideoPresenter*&gt;(this);</span >

We should be checking for null ppv before dereferencing it.

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:1678
&gt; +static HRESULT GetVideoDisplayArea(IMFMediaType *type, MFVideoArea *area)</span >

Do we need type and area null checks? Maybe we know that all uses have been null checked. The spacing looks wrong, since this isn't Objective C (i.e., &quot;IMFMediaType *type&quot; -&gt; &quot;IMFMediaType* type&quot;, &quot;MFVideoArea *area&quot; -&gt; &quot;MFVideoArea* area&quot;.

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:1684
&gt; +    bPanScan = MFGetAttributeUINT32(type, MF_MT_PAN_SCAN_ENABLED, FALSE);</span >

I prefer &quot;BOOL bPanScan = ...&quot; since nothing happens between declaring the BOOL and initializing it.

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:1779
&gt; +    if (!sample)</span >

So we do check nulls in some of these functions. I feel like this should be consistent, unless we are in an especially tight loop that can't afford the test.

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:1880
&gt; +    hr = m_mixer-&gt;ProcessOutput(0, 1, &amp;dataBuffer, &amp;status);</span >

Are there conditions where m_mixer can be null? If not, maybe we should access it through a reference instead.

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:1957
&gt; +    HRESULT hr = sample-&gt;QueryInterface(__uuidof(IMFTrackedSample), (void**)&amp;tracked);</span >

Do we ever have SUCCEEDED(hr) with a null &quot;tracked&quot;?

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:1979
&gt; +HRESULT MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::onSampleFree(IMFAsyncResult* result)</span >

Can 'result' ever be null?

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:2043
&gt; +    m_videoSampleQueue.append(sample);</span >

Is it OK to append null samples?

<span class="quote">&gt; Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:2749
&gt; +        &amp;device</span >

This should really be reduced to a few lines. We don't typically use these vertically-extended MS-style formats.</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>