<?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>127376</bug_id>
          
          <creation_ts>2014-01-21 15:51:29 -0800</creation_ts>
          <short_desc>GStreamer not buffering loading on Windows</short_desc>
          <delta_ts>2018-03-02 07:37:39 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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="Alex Christensen">alex.christensen</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cgarcia</cc>
    
    <cc>commit-queue</cc>
    
    <cc>gustavo</cc>
    
    <cc>menard</cc>
    
    <cc>mrobinson</cc>
    
    <cc>pnormand</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>970456</commentid>
    <comment_count>0</comment_count>
    <who name="Alex Christensen">alex.christensen</who>
    <bug_when>2014-01-21 15:51:29 -0800</bug_when>
    <thetext>I&apos;m not sure what a blob protocol is, but this is the fix I&apos;m using to prevent an assertion failure.  It&apos;s not the cleanest fix, and I&apos;m sure it breaks something else, but it fixes my assertion failure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>970457</commentid>
    <comment_count>1</comment_count>
      <attachid>221799</attachid>
    <who name="Alex Christensen">alex.christensen</who>
    <bug_when>2014-01-21 15:53:49 -0800</bug_when>
    <thetext>Created attachment 221799
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>970459</commentid>
    <comment_count>2</comment_count>
      <attachid>221799</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2014-01-21 15:58:51 -0800</bug_when>
    <thetext>Comment on attachment 221799
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=221799&amp;action=review

&gt; Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:1022
&gt; +    DataBufferingPolicy bufferingPolicy = BufferData;

