<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[171017] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/171017">171017</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2014-07-11 17:53:44 -0700 (Fri, 11 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[MSE] Separate MediaSource logging into its own log channel
https://bugs.webkit.org/show_bug.cgi?id=134809

Reviewed by Eric Carlson.

Separate out MediaSource logging (which can be quite verbose) into its own log channel,
distinct from the Media log channel. Add some per-sample logging and further sequester that
logging into its own MediaSourceSamples log channel.

Add the MediaSource and MediaSourceSamples channels:
* platform/Logging.h:

Move LOG(Media) -&gt; LOG(MediaSource):
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::MediaSource):
(WebCore::MediaSource::~MediaSource):
(WebCore::MediaSource::setReadyState):
(WebCore::MediaSource::addSourceBuffer):
(WebCore::MediaSource::removeSourceBuffer):
(WebCore::MediaSource::isTypeSupported):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateSeekToTime):
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
(WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::monitorBufferingRate):
(WebCore::SourceBuffer::textTrackAddCues):
(WebCore::SourceBuffer::hasFutureTime):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
(WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
(WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::append):
(WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
(WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
(WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceMediaSourcecpp">trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBuffercpp">trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformLoggingh">trunk/Source/WebCore/platform/Logging.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (171016 => 171017)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-07-11 23:54:55 UTC (rev 171016)
+++ trunk/Source/WebCore/ChangeLog        2014-07-12 00:53:44 UTC (rev 171017)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2014-07-11  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        [MSE] Separate MediaSource logging into its own log channel
+        https://bugs.webkit.org/show_bug.cgi?id=134809
+
+        Reviewed by Eric Carlson.
+
+        Separate out MediaSource logging (which can be quite verbose) into its own log channel,
+        distinct from the Media log channel. Add some per-sample logging and further sequester that
+        logging into its own MediaSourceSamples log channel.
+
+        Add the MediaSource and MediaSourceSamples channels:
+        * platform/Logging.h:
+
+        Move LOG(Media) -&gt; LOG(MediaSource):
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::MediaSource):
+        (WebCore::MediaSource::~MediaSource):
+        (WebCore::MediaSource::setReadyState):
+        (WebCore::MediaSource::addSourceBuffer):
+        (WebCore::MediaSource::removeSourceBuffer):
+        (WebCore::MediaSource::isTypeSupported):
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::sourceBufferPrivateSeekToTime):
+        (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
+        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
+        (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
+        (WebCore::SourceBuffer::provideMediaData):
+        (WebCore::SourceBuffer::monitorBufferingRate):
+        (WebCore::SourceBuffer::textTrackAddCues):
+        (WebCore::SourceBuffer::hasFutureTime):
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
+        (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
+        (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
+        (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
+        (WebCore::SourceBufferPrivateAVFObjC::append):
+        (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
+        (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
+        (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
+        (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
+
</ins><span class="cx"> 2014-07-11  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Phone numbers that span two lines are not detected.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (171016 => 171017)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2014-07-11 23:54:55 UTC (rev 171016)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2014-07-12 00:53:44 UTC (rev 171017)
</span><span class="lines">@@ -79,14 +79,14 @@
</span><span class="cx">     , m_readyState(closedKeyword())
</span><span class="cx">     , m_asyncEventQueue(*this)
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;MediaSource::MediaSource %p&quot;, this);
</del><ins>+    LOG(MediaSource, &quot;MediaSource::MediaSource %p&quot;, this);
</ins><span class="cx">     m_sourceBuffers = SourceBufferList::create(scriptExecutionContext());
</span><span class="cx">     m_activeSourceBuffers = SourceBufferList::create(scriptExecutionContext());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MediaSource::~MediaSource()
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;MediaSource::~MediaSource %p&quot;, this);
</del><ins>+    LOG(MediaSource, &quot;MediaSource::~MediaSource %p&quot;, this);
</ins><span class="cx">     ASSERT(isClosed());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -292,7 +292,7 @@
</span><span class="cx">     ASSERT(state == openKeyword() || state == closedKeyword() || state == endedKeyword());
</span><span class="cx"> 
</span><span class="cx">     AtomicString oldState = readyState();
</span><del>-    LOG(Media, &quot;MediaSource::setReadyState() %p : %s -&gt; %s&quot;, this, oldState.string().ascii().data(), state.string().ascii().data());
</del><ins>+    LOG(MediaSource, &quot;MediaSource::setReadyState() %p : %s -&gt; %s&quot;, this, oldState.string().ascii().data(), state.string().ascii().data());
</ins><span class="cx"> 
</span><span class="cx">     if (state == closedKeyword()) {
</span><span class="cx">         m_private.clear();
</span><span class="lines">@@ -400,7 +400,7 @@
</span><span class="cx"> 
</span><span class="cx"> SourceBuffer* MediaSource::addSourceBuffer(const String&amp; type, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;MediaSource::addSourceBuffer(%s) %p&quot;, type.ascii().data(), this);
</del><ins>+    LOG(MediaSource, &quot;MediaSource::addSourceBuffer(%s) %p&quot;, type.ascii().data(), this);
</ins><span class="cx"> 
</span><span class="cx">     // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type
</span><span class="cx">     // 1. If type is null or an empty then throw an INVALID_ACCESS_ERR exception and
</span><span class="lines">@@ -447,7 +447,7 @@
</span><span class="cx"> 
</span><span class="cx"> void MediaSource::removeSourceBuffer(SourceBuffer* buffer, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;MediaSource::removeSourceBuffer() %p&quot;, this);
</del><ins>+    LOG(MediaSource, &quot;MediaSource::removeSourceBuffer() %p&quot;, this);
</ins><span class="cx">     RefPtr&lt;SourceBuffer&gt; protect(buffer);
</span><span class="cx"> 
</span><span class="cx">     // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-MediaSource-removeSourceBuffer-void-SourceBuffer-sourceBuffer
</span><span class="lines">@@ -602,7 +602,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool MediaSource::isTypeSupported(const String&amp; type)
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;MediaSource::isTypeSupported(%s)&quot;, type.ascii().data());
</del><ins>+    LOG(MediaSource, &quot;MediaSource::isTypeSupported(%s)&quot;, type.ascii().data());
</ins><span class="cx"> 
</span><span class="cx">     // Section 2.2 isTypeSupported() method steps.
</span><span class="cx">     // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#widl-MediaSource-isTypeSupported-boolean-DOMString-type
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (171016 => 171017)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2014-07-11 23:54:55 UTC (rev 171016)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2014-07-12 00:53:44 UTC (rev 171017)
</span><span class="lines">@@ -310,7 +310,7 @@
</span><span class="cx"> 
</span><span class="cx"> void SourceBuffer::sourceBufferPrivateSeekToTime(SourceBufferPrivate*, const MediaTime&amp; time)
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;SourceBuffer::sourceBufferPrivateSeekToTime(%p) - time(%s)&quot;, this, toString(time).utf8().data());
</del><ins>+    LOG(MediaSource, &quot;SourceBuffer::sourceBufferPrivateSeekToTime(%p) - time(%s)&quot;, this, toString(time).utf8().data());
</ins><span class="cx"> 
</span><span class="cx">     for (auto&amp; trackBufferPair : m_trackBufferMap) {
</span><span class="cx">         TrackBuffer&amp; trackBuffer = trackBufferPair.value;
</span><span class="lines">@@ -505,7 +505,7 @@
</span><span class="cx">         const AtomicString&amp; trackID = trackBufferPair.key;
</span><span class="cx"> 
</span><span class="cx">         if (trackBuffer.needsReenqueueing) {
</span><del>-            LOG(Media, &quot;SourceBuffer::sourceBufferPrivateAppendComplete(%p) - reenqueuing at time (%s)&quot;, this, toString(currentMediaTime).utf8().data());
</del><ins>+            LOG(MediaSource, &quot;SourceBuffer::sourceBufferPrivateAppendComplete(%p) - reenqueuing at time (%s)&quot;, this, toString(currentMediaTime).utf8().data());
</ins><span class="cx">             reenqueueMediaForTime(trackBuffer, trackID, currentMediaTime);
</span><span class="cx">         } else
</span><span class="cx">             provideMediaData(trackBuffer, trackID);
</span><span class="lines">@@ -1162,6 +1162,7 @@
</span><span class="cx">                 MediaTime startTime = samplePair.second-&gt;presentationTime();
</span><span class="cx">                 MediaTime endTime = startTime + samplePair.second-&gt;duration() + microsecond;
</span><span class="cx">                 erasedRanges-&gt;add(startTime.toDouble(), endTime.toDouble());
</span><ins>+                LOG(MediaSource, &quot;SourceBuffer::sourceBufferPrivateDidReceiveSample(%p) - removing sample(%s)&quot;, this, toString(*samplePair.second).utf8().data());
</ins><span class="cx">                 trackBuffer.samples.removeSample(samplePair.second.get());
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="lines">@@ -1327,7 +1328,7 @@
</span><span class="cx"> 
</span><span class="cx"> void SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples(SourceBufferPrivate*, AtomicString trackID)
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples(%p)&quot;, this);
</del><ins>+    LOG(MediaSource, &quot;SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples(%p)&quot;, this);
</ins><span class="cx">     auto it = m_trackBufferMap.find(trackID);
</span><span class="cx">     if (it == m_trackBufferMap.end())
</span><span class="cx">         return;
</span><span class="lines">@@ -1358,7 +1359,7 @@
</span><span class="cx">     }
</span><span class="cx">     trackBuffer.decodeQueue.erase(trackBuffer.decodeQueue.begin(), sampleIt);
</span><span class="cx"> 
</span><del>-    LOG(Media, &quot;SourceBuffer::provideMediaData(%p) - Enqueued %u samples&quot;, this, enqueuedSamples);
</del><ins>+    LOG(MediaSource, &quot;SourceBuffer::provideMediaData(%p) - Enqueued %u samples&quot;, this, enqueuedSamples);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBuffer::reenqueueMediaForTime(TrackBuffer&amp; trackBuffer, AtomicString trackID, const MediaTime&amp; time)
</span><span class="lines">@@ -1421,7 +1422,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_averageBufferRate = m_averageBufferRate * (1 - ExponentialMovingAverageCoefficient) + rateSinceLastMonitor * ExponentialMovingAverageCoefficient;
</span><span class="cx"> 
</span><del>-    LOG(Media, &quot;SourceBuffer::monitorBufferingRate(%p) - m_avegareBufferRate: %lf&quot;, this, m_averageBufferRate);
</del><ins>+    LOG(MediaSource, &quot;SourceBuffer::monitorBufferingRate(%p) - m_avegareBufferRate: %lf&quot;, this, m_averageBufferRate);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SourceBuffer::hasCurrentTime() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformLoggingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Logging.h (171016 => 171017)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Logging.h        2014-07-11 23:54:55 UTC (rev 171016)
+++ trunk/Source/WebCore/platform/Logging.h        2014-07-12 00:53:44 UTC (rev 171017)
</span><span class="lines">@@ -54,6 +54,8 @@
</span><span class="cx">     M(LiveConnect) \
</span><span class="cx">     M(Loading) \
</span><span class="cx">     M(Media) \
</span><ins>+    M(MediaSource) \
+    M(MediaSourceSamples) \
</ins><span class="cx">     M(MemoryPressure) \
</span><span class="cx">     M(Network) \
</span><span class="cx">     M(NotYetImplemented) \
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (171016 => 171017)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2014-07-11 23:54:55 UTC (rev 171016)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2014-07-12 00:53:44 UTC (rev 171017)
</span><span class="lines">@@ -568,7 +568,7 @@
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset(AVAsset* asset)
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset(%p)&quot;, this);
</del><ins>+    LOG(MediaSource, &quot;SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset(%p)&quot;, this);
</ins><span class="cx"> 
</span><span class="cx">     m_asset = asset;
</span><span class="cx"> 
</span><span class="lines">@@ -607,7 +607,7 @@
</span><span class="cx"> #if LOG_DISABLED
</span><span class="cx">     UNUSED_PARAM(error);
</span><span class="cx"> #endif
</span><del>-    LOG(Media, &quot;SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError(%p) - error:\&quot;%s\&quot;&quot;, this, String([error description]).utf8().data());
</del><ins>+    LOG(MediaSource, &quot;SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError(%p) - error:\&quot;%s\&quot;&quot;, this, String([error description]).utf8().data());
</ins><span class="cx"> 
</span><span class="cx">     m_parsingSucceeded = false;
</span><span class="cx"> }
</span><span class="lines">@@ -631,15 +631,20 @@
</span><span class="cx">         CMFormatDescriptionRef formatDescription = CMSampleBufferGetFormatDescription(sampleBuffer);
</span><span class="cx">         FloatSize formatSize = FloatSize(CMVideoFormatDescriptionGetPresentationDimensions(formatDescription, true, true));
</span><span class="cx">         if (formatSize != m_cachedSize) {
</span><del>-            LOG(Media, &quot;SourceBufferPrivateAVFObjC::processCodedFrame(%p) - size change detected: {width=%lf, height=%lf&quot;, formatSize.width(), formatSize.height());
</del><ins>+            LOG(MediaSource, &quot;SourceBufferPrivateAVFObjC::processCodedFrame(%p) - size change detected: {width=%lf, height=%lf&quot;, formatSize.width(), formatSize.height());
</ins><span class="cx">             m_cachedSize = formatSize;
</span><span class="cx">             if (m_mediaSource)
</span><span class="cx">                 m_mediaSource-&gt;player()-&gt;sizeChanged();
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if (m_client)
-        m_client-&gt;sourceBufferPrivateDidReceiveSample(this, MediaSampleAVFObjC::create(sampleBuffer, trackID));
</del><span class="cx"> 
</span><ins>+
+    if (m_client) {
+        RefPtr&lt;MediaSample&gt; mediaSample = MediaSampleAVFObjC::create(sampleBuffer, trackID);
+        LOG(MediaSourceSamples, &quot;SourceBufferPrivateAVFObjC::processCodedFrame(%p) - sample(%s)&quot;, this, toString(*mediaSample).utf8().data());
+        m_client-&gt;sourceBufferPrivateDidReceiveSample(this, mediaSample.release());
+    }
+
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -657,7 +662,7 @@
</span><span class="cx"> 
</span><span class="cx">     UNUSED_PARAM(trackID);
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA_V2)
</span><del>-    LOG(Media, &quot;SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID(%p) - track:%d&quot;, this, trackID);
</del><ins>+    LOG(MediaSource, &quot;SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID(%p) - track:%d&quot;, this, trackID);
</ins><span class="cx">     m_protectedTrackID = trackID;
</span><span class="cx">     RefPtr&lt;Uint8Array&gt; initDataArray = Uint8Array::create([initData length]);
</span><span class="cx">     [initData getBytes:initDataArray-&gt;data() length:initDataArray-&gt;length()];
</span><span class="lines">@@ -684,7 +689,7 @@
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateAVFObjC::append(const unsigned char* data, unsigned length)
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;SourceBufferPrivateAVFObjC::append(%p) - data:%p, length:%d&quot;, this, data, length);
</del><ins>+    LOG(MediaSource, &quot;SourceBufferPrivateAVFObjC::append(%p) - data:%p, length:%d&quot;, this, data, length);
</ins><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;NSData&gt; nsData = adoptNS([[NSData alloc] initWithBytes:data length:length]);
</span><span class="cx">     WeakPtr&lt;SourceBufferPrivateAVFObjC&gt; weakThis = createWeakPtr();
</span><span class="lines">@@ -860,7 +865,7 @@
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateAVFObjC::layerDidReceiveError(AVSampleBufferDisplayLayer *layer, NSError *error)
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;SourceBufferPrivateAVFObjC::layerDidReceiveError(%p): layer(%p), error(%@)&quot;, this, layer, [error description]);
</del><ins>+    LOG(MediaSource, &quot;SourceBufferPrivateAVFObjC::layerDidReceiveError(%p): layer(%p), error(%@)&quot;, this, layer, [error description]);
</ins><span class="cx">     for (auto&amp; client : m_errorClients)
</span><span class="cx">         client-&gt;layerDidReceiveError(layer, error);
</span><span class="cx"> 
</span><span class="lines">@@ -872,7 +877,7 @@
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateAVFObjC::rendererDidReceiveError(AVSampleBufferAudioRenderer *renderer, NSError *error)
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;SourceBufferPrivateAVFObjC::rendererDidReceiveError(%p): renderer(%p), error(%@)&quot;, this, renderer, [error description]);
</del><ins>+    LOG(MediaSource, &quot;SourceBufferPrivateAVFObjC::rendererDidReceiveError(%p): renderer(%p), error(%@)&quot;, this, renderer, [error description]);
</ins><span class="cx">     for (auto&amp; client : m_errorClients)
</span><span class="cx">         client-&gt;rendererDidReceiveError(renderer, error);
</span><span class="cx"> }
</span><span class="lines">@@ -896,7 +901,7 @@
</span><span class="cx"> void SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples(Vector&lt;RefPtr&lt;MediaSample&gt;&gt; mediaSamples, AtomicString trackIDString)
</span><span class="cx"> {
</span><span class="cx">     int trackID = trackIDString.toInt();
</span><del>-    LOG(Media, &quot;SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples(%p) samples: %d samples, trackId: %d&quot;, this, mediaSamples.size(), trackID);
</del><ins>+    LOG(MediaSource, &quot;SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples(%p) samples: %d samples, trackId: %d&quot;, this, mediaSamples.size(), trackID);
</ins><span class="cx"> 
</span><span class="cx">     if (trackID == m_enabledVideoTrackID)
</span><span class="cx">         flushAndEnqueueNonDisplayingSamples(mediaSamples, m_displayLayer.get());
</span><span class="lines">@@ -927,6 +932,8 @@
</span><span class="cx">     for (auto it = mediaSamples.begin(), end = mediaSamples.end(); it != end; ++it) {
</span><span class="cx">         RefPtr&lt;MediaSample&gt;&amp; mediaSample = *it;
</span><span class="cx"> 
</span><ins>+        LOG(MediaSourceSamples, &quot;SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples(%p) - sample(%s)&quot;, this, toString(*mediaSample).utf8().data());
+
</ins><span class="cx">         PlatformSample platformSample = mediaSample-&gt;platformSample();
</span><span class="cx">         ASSERT(platformSample.type == PlatformSample::CMSampleBufferType);
</span><span class="cx"> 
</span><span class="lines">@@ -951,6 +958,8 @@
</span><span class="cx">     if (platformSample.type != PlatformSample::CMSampleBufferType)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    LOG(MediaSourceSamples, &quot;SourceBufferPrivateAVFObjC::enqueueSample(%p) - sample(%s)&quot;, this, toString(*mediaSample).utf8().data());
+
</ins><span class="cx">     if (trackID == m_enabledVideoTrackID) {
</span><span class="cx">         [m_displayLayer enqueueSampleBuffer:platformSample.sample.cmSampleBuffer];
</span><span class="cx">         if (m_mediaSource)
</span></span></pre>
</div>
</div>

</body>
</html>