<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>245135</bug_id>
          
          <creation_ts>2022-09-13 05:46:23 -0700</creation_ts>
          <short_desc>Holepunch missing after video source change</short_desc>
          <delta_ts>2022-09-16 01:30:45 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WPE WebKit</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Olivier Blin">olivier.blin</reporter>
          <assigned_to name="Miguel Gomez">magomez</assigned_to>
          <cc>aperez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>fujii</cc>
    
    <cc>loic.yhuel</cc>
    
    <cc>magomez</cc>
    
    <cc>zdobersek</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1898199</commentid>
    <comment_count>0</comment_count>
      <attachid>462314</attachid>
    <who name="Olivier Blin">olivier.blin</who>
    <bug_when>2022-09-13 05:46:23 -0700</bug_when>
    <thetext>Created attachment 462314
Test case to reproduce the missing holepunch after changing video source

Since r295749 (251754@main), the holepunch feature is broken (missing) after changing the video source.
See https://bugs.webkit.org/show_bug.cgi?id=240283 for the crash fix which causes this regression.

This bug can be seen with YouTube TV, just after skipping an ad.

The holepunch contents layer is reset to NULL after changing the source, which causes the holepunch buffer not to be rendered anymore.

The new content layer from the new MediaPlayer is set from TextureMapperPlatformLayerProxyGL::activateOnCompositingThread(), but after that, TextureMapperPlatformLayerProxyGL::invalidate() is called to invalidate the old content layer from the old MediaPlayer.
This sets the content layer to NULL in the target layer, and this disables the new content layer.

This can be reproduced on a WPE build with USE_GSTREAMER_HOLEPUNCH=ON and the attached test page.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898659</commentid>
    <comment_count>1</comment_count>
      <attachid>462353</attachid>
    <who name="Miguel Gomez">magomez</who>
    <bug_when>2022-09-15 01:59:47 -0700</bug_when>
    <thetext>Created attachment 462353
tentative fix

The issue is quite complicated to reproduce in my system. I was able to see it only once in tens of executions. This is because it has to happen that the old player is destroyed and the new one created before there&apos;s a layerFlush, so the CoordinatedGraphicsScene can be in the situation where a layer&apos;s proxy is replaced with a new one. Most of the times there&apos;s a layerFlush between the destruction of the old player and the creation of the new one, so the problem doesn&apos;t reproduce.

Anyway, I think the fix is as simple as doing the invalidation of the old proxies before activating the new ones.

Olivier, as you seem to be able to reproduce the issue reliably, could you give a test to this patch and check whether it fixes the problem?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898673</commentid>
    <comment_count>2</comment_count>
    <who name="Olivier Blin">olivier.blin</who>
    <bug_when>2022-09-15 04:29:27 -0700</bug_when>
    <thetext>Miguel: thank you, this fixes the issue for me.

I could reproduce the issue on my laptop, but it has been first detected on set-top boxes with less powerful CPUs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898681</commentid>
    <comment_count>3</comment_count>
    <who name="Miguel Gomez">magomez</who>
    <bug_when>2022-09-15 06:22:26 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/4379</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898930</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-09-16 01:30:42 -0700</bug_when>
    <thetext>Committed 254548@main (f994a1b3e3dc): &lt;https://commits.webkit.org/254548@main&gt;

Reviewed commits have been landed. Closing PR #4379 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>462314</attachid>
            <date>2022-09-13 05:46:23 -0700</date>
            <delta_ts>2022-09-13 05:46:23 -0700</delta_ts>
            <desc>Test case to reproduce the missing holepunch after changing video source</desc>
            <filename>video-src-change-holepunch.html</filename>
            <type>text/html</type>
            <size>936</size>
            <attacher name="Olivier Blin">olivier.blin</attacher>
            
              <data encoding="base64">PGh0bWw+CiAgICA8aGVhZD4KICAgICAgICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgogICAgICAg
