Title: [240701] trunk/Source/WebCore
Revision
240701
Author
[email protected]
Date
2019-01-29 18:03:39 -0800 (Tue, 29 Jan 2019)

Log Message

[MSE] add more source buffer logging
https://bugs.webkit.org/show_bug.cgi?id=193995
<rdar://problem/47650399>

Reviewed by Jon Lee.

No new tests, no functional change.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::resetParserState):
(WebCore::SourceBufferPrivateAVFObjC::setReadyState):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::willSeek):
(WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240700 => 240701)


--- trunk/Source/WebCore/ChangeLog	2019-01-30 02:01:21 UTC (rev 240700)
+++ trunk/Source/WebCore/ChangeLog	2019-01-30 02:03:39 UTC (rev 240701)
@@ -1,3 +1,21 @@
+2019-01-29  Eric Carlson  <[email protected]>
+
+        [MSE] add more source buffer logging
+        https://bugs.webkit.org/show_bug.cgi?id=193995
+        <rdar://problem/47650399>
+
+        Reviewed by Jon Lee.
+
+        No new tests, no functional change.
+
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
+        (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
+        (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
+        (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
+        (WebCore::SourceBufferPrivateAVFObjC::willSeek):
+        (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
+
 2019-01-29  Simon Fraser  <[email protected]>
 
         Add nodes to the scrolling tree in z-index order.

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (240700 => 240701)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm	2019-01-30 02:01:21 UTC (rev 240700)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm	2019-01-30 02:03:39 UTC (rev 240701)
@@ -756,6 +756,7 @@
 
 void SourceBufferPrivateAVFObjC::resetParserState()
 {
+    LOG(MediaSource, "SourceBufferPrivateAVFObjC::resetParserState(%p)", this);
     m_parserStateWasReset = true;
     m_discardSamplesUntilNextInitializationSegment = true;
 }
@@ -816,6 +817,8 @@
 
 void SourceBufferPrivateAVFObjC::setReadyState(MediaPlayer::ReadyState readyState)
 {
+    LOG(MediaSource, "SourceBufferPrivateAVFObjC::setReadyState(%p) - readyState = %i", this, (int)readyState);
+
     if (m_mediaSource)
         m_mediaSource->player()->setReadyState(readyState);
 }
@@ -838,6 +841,9 @@
 void SourceBufferPrivateAVFObjC::trackDidChangeEnabled(VideoTrackPrivateMediaSourceAVFObjC* track)
 {
     int trackID = track->trackID();
+
+    LOG(MediaSource, "SourceBufferPrivateAVFObjC::trackDidChangeEnabled(%p) - video trackID = %i, selected = %s", this, trackID, track->selected() ? "true" : "false");
+
     if (!track->selected() && m_enabledVideoTrackID == trackID) {
         m_enabledVideoTrackID = -1;
         [m_parser setShouldProvideMediaData:NO forTrackID:trackID];
@@ -862,6 +868,8 @@
 {
     int trackID = track->trackID();
 
+    LOG(MediaSource, "SourceBufferPrivateAVFObjC::trackDidChangeEnabled(%p) - audio trackID = %i, enabled = %s", this, trackID, track->enabled() ? "true" : "false");
+
     if (!track->enabled()) {
         ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
         RetainPtr<AVSampleBufferAudioRenderer> renderer = m_audioRenderers.get(trackID);
@@ -1104,16 +1112,23 @@
         if (m_decompressionSession)
             m_decompressionSession->enqueueSample(platformSample.sample.cmSampleBuffer);
 
-        if (m_displayLayer) {
-            if (m_mediaSource && !m_mediaSource->player()->hasAvailableVideoFrame() && !sample->isNonDisplaying()) {
-                CMSampleBufferRef rawSampleCopy;
-                CMSampleBufferCreateCopy(kCFAllocatorDefault, platformSample.sample.cmSampleBuffer, &rawSampleCopy);
-                auto sampleCopy = adoptCF(rawSampleCopy);
-                CMSetAttachment(sampleCopy.get(), kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed, (__bridge CFDictionaryRef)@{ (__bridge NSString *)kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed : @(YES) }, kCMAttachmentMode_ShouldNotPropagate);
-                [m_displayLayer enqueueSampleBuffer:sampleCopy.get()];
-            } else
-                [m_displayLayer enqueueSampleBuffer:platformSample.sample.cmSampleBuffer];
-        }
+        if (!m_displayLayer)
+            return;
+
+        if (m_mediaSource && !m_mediaSource->player()->hasAvailableVideoFrame() && !sample->isNonDisplaying()) {
+            LOG(MediaSource, "SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset(%p) - adding buffer attachment", this);
+
+            CMSampleBufferRef rawSampleCopy;
+            CMSampleBufferCreateCopy(kCFAllocatorDefault, platformSample.sample.cmSampleBuffer, &rawSampleCopy);
+            auto sampleCopy = adoptCF(rawSampleCopy);
+            CMSetAttachment(sampleCopy.get(), kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed, (__bridge CFDictionaryRef)@{ (__bridge NSString *)kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed : @(YES) }, kCMAttachmentMode_ShouldNotPropagate);
+            [m_displayLayer enqueueSampleBuffer:sampleCopy.get()];
+#if PLATFORM(IOS_FAMILY)
+            m_mediaSource->player()->setHasAvailableVideoFrame(true);
+#endif
+        } else
+            [m_displayLayer enqueueSampleBuffer:platformSample.sample.cmSampleBuffer];
+
     } else {
         auto renderer = m_audioRenderers.get(trackID);
         [renderer enqueueSampleBuffer:platformSample.sample.cmSampleBuffer];
@@ -1161,6 +1176,7 @@
 
 void SourceBufferPrivateAVFObjC::willSeek()
 {
+    LOG(MediaSource, "SourceBufferPrivateAVFObjC::willSeek(%p)", this);
     flush();
 }
 
@@ -1250,6 +1266,8 @@
     if (m_decompressionSession == decompressionSession)
         return;
 
+    LOG(MediaSource, "SourceBufferPrivateAVFObjC::setDecompressionSession(%p)", this);
+
     if (m_decompressionSession) {
         m_decompressionSession->stopRequestingMediaData();
         m_decompressionSession->invalidate();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to