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

Changeset 243404 in webkit


Ignore:
Timestamp:
Mar 22, 2019, 3:54:50 PM (7 years ago)
Author:
eric.carlson@apple.com
Message:

Flaky AVEncoderBitRateKey symbol not found crash on imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
https://bugs.webkit.org/show_bug.cgi?id=193724
<rdar://problem/47483831>

Reviewed by Jer Noble.

The soft link macros occasionally fail to load constants from AVFoundation.framework
which are actually in one of its sub-frameworks. While we investigate the cause
cause of the failure, ise the SOFT_LINK_CONSTANT_MAY_FAIL so we can detect the failure
and return a local copy of the string instead of crashing.

No new tests, this should prevent existing tests from crashing.

  • platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:

(WebCore::myAVFormatIDKey):
(WebCore::myAVNumberOfChannelsKey):
(WebCore::myAVSampleRateKey):
(WebCore::myAVEncoderBitRateKey):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r243402 r243404  
     12019-03-22  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Flaky AVEncoderBitRateKey symbol not found crash on imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
     4        https://bugs.webkit.org/show_bug.cgi?id=193724
     5        <rdar://problem/47483831>
     6
     7        Reviewed by Jer Noble.
     8
     9        The soft link macros occasionally fail to load constants from AVFoundation.framework
     10        which are actually in one of its sub-frameworks. While we investigate the cause
     11        cause of the failure, ise the SOFT_LINK_CONSTANT_MAY_FAIL so we can detect the failure
     12        and return a local copy of the string instead of crashing.
     13       
     14        No new tests, this should prevent existing tests from crashing.
     15
     16        * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
     17        (WebCore::myAVFormatIDKey):
     18        (WebCore::myAVNumberOfChannelsKey):
     19        (WebCore::myAVSampleRateKey):
     20        (WebCore::myAVEncoderBitRateKey):
     21
    1222019-03-22  Youenn Fablet  <youenn@apple.com>
    223
  • trunk/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm

    r240437 r243404  
    5353SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeVideo, NSString *)
    5454SOFT_LINK_CONSTANT(AVFoundation, AVMediaTypeAudio, NSString *)
    55 SOFT_LINK_CONSTANT(AVFoundation, AVEncoderBitRateKey, NSString *)
    56 SOFT_LINK_CONSTANT(AVFoundation, AVFormatIDKey, NSString *)
    57 SOFT_LINK_CONSTANT(AVFoundation, AVNumberOfChannelsKey, NSString *)
    58 SOFT_LINK_CONSTANT(AVFoundation, AVSampleRateKey, NSString *)
    5955
    6056SOFT_LINK_CONSTANT(AVFoundation, AVVideoExpectedSourceFrameRateKey, NSString *)
     
    7268#define AVVideoWidthKey getAVVideoWidthKey()
    7369#define AVVideoHeightKey getAVVideoHeightKey()
    74 #define AVEncoderBitRateKey getAVEncoderBitRateKey()
    75 #define AVFormatIDKey getAVFormatIDKey()
    76 #define AVNumberOfChannelsKey getAVNumberOfChannelsKey()
    77 #define AVSampleRateKey getAVSampleRateKey()
    7870
    7971#define AVVideoExpectedSourceFrameRateKey getAVVideoExpectedSourceFrameRateKey()
     
    8476#define AVVideoCompressionPropertiesKey getAVVideoCompressionPropertiesKey()
    8577
     78SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVEncoderBitRateKey, NSString *)
     79SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVFormatIDKey, NSString *)
     80SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVNumberOfChannelsKey, NSString *)
     81SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVSampleRateKey, NSString *)
     82
     83#define AVEncoderBitRateKey getAVEncoderBitRateKeyWithFallback()
     84#define AVFormatIDKey getAVFormatIDKeyWithFallback()
     85#define AVNumberOfChannelsKey getAVNumberOfChannelsKeyWithFallback()
     86#define AVSampleRateKey getAVSampleRateKeyWithFallback()
     87
    8688namespace WebCore {
    8789
    8890using namespace PAL;
     91
     92static NSString *getAVFormatIDKeyWithFallback()
     93{
     94    if (canLoadAVFormatIDKey())
     95        return getAVFormatIDKey();
     96
     97    RELEASE_LOG_ERROR(Media, "Failed to load AVFormatIDKey");
     98    return @"AVFormatIDKey";
     99}
     100
     101static NSString *getAVNumberOfChannelsKeyWithFallback()
     102{
     103    if (canLoadAVNumberOfChannelsKey())
     104        return getAVNumberOfChannelsKey();
     105
     106    RELEASE_LOG_ERROR(Media, "Failed to load AVNumberOfChannelsKey");
     107    return @"AVNumberOfChannelsKey";
     108}
     109
     110static NSString *getAVSampleRateKeyWithFallback()
     111{
     112    if (canLoadAVSampleRateKey())
     113        return getAVSampleRateKey();
     114
     115    RELEASE_LOG_ERROR(Media, "Failed to load AVSampleRateKey");
     116    return @"AVSampleRateKey";
     117}
     118
     119static NSString *getAVEncoderBitRateKeyWithFallback()
     120{
     121    if (canLoadAVEncoderBitRateKey())
     122        return getAVEncoderBitRateKey();
     123
     124    RELEASE_LOG_ERROR(Media, "Failed to load AVEncoderBitRateKey");
     125    return @"AVEncoderBitRateKey";
     126}
    89127
    90128RefPtr<MediaRecorderPrivateWriter> MediaRecorderPrivateWriter::create(const MediaStreamTrackPrivate* audioTrack, const MediaStreamTrackPrivate* videoTrack)
Note: See TracChangeset for help on using the changeset viewer.