You can see why we do this here: https://bugs.webkit.org/show_bug.cgi?id=102586 Perhaps Carlos has more information. He should probably review this patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>970592</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2014-01-21 23:29:20 -0800</bug_when>
    <thetext>(In reply to comment #0)
&gt; I&apos;m not sure what a blob protocol is, but this is the fix I&apos;m using to prevent an assertion failure.  It&apos;s not the cleanest fix, and I&apos;m sure it breaks something else, but it fixes my assertion failure.

what assertion failure exactly?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>970857</commentid>
    <comment_count>4</comment_count>
    <who name="Alex Christensen">alex.christensen</who>
    <bug_when>2014-01-22 13:55:29 -0800</bug_when>
    <thetext>&gt; what assertion failure exactly?
ASSERT(m_options.dataBufferingPolicy == BufferData) in CachedRawResource::addDataBuffer is failing.  I&apos;m using curl instead of libsoup, and I&apos;m having trouble with MediaPlayerPrivateGStreamer::fillTimerFired.  Do you think this could be related?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>972316</commentid>
    <comment_count>5</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2014-01-26 20:24:49 -0800</bug_when>
    <thetext>I suspect this bug uncovered a difference of implementation in the Soup/Curl backends. If that&apos;s the case it&apos;d be better to fix the Curl backend instead of adding a workaround in the gstreamer backend.

Do the blob layout tests pass fine in WinCairo?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>972348</commentid>
    <comment_count>6</comment_count>
      <attachid>221799</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2014-01-27 00:08:18 -0800</bug_when>
    <thetext>Comment on attachment 221799
Patch

Yes, we really want to set the policy as not buffering to avoid buffer copies while reading the stream. I don&apos;t understand why that assert is hit even using curl, and I don&apos;t have a windows to debug it. CachedRawResource::addDataBuffer() should never be called when the policy is DoNotBuffer. The resource handle calls ResourceHandleclient::didReceiveData (what curl backend does) or ResourceHandleclient::didReceiveBuffer (what soup backend does) when it has read a data chunk. The SubresourceLoader then calls didReceiveDataOrBuffer() and passes it to the parent ResourceLoader. In ResourceLoader::didReceiveDataOrBuffer() calls addDataOrBuffer which returns early when the policy is DoNotBuffer to make sure the m_resourceData is not set. And at this point is when SubresourceLoader calls CachedResource::addBuffer or CachedResource::addData, depending on whether there&apos;s cached data for the resource (m_resourceData). So, the only think I can think of is either something is changing the buffering policy once the resource load has started, or the m_resourceData of the resource is not correctly cleaned up at some point.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>986369</commentid>
    <comment_count>7</comment_count>
    <who name="Alex Christensen">alex.christensen</who>
    <bug_when>2014-03-03 09:14:49 -0800</bug_when>
    <thetext>Commenting out all calls to gst_element_register in initializeGStreamerAndRegisterWebKitElements makes it buffer correctly and wait when it reaches the end of the downloaded buffer, but it always says it has 100% loaded because gst_query_parse_buffering_range in fillTimerFired always sets start and stop to -1.  Using a gst_query_new_duration gives the correct duration, so I think it might be a problem with gst_query_new_buffering on Windows.  Using m_bufferingPercentage instead of fillStatus works close to how it should, though, but there are some quirks.  I don&apos;t think that&apos;s a good solution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>997278</commentid>
    <comment_count>8</comment_count>
    <who name="Alex Christensen">alex.christensen</who>
    <bug_when>2014-04-03 13:27:20 -0700</bug_when>
    <thetext>For some reason, gst_query_parse_buffering_range always returns -1, but gst_structure_get_int works with &quot;buffer-percent&quot;.  There is also a &quot;buffering-ranges&quot; string in gstquark.c.  Could these be used instead of querying?  Is there a specific reason a timer is used instead of just relying on GstMessages?  It&apos;s been this way for a long time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>997489</commentid>
    <comment_count>9</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2014-04-04 00:12:12 -0700</bug_when>
    <thetext>Which httpsrc element is used then?

You need to make sure it has a GstQuery handler answering to the GST_QUERY_SCHEDULING query and setting the GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED flag.

If the element doesn&apos;t have that feature please send a patch to bugzilla.gnome.org.

(In reply to comment #8)
&gt; For some reason, gst_query_parse_buffering_range always returns -1, but gst_structure_get_int works with &quot;buffer-percent&quot;.  There is also a &quot;buffering-ranges&quot; string in gstquark.c.  Could these be used instead of querying?  Is there a specific reason a timer is used instead of just relying on GstMessages?  It&apos;s been this way for a long time.

Yes of course there is a specific reason for this design, this is how on-disk buffering is supposed to be implemented and not to be confused with the GST_QUERY_BUFFERING which is used to know if the pipeline has enough data to handle efficient seeking.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1403215</commentid>
    <comment_count>10</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2018-03-02 07:37:39 -0800</bug_when>
    <thetext>Closing because the informations requested were not provided. Feel free to reopen if you want to provide answers :)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>221799</attachid>
            <date>2014-01-21 15:53:49 -0800</date>
            <delta_ts>2014-01-27 00:08:16 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-127376-20140121165348.patch</filename>
            <type>text/plain</type>
            <size>1871</size>
            <attacher name="Alex Christensen">alex.christensen</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09P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1BvbGlj
eSwgRG9Ob3RBbGxvd1N0b3JlZENyZWRlbnRpYWxzLCBEb05vdEFza0NsaWVudEZvckNyb3NzT3Jp
Z2luQ3JlZGVudGlhbHMsIERvU2VjdXJpdHlDaGVjaywgVXNlRGVmYXVsdE9yaWdpblJlc3RyaWN0
aW9uc0ZvclR5cGUpKTsKICAgICBtX3Jlc291cmNlID0gcmVzb3VyY2VMb2FkZXItPnJlcXVlc3RS
YXdSZXNvdXJjZShjYWNoZVJlcXVlc3QpOwogICAgIGlmIChtX3Jlc291cmNlKQo=
</data>
<flag name="review"
          id="245761"
          type_id="1"
          status="-"
          setter="cgarcia"
    />
          </attachment>
      

    </bug>

</bugzilla>