<!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>[150524] 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/150524">150524</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-05-22 11:30:55 -0700 (Wed, 22 May 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GStreamer] Allow multiple log levels in media player
https://bugs.webkit.org/show_bug.cgi?id=116618

Patch by Lori Anderson &lt;lori@rkymtnhi.com&gt; on 2013-05-22
Reviewed by Philippe Normand.

No new tests, just changing logging.

* platform/graphics/gstreamer/GStreamerUtilities.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):
(WebCore::MediaPlayerPrivateGStreamer::pause):
(WebCore::MediaPlayerPrivateGStreamer::seek):
(WebCore::MediaPlayerPrivateGStreamer::setRate):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerGStreamerUtilitiesh">trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (150523 => 150524)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-05-22 18:13:32 UTC (rev 150523)
+++ trunk/Source/WebCore/ChangeLog        2013-05-22 18:30:55 UTC (rev 150524)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2013-05-22  Lori Anderson  &lt;lori@rkymtnhi.com&gt;
+
+        [GStreamer] Allow multiple log levels in media player
+        https://bugs.webkit.org/show_bug.cgi?id=116618
+
+        Reviewed by Philippe Normand.
+
+        No new tests, just changing logging.
+
+        * platform/graphics/gstreamer/GStreamerUtilities.h:
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::load):
+        (WebCore::MediaPlayerPrivateGStreamer::pause):
+        (WebCore::MediaPlayerPrivateGStreamer::seek):
+        (WebCore::MediaPlayerPrivateGStreamer::setRate):
+        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
+
</ins><span class="cx"> 2013-05-22  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         The LayoutMilestones didLayout callback sometimes fires with a milestone value of 0
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerGStreamerUtilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h (150523 => 150524)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h        2013-05-22 18:13:32 UTC (rev 150523)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h        2013-05-22 18:30:55 UTC (rev 150524)
</span><span class="lines">@@ -20,6 +20,14 @@
</span><span class="cx">     GST_DEBUG(__VA_ARGS__); \
</span><span class="cx">     LOG_VERBOSE(Media, __VA_ARGS__); } while (0)
</span><span class="cx"> 
</span><ins>+#define ERROR_MEDIA_MESSAGE(...) do { \
+    GST_ERROR(__VA_ARGS__); \
+    LOG_VERBOSE(Media, __VA_ARGS__); } while (0)
+
+#define INFO_MEDIA_MESSAGE(...) do { \
+    GST_INFO(__VA_ARGS__); \
+    LOG_VERBOSE(Media, __VA_ARGS__); } while (0)
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> bool initializeGStreamer();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (150523 => 150524)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2013-05-22 18:13:32 UTC (rev 150523)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2013-05-22 18:30:55 UTC (rev 150524)
</span><span class="lines">@@ -298,7 +298,7 @@
</span><span class="cx">     m_url = KURL(KURL(), cleanUrl);
</span><span class="cx">     g_object_set(m_playBin.get(), &quot;uri&quot;, cleanUrl.utf8().data(), NULL);
</span><span class="cx"> 
</span><del>-    LOG_MEDIA_MESSAGE(&quot;Load %s&quot;, cleanUrl.utf8().data());
</del><ins>+    INFO_MEDIA_MESSAGE(&quot;Load %s&quot;, cleanUrl.utf8().data());
</ins><span class="cx"> 
</span><span class="cx">     if (m_preload == MediaPlayer::None) {
</span><span class="cx">         LOG_MEDIA_MESSAGE(&quot;Delaying load.&quot;);
</span><span class="lines">@@ -417,7 +417,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (changePipelineState(GST_STATE_PAUSED))
</span><del>-        LOG_MEDIA_MESSAGE(&quot;Pause&quot;);
</del><ins>+        INFO_MEDIA_MESSAGE(&quot;Pause&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> float MediaPlayerPrivateGStreamer::duration() const
</span><span class="lines">@@ -485,7 +485,7 @@
</span><span class="cx">     if (m_errorOccured)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    LOG_MEDIA_MESSAGE(&quot;[Seek] seek attempt to %f secs&quot;, time);
</del><ins>+    INFO_MEDIA_MESSAGE(&quot;[Seek] seek attempt to %f secs&quot;, time);
</ins><span class="cx"> 
</span><span class="cx">     // Avoid useless seeking.
</span><span class="cx">     if (time == currentTime())
</span><span class="lines">@@ -495,7 +495,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     GstClockTime clockTime = toGstClockTime(time);
</span><del>-    LOG_MEDIA_MESSAGE(&quot;[Seek] seeking to %&quot; GST_TIME_FORMAT &quot; (%f)&quot;, GST_TIME_ARGS(clockTime), time);
</del><ins>+    INFO_MEDIA_MESSAGE(&quot;[Seek] seeking to %&quot; GST_TIME_FORMAT &quot; (%f)&quot;, GST_TIME_ARGS(clockTime), time);
</ins><span class="cx"> 
</span><span class="cx">     if (m_seeking) {
</span><span class="cx">         if (m_seekIsPending) {
</span><span class="lines">@@ -619,7 +619,7 @@
</span><span class="cx">     gint64 start, end;
</span><span class="cx">     bool mute = false;
</span><span class="cx"> 
</span><del>-    LOG_MEDIA_MESSAGE(&quot;Set Rate to %f&quot;, rate);
</del><ins>+    INFO_MEDIA_MESSAGE(&quot;Set Rate to %f&quot;, rate);
</ins><span class="cx">     if (rate &gt; 0) {
</span><span class="cx">         // Mute the sound if the playback rate is too extreme and
</span><span class="cx">         // audio pitch is not adjusted.
</span><span class="lines">@@ -638,12 +638,12 @@
</span><span class="cx">             end = currentPosition;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    LOG_MEDIA_MESSAGE(&quot;Need to mute audio: %d&quot;, (int) mute);
</del><ins>+    INFO_MEDIA_MESSAGE(&quot;Need to mute audio?: %d&quot;, (int) mute);
</ins><span class="cx"> 
</span><span class="cx">     if (!gst_element_seek(m_playBin.get(), rate, GST_FORMAT_TIME, flags,
</span><span class="cx">                           GST_SEEK_TYPE_SET, start,
</span><span class="cx">                           GST_SEEK_TYPE_SET, end))
</span><del>-        LOG_MEDIA_MESSAGE(&quot;Set rate to %f failed&quot;, rate);
</del><ins>+        ERROR_MEDIA_MESSAGE(&quot;Set rate to %f failed&quot;, rate);
</ins><span class="cx">     else
</span><span class="cx">         g_object_set(m_playBin.get(), &quot;mute&quot;, mute, NULL);
</span><span class="cx"> }
</span><span class="lines">@@ -727,7 +727,7 @@
</span><span class="cx">         if (m_missingPlugins)
</span><span class="cx">             break;
</span><span class="cx">         gst_message_parse_error(message, &amp;err.outPtr(), &amp;debug.outPtr());
</span><del>-        LOG_MEDIA_MESSAGE(&quot;Error %d: %s (url=%s)&quot;, err-&gt;code, err-&gt;message, m_url.string().utf8().data());
</del><ins>+        ERROR_MEDIA_MESSAGE(&quot;Error %d: %s (url=%s)&quot;, err-&gt;code, err-&gt;message, m_url.string().utf8().data());
</ins><span class="cx"> 
</span><span class="cx">         GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(m_playBin.get()), GST_DEBUG_GRAPH_SHOW_ALL, &quot;webkit-video.error&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -743,7 +743,7 @@
</span><span class="cx">             // this case the HTMLMediaElement will emit a stalled
</span><span class="cx">             // event.
</span><span class="cx">             if (err-&gt;code == GST_STREAM_ERROR_TYPE_NOT_FOUND) {
</span><del>-                LOG_MEDIA_MESSAGE(&quot;Decode error, let the Media element emit a stalled event.&quot;);
</del><ins>+                ERROR_MEDIA_MESSAGE(&quot;Decode error, let the Media element emit a stalled event.&quot;);
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">             error = MediaPlayer::DecodeError;
</span><span class="lines">@@ -793,7 +793,7 @@
</span><span class="cx">         gst_element_get_state(m_playBin.get(), &amp;currentState, NULL, 250);
</span><span class="cx">         if (requestedState &lt; currentState) {
</span><span class="cx">             GOwnPtr&lt;gchar&gt; elementName(gst_element_get_name(GST_ELEMENT(message)));
</span><del>-            LOG_MEDIA_MESSAGE(&quot;Element %s requested state change to %s&quot;, elementName.get(),
</del><ins>+            INFO_MEDIA_MESSAGE(&quot;Element %s requested state change to %s&quot;, elementName.get(),
</ins><span class="cx">                 gst_element_state_get_name(requestedState));
</span><span class="cx">             m_requestedState = requestedState;
</span><span class="cx">             changePipelineState(requestedState);
</span><span class="lines">@@ -961,7 +961,7 @@
</span><span class="cx"> #else
</span><span class="cx">     if (gst_element_query_duration(m_source.get(), &amp;fmt, &amp;length)) {
</span><span class="cx"> #endif
</span><del>-        LOG_MEDIA_MESSAGE(&quot;totalBytes %&quot; G_GINT64_FORMAT, length);
</del><ins>+        INFO_MEDIA_MESSAGE(&quot;totalBytes %&quot; G_GINT64_FORMAT, length);
</ins><span class="cx">         m_totalBytes = static_cast&lt;unsigned&gt;(length);
</span><span class="cx">         m_isStreaming = !length;
</span><span class="cx">         return m_totalBytes;
</span><span class="lines">@@ -1011,7 +1011,7 @@
</span><span class="cx"> 
</span><span class="cx">     gst_iterator_free(iter);
</span><span class="cx"> 
</span><del>-    LOG_MEDIA_MESSAGE(&quot;totalBytes %&quot; G_GINT64_FORMAT, length);
</del><ins>+    INFO_MEDIA_MESSAGE(&quot;totalBytes %&quot; G_GINT64_FORMAT, length);
</ins><span class="cx">     m_totalBytes = static_cast&lt;unsigned&gt;(length);
</span><span class="cx">     m_isStreaming = !length;
</span><span class="cx">     return m_totalBytes;
</span><span class="lines">@@ -1313,7 +1313,7 @@
</span><span class="cx"> 
</span><span class="cx">         RefPtr&lt;SecurityOrigin&gt; securityOrigin = SecurityOrigin::create(m_url);
</span><span class="cx">         if (securityOrigin-&gt;canRequest(newUrl)) {
</span><del>-            LOG_MEDIA_MESSAGE(&quot;New media url: %s&quot;, newUrl.string().utf8().data());
</del><ins>+            INFO_MEDIA_MESSAGE(&quot;New media url: %s&quot;, newUrl.string().utf8().data());
</ins><span class="cx"> 
</span><span class="cx">             // Reset player states.
</span><span class="cx">             m_networkState = MediaPlayer::Loading;
</span><span class="lines">@@ -1335,7 +1335,7 @@
</span><span class="cx">                 return true;
</span><span class="cx">             }
</span><span class="cx">         } else
</span><del>-            LOG_MEDIA_MESSAGE(&quot;Not allowed to load new media location: %s&quot;, newUrl.string().utf8().data());
</del><ins>+            INFO_MEDIA_MESSAGE(&quot;Not allowed to load new media location: %s&quot;, newUrl.string().utf8().data());
</ins><span class="cx">     }
</span><span class="cx">     m_mediaLocationCurrentIndex--;
</span><span class="cx">     return false;
</span></span></pre>
</div>
</div>

</body>
</html>