<!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>[161612] 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/161612">161612</a></dd>
<dt>Author</dt> <dd>jer.noble@apple.com</dd>
<dt>Date</dt> <dd>2014-01-09 17:49:21 -0800 (Thu, 09 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[MSE][Mac] Report the intrinsic size of the media element
https://bugs.webkit.org/show_bug.cgi?id=125156

Reviewed by Eric Carlson.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize): Pass to MediaSourcePrivateAVFObjC.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeChanged): Added; Pass to MediaPlayer.
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::naturalSize): Return the union of the naturalSizes of all active buffers.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): Notify the media player that the size changed.
(WebCore::SourceBufferPrivateAVFObjC::naturalSize): Return the size of the selected video track.
* platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp.
(WebCore::VideoTrackPrivateMediaSourceAVFObjC::assetTrack): Made const.
(WebCore::VideoTrackPrivateMediaSourceAVFObjC::naturalSize): Return the size of the AVAssetTrack.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateMediaSourceAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateMediaSourceAVFObjCcpp">trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161611 => 161612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-10 01:45:16 UTC (rev 161611)
+++ trunk/Source/WebCore/ChangeLog        2014-01-10 01:49:21 UTC (rev 161612)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2014-01-08  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+        [MSE][Mac] Report the intrinsic size of the media element
+        https://bugs.webkit.org/show_bug.cgi?id=125156
+
+        Reviewed by Eric Carlson.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize): Pass to MediaSourcePrivateAVFObjC.
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeChanged): Added; Pass to MediaPlayer.
+        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
+        (WebCore::MediaSourcePrivateAVFObjC::naturalSize): Return the union of the naturalSizes of all active buffers.
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): Notify the media player that the size changed.
+        (WebCore::SourceBufferPrivateAVFObjC::naturalSize): Return the size of the selected video track.
+        * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
+        * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp.
+        (WebCore::VideoTrackPrivateMediaSourceAVFObjC::assetTrack): Made const.
+        (WebCore::VideoTrackPrivateMediaSourceAVFObjC::naturalSize): Return the size of the AVAssetTrack.
+
</ins><span class="cx"> 2014-01-09  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed Windows build fix for r161563.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (161611 => 161612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-10 01:45:16 UTC (rev 161611)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-10 01:49:21 UTC (rev 161612)
</span><span class="lines">@@ -5472,7 +5472,7 @@
</span><span class="cx">                 CD82030D1395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD8203091395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm */; };
</span><span class="cx">                 CD8203101395ACE700F956C6 /* WebWindowAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CD8203111395ACE700F956C6 /* WebWindowAnimation.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */; };
</span><del>-                CD8B5A42180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.cpp */; };
</del><ins>+                CD8B5A42180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm */; };
</ins><span class="cx">                 CD8B5A43180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A41180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h */; };
</span><span class="cx">                 CD8B5A46180DFF4E008B8E65 /* VideoTrackMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A45180DFF4E008B8E65 /* VideoTrackMediaSource.h */; };
</span><span class="cx">                 CD8B5A49180E138B008B8E65 /* TextTrackMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A48180E138B008B8E65 /* TextTrackMediaSource.h */; };
</span><span class="lines">@@ -12697,7 +12697,7 @@
</span><span class="cx">                 CD8203091395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenHUDWindowController.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebWindowAnimation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebWindowAnimation.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VideoTrackPrivateMediaSourceAVFObjC.cpp; path = objc/VideoTrackPrivateMediaSourceAVFObjC.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = VideoTrackPrivateMediaSourceAVFObjC.mm; path = objc/VideoTrackPrivateMediaSourceAVFObjC.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CD8B5A41180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VideoTrackPrivateMediaSourceAVFObjC.h; path = objc/VideoTrackPrivateMediaSourceAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD8B5A44180DD8D6008B8E65 /* VideoTrackMediaSource.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = VideoTrackMediaSource.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD8B5A45180DFF4E008B8E65 /* VideoTrackMediaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackMediaSource.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -20952,7 +20952,7 @@
</span><span class="cx">                                 CDC8B5A818047FF10016E685 /* SourceBufferPrivateAVFObjC.mm */,
</span><span class="cx">                                 CD336F6517FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.cpp */,
</span><span class="cx">                                 CD336F6617FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.h */,
</span><del>-                                CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.cpp */,
</del><ins>+                                CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm */,
</ins><span class="cx">                                 CD8B5A41180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h */,
</span><span class="cx">                                 CD7E05201651A84100C1201F /* WebCoreAVFResourceLoader.h */,
</span><span class="cx">                                 CD7E05211651A84100C1201F /* WebCoreAVFResourceLoader.mm */,
</span><span class="lines">@@ -26877,7 +26877,7 @@
</span><span class="cx">                                 07969DB917D14151007FF842 /* JSRTCPeerConnection.cpp in Sources */,
</span><span class="cx">                                 E0FEF372B27C53EAC1C1FBEE /* EventSource.cpp in Sources */,
</span><span class="cx">                                 E12EDBEA0B308E0B002704B6 /* EventTarget.cpp in Sources */,
</span><del>-                                CD8B5A42180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.cpp in Sources */,
</del><ins>+                                CD8B5A42180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm in Sources */,
</ins><span class="cx">                                 BC60D8F20D2A11E000B9918F /* ExceptionBase.cpp in Sources */,
</span><span class="cx">                                 973DC63F145A9409002842C2 /* ExceptionCodeDescription.cpp in Sources */,
</span><span class="cx">                                 A7CACDB113CE875C00BBBE3F /* ExceptionCodePlaceholder.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h (161611 => 161612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h        2014-01-10 01:45:16 UTC (rev 161611)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h        2014-01-10 01:49:21 UTC (rev 161612)
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx">     void durationChanged();
</span><span class="cx"> 
</span><span class="cx">     void effectiveRateChanged();
</span><ins>+    void sizeChanged();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     // MediaPlayerPrivateInterface
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (161611 => 161612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2014-01-10 01:45:16 UTC (rev 161611)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2014-01-10 01:49:21 UTC (rev 161612)
</span><span class="lines">@@ -303,8 +303,7 @@
</span><span class="cx"> 
</span><span class="cx"> IntSize MediaPlayerPrivateMediaSourceAVFObjC::naturalSize() const
</span><span class="cx"> {
</span><del>-    // FIXME(125156): Report the intrinsic size of the enabled video track.
-    return IntSize();
</del><ins>+    return m_mediaSourcePrivate-&gt;naturalSize();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MediaPlayerPrivateMediaSourceAVFObjC::hasVideo() const
</span><span class="lines">@@ -520,6 +519,11 @@
</span><span class="cx">     m_player-&gt;rateChanged();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MediaPlayerPrivateMediaSourceAVFObjC::sizeChanged()
+{
+    m_player-&gt;sizeChanged();
+}
+
</ins><span class="cx"> void MediaPlayerPrivateMediaSourceAVFObjC::setReadyState(MediaPlayer::ReadyState readyState)
</span><span class="cx"> {
</span><span class="cx">     if (m_readyState == readyState)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h (161611 => 161612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h        2014-01-10 01:45:16 UTC (rev 161611)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h        2014-01-10 01:49:21 UTC (rev 161612)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx">     bool hasVideo() const;
</span><span class="cx"> 
</span><span class="cx">     MediaTime seekToTime(MediaTime, MediaTime negativeThreshold, MediaTime positiveThreshold);
</span><ins>+    IntSize naturalSize() const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     MediaSourcePrivateAVFObjC(MediaPlayerPrivateMediaSourceAVFObjC*);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSourcePrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm (161611 => 161612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm        2014-01-10 01:45:16 UTC (rev 161611)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm        2014-01-10 01:49:21 UTC (rev 161612)
</span><span class="lines">@@ -174,6 +174,16 @@
</span><span class="cx">     return seekTime;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntSize MediaSourcePrivateAVFObjC::naturalSize() const
+{
+    IntSize result;
+
+    for (auto* sourceBuffer : m_activeSourceBuffers)
+        result = result.expandedTo(sourceBuffer-&gt;naturalSize());
+
+    return result;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> #endif // ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h (161611 => 161612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h        2014-01-10 01:45:16 UTC (rev 161611)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h        2014-01-10 01:49:21 UTC (rev 161612)
</span><span class="lines">@@ -79,6 +79,7 @@
</span><span class="cx"> 
</span><span class="cx">     void seekToTime(MediaTime);
</span><span class="cx">     MediaTime fastSeekTimeForMediaTime(MediaTime, MediaTime negativeThreshold, MediaTime positiveThreshold);
</span><ins>+    IntSize naturalSize();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     explicit SourceBufferPrivateAVFObjC(MediaSourcePrivateAVFObjC*);
</span><span class="lines">@@ -104,8 +105,8 @@
</span><span class="cx">     void didBecomeReadyForMoreSamples(int trackID);
</span><span class="cx">     void destroyRenderers();
</span><span class="cx"> 
</span><del>-    Vector&lt;RefPtr&lt;VideoTrackPrivate&gt;&gt; m_videoTracks;
-    Vector&lt;RefPtr&lt;AudioTrackPrivate&gt;&gt; m_audioTracks;
</del><ins>+    Vector&lt;RefPtr&lt;VideoTrackPrivateMediaSourceAVFObjC&gt;&gt; m_videoTracks;
+    Vector&lt;RefPtr&lt;AudioTrackPrivateMediaSourceAVFObjC&gt;&gt; m_audioTracks;
</ins><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;AVStreamDataParser&gt; m_parser;
</span><span class="cx">     RetainPtr&lt;AVAsset&gt; m_asset;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (161611 => 161612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2014-01-10 01:45:16 UTC (rev 161611)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2014-01-10 01:49:21 UTC (rev 161612)
</span><span class="lines">@@ -319,18 +319,25 @@
</span><span class="cx"> 
</span><span class="cx">     m_asset = asset;
</span><span class="cx"> 
</span><ins>+    m_videoTracks.clear();
+    m_audioTracks.clear();
+
</ins><span class="cx">     SourceBufferPrivateClient::InitializationSegment segment;
</span><span class="cx">     segment.duration = toMediaTime([m_asset duration]);
</span><span class="cx"> 
</span><span class="cx">     for (AVAssetTrack* track in [m_asset tracks]) {
</span><span class="cx">         if ([track hasMediaCharacteristic:AVMediaCharacteristicVisual]) {
</span><span class="cx">             SourceBufferPrivateClient::InitializationSegment::VideoTrackInformation info;
</span><del>-            info.track = VideoTrackPrivateMediaSourceAVFObjC::create(track, this);
</del><ins>+            RefPtr&lt;VideoTrackPrivateMediaSourceAVFObjC&gt; videoTrack = VideoTrackPrivateMediaSourceAVFObjC::create(track, this);
+            info.track = videoTrack;
+            m_videoTracks.append(videoTrack);
</ins><span class="cx">             info.description = MediaDescriptionAVFObjC::create(track);
</span><span class="cx">             segment.videoTracks.append(info);
</span><span class="cx">         } else if ([track hasMediaCharacteristic:AVMediaCharacteristicAudible]) {
</span><span class="cx">             SourceBufferPrivateClient::InitializationSegment::AudioTrackInformation info;
</span><del>-            info.track = AudioTrackPrivateMediaSourceAVFObjC::create(track, this);
</del><ins>+            RefPtr&lt;AudioTrackPrivateMediaSourceAVFObjC&gt; audioTrack = AudioTrackPrivateMediaSourceAVFObjC::create(track, this);
+            info.track = audioTrack;
+            m_audioTracks.append(audioTrack);
</ins><span class="cx">             info.description = MediaDescriptionAVFObjC::create(track);
</span><span class="cx">             segment.audioTracks.append(info);
</span><span class="cx">         }
</span><span class="lines">@@ -338,6 +345,9 @@
</span><span class="cx">         // FIXME(125161): Add TextTrack support
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (!m_videoTracks.isEmpty())
+        m_mediaSource-&gt;player()-&gt;sizeChanged();
+
</ins><span class="cx">     if (m_client)
</span><span class="cx">         m_client-&gt;sourceBufferPrivateDidReceiveInitializationSegment(this, segment);
</span><span class="cx"> }
</span><span class="lines">@@ -633,6 +643,16 @@
</span><span class="cx">         m_client-&gt;sourceBufferPrivateSeekToTime(this, time);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IntSize SourceBufferPrivateAVFObjC::naturalSize()
+{
+    for (auto videoTrack : m_videoTracks) {
+        if (videoTrack-&gt;selected())
+            return videoTrack-&gt;naturalSize();
+    }
+
+    return IntSize();
+}
+
</ins><span class="cx"> void SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples(int trackID)
</span><span class="cx"> {
</span><span class="cx">     if (trackID == m_enabledVideoTrackID)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateMediaSourceAVFObjCcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp (161611 => 161612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp        2014-01-10 01:45:16 UTC (rev 161611)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp        2014-01-10 01:49:21 UTC (rev 161612)
</span><span class="lines">@@ -1,83 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include &quot;config.h&quot;
-#include &quot;VideoTrackPrivateMediaSourceAVFObjC.h&quot;
-
-#if ENABLE(MEDIA_SOURCE) &amp;&amp; ENABLE(VIDEO_TRACK)
-
-#include &quot;AVTrackPrivateAVFObjCImpl.h&quot;
-#include &quot;SourceBufferPrivateAVFObjC.h&quot;
-
-namespace WebCore {
-
-VideoTrackPrivateMediaSourceAVFObjC::VideoTrackPrivateMediaSourceAVFObjC(AVAssetTrack* track, SourceBufferPrivateAVFObjC* parent)
-    : m_impl(std::make_unique&lt;AVTrackPrivateAVFObjCImpl&gt;(track))
-    , m_parent(parent)
-    , m_trackID(-1)
-    , m_selected(false)
-{
-    resetPropertiesFromTrack();
-}
-
-void VideoTrackPrivateMediaSourceAVFObjC::resetPropertiesFromTrack()
-{
-    m_trackID = m_impl-&gt;trackID();
-
-    setKind(m_impl-&gt;videoKind());
-    setId(m_impl-&gt;id());
-    setLabel(m_impl-&gt;label());
-    setLanguage(m_impl-&gt;language());
-}
-
-void VideoTrackPrivateMediaSourceAVFObjC::setAssetTrack(AVAssetTrack *track)
-{
-    m_impl = std::make_unique&lt;AVTrackPrivateAVFObjCImpl&gt;(track);
-    resetPropertiesFromTrack();
-}
-
-AVAssetTrack* VideoTrackPrivateMediaSourceAVFObjC::assetTrack()
-{
-    return m_impl-&gt;assetTrack();
-}
-
-
-bool VideoTrackPrivateMediaSourceAVFObjC::selected() const
-{
-    return m_selected;
-}
-
-void VideoTrackPrivateMediaSourceAVFObjC::setSelected(bool selected)
-{
-    if (m_selected == selected)
-        return;
-
-    m_selected = selected;
-    m_parent-&gt;trackDidChangeEnabled(this);
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateMediaSourceAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h (161611 => 161612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h        2014-01-10 01:45:16 UTC (rev 161611)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h        2014-01-10 01:49:21 UTC (rev 161612)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef VideoTrackPrivateMediaSourceAVFObjC_h
</span><span class="cx"> #define VideoTrackPrivateMediaSourceAVFObjC_h
</span><span class="cx"> 
</span><ins>+#include &quot;IntSize.h&quot;
</ins><span class="cx"> #include &quot;VideoTrackPrivateAVF.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE) &amp;&amp; ENABLE(VIDEO_TRACK)
</span><span class="lines">@@ -50,10 +51,12 @@
</span><span class="cx">     virtual void setSelected(bool) OVERRIDE;
</span><span class="cx"> 
</span><span class="cx">     void setAssetTrack(AVAssetTrack*);
</span><del>-    AVAssetTrack* assetTrack();
</del><ins>+    AVAssetTrack* assetTrack() const;
</ins><span class="cx"> 
</span><span class="cx">     int trackID() { return m_trackID; }
</span><span class="cx"> 
</span><ins>+    IntSize naturalSize() const;
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit VideoTrackPrivateMediaSourceAVFObjC(AVAssetTrack*, SourceBufferPrivateAVFObjC* parent);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateMediaSourceAVFObjCmmfromrev161611trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateMediaSourceAVFObjCcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm (from rev 161611, trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.cpp) (0 => 161612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm        2014-01-10 01:49:21 UTC (rev 161612)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+#import &quot;VideoTrackPrivateMediaSourceAVFObjC.h&quot;
+
+#if ENABLE(MEDIA_SOURCE) &amp;&amp; ENABLE(VIDEO_TRACK)
+
+#import &quot;AVTrackPrivateAVFObjCImpl.h&quot;
+#import &quot;SourceBufferPrivateAVFObjC.h&quot;
+#import &lt;AVFoundation/AVAssetTrack.h&gt;
+
+namespace WebCore {
+
+VideoTrackPrivateMediaSourceAVFObjC::VideoTrackPrivateMediaSourceAVFObjC(AVAssetTrack* track, SourceBufferPrivateAVFObjC* parent)
+    : m_impl(std::make_unique&lt;AVTrackPrivateAVFObjCImpl&gt;(track))
+    , m_parent(parent)
+    , m_trackID(-1)
+    , m_selected(false)
+{
+    resetPropertiesFromTrack();
+}
+
+void VideoTrackPrivateMediaSourceAVFObjC::resetPropertiesFromTrack()
+{
+    m_trackID = m_impl-&gt;trackID();
+
+    setKind(m_impl-&gt;videoKind());
+    setId(m_impl-&gt;id());
+    setLabel(m_impl-&gt;label());
+    setLanguage(m_impl-&gt;language());
+}
+
+void VideoTrackPrivateMediaSourceAVFObjC::setAssetTrack(AVAssetTrack *track)
+{
+    m_impl = std::make_unique&lt;AVTrackPrivateAVFObjCImpl&gt;(track);
+    resetPropertiesFromTrack();
+}
+
+AVAssetTrack* VideoTrackPrivateMediaSourceAVFObjC::assetTrack() const
+{
+    return m_impl-&gt;assetTrack();
+}
+
+
+bool VideoTrackPrivateMediaSourceAVFObjC::selected() const
+{
+    return m_selected;
+}
+
+void VideoTrackPrivateMediaSourceAVFObjC::setSelected(bool selected)
+{
+    if (m_selected == selected)
+        return;
+
+    m_selected = selected;
+    m_parent-&gt;trackDidChangeEnabled(this);
+}
+
+IntSize VideoTrackPrivateMediaSourceAVFObjC::naturalSize() const
+{
+    return IntSize([assetTrack() naturalSize]);
+}
+
+}
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>