Changeset 247133 in webkit


Ignore:
Timestamp:
Jul 3, 2019 8:23:39 PM (5 years ago)
Author:
eric.carlson@apple.com
Message:

[MSE] Add more debug and error logging
https://bugs.webkit.org/show_bug.cgi?id=199473
<rdar://problem/52615882>

Reviewed by Jer Noble.

  • Modules/mediasource/SourceBuffer.cpp:

(WebCore::SourceBuffer::provideMediaData): Log if we don't enqueue every buffer.

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:

(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): Log if we return
without starting playback.

  • platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:

(WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Log if
prerollDecodeWithCompletionHandler fails.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247129 r247133  
     12019-07-03  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [MSE] Add more debug and error logging
     4        https://bugs.webkit.org/show_bug.cgi?id=199473
     5        <rdar://problem/52615882>
     6
     7        Reviewed by Jer Noble.
     8
     9        * Modules/mediasource/SourceBuffer.cpp:
     10        (WebCore::SourceBuffer::provideMediaData): Log if we don't enqueue every buffer.
     11
     12        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
     13        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): Log if we return
     14        without starting playback.
     15
     16        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
     17        (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Log if
     18        prerollDecodeWithCompletionHandler fails.
     19
    1202019-07-03  Simon Fraser  <simon.fraser@apple.com>
    221
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp

    r246490 r247133  
    20182018    while (!trackBuffer.decodeQueue.empty()) {
    20192019        if (!m_private->isReadyForMoreSamples(trackID)) {
     2020            DEBUG_LOG(LOGIDENTIFIER, "bailing early, track id ", trackID, " is not ready for more data");
    20202021            m_private->notifyClientWhenReadyForMoreSamples(trackID);
    20212022            break;
     
    20372038        if (trackBuffer.lastEnqueuedDecodeKey.first.isValid()
    20382039            && trackBuffer.lastEnqueuedDecodeDuration.isValid()
    2039             && sample->decodeTime() - trackBuffer.lastEnqueuedDecodeKey.first > oneSecond + trackBuffer.lastEnqueuedDecodeDuration)
     2040            && sample->decodeTime() - trackBuffer.lastEnqueuedDecodeKey.first > oneSecond + trackBuffer.lastEnqueuedDecodeDuration) {
     2041
     2042        DEBUG_LOG(LOGIDENTIFIER, "bailing early because of unbuffered gap, new sample: ", sample->decodeTime(), ", last enqueued sample ends: ", trackBuffer.lastEnqueuedDecodeKey.first + trackBuffer.lastEnqueuedDecodeDuration);
    20402043            break;
     2044        }
    20412045
    20422046        // Remove the sample from the decode queue now.
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm

    r247113 r247133  
    297297void MediaPlayerPrivateMediaSourceAVFObjC::playInternal()
    298298{
    299     if (currentMediaTime() >= m_mediaSourcePrivate->duration())
    300         return;
     299    if (currentMediaTime() >= m_mediaSourcePrivate->duration()) {
     300        ALWAYS_LOG(LOGIDENTIFIER, "bailing, current time: ", currentMediaTime(), " greater than duration ", m_mediaSourcePrivate->duration());
     301        return;
     302    }
    301303
    302304    ALWAYS_LOG(LOGIDENTIFIER);
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm

    r246490 r247133  
    10991099        return;
    11001100
    1101     DEBUG_LOG(LOGIDENTIFIER, "track ID = ", trackID, ", sample = ", sample.get());
     1101    auto logSiteIdentifier = LOGIDENTIFIER;
     1102    DEBUG_LOG(logSiteIdentifier, "track ID = ", trackID, ", sample = ", sample.get());
    11021103
    11031104    if (trackID == m_enabledVideoTrackID) {
     
    11051106        FloatSize formatSize = FloatSize(CMVideoFormatDescriptionGetPresentationDimensions(formatDescription, true, true));
    11061107        if (!m_cachedSize || formatSize != m_cachedSize.value()) {
    1107             DEBUG_LOG(LOGIDENTIFIER, "size changed to ", formatSize);
     1108            DEBUG_LOG(logSiteIdentifier, "size changed to ", formatSize);
    11081109            bool sizeWasNull = !m_cachedSize;
    11091110            m_cachedSize = formatSize;
     
    11231124
    11241125        if (m_mediaSource && !m_mediaSource->player()->hasAvailableVideoFrame() && !sample->isNonDisplaying()) {
    1125             DEBUG_LOG(LOGIDENTIFIER, "adding buffer attachment");
     1126            DEBUG_LOG(logSiteIdentifier, "adding buffer attachment");
    11261127
    11271128            bool havePrerollDecodeWithCompletionHandler = [PAL::getAVSampleBufferDisplayLayerClass() instancesRespondToSelector:@selector(prerollDecodeWithCompletionHandler:)];
     
    11371138#endif
    11381139            } else {
     1140
    11391141                [m_displayLayer enqueueSampleBuffer:platformSample.sample.cmSampleBuffer];
    1140                 [m_displayLayer prerollDecodeWithCompletionHandler:[weakThis = makeWeakPtr(*this)] (BOOL success) mutable {
    1141                     if (!success || !weakThis)
     1142                [m_displayLayer prerollDecodeWithCompletionHandler:[this, logSiteIdentifier, weakThis = makeWeakPtr(*this)] (BOOL success) mutable {
     1143                    if (!weakThis)
    11421144                        return;
     1145
     1146                    if (!success) {
     1147                        ERROR_LOG(logSiteIdentifier, "prerollDecodeWithCompletionHandler failed");
     1148                        return;
     1149                    }
    11431150
    11441151                    callOnMainThread([weakThis = WTFMove(weakThis)] () mutable {
Note: See TracChangeset for help on using the changeset viewer.