ICAgICBib2R5IHsKICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMjU1LCAy
NTUsIDI1NSwgMC44KTsKICAgICAgICAgICAgfQogICAgICAgICAgICAuYm94IHsKICAgICAgICAg
ICAgICAgIHdpZHRoOiA2NDBweDsKICAgICAgICAgICAgICAgIGhlaWdodDogNDgwcHg7CiAgICAg
ICAgICAgIH0KICAgICAgICA8L3N0eWxlPgogICAgICAgIDxzY3JpcHQ+CiAgICAgICAgICAgIHZh
ciB2aWRlbyA9IG51bGw7CiAgICAgICAgICAgIHZhciBwcmVmaXggPSAiTGF5b3V0VGVzdHMvbWVk
aWEvY29udGVudC8iOwogICAgICAgICAgICB2YXIgc3JjMSA9IHByZWZpeCArICJ0ZXN0Lm1wNCI7
CiAgICAgICAgICAgIHZhciBzcmMyID0gcHJlZml4ICsgInRlc3QubXA0IjsKICAgICAgICAKICAg
ICAgICAgICAgZnVuY3Rpb24gc2V0dXAoKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICB2
aWRlbyA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCd2aWRlbycpWzBdOwogICAgICAg
ICAgICAgICAgdmlkZW8uc3JjID0gc3JjMTsKICAgICAgICAgICAgICAgIHZpZGVvLnBsYXkoKTsK
ICAgICAgICAgICAgICAgIHNldFRpbWVvdXQobmV4dFNyYywgMjAwMCk7CiAgICAgICAgICAgIH0K
CiAgICAgICAgICAgIGZ1bmN0aW9uIG5leHRTcmMoKQogICAgICAgICAgICB7CiAgICAgICAgICAg
ICAgICB2aWRlby5zcmMgPSBzcmMyOwogICAgICAgICAgICAgICAgdmlkZW8ucGxheSgpOwogICAg
ICAgICAgICB9CiAgICAgICAgPC9zY3JpcHQ+CiAgICA8L2hlYWQ+Cgo8Ym9keSBvbmxvYWQ9InNl
dHVwKCkiPgogICAgPGRpdiBjbGFzcz0iYm94Ij4KICAgICAgICA8dmlkZW8+PC92aWRlbz4KICAg
IDwvZGl2Pgo8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>462353</attachid>
            <date>2022-09-15 01:59:47 -0700</date>
            <delta_ts>2022-09-15 01:59:47 -0700</delta_ts>
            <desc>tentative fix</desc>
            <filename>invalidate-before-activate.patch</filename>
            <type>text/plain</type>
            <size>1510</size>
            <attacher name="Miguel Gomez">magomez</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQvU2hhcmVkL0Nvb3JkaW5hdGVkR3JhcGhpY3MvQ29v
cmRpbmF0ZWRHcmFwaGljc1NjZW5lLmNwcCBiL1NvdXJjZS9XZWJLaXQvU2hhcmVkL0Nvb3JkaW5h
dGVkR3JhcGhpY3MvQ29vcmRpbmF0ZWRHcmFwaGljc1NjZW5lLmNwcAppbmRleCAyYjg0ODQ0MGQ4
NDguLmM3OGVhMzg0OGM0ZCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYktpdC9TaGFyZWQvQ29vcmRp
bmF0ZWRHcmFwaGljcy9Db29yZGluYXRlZEdyYXBoaWNzU2NlbmUuY3BwCisrKyBiL1NvdXJjZS9X
ZWJLaXQvU2hhcmVk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FwaGljc1NjZW5lOjp1cGRhdGVTY2VuZVN0YXRlKCkKICAgICBmb3Ig
KGF1dG8mIHByb3h5IDogcHJveGllc0ZvclN3YXBwaW5nKQogICAgICAgICBwcm94eS0+c3dhcEJ1
ZmZlcigpOwogCi0gICAgZm9yIChhdXRvJiBwcm94eSA6IHJlcGxhY2VkUHJveGllc1RvSW52YWxp
ZGF0ZSkKLSAgICAgICAgcHJveHktPmludmFsaWRhdGUoKTsKLSAgICByZXBsYWNlZFByb3hpZXNU
b0ludmFsaWRhdGUgPSB7IH07Ci0KICAgICAvLyBFamVjdCBhbnkgYmFja2luZyBzdG9yZSBjb250
YWluZXIgd2hvc2Ugb25seSByZWZlcmVuY2UgaXMgaGVsZCBpbiB0aGlzIHNjZW5lJ3MgSGFzaFNl
dCBjYWNoZS4KICAgICBtX2ltYWdlQmFja2luZ1N0b3JlQ29udGFpbmVycy5yZW1vdmVJZigKICAg
ICAgICAgW10oYXV0byYgY29udGFpbmVyKSB7Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>