Changeset 275511 in webkit


Ignore:
Timestamp:
Apr 6, 2021 6:25:01 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

[GStreamer] Heap allocation exceptions
https://bugs.webkit.org/show_bug.cgi?id=224188

Patch by Philippe Normand <pnormand@igalia.com> on 2021-04-06
Reviewed by Xabier Rodriguez-Calvar.

The current GStreamer audio-related backends can't yet avoid heap allocations in the audio
thread, so we need exceptions for those cases.

  • platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:

(WebCore::AudioSourceProviderGStreamer::provideInput):

  • platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:

(gstMemoryFastMallocNew):

  • platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:

(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r275510 r275511  
     12021-04-06  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GStreamer] Heap allocation exceptions
     4        https://bugs.webkit.org/show_bug.cgi?id=224188
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        The current GStreamer audio-related backends can't yet avoid heap allocations in the audio
     9        thread, so we need exceptions for those cases.
     10
     11        * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
     12        (WebCore::AudioSourceProviderGStreamer::provideInput):
     13        * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:
     14        (gstMemoryFastMallocNew):
     15        * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
     16        (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable):
     17
    1182021-04-06  Philippe Normand  <pnormand@igalia.com>
    219
  • trunk/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp

    r272646 r275511  
    154154{
    155155    GST_TRACE("Fetching buffers from adapters");
    156     auto locker = holdLock(m_adapterMutex);
     156    auto locker = tryHoldLock(m_adapterMutex);
     157    if (!locker)
     158        return;
    157159    for (auto& it : m_adapters)
    158160        copyGStreamerBuffersToAudioChannel(it.value.get(), bus, it.key - 1, framesToProcess);
  • trunk/Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp

    r254087 r275511  
    4545    alignment |= gst_memory_alignment;
    4646    ASSERT(!((alignment + 1) & alignment));
     47
     48    // GStreamer's allocator requires heap allocations.
     49    DisableMallocRestrictionsForCurrentThreadScope disableMallocRestrictions;
    4750
    4851    gsize headerSize = (sizeof(GstMemoryFastMalloc) + alignment) & ~alignment;
  • trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp

    r274787 r275511  
    6565void RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable(const MediaTime&, const PlatformAudioData& audioData, const AudioStreamDescription& streamDescription, size_t /* sampleCount */)
    6666{
     67    DisableMallocRestrictionsForCurrentThreadScope disableMallocRestrictions;
    6768    auto data = static_cast<const GStreamerAudioData&>(audioData);
    6869    auto desc = static_cast<const GStreamerAudioStreamDescription&>(streamDescription);
Note: See TracChangeset for help on using the changeset viewer.