Title: [270876] trunk
Revision
270876
Author
aes...@apple.com
Date
2020-12-15 18:02:02 -0800 (Tue, 15 Dec 2020)

Log Message

[Mac] Numerous webgl tests continue to time out with the WebM format reader enabled
https://bugs.webkit.org/show_bug.cgi?id=219928

Reviewed by Eric Carlson.

Source/WebKit:

Covered by existing tests.

* Shared/mac/MediaFormatReader/TrackReader.cpp:
(WebKit::MediaSampleByteRange::MediaSampleByteRange):
(WebKit::MediaSampleByteRange::trackID const):
(WebKit::TrackReader::addSample): Store MediaSampleByteRange's track ID as a uint64_t
instead of an AtomString that might've been created on another thread.

(WebKit::TrackReader::finalize): Ensure that m_sampleStorage really is destroyed on the
storage queue by explicitly settings its unique_ptr to nullptr in the lambda. Without
doing this, it's possible that the lambda will execute on the storage queue *before*
WorkQueue::dispatch returns, and since WorkQueue's BlockPtr is still holding a reference
to the block containing the lambda, it would not have been destroyed on the storage queue.

Tools:

* Scripts/webkitpy/port/mac.py:
(MacPort.logging_patterns_to_strip): Stripped unnecessary logging during VP9 decoding.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (270875 => 270876)


--- trunk/Source/WebKit/ChangeLog	2020-12-16 01:05:20 UTC (rev 270875)
+++ trunk/Source/WebKit/ChangeLog	2020-12-16 02:02:02 UTC (rev 270876)
@@ -1,3 +1,24 @@
+2020-12-15  Andy Estes  <aes...@apple.com>
+
+        [Mac] Numerous webgl tests continue to time out with the WebM format reader enabled
+        https://bugs.webkit.org/show_bug.cgi?id=219928
+
+        Reviewed by Eric Carlson.
+
+        Covered by existing tests.
+
+        * Shared/mac/MediaFormatReader/TrackReader.cpp:
+        (WebKit::MediaSampleByteRange::MediaSampleByteRange):
+        (WebKit::MediaSampleByteRange::trackID const):
+        (WebKit::TrackReader::addSample): Store MediaSampleByteRange's track ID as a uint64_t
+        instead of an AtomString that might've been created on another thread.
+
+        (WebKit::TrackReader::finalize): Ensure that m_sampleStorage really is destroyed on the
+        storage queue by explicitly settings its unique_ptr to nullptr in the lambda. Without
+        doing this, it's possible that the lambda will execute on the storage queue *before*
+        WorkQueue::dispatch returns, and since WorkQueue's BlockPtr is still holding a reference
+        to the block containing the lambda, it would not have been destroyed on the storage queue.
+
 2020-12-15  Per Arne Vollan <pvol...@apple.com>
 
         [macOS, iOS] Add required mach syscall

Modified: trunk/Source/WebKit/Shared/mac/MediaFormatReader/TrackReader.cpp (270875 => 270876)


--- trunk/Source/WebKit/Shared/mac/MediaFormatReader/TrackReader.cpp	2020-12-16 01:05:20 UTC (rev 270875)
+++ trunk/Source/WebKit/Shared/mac/MediaFormatReader/TrackReader.cpp	2020-12-16 02:02:02 UTC (rev 270876)
@@ -50,9 +50,9 @@
 
 class MediaSampleByteRange final : public MediaSampleAVFObjC {
 public:
-    static Ref<MediaSampleByteRange> create(MediaSample& sample, MTPluginByteSourceRef byteSource)
+    static Ref<MediaSampleByteRange> create(MediaSample& sample, MTPluginByteSourceRef byteSource, uint64_t trackID)
     {
-        return adoptRef(*new MediaSampleByteRange(sample, byteSource));
+        return adoptRef(*new MediaSampleByteRange(sample, byteSource, trackID));
     }
 
     MediaTime presentationTime() const final { return m_presentationTime; }
@@ -63,12 +63,13 @@
     SampleFlags flags() const final { return m_flags; }
     Optional<ByteRange> byteRange() const final { return m_byteRange; }
 
+    AtomString trackID() const final;
     PlatformSample platformSample() final;
     void offsetTimestampsBy(const MediaTime&) final;
     void setTimestamps(const MediaTime&, const MediaTime&) final;
 
 private:
-    MediaSampleByteRange(MediaSample&, MTPluginByteSourceRef);
+    MediaSampleByteRange(MediaSample&, MTPluginByteSourceRef, uint64_t trackID);
 
     MediaTime m_presentationTime;
     MediaTime m_decodeTime;
@@ -76,13 +77,14 @@
     size_t m_sizeInBytes;
     FloatSize m_presentationSize;
     SampleFlags m_flags;
+    uint64_t m_trackID;
     Optional<ByteRange> m_byteRange;
     RetainPtr<MTPluginByteSourceRef> m_byteSource;
     RetainPtr<CMFormatDescriptionRef> m_formatDescription;
 };
 
