⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 239387 in webkit


Ignore:
Timestamp:
Dec 19, 2018, 1:11:12 PM (8 years ago)
Author:
jer.noble@apple.com
Message:

Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync()
​https://bugs.webkit.org/show_bug.cgi?id=192856
<rdar://problem/46843245>

Reviewed by Alex Christensen.

Some decoders exposed through VideoToolbox will decode asynchronously even when
kVTDecodeInfo_Asynchronous is not set. Force synchronous behavior with a Semaphore.

  • platform/graphics/cocoa/WebCoreDecompressionSession.mm:

(WebCore::WebCoreDecompressionSession::decodeSampleSync):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239384 r239387  
     12018-12-19  Jer Noble  <jer.noble@apple.com>
     2
     3        Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync()
     4        https://bugs.webkit.org/show_bug.cgi?id=192856
     5        <rdar://problem/46843245>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Some decoders exposed through VideoToolbox will decode asynchronously even when
     10        kVTDecodeInfo_Asynchronous is not set. Force synchronous behavior with a Semaphore.
     11
     12        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
     13        (WebCore::WebCoreDecompressionSession::decodeSampleSync):
     14
    1152018-12-19  Megan Gardner  <megan_gardner@apple.com>
    216
  • trunk/Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm

    r236101 r239387  
    4040#import <wtf/StringPrintStream.h>
    4141#import <wtf/Vector.h>
     42#import <wtf/WTFSemaphore.h>
    4243#import <wtf/cf/TypeCastsCF.h>
    4344
    … …  
    278279    RetainPtr<CVPixelBufferRef> pixelBuffer;
    279280    VTDecodeInfoFlags flags { 0 };
     281    WTF::Semaphore syncDecompressionOutputSemaphore { 0 };
    280282    VTDecompressionSessionDecodeFrameWithOutputHandler(m_decompressionSession.get(), sample, flags, nullptr, [&] (OSStatus, VTDecodeInfoFlags, CVImageBufferRef imageBuffer, CMTime, CMTime) mutable {
    281283        if (imageBuffer && CFGetTypeID(imageBuffer) == CVPixelBufferGetTypeID())
    282284            pixelBuffer = (CVPixelBufferRef)imageBuffer;
     285        syncDecompressionOutputSemaphore.signal();
    283286    });
     287    syncDecompressionOutputSemaphore.wait();
    284288    return pixelBuffer;
    285289}
Note: See TracChangeset for help on using the changeset viewer.