-MediaSampleByteRange::MediaSampleByteRange(MediaSample& sample, MTPluginByteSourceRef byteSource)
-    : MediaSampleAVFObjC(nullptr, sample.trackID())
+MediaSampleByteRange::MediaSampleByteRange(MediaSample& sample, MTPluginByteSourceRef byteSource, uint64_t trackID)
+    : MediaSampleAVFObjC(nullptr)
     , m_presentationTime(sample.presentationTime())
     , m_decodeTime(sample.decodeTime())
     , m_duration(sample.duration())
@@ -89,6 +91,7 @@
     , m_sizeInBytes(sample.sizeInBytes())
     , m_presentationSize(sample.presentationSize())
     , m_flags(sample.flags())
+    , m_trackID(trackID)
     , m_byteRange(sample.byteRange())
     , m_byteSource(byteSource)
 {
@@ -107,6 +110,11 @@
     }
 }
 
+AtomString MediaSampleByteRange::trackID() const
+{
+    return AtomString::number(m_trackID);
+}
+
 PlatformSample MediaSampleByteRange::platformSample()
 {
     return {
@@ -180,7 +188,7 @@
         m_sampleStorage = makeUnique<SampleStorage>();
 
     ASSERT(!sample->isDivisable() && sample->byteRange());
-    auto sampleToAdd = MediaSampleByteRange::create(sample.get(), byteSource);
+    auto sampleToAdd = MediaSampleByteRange::create(sample.get(), byteSource, m_trackID);
 
     // FIXME: Even though WebM muxer guidelines say this must not happen, some video tracks have two
     // consecutive frames with the same presentation time. SampleMap will not store the second frame
@@ -248,7 +256,9 @@
 void TrackReader::finalize()
 {
     auto locker = holdLock(m_sampleStorageLock);
-    storageQueue().dispatch([sampleStorage = std::exchange(m_sampleStorage, nullptr)] { });
+    storageQueue().dispatch([sampleStorage = std::exchange(m_sampleStorage, nullptr)]() mutable {
+        sampleStorage = nullptr;
+    });
     CoreMediaWrapped<TrackReader>::finalize();
 }
 

Modified: trunk/Tools/ChangeLog (270875 => 270876)


--- trunk/Tools/ChangeLog	2020-12-16 01:05:20 UTC (rev 270875)
+++ trunk/Tools/ChangeLog	2020-12-16 02:02:02 UTC (rev 270876)
@@ -1,3 +1,13 @@
+2020-12-15  Andy Estes  <aes...@apple.com>
+
+        [Mac] Numerous webgl tests continue to time out with the WebM format reader enabled
+        https://bugs.webkit.org/show_bug.cgi?id=219928
+
+        Reviewed by Eric Carlson.
+
+        * Scripts/webkitpy/port/mac.py:
+        (MacPort.logging_patterns_to_strip): Stripped unnecessary logging during VP9 decoding.
+
 2020-12-15  Jonathan Bedard  <jbed...@apple.com>
 
         [webkitscmpy] Support remote GitHub repository

Modified: trunk/Tools/Scripts/webkitpy/port/mac.py (270875 => 270876)


--- trunk/Tools/Scripts/webkitpy/port/mac.py	2020-12-16 01:05:20 UTC (rev 270875)
+++ trunk/Tools/Scripts/webkitpy/port/mac.py	2020-12-16 02:02:02 UTC (rev 270876)
@@ -295,6 +295,9 @@
         # FIXME: Remove this after <rdar://problem/52897406> is fixed.
         logging_patterns.append((re.compile('VPA info:.*\n'), ''))
 
+        # FIXME: Find where this is coming from and file a bug to have it removed (then remove this line).
+        logging_patterns.append((re.compile('VP9 Info:.*\n'), ''))
+
         return logging_patterns
 
     def stderr_patterns_to_strip(self):
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to