<!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>[165476] trunk</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/165476">165476</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2014-03-12 10:02:06 -0700 (Wed, 12 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[Win] Remove use of QTSDK
https://bugs.webkit.org/show_bug.cgi?id=130049
Reviewed by Darin Adler.
Source/WebCore:
Media testing already covers this functionality.
* WebCore.vcxproj/WebCore.vcxproj: Remove QuickTime files.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* platform/graphics/MediaPlayer.h: Remove QuickTime and Chromium
media references.
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp: Removed.
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h: Removed.
* platform/graphics/win/QTCFDictionary.cpp: Removed.
* platform/graphics/win/QTCFDictionary.h: Removed.
* platform/graphics/win/QTDecompressionSession.cpp: Removed.
* platform/graphics/win/QTDecompressionSession.h: Removed.
* platform/graphics/win/QTMovie.cpp: Removed.
* platform/graphics/win/QTMovie.h: Removed.
* platform/graphics/win/QTMovieGWorld.cpp: Removed.
* platform/graphics/win/QTMovieGWorld.h: Removed.
* platform/graphics/win/QTMovieTask.cpp: Removed.
* platform/graphics/win/QTMovieTask.h: Removed.
* platform/graphics/win/QTMovieVisualContext.cpp: Removed.
* platform/graphics/win/QTMovieVisualContext.h: Removed.
* platform/graphics/win/QTMovieWinTimer.cpp: Removed.
* platform/graphics/win/QTMovieWinTimer.h: Removed.
* platform/graphics/win/QTPixelBuffer.cpp: Removed.
* platform/graphics/win/QTPixelBuffer.h: Removed.
* platform/graphics/win/QTTrack.cpp: Removed.
* platform/graphics/win/QTTrack.h: Removed.
* plugins/win/PluginDatabaseWin.cpp:
(WebCore::PluginDatabase::defaultPluginDirectories): Don't look
for the QuickTime plugin anymore.
Tools:
* DumpRenderTree/win/DumpRenderTree.cpp:
(initialize): Remove QuickTime code.
* win/AssembleBuildLogs/AssembleLogs.cmd: Don't grab logs from
building QTMovieWin.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCorepluginswinPluginDatabaseWincpp">trunk/Source/WebCore/plugins/win/PluginDatabaseWin.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreewinDumpRenderTreecpp">trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp</a></li>
<li><a href="#trunkToolswinAssembleBuildLogsAssembleLogscmd">trunk/Tools/win/AssembleBuildLogs/AssembleLogs.cmd</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicswinMediaPlayerPrivateQuickTimeVisualContextcpp">trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinMediaPlayerPrivateQuickTimeVisualContexth">trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTCFDictionarycpp">trunk/Source/WebCore/platform/graphics/win/QTCFDictionary.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTCFDictionaryh">trunk/Source/WebCore/platform/graphics/win/QTCFDictionary.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTDecompressionSessioncpp">trunk/Source/WebCore/platform/graphics/win/QTDecompressionSession.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTDecompressionSessionh">trunk/Source/WebCore/platform/graphics/win/QTDecompressionSession.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTMoviecpp">trunk/Source/WebCore/platform/graphics/win/QTMovie.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTMovieh">trunk/Source/WebCore/platform/graphics/win/QTMovie.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTMovieGWorldcpp">trunk/Source/WebCore/platform/graphics/win/QTMovieGWorld.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTMovieGWorldh">trunk/Source/WebCore/platform/graphics/win/QTMovieGWorld.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTMovieTaskcpp">trunk/Source/WebCore/platform/graphics/win/QTMovieTask.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTMovieTaskh">trunk/Source/WebCore/platform/graphics/win/QTMovieTask.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTMovieVisualContextcpp">trunk/Source/WebCore/platform/graphics/win/QTMovieVisualContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTMovieVisualContexth">trunk/Source/WebCore/platform/graphics/win/QTMovieVisualContext.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTMovieWinTimercpp">trunk/Source/WebCore/platform/graphics/win/QTMovieWinTimer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTMovieWinTimerh">trunk/Source/WebCore/platform/graphics/win/QTMovieWinTimer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTPixelBuffercpp">trunk/Source/WebCore/platform/graphics/win/QTPixelBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTPixelBufferh">trunk/Source/WebCore/platform/graphics/win/QTPixelBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTTrackcpp">trunk/Source/WebCore/platform/graphics/win/QTTrack.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinQTTrackh">trunk/Source/WebCore/platform/graphics/win/QTTrack.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/ChangeLog        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2014-03-12 Brent Fulgham <bfulgham@apple.com>
+
+ [Win] Remove use of QTSDK
+ https://bugs.webkit.org/show_bug.cgi?id=130049
+
+ Reviewed by Darin Adler.
+
+ Media testing already covers this functionality.
+
+ * WebCore.vcxproj/WebCore.vcxproj: Remove QuickTime files.
+ * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
+ * platform/graphics/MediaPlayer.h: Remove QuickTime and Chromium
+ media references.
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp: Removed.
+ * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h: Removed.
+ * platform/graphics/win/QTCFDictionary.cpp: Removed.
+ * platform/graphics/win/QTCFDictionary.h: Removed.
+ * platform/graphics/win/QTDecompressionSession.cpp: Removed.
+ * platform/graphics/win/QTDecompressionSession.h: Removed.
+ * platform/graphics/win/QTMovie.cpp: Removed.
+ * platform/graphics/win/QTMovie.h: Removed.
+ * platform/graphics/win/QTMovieGWorld.cpp: Removed.
+ * platform/graphics/win/QTMovieGWorld.h: Removed.
+ * platform/graphics/win/QTMovieTask.cpp: Removed.
+ * platform/graphics/win/QTMovieTask.h: Removed.
+ * platform/graphics/win/QTMovieVisualContext.cpp: Removed.
+ * platform/graphics/win/QTMovieVisualContext.h: Removed.
+ * platform/graphics/win/QTMovieWinTimer.cpp: Removed.
+ * platform/graphics/win/QTMovieWinTimer.h: Removed.
+ * platform/graphics/win/QTPixelBuffer.cpp: Removed.
+ * platform/graphics/win/QTPixelBuffer.h: Removed.
+ * platform/graphics/win/QTTrack.cpp: Removed.
+ * platform/graphics/win/QTTrack.h: Removed.
+ * plugins/win/PluginDatabaseWin.cpp:
+ (WebCore::PluginDatabase::defaultPluginDirectories): Don't look
+ for the QuickTime plugin anymore.
+
</ins><span class="cx"> 2014-03-12 David Kilzer <ddkilzer@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix build after r165472
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -7782,17 +7782,6 @@
</span><span class="cx"> <ClCompile Include="..\platform\graphics\win\IntRectWin.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\win\IntSizeWin.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\win\MediaPlayerPrivateFullscreenWindow.cpp" />
</span><del>- <ClCompile Include="..\platform\graphics\win\MediaPlayerPrivateQuickTimeVisualContext.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
- </ClCompile>
- <ClCompile Include="..\platform\graphics\win\MediaPlayerPrivateTaskTimer.cpp" />
</del><span class="cx"> <ClCompile Include="..\platform\graphics\opentype\OpenTypeUtilities.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\opentype\OpenTypeVerticalData.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\win\SimpleFontDataCairoWin.cpp">
</span><span class="lines">@@ -19124,8 +19113,6 @@
</span><span class="cx"> <ClInclude Include="..\platform\graphics\win\FullScreenControllerClient.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\win\LocalWindowsContext.h" />
</span><span class="cx"> <CustomBuildStep Include="..\platform\graphics\win\MediaPlayerPrivateFullscreenWindow.h" />
</span><del>- <CustomBuildStep Include="..\platform\graphics\win\MediaPlayerPrivateQuickTimeVisualContext.h" />
- <ClInclude Include="..\platform\graphics\win\MediaPlayerPrivateTaskTimer.h" />
</del><span class="cx"> <ClInclude Include="..\platform\graphics\opentype\OpenTypeTypes.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\opentype\OpenTypeUtilities.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\opentype\OpenTypeVerticalData.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1473,12 +1473,6 @@
</span><span class="cx"> <ClCompile Include="..\platform\graphics\win\MediaPlayerPrivateFullscreenWindow.cpp">
</span><span class="cx"> <Filter>platform\graphics\win</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\platform\graphics\win\MediaPlayerPrivateQuickTimeVisualContext.cpp">
- <Filter>platform\graphics\win</Filter>
- </ClCompile>
- <ClCompile Include="..\platform\graphics\win\MediaPlayerPrivateTaskTimer.cpp">
- <Filter>platform\graphics\win</Filter>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\platform\graphics\opentype\OpenTypeUtilities.cpp">
</span><span class="cx"> <Filter>platform\graphics\win</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -8364,9 +8358,6 @@
</span><span class="cx"> <ClInclude Include="..\platform\graphics\win\LocalWindowsContext.h">
</span><span class="cx"> <Filter>platform\graphics\win</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\platform\graphics\win\MediaPlayerPrivateTaskTimer.h">
- <Filter>platform\graphics\win</Filter>
- </ClInclude>
</del><span class="cx"> <ClInclude Include="..\platform\graphics\opentype\OpenTypeTypes.h">
</span><span class="cx"> <Filter>platform\graphics\win</Filter>
</span><span class="cx"> </ClInclude>
</span><span class="lines">@@ -14889,9 +14880,6 @@
</span><span class="cx"> <CustomBuildStep Include="..\platform\graphics\win\MediaPlayerPrivateFullscreenWindow.h">
</span><span class="cx"> <Filter>platform\graphics\win</Filter>
</span><span class="cx"> </CustomBuildStep>
</span><del>- <CustomBuildStep Include="..\platform\graphics\win\MediaPlayerPrivateQuickTimeVisualContext.h">
- <Filter>platform\graphics\win</Filter>
- </CustomBuildStep>
</del><span class="cx"> <CustomBuildStep Include="..\platform\graphics\win\WKCAImageQueue.h">
</span><span class="cx"> <Filter>platform\graphics\win</Filter>
</span><span class="cx"> </CustomBuildStep>
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinMediaPlayerPrivateQuickTimeVisualContextcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,1226 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010, 2011 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 "config.h"
-
-#if ENABLE(VIDEO)
-#include "MediaPlayerPrivateQuickTimeVisualContext.h"
-
-#include "Cookie.h"
-#include "CookieJar.h"
-#include "Document.h"
-#include "DocumentLoader.h"
-#include "Frame.h"
-#include "FrameView.h"
-#include "GraphicsContext.h"
-#include "MediaPlayerPrivateTaskTimer.h"
-#include "Page.h"
-#include "PlatformCALayerWin.h"
-#include "QTCFDictionary.h"
-#include "QTDecompressionSession.h"
-#include "QTMovie.h"
-#include "QTMovieTask.h"
-#include "QTMovieVisualContext.h"
-#include "ScrollView.h"
-#include "Settings.h"
-#include "SoftLinking.h"
-#include "TimeRanges.h"
-#include "Timer.h"
-#include "URL.h"
-#include "WKCAImageQueue.h"
-#include <AssertMacros.h>
-#include <CoreGraphics/CGAffineTransform.h>
-#include <CoreGraphics/CGContext.h>
-#include <QuartzCore/CATransform3D.h>
-#include <Wininet.h>
-#include <wtf/CurrentTime.h>
-#include <wtf/HashSet.h>
-#include <wtf/MainThread.h>
-#include <wtf/MathExtras.h>
-#include <wtf/StdLibExtras.h>
-#include <wtf/text/StringBuilder.h>
-#include <wtf/text/StringHash.h>
-
-using namespace std;
-
-namespace WebCore {
-
-static CGImageRef CreateCGImageFromPixelBuffer(QTPixelBuffer buffer);
-static bool requiredDllsAvailable();
-
-SOFT_LINK_LIBRARY(Wininet)
-SOFT_LINK(Wininet, InternetSetCookieExW, DWORD, WINAPI, (LPCWSTR lpszUrl, LPCWSTR lpszCookieName, LPCWSTR lpszCookieData, DWORD dwFlags, DWORD_PTR dwReserved), (lpszUrl, lpszCookieName, lpszCookieData, dwFlags, dwReserved))
-
-// Interface declaration for MediaPlayerPrivateQuickTimeVisualContext's QTMovieClient aggregate
-class MediaPlayerPrivateQuickTimeVisualContext::MovieClient : public QTMovieClient {
-public:
- MovieClient(MediaPlayerPrivateQuickTimeVisualContext* parent) : m_parent(parent) {}
- virtual ~MovieClient() { m_parent = 0; }
- virtual void movieEnded(QTMovie*);
- virtual void movieLoadStateChanged(QTMovie*);
- virtual void movieTimeChanged(QTMovie*);
-private:
- MediaPlayerPrivateQuickTimeVisualContext* m_parent;
-};
-
-class MediaPlayerPrivateQuickTimeVisualContext::LayerClient : public PlatformCALayerClient {
-public:
- LayerClient(MediaPlayerPrivateQuickTimeVisualContext* parent) : m_parent(parent) {}
- virtual ~LayerClient() { m_parent = 0; }
-
-private:
- virtual void platformCALayerLayoutSublayersOfLayer(PlatformCALayer*);
- virtual bool platformCALayerRespondsToLayoutChanges() const { return true; }
-
- virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) { }
- virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesBottomUp; }
- virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& inClip) { }
- virtual bool platformCALayerShowDebugBorders() const { return false; }
- virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; }
- virtual int platformCALayerIncrementRepaintCount(PlatformCALayer*) { return 0; }
-
- virtual bool platformCALayerContentsOpaque() const { return false; }
- virtual bool platformCALayerDrawsContent() const { return false; }
- virtual void platformCALayerLayerDidDisplay(PlatformLayer*) { }
- virtual float platformCALayerDeviceScaleFactor() const { return 1; }
-
- MediaPlayerPrivateQuickTimeVisualContext* m_parent;
-};
-
-void MediaPlayerPrivateQuickTimeVisualContext::LayerClient::platformCALayerLayoutSublayersOfLayer(PlatformCALayer* layer)
-{
- ASSERT(m_parent);
- ASSERT(m_parent->m_transformLayer == layer);
-
- FloatSize parentSize = layer->bounds().size();
- FloatSize naturalSize = m_parent->naturalSize();
-
- // Calculate the ratio of these two sizes and use that ratio to scale the qtVideoLayer:
- FloatSize ratio(parentSize.width() / naturalSize.width(), parentSize.height() / naturalSize.height());
-
- int videoWidth = 0;
- int videoHeight = 0;
- m_parent->m_movie->getNaturalSize(videoWidth, videoHeight);
- FloatRect videoBounds(0, 0, videoWidth * ratio.width(), videoHeight * ratio.height());
- FloatPoint3D videoAnchor = m_parent->m_qtVideoLayer->anchorPoint();
-
- // Calculate the new position based on the parent's size:
- FloatPoint position(parentSize.width() * 0.5 - videoBounds.width() * (0.5 - videoAnchor.x()),
- parentSize.height() * 0.5 - videoBounds.height() * (0.5 - videoAnchor.y()));
-
- m_parent->m_qtVideoLayer->setBounds(videoBounds);
- m_parent->m_qtVideoLayer->setPosition(position);
-}
-
-class MediaPlayerPrivateQuickTimeVisualContext::VisualContextClient : public QTMovieVisualContextClient {
-public:
- VisualContextClient(MediaPlayerPrivateQuickTimeVisualContext* parent) : m_parent(parent) {}
- virtual ~VisualContextClient() { m_parent = 0; }
- void imageAvailableForTime(const QTCVTimeStamp*);
- static void retrieveCurrentImageProc(void*);
-private:
- MediaPlayerPrivateQuickTimeVisualContext* m_parent;
-};
-
-PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateQuickTimeVisualContext::create(MediaPlayer* player)
-{
- return adoptPtr(new MediaPlayerPrivateQuickTimeVisualContext(player));
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::registerMediaEngine(MediaEngineRegistrar registrar)
-{
- if (isAvailable())
- registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0);
-}
-
-MediaPlayerPrivateQuickTimeVisualContext::MediaPlayerPrivateQuickTimeVisualContext(MediaPlayer* player)
- : m_player(player)
- , m_seekTo(-1)
- , m_seekTimer(this, &MediaPlayerPrivateQuickTimeVisualContext::seekTimerFired)
- , m_visualContextTimer(this, &MediaPlayerPrivateQuickTimeVisualContext::visualContextTimerFired)
- , m_networkState(MediaPlayer::Empty)
- , m_readyState(MediaPlayer::HaveNothing)
- , m_enabledTrackCount(0)
- , m_totalTrackCount(0)
- , m_hasUnsupportedTracks(false)
- , m_startedPlaying(false)
- , m_isStreaming(false)
- , m_visible(false)
- , m_newFrameAvailable(false)
- , m_movieClient(adoptPtr(new MediaPlayerPrivateQuickTimeVisualContext::MovieClient(this)))
- , m_layerClient(adoptPtr(new MediaPlayerPrivateQuickTimeVisualContext::LayerClient(this)))
- , m_movieTransform(CGAffineTransformIdentity)
- , m_visualContextClient(adoptPtr(new MediaPlayerPrivateQuickTimeVisualContext::VisualContextClient(this)))
- , m_delayingLoad(false)
- , m_privateBrowsing(false)
- , m_preload(MediaPlayer::Auto)
- , m_maxTimeLoadedAtLastDidLoadingProgress(0)
-{
-}
-
-MediaPlayerPrivateQuickTimeVisualContext::~MediaPlayerPrivateQuickTimeVisualContext()
-{
- tearDownVideoRendering();
- cancelCallOnMainThread(&VisualContextClient::retrieveCurrentImageProc, this);
-}
-
-bool MediaPlayerPrivateQuickTimeVisualContext::supportsFullscreen() const
-{
- Document* document = m_player->mediaPlayerClient()->mediaPlayerOwningDocument();
- if (document)
- return document->settings()->acceleratedCompositingEnabled();
-
- return false;
-}
-
-PlatformMedia MediaPlayerPrivateQuickTimeVisualContext::platformMedia() const
-{
- PlatformMedia p;
- p.type = PlatformMedia::QTMovieVisualContextType;
- p.media.qtMovieVisualContext = m_visualContext.get();
- return p;
-}
-
-PlatformLayer* MediaPlayerPrivateQuickTimeVisualContext::platformLayer() const
-{
- return m_transformLayer ? m_transformLayer->platformLayer() : 0;
-}
-
-String MediaPlayerPrivateQuickTimeVisualContext::rfc2616DateStringFromTime(CFAbsoluteTime time)
-{
- static const char* const dayStrings[] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
- static const char* const monthStrings[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
- static const CFStringRef dateFormatString = CFSTR("%s, %02d %s %04d %02d:%02d:%02d GMT");
- static CFTimeZoneRef gmtTimeZone;
- if (!gmtTimeZone)
- gmtTimeZone = CFTimeZoneCopyDefault();
-
- CFGregorianDate dateValue = CFAbsoluteTimeGetGregorianDate(time, gmtTimeZone);
- if (!CFGregorianDateIsValid(dateValue, kCFGregorianAllUnits))
- return String();
-
- time = CFGregorianDateGetAbsoluteTime(dateValue, gmtTimeZone);
- SInt32 day = CFAbsoluteTimeGetDayOfWeek(time, 0);
-
- RetainPtr<CFStringRef> dateCFString = adoptCF(CFStringCreateWithFormat(0, 0, dateFormatString, dayStrings[day - 1], dateValue.day,
- monthStrings[dateValue.month - 1], dateValue.year, dateValue.hour, dateValue.minute, (int)dateValue.second));
- return dateCFString.get();
-}
-
-static void addCookieParam(StringBuilder& cookieBuilder, const String& name, const String& value)
-{
- if (name.isEmpty())
- return;
-
- // If this isn't the first parameter added, terminate the previous one.
- if (cookieBuilder.length())
- cookieBuilder.append("; ");
-
- // Add parameter name, and value if there is one.
- cookieBuilder.append(name);
- if (!value.isEmpty()) {
- cookieBuilder.append('=');
- cookieBuilder.append(value);
- }
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::setUpCookiesForQuickTime(const String& url)
-{
- // WebCore loaded the page with the movie URL with CFNetwork but QuickTime will
- // use WinINet to download the movie, so we need to copy any cookies needed to
- // download the movie into WinInet before asking QuickTime to open it.
- Document* document = m_player->mediaPlayerClient()->mediaPlayerOwningDocument();
- Frame* frame = document ? document->frame() : 0;
- if (!frame || !frame->page() || !frame->page()->settings().cookieEnabled())
- return;
-
- URL movieURL = URL(URL(), url);
- Vector<Cookie> documentCookies;
- if (!getRawCookies(frame->document(), movieURL, documentCookies))
- return;
-
- for (size_t ndx = 0; ndx < documentCookies.size(); ndx++) {
- const Cookie& cookie = documentCookies[ndx];
-
- if (cookie.name.isEmpty())
- continue;
-
- // Build up the cookie string with as much information as we can get so WinINet
- // knows what to do with it.
- StringBuilder cookieBuilder;
- addCookieParam(cookieBuilder, cookie.name, cookie.value);
- addCookieParam(cookieBuilder, "path", cookie.path);
- if (cookie.expires)
- addCookieParam(cookieBuilder, "expires", rfc2616DateStringFromTime(cookie.expires));
- if (cookie.httpOnly)
- addCookieParam(cookieBuilder, "httpOnly", String());
- cookieBuilder.append(';');
-
- String cookieURL;
- if (!cookie.domain.isEmpty()) {
- StringBuilder urlBuilder;
-
- urlBuilder.append(movieURL.protocol());
- urlBuilder.append("://");
- if (cookie.domain[0] == '.')
- urlBuilder.append(cookie.domain.substring(1));
- else
- urlBuilder.append(cookie.domain);
- if (cookie.path.length() > 1)
- urlBuilder.append(cookie.path);
-
- cookieURL = urlBuilder.toString();
- } else
- cookieURL = movieURL;
-
- String string = cookieBuilder.toString();
- InternetSetCookieExW(cookieURL.charactersWithNullTermination().data(), 0, string.charactersWithNullTermination().data(), 0, 0);
- }
-}
-
-static void disableComponentsOnce()
-{
- static bool sComponentsDisabled = false;
- if (sComponentsDisabled)
- return;
- sComponentsDisabled = true;
-
- uint32_t componentsToDisable[][5] = {
- {'eat ', 'TEXT', 'text', 0, 0},
- {'eat ', 'TXT ', 'text', 0, 0},
- {'eat ', 'utxt', 'text', 0, 0},
- {'eat ', 'TEXT', 'tx3g', 0, 0},
- };
-
- for (size_t i = 0; i < WTF_ARRAY_LENGTH(componentsToDisable); ++i)
- QTMovie::disableComponent(componentsToDisable[i]);
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::resumeLoad()
-{
- m_delayingLoad = false;
-
- if (!m_movieURL.isEmpty())
- loadInternal(m_movieURL);
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::load(const String& url)
-{
- m_movieURL = url;
-
- if (m_preload == MediaPlayer::None) {
- m_delayingLoad = true;
- return;
- }
-
- loadInternal(url);
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::loadInternal(const String& url)
-{
- if (!QTMovie::initializeQuickTime()) {
- // FIXME: is this the right error to return?
- m_networkState = MediaPlayer::DecodeError;
- m_player->networkStateChanged();
- return;
- }
-
- disableComponentsOnce();
-
- // Initialize the task timer.
- MediaPlayerPrivateTaskTimer::initialize();
-
- if (m_networkState != MediaPlayer::Loading) {
- m_networkState = MediaPlayer::Loading;
- m_player->networkStateChanged();
- }
- if (m_readyState != MediaPlayer::HaveNothing) {
- m_readyState = MediaPlayer::HaveNothing;
- m_player->readyStateChanged();
- }
- cancelSeek();
-
- setUpCookiesForQuickTime(url);
-
- m_movie = adoptRef(new QTMovie(m_movieClient.get()));
-
- m_movie->load(url.characters16(), url.length(), m_player->preservesPitch());
- m_movie->setVolume(m_player->volume());
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::prepareToPlay()
-{
- if (!m_movie || m_delayingLoad)
- resumeLoad();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::play()
-{
- if (!m_movie)
- return;
- m_startedPlaying = true;
-
- m_movie->play();
- m_visualContextTimer.startRepeating(1.0 / 30);
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::pause()
-{
- if (!m_movie)
- return;
- m_startedPlaying = false;
-
- m_movie->pause();
- m_visualContextTimer.stop();
-}
-
-float MediaPlayerPrivateQuickTimeVisualContext::duration() const
-{
- if (!m_movie)
- return 0;
- return m_movie->duration();
-}
-
-float MediaPlayerPrivateQuickTimeVisualContext::currentTime() const
-{
- if (!m_movie)
- return 0;
- return m_movie->currentTime();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::seek(float time)
-{
- cancelSeek();
-
- if (!m_movie)
- return;
-
- if (time > duration())
- time = duration();
-
- m_seekTo = time;
- if (maxTimeLoaded() >= m_seekTo)
- doSeek();
- else
- m_seekTimer.start(0, 0.5f);
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::doSeek()
-{
- float oldRate = m_movie->rate();
- if (oldRate)
- m_movie->setRate(0);
- m_movie->setCurrentTime(m_seekTo);
- float timeAfterSeek = currentTime();
- // restore playback only if not at end, othewise QTMovie will loop
- if (oldRate && timeAfterSeek < duration())
- m_movie->setRate(oldRate);
- cancelSeek();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::cancelSeek()
-{
- m_seekTo = -1;
- m_seekTimer.stop();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::seekTimerFired(Timer<MediaPlayerPrivateQuickTimeVisualContext>*)
-{
- if (!m_movie || !seeking() || currentTime() == m_seekTo) {
- cancelSeek();
- updateStates();
- m_player->timeChanged();
- return;
- }
-
- if (maxTimeLoaded() >= m_seekTo)
- doSeek();
- else {
- MediaPlayer::NetworkState state = networkState();
- if (state == MediaPlayer::Empty || state == MediaPlayer::Loaded) {
- cancelSeek();
- updateStates();
- m_player->timeChanged();
- }
- }
-}
-
-bool MediaPlayerPrivateQuickTimeVisualContext::paused() const
-{
- if (!m_movie)
- return true;
- return (!m_movie->rate());
-}
-
-bool MediaPlayerPrivateQuickTimeVisualContext::seeking() const
-{
- if (!m_movie)
- return false;
- return m_seekTo >= 0;
-}
-
-IntSize MediaPlayerPrivateQuickTimeVisualContext::naturalSize() const
-{
- if (!m_movie)
- return IntSize();
- int width;
- int height;
- m_movie->getNaturalSize(width, height);
- CGSize originalSize = {width, height};
- CGSize transformedSize = CGSizeApplyAffineTransform(originalSize, m_movieTransform);
- return IntSize(abs(transformedSize.width), abs(transformedSize.height));
-}
-
-bool MediaPlayerPrivateQuickTimeVisualContext::hasVideo() const
-{
- if (!m_movie)
- return false;
- return m_movie->hasVideo();
-}
-
-bool MediaPlayerPrivateQuickTimeVisualContext::hasAudio() const
-{
- if (!m_movie)
- return false;
- return m_movie->hasAudio();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::setVolume(float volume)
-{
- if (!m_movie)
- return;
- m_movie->setVolume(volume);
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::setRate(float rate)
-{
- if (!m_movie)
- return;
-
- // Do not call setRate(...) unless we have started playing; otherwise
- // QuickTime's VisualContext can get wedged waiting for a rate change
- // call which will never come.
- if (m_startedPlaying)
- m_movie->setRate(rate);
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::setPreservesPitch(bool preservesPitch)
-{
- if (!m_movie)
- return;
- m_movie->setPreservesPitch(preservesPitch);
-}
-
-bool MediaPlayerPrivateQuickTimeVisualContext::hasClosedCaptions() const
-{
- if (!m_movie)
- return false;
- return m_movie->hasClosedCaptions();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::setClosedCaptionsVisible(bool visible)
-{
- if (!m_movie)
- return;
- m_movie->setClosedCaptionsVisible(visible);
-}
-
-std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateQuickTimeVisualContext::buffered() const
-{
- auto timeRanges = PlatformTimeRanges::create();
-
- float loaded = maxTimeLoaded();
- // rtsp streams are not buffered
- if (!m_isStreaming && loaded > 0)
- timeRanges->add(0, loaded);
- return timeRanges;
-}
-
-float MediaPlayerPrivateQuickTimeVisualContext::maxTimeSeekable() const
-{
- // infinite duration means live stream
- return !std::isfinite(duration()) ? 0 : maxTimeLoaded();
-}
-
-float MediaPlayerPrivateQuickTimeVisualContext::maxTimeLoaded() const
-{
- if (!m_movie)
- return 0;
- return m_movie->maxTimeLoaded();
-}
-
-bool MediaPlayerPrivateQuickTimeVisualContext::didLoadingProgress() const
-{
- if (!m_movie || !duration())
- return false;
- float currentMaxTimeLoaded = maxTimeLoaded();
- bool didLoadingProgress = currentMaxTimeLoaded != m_maxTimeLoadedAtLastDidLoadingProgress;
- m_maxTimeLoadedAtLastDidLoadingProgress = currentMaxTimeLoaded;
- return didLoadingProgress;
-}
-
-unsigned MediaPlayerPrivateQuickTimeVisualContext::totalBytes() const
-{
- if (!m_movie)
- return 0;
- return m_movie->dataSize();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::cancelLoad()
-{
- if (m_networkState < MediaPlayer::Loading || m_networkState == MediaPlayer::Loaded)
- return;
-
- tearDownVideoRendering();
-
- // Cancel the load by destroying the movie.
- m_movie.clear();
-
- updateStates();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::updateStates()
-{
- MediaPlayer::NetworkState oldNetworkState = m_networkState;
- MediaPlayer::ReadyState oldReadyState = m_readyState;
-
- long loadState = m_movie ? m_movie->loadState() : QTMovieLoadStateError;
-
- if (loadState >= QTMovieLoadStateLoaded && m_readyState < MediaPlayer::HaveMetadata) {
- m_movie->disableUnsupportedTracks(m_enabledTrackCount, m_totalTrackCount);
- if (m_player->inMediaDocument()) {
- if (!m_enabledTrackCount || m_enabledTrackCount != m_totalTrackCount) {
- // This is a type of media that we do not handle directly with a <video>
- // element, eg. QuickTime VR, a movie with a sprite track, etc. Tell the
- // MediaPlayerClient that we won't support it.
- sawUnsupportedTracks();
- return;
- }
- } else if (!m_enabledTrackCount)
- loadState = QTMovieLoadStateError;
- }
-
- // "Loaded" is reserved for fully buffered movies, never the case when streaming
- if (loadState >= QTMovieLoadStateComplete && !m_isStreaming) {
- m_networkState = MediaPlayer::Loaded;
- m_readyState = MediaPlayer::HaveEnoughData;
- } else if (loadState >= QTMovieLoadStatePlaythroughOK) {
- m_readyState = MediaPlayer::HaveEnoughData;
- } else if (loadState >= QTMovieLoadStatePlayable) {
- // FIXME: This might not work correctly in streaming case, <rdar://problem/5693967>
- m_readyState = currentTime() < maxTimeLoaded() ? MediaPlayer::HaveFutureData : MediaPlayer::HaveCurrentData;
- } else if (loadState >= QTMovieLoadStateLoaded) {
- m_readyState = MediaPlayer::HaveMetadata;
- } else if (loadState > QTMovieLoadStateError) {
- m_networkState = MediaPlayer::Loading;
- m_readyState = MediaPlayer::HaveNothing;
- } else {
- if (m_player->inMediaDocument()) {
- // Something went wrong in the loading of media within a standalone file.
- // This can occur with chained ref movies that eventually resolve to a
- // file we don't support.
- sawUnsupportedTracks();
- return;
- }
-
- float loaded = maxTimeLoaded();
- if (!loaded)
- m_readyState = MediaPlayer::HaveNothing;
-
- if (!m_enabledTrackCount)
- m_networkState = MediaPlayer::FormatError;
- else {
- // FIXME: We should differentiate between load/network errors and decode errors <rdar://problem/5605692>
- if (loaded > 0)
- m_networkState = MediaPlayer::DecodeError;
- else
- m_readyState = MediaPlayer::HaveNothing;
- }
- }
-
- if (isReadyForRendering() && !hasSetUpVideoRendering())
- setUpVideoRendering();
-
- if (seeking())
- m_readyState = MediaPlayer::HaveNothing;
-
- if (m_networkState != oldNetworkState)
- m_player->networkStateChanged();
- if (m_readyState != oldReadyState)
- m_player->readyStateChanged();
-}
-
-bool MediaPlayerPrivateQuickTimeVisualContext::isReadyForRendering() const
-{
- return m_readyState >= MediaPlayer::HaveMetadata && m_player->visible();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::sawUnsupportedTracks()
-{
- m_movie->setDisabled(true);
- m_hasUnsupportedTracks = true;
- m_player->mediaPlayerClient()->mediaPlayerSawUnsupportedTracks(m_player);
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::didEnd()
-{
- if (m_hasUnsupportedTracks)
- return;
-
- m_startedPlaying = false;
-
- updateStates();
- m_player->timeChanged();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::setSize(const IntSize& size)
-{
- if (m_hasUnsupportedTracks || !m_movie || m_size == size)
- return;
- m_size = size;
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::setVisible(bool visible)
-{
- if (m_hasUnsupportedTracks || !m_movie || m_visible == visible)
- return;
-
- m_visible = visible;
- if (m_visible) {
- if (isReadyForRendering())
- setUpVideoRendering();
- } else
- tearDownVideoRendering();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::paint(GraphicsContext* p, const IntRect& r)
-{
- MediaRenderingMode currentMode = currentRenderingMode();
-
- if (currentMode == MediaRenderingNone)
- return;
-
- if (currentMode == MediaRenderingSoftwareRenderer && !m_visualContext)
- return;
-
- QTPixelBuffer buffer = m_visualContext->imageForTime(0);
- if (buffer.pixelBufferRef()) {
- if (m_qtVideoLayer) {
- // We are probably being asked to render the video into a canvas, but
- // there's a good chance the QTPixelBuffer is not ARGB and thus can't be
- // drawn using CG. If so, fire up an ICMDecompressionSession and convert
- // the current frame into something which can be rendered by CG.
- if (!buffer.pixelFormatIs32ARGB() && !buffer.pixelFormatIs32BGRA()) {
- // The decompression session will only decompress a specific pixelFormat
- // at a specific width and height; if these differ, the session must be
- // recreated with the new parameters.
- if (!m_decompressionSession || !m_decompressionSession->canDecompress(buffer))
- m_decompressionSession = QTDecompressionSession::create(buffer.pixelFormatType(), buffer.width(), buffer.height());
- buffer = m_decompressionSession->decompress(buffer);
- }
- }
-
- CGImageRef image = CreateCGImageFromPixelBuffer(buffer);
-
- CGContextRef context = p->platformContext();
- CGContextSaveGState(context);
- CGContextTranslateCTM(context, r.x(), r.y());
- CGContextTranslateCTM(context, 0, r.height());
- CGContextScaleCTM(context, 1, -1);
- CGContextDrawImage(context, CGRectMake(0, 0, r.width(), r.height()), image);
- CGContextRestoreGState(context);
-
- CGImageRelease(image);
- }
- paintCompleted(*p, r);
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::paintCompleted(GraphicsContext& context, const IntRect& rect)
-{
- m_newFrameAvailable = false;
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::VisualContextClient::retrieveCurrentImageProc(void* refcon)
-{
- static_cast<MediaPlayerPrivateQuickTimeVisualContext*>(refcon)->retrieveCurrentImage();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::VisualContextClient::imageAvailableForTime(const QTCVTimeStamp* timeStamp)
-{
- // This call may come in on another thread, so marshall to the main thread first:
- callOnMainThread(&retrieveCurrentImageProc, m_parent);
-
- // callOnMainThread must be paired with cancelCallOnMainThread in the destructor,
- // in case this object is deleted before the main thread request is handled.
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::visualContextTimerFired(Timer<MediaPlayerPrivateQuickTimeVisualContext>*)
-{
- if (m_visualContext && m_visualContext->isImageAvailableForTime(0))
- retrieveCurrentImage();
-}
-
-static CFDictionaryRef QTCFDictionaryCreateWithDataCallback(CFAllocatorRef allocator, const UInt8* bytes, CFIndex length)
-{
- RetainPtr<CFDataRef> data = adoptCF(CFDataCreateWithBytesNoCopy(allocator, bytes, length, kCFAllocatorNull));
- if (!data)
- return 0;
-
- return reinterpret_cast<CFDictionaryRef>(CFPropertyListCreateFromXMLData(allocator, data.get(), kCFPropertyListImmutable, 0));
-}
-
-static CGImageRef CreateCGImageFromPixelBuffer(QTPixelBuffer buffer)
-{
- CGDataProviderRef provider = 0;
- CGColorSpaceRef colorSpace = 0;
- CGImageRef image = 0;
-
- size_t bitsPerComponent = 0;
- size_t bitsPerPixel = 0;
- CGImageAlphaInfo alphaInfo = kCGImageAlphaNone;
-
- if (buffer.pixelFormatIs32BGRA()) {
- bitsPerComponent = 8;
- bitsPerPixel = 32;
- alphaInfo = (CGImageAlphaInfo)(kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little);
- } else if (buffer.pixelFormatIs32ARGB()) {
- bitsPerComponent = 8;
- bitsPerPixel = 32;
- alphaInfo = (CGImageAlphaInfo)(kCGImageAlphaNoneSkipLast | kCGBitmapByteOrder32Big);
- } else {
- // All other pixel formats are currently unsupported:
- ASSERT_NOT_REACHED();
- }
-
- CGDataProviderDirectAccessCallbacks callbacks = {
- &QTPixelBuffer::dataProviderGetBytePointerCallback,
- &QTPixelBuffer::dataProviderReleaseBytePointerCallback,
- &QTPixelBuffer::dataProviderGetBytesAtPositionCallback,
- &QTPixelBuffer::dataProviderReleaseInfoCallback,
- };
-
- // Colorspace should be device, so that Quartz does not have to do an extra render.
- colorSpace = CGColorSpaceCreateDeviceRGB();
- require(colorSpace, Bail);
-
- provider = CGDataProviderCreateDirectAccess(buffer.pixelBufferRef(), buffer.dataSize(), &callbacks);
- require(provider, Bail);
-
- // CGDataProvider does not retain the buffer, but it will release it later, so do an extra retain here:
- QTPixelBuffer::retainCallback(buffer.pixelBufferRef());
-
- image = CGImageCreate(buffer.width(), buffer.height(), bitsPerComponent, bitsPerPixel, buffer.bytesPerRow(), colorSpace, alphaInfo, provider, 0, false, kCGRenderingIntentDefault);
-
-Bail:
- // Once the image is created we can release our reference to the provider and the colorspace, they are retained by the image
- if (provider)
- CGDataProviderRelease(provider);
- if (colorSpace)
- CGColorSpaceRelease(colorSpace);
-
- return image;
-}
-
-
-void MediaPlayerPrivateQuickTimeVisualContext::retrieveCurrentImage()
-{
- if (!m_visualContext)
- return;
-
- if (m_qtVideoLayer) {
-
- QTPixelBuffer buffer = m_visualContext->imageForTime(0);
- if (!buffer.pixelBufferRef())
- return;
-
- PlatformCALayer* layer = m_qtVideoLayer.get();
-
- if (!buffer.lockBaseAddress()) {
- if (requiredDllsAvailable()) {
- if (!m_imageQueue) {
- m_imageQueue = adoptPtr(new WKCAImageQueue(buffer.width(), buffer.height(), 30));
- m_imageQueue->setFlags(WKCAImageQueue::Fill, WKCAImageQueue::Fill);
- layer->setContents(m_imageQueue->get());
- }
-
- // Debug QuickTime links against a non-Debug version of CoreFoundation, so the
- // CFDictionary attached to the CVPixelBuffer cannot be directly passed on into the
- // CAImageQueue without being converted to a non-Debug CFDictionary. Additionally,
- // old versions of QuickTime used a non-AAS CoreFoundation, so the types are not
- // interchangable even in the release case.
- RetainPtr<CFDictionaryRef> attachments = adoptCF(QTCFDictionaryCreateCopyWithDataCallback(kCFAllocatorDefault, buffer.attachments(), &QTCFDictionaryCreateWithDataCallback));
- CFTimeInterval imageTime = QTMovieVisualContext::currentHostTime();
-
- m_imageQueue->collect();
-
- uint64_t imageId = m_imageQueue->registerPixelBuffer(buffer.baseAddress(), buffer.dataSize(), buffer.bytesPerRow(), buffer.width(), buffer.height(), buffer.pixelFormatType(), attachments.get(), 0);
-
- if (m_imageQueue->insertImage(imageTime, WKCAImageQueue::Buffer, imageId, WKCAImageQueue::Opaque | WKCAImageQueue::Flush, &QTPixelBuffer::imageQueueReleaseCallback, buffer.pixelBufferRef())) {
- // Retain the buffer one extra time so it doesn't dissappear before CAImageQueue decides to release it:
- QTPixelBuffer::retainCallback(buffer.pixelBufferRef());
- }
-
- } else {
- CGImageRef image = CreateCGImageFromPixelBuffer(buffer);
- layer->setContents(image);
- CGImageRelease(image);
- }
-
- buffer.unlockBaseAddress();
- layer->setNeedsCommit();
- }
- } else
- m_player->repaint();
-
- m_visualContext->task();
-}
-
-static HashSet<String> mimeTypeCache()
-{
- DEFINE_STATIC_LOCAL(HashSet<String>, typeCache, ());
- static bool typeListInitialized = false;
-
- if (!typeListInitialized) {
- unsigned count = QTMovie::countSupportedTypes();
- for (unsigned n = 0; n < count; n++) {
- const UChar* character;
- unsigned len;
- QTMovie::getSupportedType(n, character, len);
- if (len)
- typeCache.add(String(character, len));
- }
-
- typeListInitialized = true;
- }
-
- return typeCache;
-}
-
-static CFStringRef createVersionStringFromModuleName(LPCWSTR moduleName)
-{
- HMODULE module = GetModuleHandleW(moduleName);
- if (!module)
- return 0;
-
- wchar_t filePath[MAX_PATH] = {0};
- if (!GetModuleFileNameW(module, filePath, MAX_PATH))
- return 0;
-
- DWORD versionInfoSize = GetFileVersionInfoSizeW(filePath, 0);
- if (!versionInfoSize)
- return 0;
-
- CFStringRef versionString = 0;
- void* versionInfo = calloc(versionInfoSize, sizeof(char));
- if (GetFileVersionInfo(filePath, 0, versionInfoSize, versionInfo)) {
- VS_FIXEDFILEINFO* fileInfo = 0;
- UINT fileInfoLength = 0;
-
- if (VerQueryValueW(versionInfo, L"\\", reinterpret_cast<LPVOID*>(&fileInfo), &fileInfoLength)) {
- versionString = CFStringCreateWithFormat(kCFAllocatorDefault, 0, CFSTR("%d.%d.%d.%d"),
- HIWORD(fileInfo->dwFileVersionMS), LOWORD(fileInfo->dwFileVersionMS),
- HIWORD(fileInfo->dwFileVersionLS), LOWORD(fileInfo->dwFileVersionLS));
- }
- }
- free(versionInfo);
-
- return versionString;
-}
-
-static bool requiredDllsAvailable()
-{
- static bool s_prerequisitesChecked = false;
- static bool s_prerequisitesSatisfied;
- static const CFStringRef kMinQuartzCoreVersion = CFSTR("1.0.42.0");
- static const CFStringRef kMinCoreVideoVersion = CFSTR("1.0.1.0");
-
- if (s_prerequisitesChecked)
- return s_prerequisitesSatisfied;
- s_prerequisitesChecked = true;
- s_prerequisitesSatisfied = false;
-
- CFStringRef quartzCoreString = createVersionStringFromModuleName(L"QuartzCore");
- if (!quartzCoreString)
- quartzCoreString = createVersionStringFromModuleName(L"QuartzCore_debug");
-
- CFStringRef coreVideoString = createVersionStringFromModuleName(L"CoreVideo");
- if (!coreVideoString)
- coreVideoString = createVersionStringFromModuleName(L"CoreVideo_debug");
-
- s_prerequisitesSatisfied = (quartzCoreString && coreVideoString
- && CFStringCompare(quartzCoreString, kMinQuartzCoreVersion, kCFCompareNumerically) != kCFCompareLessThan
- && CFStringCompare(coreVideoString, kMinCoreVideoVersion, kCFCompareNumerically) != kCFCompareLessThan);
-
- if (quartzCoreString)
- CFRelease(quartzCoreString);
- if (coreVideoString)
- CFRelease(coreVideoString);
-
- return s_prerequisitesSatisfied;
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::getSupportedTypes(HashSet<String>& types)
-{
- types = mimeTypeCache();
-}
-
-bool MediaPlayerPrivateQuickTimeVisualContext::isAvailable()
-{
-#ifdef DEBUG_ALL
- return false;
-#else
- return QTMovie::initializeQuickTime();
-#endif
-}
-
-MediaPlayer::SupportsType MediaPlayerPrivateQuickTimeVisualContext::supportsType(const MediaEngineSupportParameters& parameters)
-{
- // only return "IsSupported" if there is no codecs parameter for now as there is no way to ask QT if it supports an
- // extended MIME type
- return mimeTypeCache().contains(parameters.type) ? (parameters.codecs.isEmpty() ? MediaPlayer::MayBeSupported : MediaPlayer::IsSupported) : MediaPlayer::IsNotSupported;
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::MovieClient::movieEnded(QTMovie* movie)
-{
- if (m_parent->m_hasUnsupportedTracks)
- return;
-
- m_parent->m_visualContextTimer.stop();
-
- ASSERT(m_parent->m_movie.get() == movie);
- m_parent->didEnd();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::MovieClient::movieLoadStateChanged(QTMovie* movie)
-{
- if (m_parent->m_hasUnsupportedTracks)
- return;
-
- ASSERT(m_parent->m_movie.get() == movie);
- m_parent->updateStates();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::MovieClient::movieTimeChanged(QTMovie* movie)
-{
- if (m_parent->m_hasUnsupportedTracks)
- return;
-
- ASSERT(m_parent->m_movie.get() == movie);
- m_parent->updateStates();
- m_parent->m_player->timeChanged();
-}
-
-bool MediaPlayerPrivateQuickTimeVisualContext::hasSingleSecurityOrigin() const
-{
- // We tell quicktime to disallow resources that come from different origins
- // so we all media is single origin.
- return true;
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::setPreload(MediaPlayer::Preload preload)
-{
- m_preload = preload;
- if (m_delayingLoad && m_preload != MediaPlayer::None)
- resumeLoad();
-}
-
-float MediaPlayerPrivateQuickTimeVisualContext::mediaTimeForTimeValue(float timeValue) const
-{
- long timeScale;
- if (m_readyState < MediaPlayer::HaveMetadata || !(timeScale = m_movie->timeScale()))
- return timeValue;
-
- long mediaTimeValue = lroundf(timeValue * timeScale);
- return static_cast<float>(mediaTimeValue) / timeScale;
-}
-
-MediaPlayerPrivateQuickTimeVisualContext::MediaRenderingMode MediaPlayerPrivateQuickTimeVisualContext::currentRenderingMode() const
-{
- if (!m_movie)
- return MediaRenderingNone;
-
- if (m_qtVideoLayer)
- return MediaRenderingMovieLayer;
-
- return m_visualContext ? MediaRenderingSoftwareRenderer : MediaRenderingNone;
-}
-
-MediaPlayerPrivateQuickTimeVisualContext::MediaRenderingMode MediaPlayerPrivateQuickTimeVisualContext::preferredRenderingMode() const
-{
- if (!m_player->frameView() || !m_movie)
- return MediaRenderingNone;
-
- if (supportsAcceleratedRendering() && m_player->mediaPlayerClient()->mediaPlayerRenderingCanBeAccelerated(m_player))
- return MediaRenderingMovieLayer;
-
- return MediaRenderingSoftwareRenderer;
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::setUpVideoRendering()
-{
- MediaRenderingMode currentMode = currentRenderingMode();
- MediaRenderingMode preferredMode = preferredRenderingMode();
-
- if (currentMode == preferredMode && currentMode != MediaRenderingNone)
- return;
-
- if (currentMode != MediaRenderingNone)
- tearDownVideoRendering();
-
- if (preferredMode == MediaRenderingMovieLayer)
- createLayerForMovie();
-
- if (currentMode == MediaRenderingMovieLayer || preferredMode == MediaRenderingMovieLayer)
- m_player->mediaPlayerClient()->mediaPlayerRenderingModeChanged(m_player);
-
- QTPixelBuffer::Type contextType = requiredDllsAvailable() && preferredMode == MediaRenderingMovieLayer ? QTPixelBuffer::ConfigureForCAImageQueue : QTPixelBuffer::ConfigureForCGImage;
- m_visualContext = QTMovieVisualContext::create(m_visualContextClient.get(), contextType);
- m_visualContext->setMovie(m_movie.get());
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::tearDownVideoRendering()
-{
- if (m_qtVideoLayer)
- destroyLayerForMovie();
-
- m_visualContext = 0;
-}
-
-bool MediaPlayerPrivateQuickTimeVisualContext::hasSetUpVideoRendering() const
-{
- return m_qtVideoLayer || (currentRenderingMode() != MediaRenderingMovieLayer && m_visualContext);
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::retrieveAndResetMovieTransform()
-{
- // First things first, reset the total movie transform so that
- // we can bail out early:
- m_movieTransform = CGAffineTransformIdentity;
-
- if (!m_movie || !m_movie->hasVideo())
- return;
-
- // This trick will only work on movies with a single video track,
- // so bail out early if the video contains more than one (or zero)
- // video tracks.
- QTTrackArray videoTracks = m_movie->videoTracks();
- if (videoTracks.size() != 1)
- return;
-
- QTTrack* track = videoTracks[0].get();
- ASSERT(track);
-
- CGAffineTransform movieTransform = m_movie->getTransform();
- if (!CGAffineTransformEqualToTransform(movieTransform, CGAffineTransformIdentity))
- m_movie->resetTransform();
-
- CGAffineTransform trackTransform = track->getTransform();
- if (!CGAffineTransformEqualToTransform(trackTransform, CGAffineTransformIdentity))
- track->resetTransform();
-
- // Multiply the two transforms together, taking care to
- // do so in the correct order, track * movie = final:
- m_movieTransform = CGAffineTransformConcat(trackTransform, movieTransform);
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::createLayerForMovie()
-{
- ASSERT(supportsAcceleratedRendering());
-
- if (!m_movie || m_qtVideoLayer)
- return;
-
- // Create a PlatformCALayer which will transform the contents of the video layer
- // which is in m_qtVideoLayer.
- m_transformLayer = PlatformCALayerWin::create(PlatformCALayer::LayerTypeLayer, m_layerClient.get());
- if (!m_transformLayer)
- return;
-
- // Mark the layer as anchored in the top left.
- m_transformLayer->setAnchorPoint(FloatPoint3D());
-
- m_qtVideoLayer = PlatformCALayerWin::create(PlatformCALayer::LayerTypeLayer, 0);
- if (!m_qtVideoLayer)
- return;
-
- if (CGAffineTransformEqualToTransform(m_movieTransform, CGAffineTransformIdentity))
- retrieveAndResetMovieTransform();
- CGAffineTransform t = m_movieTransform;
-
- // Remove the translation portion of the transform, since we will always rotate about
- // the layer's center point. In our limited use-case (a single video track), this is
- // safe:
- t.tx = t.ty = 0;
- m_qtVideoLayer->setTransform(CATransform3DMakeAffineTransform(t));
-
-#ifndef NDEBUG
- m_qtVideoLayer->setName("Video layer");
-#endif
- m_transformLayer->appendSublayer(m_qtVideoLayer.get());
- m_transformLayer->setNeedsLayout();
- // The layer will get hooked up via RenderLayerBacking::updateGraphicsLayerConfiguration().
-
- // Fill the newly created layer with image data, so we're not looking at
- // an empty layer until the next time a new image is available, which could
- // be a long time if we're paused.
- if (m_visualContext)
- retrieveCurrentImage();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::destroyLayerForMovie()
-{
- if (m_qtVideoLayer) {
- m_qtVideoLayer->removeFromSuperlayer();
- m_qtVideoLayer = 0;
- }
-
- if (m_transformLayer)
- m_transformLayer = 0;
-
- if (m_imageQueue)
- m_imageQueue = nullptr;
-}
-
-bool MediaPlayerPrivateQuickTimeVisualContext::supportsAcceleratedRendering() const
-{
- return isReadyForRendering();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::acceleratedRenderingStateChanged()
-{
- // Set up or change the rendering path if necessary.
- setUpVideoRendering();
-}
-
-void MediaPlayerPrivateQuickTimeVisualContext::setPrivateBrowsingMode(bool privateBrowsing)
-{
- m_privateBrowsing = privateBrowsing;
- if (m_movie)
- m_movie->setPrivateBrowsingMode(m_privateBrowsing);
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinMediaPlayerPrivateQuickTimeVisualContexth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,207 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010, 2011 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.
- */
-
-#ifndef MediaPlayerPrivateQuickTimeVisualContext_h
-#define MediaPlayerPrivateQuickTimeVisualContext_h
-
-#if ENABLE(VIDEO)
-
-#include "MediaPlayerPrivate.h"
-#include "Timer.h"
-#include <CoreGraphics/CGAffineTransform.h>
-#include <wtf/Forward.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/RetainPtr.h>
-
-#ifndef DRAW_FRAME_RATE
-#define DRAW_FRAME_RATE 0
-#endif
-
-typedef struct CGImage *CGImageRef;
-class QTMovie;
-class QTMovieVisualContext;
-class QTDecompressionSession;
-
-namespace WebCore {
-
-class GraphicsContext;
-class IntSize;
-class IntRect;
-class PlatformCALayer;
-class WKCAImageQueue;
-
-class MediaPlayerPrivateQuickTimeVisualContext : public MediaPlayerPrivateInterface {
-public:
- static void registerMediaEngine(MediaEngineRegistrar);
-
- ~MediaPlayerPrivateQuickTimeVisualContext();
-
-private:
- MediaPlayerPrivateQuickTimeVisualContext(MediaPlayer*);
-
- virtual bool supportsFullscreen() const;
- virtual PlatformMedia platformMedia() const;
- virtual PlatformLayer* platformLayer() const;
-
- IntSize naturalSize() const;
- bool hasVideo() const;
- bool hasAudio() const;
-
- void load(const String& url);
- void cancelLoad();
- void loadInternal(const String& url);
- void resumeLoad();
-
- void play();
- void pause();
- void prepareToPlay();
-
- bool paused() const;
- bool seeking() const;
-
- float duration() const;
- float currentTime() const;
- void seek(float time);
-
- void setRate(float);
- void setVolume(float);
- void setPreservesPitch(bool);
-
- MediaPlayer::NetworkState networkState() const { return m_networkState; }
- MediaPlayer::ReadyState readyState() const { return m_readyState; }
-
- std::unique_ptr<PlatformTimeRanges> buffered() const;
- float maxTimeSeekable() const;
- bool didLoadingProgress() const;
- unsigned totalBytes() const;
-
- void setVisible(bool);
- void setSize(const IntSize&);
-
- void loadStateChanged();
- void didEnd();
-
- void paint(GraphicsContext*, const IntRect&);
- void paintCompleted(GraphicsContext&, const IntRect&);
-
- bool hasSingleSecurityOrigin() const;
-
- bool hasClosedCaptions() const;
- void setClosedCaptionsVisible(bool);
-
- void setPreload(MediaPlayer::Preload);
-
- void updateStates();
- void doSeek();
- void cancelSeek();
- void seekTimerFired(Timer<MediaPlayerPrivateQuickTimeVisualContext>*);
- float maxTimeLoaded() const;
- void sawUnsupportedTracks();
-
- // engine support
- static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
- static void getSupportedTypes(HashSet<String>& types);
- static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
- static bool isAvailable();
-
- virtual bool supportsAcceleratedRendering() const;
- virtual void acceleratedRenderingStateChanged();
-
- enum MediaRenderingMode { MediaRenderingNone, MediaRenderingSoftwareRenderer, MediaRenderingMovieLayer };
- MediaRenderingMode currentRenderingMode() const;
- MediaRenderingMode preferredRenderingMode() const;
- bool isReadyForRendering() const;
-
- void setUpVideoRendering();
- void tearDownVideoRendering();
- bool hasSetUpVideoRendering() const;
-
- void createLayerForMovie();
- void destroyLayerForMovie();
-
- void setUpCookiesForQuickTime(const String& url);
- String rfc2616DateStringFromTime(CFAbsoluteTime);
-
- void visualContextTimerFired(Timer<MediaPlayerPrivateQuickTimeVisualContext>*);
- void retrieveCurrentImage();
-
- virtual void setPrivateBrowsingMode(bool);
-
- virtual String engineDescription() const { return "QuickTime"; }
-
- class MovieClient;
- friend class MovieClient;
- OwnPtr<MovieClient> m_movieClient;
-
- class LayerClient;
- friend class LayerClient;
- OwnPtr<LayerClient> m_layerClient;
-
- class VisualContextClient;
- friend class VisualContextClient;
- OwnPtr<VisualContextClient> m_visualContextClient;
-
- void retrieveAndResetMovieTransform();
-
- virtual float mediaTimeForTimeValue(float) const;
-
- MediaPlayer* m_player;
- RefPtr<QTMovie> m_movie;
- RefPtr<PlatformCALayer> m_qtVideoLayer;
- RefPtr<PlatformCALayer> m_transformLayer;
- OwnPtr<WKCAImageQueue> m_imageQueue;
- OwnPtr<QTDecompressionSession> m_decompressionSession;
- CGAffineTransform m_movieTransform;
- RefPtr<QTMovieVisualContext> m_visualContext;
- float m_seekTo;
- Timer<MediaPlayerPrivateQuickTimeVisualContext> m_seekTimer;
- Timer<MediaPlayerPrivateQuickTimeVisualContext> m_visualContextTimer;
- IntSize m_size;
- MediaPlayer::NetworkState m_networkState;
- MediaPlayer::ReadyState m_readyState;
- unsigned m_enabledTrackCount;
- unsigned m_totalTrackCount;
- bool m_hasUnsupportedTracks;
- bool m_startedPlaying;
- bool m_isStreaming;
- bool m_visible;
- bool m_newFrameAvailable;
- bool m_delayingLoad;
- String m_movieURL;
- bool m_privateBrowsing;
- MediaPlayer::Preload m_preload;
- mutable float m_maxTimeLoadedAtLastDidLoadingProgress;
-#if DRAW_FRAME_RATE
- double m_frameCountWhilePlaying;
- double m_timeStartedPlaying;
- double m_timeStoppedPlaying;
-#endif
-
-};
-
-}
-
-#endif
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTCFDictionarycpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTCFDictionary.cpp (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTCFDictionary.cpp        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTCFDictionary.cpp        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,61 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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 "config.h"
-
-#include "QTCFDictionary.h"
-
-#include <CFData.h>
-#include <windows.h>
-
-CFDataRef QTCFPropertyListCreateXMLData(CFAllocatorRef allocator, CFPropertyListRef propertyList)
-{
-
- typedef CFDataRef (* pfnCFPropertyListCreateXMLData)(CFAllocatorRef allocator, CFPropertyListRef propertyList);
- static pfnCFPropertyListCreateXMLData pCFPropertyListCreateXMLData = 0;
- if (!pCFPropertyListCreateXMLData) {
- HMODULE qtcfDLL = LoadLibraryW(L"QTCF.dll");
- if (qtcfDLL)
- pCFPropertyListCreateXMLData = reinterpret_cast<pfnCFPropertyListCreateXMLData>(GetProcAddress(qtcfDLL, "QTCF_CFPropertyListCreateXMLData"));
- }
-
- if (pCFPropertyListCreateXMLData)
- return pCFPropertyListCreateXMLData(allocator, propertyList);
- return 0;
-}
-
-CFDictionaryRef QTCFDictionaryCreateCopyWithDataCallback(CFAllocatorRef allocator, CFDictionaryRef dictionary, QTCFDictonaryCreateFromDataCallback callback)
-{
- ASSERT(dictionary);
- ASSERT(callback);
-
- CFDataRef data = QTCFPropertyListCreateXMLData(kCFAllocatorDefault, dictionary);
- if (!data)
- return 0;
- CFDictionaryRef outputDictionary = callback(allocator, CFDataGetBytePtr(data), CFDataGetLength(data));
- CFRelease(data);
-
- return outputDictionary;
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTCFDictionaryh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTCFDictionary.h (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTCFDictionary.h        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTCFDictionary.h        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,44 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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.
- */
-
-#ifndef QTCFDictionary_h
-#define QTCFDictionary_h
-
-#ifdef QTMOVIEWIN_EXPORTS
-#define QTMOVIEWIN_API __declspec(dllexport)
-#else
-#define QTMOVIEWIN_API __declspec(dllimport)
-#endif
-
-#include <CoreFoundation/CFBase.h>
-
-typedef const struct __CFDictionary * CFDictionaryRef;
-typedef const struct __CFAllocator * CFAllocatorRef;
-
-typedef CFDictionaryRef (* QTCFDictonaryCreateFromDataCallback)(CFAllocatorRef, const UInt8*, CFIndex);
-
-QTMOVIEWIN_API CFDictionaryRef QTCFDictionaryCreateCopyWithDataCallback(CFAllocatorRef, CFDictionaryRef, QTCFDictonaryCreateFromDataCallback);
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTDecompressionSessioncpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTDecompressionSession.cpp (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTDecompressionSession.cpp        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTDecompressionSession.cpp        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,170 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 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 "config.h"
-
-#include "QTDecompressionSession.h"
-
-#include <ImageCompression.h>
-#include <algorithm>
-
-class QTDecompressionSessionClient {
-public:
- static void trackingCallback(void *decompressionTrackingRefCon, OSStatus,
- ICMDecompressionTrackingFlags decompressionTrackingFlags, CVPixelBufferRef pixelBuffer,
- TimeValue64, TimeValue64, ICMValidTimeFlags, void *, void *)
- {
- QTDecompressionSession* session = static_cast<QTDecompressionSession*>(decompressionTrackingRefCon);
- ASSERT(session);
-
- if (decompressionTrackingFlags & kICMDecompressionTracking_FrameDecoded)
- session->m_latestFrame = QTPixelBuffer(pixelBuffer);
- }
-};
-
-PassOwnPtr<QTDecompressionSession> QTDecompressionSession::create(unsigned long pixelFormat, size_t width, size_t height)
-{
- return adoptPtr(new QTDecompressionSession(pixelFormat, width, height));
-}
-
-QTDecompressionSession::QTDecompressionSession(unsigned long pixelFormat, size_t width, size_t height)
- : m_session(0)
- , m_pixelFormat(pixelFormat)
- , m_width(width)
- , m_height(height)
-{
- initializeSession();
-}
-
-QTDecompressionSession::~QTDecompressionSession()
-{
- if (m_session)
- ICMDecompressionSessionRelease(m_session);
-}
-
-void QTDecompressionSession::initializeSession()
-{
- if (m_session)
- return;
-
- ICMPixelFormatInfo pixelFormatInfo = {sizeof(ICMPixelFormatInfo), 0};
- if (ICMGetPixelFormatInfo(m_pixelFormat, &pixelFormatInfo) != noErr) {
- // The ICM does not know anything about the pixelFormat contained in
- // the pixel buffer, so it won't be able to convert it to RGBA.
- return;
- }
-
- // The depth and cType fields of the ImageDescriptionHandle are filled
- // out according to the instructions in Technical Q&A QA1183:
- // http://developer.apple.com/library/mac/#qa/qa2001/qa1183.html
- bool isIndexed = pixelFormatInfo.formatFlags & kICMPixelFormatIsIndexed;
- bool isQD = pixelFormatInfo.formatFlags & kICMPixelFormatIsSupportedByQD;
- bool isMonochrome = pixelFormatInfo.formatFlags & kICMPixelFormatIsMonochrome;
- bool hasAlpha = pixelFormatInfo.formatFlags & kICMPixelFormatHasAlphaChannel;
-
- unsigned int depth = 24; // The default depth is 24.
- if (hasAlpha)
- depth = 32; // Any pixel format with alpha gets a depth of 32.
- else if (isMonochrome) {
- // Grayscale pixel formats get depths 33 through 40, depending
- // on their bits per pixel. Yes, this means that 16-bit grayscale
- // and 8-bit grayscale have the same pixel depth.
- depth = 32 + std::min<unsigned int>(8, pixelFormatInfo.bitsPerPixel[0]);
- } else if (isIndexed) {
- // Indexed pixel formats get a depth of 1 through 8, depending on
- // the their bits per pixel.
- depth = pixelFormatInfo.bitsPerPixel[0];
- }
-
- // If QuickDraw supports the given pixel format, the cType should be kRawCodecType.
- // Otherwise, use the pixel format code for the cType. We are assuming the pixel
- // buffer is uncompressed.
- unsigned long cType = isQD ? kRawCodecType : m_pixelFormat;
-
- ImageDescriptionHandle description = (ImageDescriptionHandle)NewHandleClear(sizeof(ImageDescription));
- (**description).idSize = sizeof(ImageDescription);
- (**description).cType = cType;
- (**description).version = 2;
- (**description).spatialQuality = codecLosslessQuality;
- (**description).width = m_width;
- (**description).height = m_height;
- (**description).hRes = 72 << 16; // 72 DPI as a fixed-point number
- (**description).vRes = 72 << 16; // 72 DPI as a fixed-point number
- (**description).frameCount = 1;
- (**description).depth = depth;
- (**description).clutID = -1;
-
- // Create the mandatory ICMDecompressionSessionOptions, but leave
- // all the default values.
- ICMDecompressionSessionOptionsRef options = 0;
- ICMDecompressionSessionOptionsCreate(kCFAllocatorDefault, &options);
-
- CFDictionaryRef pixelBufferAttributes = QTPixelBuffer::createPixelBufferAttributesDictionary(QTPixelBuffer::ConfigureForCGImage);
-
- ICMDecompressionTrackingCallbackRecord callback = {
- QTDecompressionSessionClient::trackingCallback,
- this,
- };
-
- ICMDecompressionSessionCreate(kCFAllocatorDefault,
- description,
- options,
- pixelBufferAttributes,
- &callback,
- &m_session);
-
- if (pixelBufferAttributes)
- CFRelease(pixelBufferAttributes);
-
- ICMDecompressionSessionOptionsRelease(options);
- DisposeHandle((Handle)description);
-}
-
-bool QTDecompressionSession::canDecompress(QTPixelBuffer inBuffer)
-{
- return m_session
- && inBuffer.pixelFormatType() == m_pixelFormat
- && inBuffer.width() == m_width
- && inBuffer.height() == m_height;
-}
-
-QTPixelBuffer QTDecompressionSession::decompress(QTPixelBuffer inBuffer)
-{
- if (!canDecompress(inBuffer))
- return QTPixelBuffer();
-
- inBuffer.lockBaseAddress();
- ICMDecompressionSessionDecodeFrame(m_session,
- static_cast<UInt8*>(inBuffer.baseAddress()),
- inBuffer.dataSize(),
- 0, // frameOptions
- 0, // frameTime
- 0); // sourceFrameRefCon
-
- // Because we passed in 0 for frameTime, the above function
- // is synchronous, and the client callback will have been
- // called before the function returns, and m_latestFrame
- // will contain the newly decompressed frame.
- return m_latestFrame;
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTDecompressionSessionh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTDecompressionSession.h (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTDecompressionSession.h        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTDecompressionSession.h        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,64 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef QTDecompressionSession_h
-#define QTDecompressionSession_h
-
-#ifdef QTMOVIEWIN_EXPORTS
-#define QTMOVIEWIN_API __declspec(dllexport)
-#else
-#define QTMOVIEWIN_API __declspec(dllimport)
-#endif
-
-#include "QTPixelBuffer.h"
-
-#include <wtf/PassOwnPtr.h>
-
-class QTDecompressionSessionClient;
-typedef struct OpaqueICMDecompressionSession* ICMDecompressionSessionRef;
-
-class QTMOVIEWIN_API QTDecompressionSession {
-public:
- static PassOwnPtr<QTDecompressionSession> create(unsigned long pixelFormat, size_t width, size_t height);
- ~QTDecompressionSession();
-
- bool canDecompress(QTPixelBuffer);
-
- // The resulting QTPixelBuffer will be a CG compatable ARGB pixel buffer.
- QTPixelBuffer decompress(QTPixelBuffer);
-
-private:
- friend class QTDecompressionSessionClient;
- QTDecompressionSession(unsigned long pixelFormat, size_t width, size_t height);
- void initializeSession();
-
- unsigned long m_pixelFormat;
- size_t m_width;
- size_t m_height;
- QTPixelBuffer m_latestFrame;
- ICMDecompressionSessionRef m_session;
-};
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTMoviecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTMovie.cpp (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTMovie.cpp        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTMovie.cpp        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,924 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010, 2011 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 "config.h"
-
-#include "QTMovie.h"
-
-#include "QTMovieTask.h"
-#include "QTMovieWinTimer.h"
-#include <FixMath.h>
-#include <GXMath.h>
-#include <Movies.h>
-#include <QTML.h>
-#include <QuickTimeComponents.h>
-#include <WebKitSystemInterface/WebKitSystemInterface.h>
-#include <wtf/Assertions.h>
-#include <wtf/MathExtras.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/Vector.h>
-
-using namespace std;
-
-static const long minimumQuickTimeVersion = 0x07300000; // 7.3
-
-static const long closedCaptionTrackType = 'clcp';
-static const long subTitleTrackType = 'sbtl';
-static const long mpeg4ObjectDescriptionTrackType = 'odsm';
-static const long mpeg4SceneDescriptionTrackType = 'sdsm';
-static const long closedCaptionDisplayPropertyID = 'disp';
-
-// Resizing GWorlds is slow, give them a minimum size so size of small
-// videos can be animated smoothly
-static const int cGWorldMinWidth = 640;
-static const int cGWorldMinHeight = 360;
-
-static const float cNonContinuousTimeChange = 0.2f;
-
-union UppParam {
- long longValue;
- void* ptr;
-};
-
-static CFMutableArrayRef gSupportedTypes = 0;
-static SInt32 quickTimeVersion = 0;
-
-class QTMoviePrivate : public QTMovieTaskClient {
- WTF_MAKE_NONCOPYABLE(QTMoviePrivate);
-public:
- QTMoviePrivate();
- ~QTMoviePrivate();
- void task();
- void startTask();
- void endTask();
-
- void createMovieController();
- void cacheMovieScale();
-
- QTMovie* m_movieWin;
- Movie m_movie;
- MovieController m_movieController;
- bool m_tasking;
- bool m_disabled;
- Vector<QTMovieClient*> m_clients;
- long m_loadState;
- bool m_ended;
- bool m_seeking;
- float m_lastMediaTime;
- double m_lastLoadStateCheckTime;
- int m_width;
- int m_height;
- bool m_visible;
- long m_loadError;
- float m_widthScaleFactor;
- float m_heightScaleFactor;
- CFURLRef m_currentURL;
- float m_timeToRestore;
- float m_rateToRestore;
- bool m_privateBrowsing;
-#if !ASSERT_DISABLED
- bool m_scaleCached;
-#endif
-};
-
-QTMoviePrivate::QTMoviePrivate()
- : m_movieWin(0)
- , m_movie(0)
- , m_movieController(0)
- , m_tasking(false)
- , m_loadState(0)
- , m_ended(false)
- , m_seeking(false)
- , m_lastMediaTime(0)
- , m_lastLoadStateCheckTime(0)
- , m_width(0)
- , m_height(0)
- , m_visible(false)
- , m_loadError(0)
- , m_widthScaleFactor(1)
- , m_heightScaleFactor(1)
- , m_currentURL(0)
- , m_timeToRestore(-1.0f)
- , m_rateToRestore(-1.0f)
- , m_disabled(false)
- , m_privateBrowsing(false)
-#if !ASSERT_DISABLED
- , m_scaleCached(false)
-#endif
-{
-}
-
-QTMoviePrivate::~QTMoviePrivate()
-{
- endTask();
- if (m_movieController)
- DisposeMovieController(m_movieController);
- if (m_movie)
- DisposeMovie(m_movie);
- if (m_currentURL)
- CFRelease(m_currentURL);
-}
-
-void QTMoviePrivate::startTask()
-{
- if (!m_tasking) {
- QTMovieTask::sharedTask()->addTaskClient(this);
- m_tasking = true;
- }
- QTMovieTask::sharedTask()->updateTaskTimer();
-}
-
-void QTMoviePrivate::endTask()
-{
- if (m_tasking) {
- QTMovieTask::sharedTask()->removeTaskClient(this);
- m_tasking = false;
- }
- QTMovieTask::sharedTask()->updateTaskTimer();
-}
-
-void QTMoviePrivate::task()
-{
- ASSERT(m_tasking);
-
- if (!m_loadError) {
- if (m_movieController)
- MCIdle(m_movieController);
- else
- MoviesTask(m_movie, 0);
- }
-
- // GetMovieLoadState documentation says that you should not call it more often than every quarter of a second.
- if (systemTime() >= m_lastLoadStateCheckTime + 0.25 || m_loadError) {
- // If load fails QT's load state is QTMovieLoadStateComplete.
- // This is different from QTKit API and seems strange.
- long loadState = m_loadError ? QTMovieLoadStateError : GetMovieLoadState(m_movie);
- if (loadState != m_loadState) {
- // we only need to erase the movie gworld when the load state changes to loaded while it
- // is visible as the gworld is destroyed/created when visibility changes
- bool shouldRestorePlaybackState = false;
- bool movieNewlyPlayable = loadState >= QTMovieLoadStateLoaded && m_loadState < QTMovieLoadStateLoaded;
- m_loadState = loadState;
- if (movieNewlyPlayable) {
- cacheMovieScale();
- shouldRestorePlaybackState = true;
- }
-
- if (!m_movieController && m_loadState >= QTMovieLoadStateLoaded)
- createMovieController();
-
- for (size_t i = 0; i < m_clients.size(); ++i)
- m_clients[i]->movieLoadStateChanged(m_movieWin);
-
- if (shouldRestorePlaybackState && m_timeToRestore != -1.0f) {
- m_movieWin->setCurrentTime(m_timeToRestore);
- m_timeToRestore = -1.0f;
- m_movieWin->setRate(m_rateToRestore);
- m_rateToRestore = -1.0f;
- }
-
- if (m_disabled) {
- endTask();
- return;
- }
- }
- m_lastLoadStateCheckTime = systemTime();
- }
-
- bool ended = !!IsMovieDone(m_movie);
- if (ended != m_ended) {
- m_ended = ended;
- if (ended) {
- for (size_t i = 0; i < m_clients.size(); ++i)
- m_clients[i]->movieEnded(m_movieWin);
- }
- }
-
- float time = m_movieWin->currentTime();
- if (time < m_lastMediaTime || time >= m_lastMediaTime + cNonContinuousTimeChange || m_seeking) {
- m_seeking = false;
- for (size_t i = 0; i < m_clients.size(); ++i)
- m_clients[i]->movieTimeChanged(m_movieWin);
- }
- m_lastMediaTime = time;
-
- if (m_loadError)
- endTask();
- else
- QTMovieTask::sharedTask()->updateTaskTimer();
-}
-
-void QTMoviePrivate::createMovieController()
-{
- Rect bounds;
- long flags;
-
- if (!m_movie)
- return;
-
- if (m_movieController)
- DisposeMovieController(m_movieController);
-
- GetMovieBox(m_movie, &bounds);
- flags = mcTopLeftMovie | mcNotVisible;
- m_movieController = NewMovieController(m_movie, &bounds, flags);
- if (!m_movieController)
- return;
-
- // Disable automatic looping.
- MCDoAction(m_movieController, mcActionSetLooping, 0);
-}
-
-void QTMoviePrivate::cacheMovieScale()
-{
- Rect naturalRect;
- Rect initialRect;
-
- GetMovieNaturalBoundsRect(m_movie, &naturalRect);
- GetMovieBox(m_movie, &initialRect);
-
- float naturalWidth = naturalRect.right - naturalRect.left;
- float naturalHeight = naturalRect.bottom - naturalRect.top;
-
- if (naturalWidth)
- m_widthScaleFactor = (initialRect.right - initialRect.left) / naturalWidth;
- if (naturalHeight)
- m_heightScaleFactor = (initialRect.bottom - initialRect.top) / naturalHeight;
-#if !ASSERT_DISABLED
- m_scaleCached = true;
-#endif
-}
-
-QTMovie::QTMovie(QTMovieClient* client)
- : m_private(new QTMoviePrivate())
-{
- m_private->m_movieWin = this;
- if (client)
- m_private->m_clients.append(client);
- initializeQuickTime();
-}
-
-QTMovie::~QTMovie()
-{
- delete m_private;
-}
-
-void QTMovie::disableComponent(uint32_t cd[5])
-{
- ComponentDescription nullDesc = {'null', 'base', kAppleManufacturer, 0, 0};
- Component nullComp = FindNextComponent(0, &nullDesc);
- Component disabledComp = 0;
-
- while (disabledComp = FindNextComponent(disabledComp, (ComponentDescription*)&cd[0]))
- CaptureComponent(disabledComp, nullComp);
-}
-
-void QTMovie::addClient(QTMovieClient* client)
-{
- if (client)
- m_private->m_clients.append(client);
-}
-
-void QTMovie::removeClient(QTMovieClient* client)
-{
- size_t indexOfClient = m_private->m_clients.find(client);
- if (indexOfClient != notFound)
- m_private->m_clients.remove(indexOfClient);
-}
-
-void QTMovie::play()
-{
- m_private->m_timeToRestore = -1.0f;
-
- if (m_private->m_movieController)
- MCDoAction(m_private->m_movieController, mcActionPrerollAndPlay, (void *)GetMoviePreferredRate(m_private->m_movie));
- else
- StartMovie(m_private->m_movie);
- m_private->startTask();
-}
-
-void QTMovie::pause()
-{
- m_private->m_timeToRestore = -1.0f;
-
- if (m_private->m_movieController)
- MCDoAction(m_private->m_movieController, mcActionPlay, 0);
- else
- StopMovie(m_private->m_movie);
- QTMovieTask::sharedTask()->updateTaskTimer();
-}
-
-float QTMovie::rate() const
-{
- if (!m_private->m_movie)
- return 0;
- return FixedToFloat(GetMovieRate(m_private->m_movie));
-}
-
-void QTMovie::setRate(float rate)
-{
- if (!m_private->m_movie)
- return;
- m_private->m_timeToRestore = -1.0f;
-
- if (m_private->m_movieController)
- MCDoAction(m_private->m_movieController, mcActionPrerollAndPlay, (void *)FloatToFixed(rate));
- else
- SetMovieRate(m_private->m_movie, FloatToFixed(rate));
- QTMovieTask::sharedTask()->updateTaskTimer();
-}
-
-float QTMovie::duration() const
-{
- if (!m_private->m_movie)
- return 0;
- TimeValue val = GetMovieDuration(m_private->m_movie);
- TimeScale scale = GetMovieTimeScale(m_private->m_movie);
- return static_cast<float>(val) / scale;
-}
-
-float QTMovie::currentTime() const
-{
- if (!m_private->m_movie)
- return 0;
- TimeValue val = GetMovieTime(m_private->m_movie, 0);
- TimeScale scale = GetMovieTimeScale(m_private->m_movie);
- return static_cast<float>(val) / scale;
-}
-
-void QTMovie::setCurrentTime(float time) const
-{
- if (!m_private->m_movie)
- return;
-
- m_private->m_timeToRestore = -1.0f;
-
- m_private->m_seeking = true;
- TimeScale scale = GetMovieTimeScale(m_private->m_movie);
- if (m_private->m_movieController) {
- QTRestartAtTimeRecord restart = { lroundf(time * scale) , 0 };
- MCDoAction(m_private->m_movieController, mcActionRestartAtTime, (void *)&restart);
- } else
- SetMovieTimeValue(m_private->m_movie, TimeValue(lroundf(time * scale)));
- QTMovieTask::sharedTask()->updateTaskTimer();
-}
-
-void QTMovie::setVolume(float volume)
-{
- if (!m_private->m_movie)
- return;
- SetMovieVolume(m_private->m_movie, static_cast<short>(volume * 256));
-}
-
-void QTMovie::setPreservesPitch(bool preservesPitch)
-{
- if (!m_private->m_movie || !m_private->m_currentURL)
- return;
-
- OSErr error;
- bool prop = false;
-
- error = QTGetMovieProperty(m_private->m_movie, kQTPropertyClass_Audio, kQTAudioPropertyID_RateChangesPreservePitch,
- sizeof(kQTAudioPropertyID_RateChangesPreservePitch), static_cast<QTPropertyValuePtr>(&prop), 0);
-
- if (error || prop == preservesPitch)
- return;
-
- m_private->m_timeToRestore = currentTime();
- m_private->m_rateToRestore = rate();
- load(m_private->m_currentURL, preservesPitch);
-}
-
-unsigned QTMovie::dataSize() const
-{
- if (!m_private->m_movie)
- return 0;
- return GetMovieDataSize(m_private->m_movie, 0, GetMovieDuration(m_private->m_movie));
-}
-
-float QTMovie::maxTimeLoaded() const
-{
- if (!m_private->m_movie)
- return 0;
- TimeValue val;
- GetMaxLoadedTimeInMovie(m_private->m_movie, &val);
- TimeScale scale = GetMovieTimeScale(m_private->m_movie);
- return static_cast<float>(val) / scale;
-}
-
-long QTMovie::loadState() const
-{
- return m_private->m_loadState;
-}
-
-void QTMovie::getNaturalSize(int& width, int& height)
-{
- Rect rect = { 0, };
-
- if (m_private->m_movie)
- GetMovieNaturalBoundsRect(m_private->m_movie, &rect);
- width = (rect.right - rect.left) * m_private->m_widthScaleFactor;
- height = (rect.bottom - rect.top) * m_private->m_heightScaleFactor;
-}
-
-void QTMovie::loadPath(const UChar* url, int len, bool preservesPitch)
-{
- CFStringRef urlStringRef = CFStringCreateWithCharacters(kCFAllocatorDefault, reinterpret_cast<const UniChar*>(url), len);
- CFURLRef cfURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, urlStringRef, kCFURLWindowsPathStyle, false);
-
- load(cfURL, preservesPitch);
-
- if (cfURL)
- CFRelease(cfURL);
- if (urlStringRef)
- CFRelease(urlStringRef);
-}
-
-void QTMovie::load(const UChar* url, int len, bool preservesPitch)
-{
- CFStringRef urlStringRef = CFStringCreateWithCharacters(kCFAllocatorDefault, reinterpret_cast<const UniChar*>(url), len);
- CFURLRef cfURL = CFURLCreateWithString(kCFAllocatorDefault, urlStringRef, 0);
-
- load(cfURL, preservesPitch);
-
- if (cfURL)
- CFRelease(cfURL);
- if (urlStringRef)
- CFRelease(urlStringRef);
-}
-
-void QTMovie::load(CFURLRef url, bool preservesPitch)
-{
- if (!url)
- return;
-
- if (m_private->m_movie) {
- m_private->endTask();
- if (m_private->m_movieController)
- DisposeMovieController(m_private->m_movieController);
- m_private->m_movieController = 0;
- DisposeMovie(m_private->m_movie);
- m_private->m_movie = 0;
- m_private->m_loadState = 0;
- }
-
- // Define a property array for NewMovieFromProperties.
- QTNewMoviePropertyElement movieProps[9];
- ItemCount moviePropCount = 0;
-
- bool boolTrue = true;
-
- // Disable streaming support for now.
- CFStringRef scheme = CFURLCopyScheme(url);
- bool isRTSP = CFStringHasPrefix(scheme, CFSTR("rtsp:"));
- CFRelease(scheme);
-
- if (isRTSP) {
- m_private->m_loadError = noMovieFound;
- goto end;
- }
-
- if (m_private->m_currentURL) {
- if (m_private->m_currentURL != url) {
- CFRelease(m_private->m_currentURL);
- m_private->m_currentURL = url;
- CFRetain(url);
- }
- } else {
- m_private->m_currentURL = url;
- CFRetain(url);
- }
-
- // Add the movie data location to the property array
- movieProps[moviePropCount].propClass = kQTPropertyClass_DataLocation;
- movieProps[moviePropCount].propID = kQTDataLocationPropertyID_CFURL;
- movieProps[moviePropCount].propValueSize = sizeof(m_private->m_currentURL);
- movieProps[moviePropCount].propValueAddress = &(m_private->m_currentURL);
- movieProps[moviePropCount].propStatus = 0;
- moviePropCount++;
-
- movieProps[moviePropCount].propClass = kQTPropertyClass_MovieInstantiation;
- movieProps[moviePropCount].propID = kQTMovieInstantiationPropertyID_DontAskUnresolvedDataRefs;
- movieProps[moviePropCount].propValueSize = sizeof(boolTrue);
- movieProps[moviePropCount].propValueAddress = &boolTrue;
- movieProps[moviePropCount].propStatus = 0;
- moviePropCount++;
-
- movieProps[moviePropCount].propClass = kQTPropertyClass_MovieInstantiation;
- movieProps[moviePropCount].propID = kQTMovieInstantiationPropertyID_AsyncOK;
- movieProps[moviePropCount].propValueSize = sizeof(boolTrue);
- movieProps[moviePropCount].propValueAddress = &boolTrue;
- movieProps[moviePropCount].propStatus = 0;
- moviePropCount++;
-
- movieProps[moviePropCount].propClass = kQTPropertyClass_NewMovieProperty;
- movieProps[moviePropCount].propID = kQTNewMoviePropertyID_Active;
- movieProps[moviePropCount].propValueSize = sizeof(boolTrue);
- movieProps[moviePropCount].propValueAddress = &boolTrue;
- movieProps[moviePropCount].propStatus = 0;
- moviePropCount++;
-
- movieProps[moviePropCount].propClass = kQTPropertyClass_NewMovieProperty;
- movieProps[moviePropCount].propID = kQTNewMoviePropertyID_DontInteractWithUser;
- movieProps[moviePropCount].propValueSize = sizeof(boolTrue);
- movieProps[moviePropCount].propValueAddress = &boolTrue;
- movieProps[moviePropCount].propStatus = 0;
- moviePropCount++;
-
- movieProps[moviePropCount].propClass = kQTPropertyClass_MovieInstantiation;
- movieProps[moviePropCount].propID = '!url';
- movieProps[moviePropCount].propValueSize = sizeof(boolTrue);
- movieProps[moviePropCount].propValueAddress = &boolTrue;
- movieProps[moviePropCount].propStatus = 0;
- moviePropCount++;
-
- movieProps[moviePropCount].propClass = kQTPropertyClass_MovieInstantiation;
- movieProps[moviePropCount].propID = 'site';
- movieProps[moviePropCount].propValueSize = sizeof(boolTrue);
- movieProps[moviePropCount].propValueAddress = &boolTrue;
- movieProps[moviePropCount].propStatus = 0;
- moviePropCount++;
-
- movieProps[moviePropCount].propClass = kQTPropertyClass_Audio;
- movieProps[moviePropCount].propID = kQTAudioPropertyID_RateChangesPreservePitch;
- movieProps[moviePropCount].propValueSize = sizeof(preservesPitch);
- movieProps[moviePropCount].propValueAddress = &preservesPitch;
- movieProps[moviePropCount].propStatus = 0;
- moviePropCount++;
-
- bool allowCaching = !m_private->m_privateBrowsing;
- movieProps[moviePropCount].propClass = kQTPropertyClass_MovieInstantiation;
- movieProps[moviePropCount].propID = 'pers';
- movieProps[moviePropCount].propValueSize = sizeof(allowCaching);
- movieProps[moviePropCount].propValueAddress = &allowCaching;
- movieProps[moviePropCount].propStatus = 0;
- moviePropCount++;
-
- ASSERT(moviePropCount <= WTF_ARRAY_LENGTH(movieProps));
- m_private->m_loadError = NewMovieFromProperties(moviePropCount, movieProps, 0, 0, &m_private->m_movie);
-
-end:
- m_private->startTask();
- // get the load fail callback quickly
- if (m_private->m_loadError)
- QTMovieTask::sharedTask()->updateTaskTimer(0);
- else {
- OSType mode = kQTApertureMode_CleanAperture;
-
- // Set the aperture mode property on a movie to signal that we want aspect ratio
- // and clean aperture dimensions. Don't worry about errors, we can't do anything if
- // the installed version of QT doesn't support it and it isn't serious enough to
- // warrant failing.
- QTSetMovieProperty(m_private->m_movie, kQTPropertyClass_Visual, kQTVisualPropertyID_ApertureMode, sizeof(mode), &mode);
- }
-}
-
-void QTMovie::disableUnsupportedTracks(unsigned& enabledTrackCount, unsigned& totalTrackCount)
-{
- if (!m_private->m_movie) {
- totalTrackCount = 0;
- enabledTrackCount = 0;
- return;
- }
-
- static HashSet<OSType>* allowedTrackTypes = 0;
- if (!allowedTrackTypes) {
- allowedTrackTypes = new HashSet<OSType>;
- allowedTrackTypes->add(VideoMediaType);
- allowedTrackTypes->add(SoundMediaType);
- allowedTrackTypes->add(TextMediaType);
- allowedTrackTypes->add(BaseMediaType);
- allowedTrackTypes->add(closedCaptionTrackType);
- allowedTrackTypes->add(subTitleTrackType);
- allowedTrackTypes->add(mpeg4ObjectDescriptionTrackType);
- allowedTrackTypes->add(mpeg4SceneDescriptionTrackType);
- allowedTrackTypes->add(TimeCodeMediaType);
- allowedTrackTypes->add(TimeCode64MediaType);
- }
-
- long trackCount = GetMovieTrackCount(m_private->m_movie);
- enabledTrackCount = trackCount;
- totalTrackCount = trackCount;
-
- // Track indexes are 1-based. yuck. These things must descend from old-
- // school mac resources or something.
- for (long trackIndex = 1; trackIndex <= trackCount; trackIndex++) {
- // Grab the track at the current index. If there isn't one there, then
- // we can move onto the next one.
- Track currentTrack = GetMovieIndTrack(m_private->m_movie, trackIndex);
- if (!currentTrack)
- continue;
-
- // Check to see if the track is disabled already, we should move along.
- // We don't need to re-disable it.
- if (!GetTrackEnabled(currentTrack))
- continue;
-
- // Grab the track's media. We're going to check to see if we need to
- // disable the tracks. They could be unsupported.
- Media trackMedia = GetTrackMedia(currentTrack);
- if (!trackMedia)
- continue;
-
- // Grab the media type for this track. Make sure that we don't
- // get an error in doing so. If we do, then something really funky is
- // wrong.
- OSType mediaType;
- GetMediaHandlerDescription(trackMedia, &mediaType, nil, nil);
- OSErr mediaErr = GetMoviesError();
- if (mediaErr != noErr)
- continue;
-
- if (!allowedTrackTypes->contains(mediaType)) {
-
- // Different mpeg variants import as different track types so check for the "mpeg
- // characteristic" instead of hard coding the (current) list of mpeg media types.
- if (GetMovieIndTrackType(m_private->m_movie, 1, 'mpeg', movieTrackCharacteristic | movieTrackEnabledOnly))
- continue;
-
- SetTrackEnabled(currentTrack, false);
- --enabledTrackCount;
- }
-
- // Grab the track reference count for chapters. This will tell us if it
- // has chapter tracks in it. If there aren't any references, then we
- // can move on the next track.
- long referenceCount = GetTrackReferenceCount(currentTrack, kTrackReferenceChapterList);
- if (referenceCount <= 0)
- continue;
-
- long referenceIndex = 0;
- while (1) {
- // If we get nothing here, we've overstepped our bounds and can stop
- // looking. Chapter indices here are 1-based as well - hence, the
- // pre-increment.
- referenceIndex++;
- Track chapterTrack = GetTrackReference(currentTrack, kTrackReferenceChapterList, referenceIndex);
- if (!chapterTrack)
- break;
-
- // Try to grab the media for the track.
- Media chapterMedia = GetTrackMedia(chapterTrack);
- if (!chapterMedia)
- continue;
-
- // Grab the media type for this track. Make sure that we don't
- // get an error in doing so. If we do, then something really
- // funky is wrong.
- OSType mediaType;
- GetMediaHandlerDescription(chapterMedia, &mediaType, nil, nil);
- OSErr mediaErr = GetMoviesError();
- if (mediaErr != noErr)
- continue;
-
- // Check to see if the track is a video track. We don't care about
- // other non-video tracks.
- if (mediaType != VideoMediaType)
- continue;
-
- // Check to see if the track is already disabled. If it is, we
- // should move along.
- if (!GetTrackEnabled(chapterTrack))
- continue;
-
- // Disabled the evil, evil track.
- SetTrackEnabled(chapterTrack, false);
- --enabledTrackCount;
- }
- }
-}
-
-bool QTMovie::isDisabled() const
-{
- return m_private->m_disabled;
-}
-
-void QTMovie::setDisabled(bool b)
-{
- m_private->m_disabled = b;
-}
-
-
-bool QTMovie::hasVideo() const
-{
- if (!m_private->m_movie)
- return false;
- return (GetMovieIndTrackType(m_private->m_movie, 1, VisualMediaCharacteristic, movieTrackCharacteristic | movieTrackEnabledOnly));
-}
-
-bool QTMovie::hasAudio() const
-{
- if (!m_private->m_movie)
- return false;
- return (GetMovieIndTrackType(m_private->m_movie, 1, AudioMediaCharacteristic, movieTrackCharacteristic | movieTrackEnabledOnly));
-}
-
-QTTrackArray QTMovie::videoTracks() const
-{
- QTTrackArray tracks;
- long trackIndex = 1;
-
- while (Track theTrack = GetMovieIndTrackType(m_private->m_movie, trackIndex++, VisualMediaCharacteristic, movieTrackCharacteristic | movieTrackEnabledOnly))
- tracks.append(QTTrack::create(theTrack));
-
- return tracks;
-}
-
-bool QTMovie::hasClosedCaptions() const
-{
- if (!m_private->m_movie)
- return false;
- return GetMovieIndTrackType(m_private->m_movie, 1, closedCaptionTrackType, movieTrackMediaType);
-}
-
-void QTMovie::setClosedCaptionsVisible(bool visible)
-{
- if (!m_private->m_movie)
- return;
-
- Track ccTrack = GetMovieIndTrackType(m_private->m_movie, 1, closedCaptionTrackType, movieTrackMediaType);
- if (!ccTrack)
- return;
-
- Boolean doDisplay = visible;
- QTSetTrackProperty(ccTrack, closedCaptionTrackType, closedCaptionDisplayPropertyID, sizeof(doDisplay), &doDisplay);
-}
-
-long QTMovie::timeScale() const
-{
- if (!m_private->m_movie)
- return 0;
-
- return GetMovieTimeScale(m_private->m_movie);
-}
-
-static void getMIMETypeCallBack(const char* type);
-
-static void initializeSupportedTypes()
-{
- if (gSupportedTypes)
- return;
-
- gSupportedTypes = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
- if (quickTimeVersion < minimumQuickTimeVersion) {
- LOG_ERROR("QuickTime version %x detected, at least %x required. Returning empty list of supported media MIME types.", quickTimeVersion, minimumQuickTimeVersion);
- return;
- }
-
- // QuickTime doesn't have an importer for video/quicktime. Add it manually.
- CFArrayAppendValue(gSupportedTypes, CFSTR("video/quicktime"));
-
- wkGetQuickTimeMIMETypeList(getMIMETypeCallBack);
-}
-
-static void getMIMETypeCallBack(const char* type)
-{
- ASSERT(type);
- CFStringRef cfType = CFStringCreateWithCString(kCFAllocatorDefault, type, kCFStringEncodingMacRoman);
- if (!cfType)
- return;
-
- // Filter out all non-audio or -video MIME Types, and only add each type once:
- if (CFStringHasPrefix(cfType, CFSTR("audio/")) || CFStringHasPrefix(cfType, CFSTR("video/"))) {
- CFRange range = CFRangeMake(0, CFArrayGetCount(gSupportedTypes));
- if (!CFArrayContainsValue(gSupportedTypes, range, cfType))
- CFArrayAppendValue(gSupportedTypes, cfType);
- }
-
- CFRelease(cfType);
-}
-
-unsigned QTMovie::countSupportedTypes()
-{
- initializeSupportedTypes();
- return static_cast<unsigned>(CFArrayGetCount(gSupportedTypes));
-}
-
-void QTMovie::getSupportedType(unsigned index, const UChar*& str, unsigned& len)
-{
- initializeSupportedTypes();
- ASSERT(index < CFArrayGetCount(gSupportedTypes));
-
- // Allocate sufficient buffer to hold any MIME type
- static UniChar* staticBuffer = 0;
- if (!staticBuffer)
- staticBuffer = new UniChar[32];
-
- CFStringRef cfstr = (CFStringRef)CFArrayGetValueAtIndex(gSupportedTypes, index);
- len = CFStringGetLength(cfstr);
- CFRange range = { 0, len };
- CFStringGetCharacters(cfstr, range, staticBuffer);
- str = reinterpret_cast<const UChar*>(staticBuffer);
-
-}
-
-CGAffineTransform QTMovie::getTransform() const
-{
- ASSERT(m_private->m_movie);
- MatrixRecord m = {0};
- GetMovieMatrix(m_private->m_movie, &m);
-
- ASSERT(!m.matrix[0][2]);
- ASSERT(!m.matrix[1][2]);
- CGAffineTransform transform = CGAffineTransformMake(
- Fix2X(m.matrix[0][0]),
- Fix2X(m.matrix[0][1]),
- Fix2X(m.matrix[1][0]),
- Fix2X(m.matrix[1][1]),
- Fix2X(m.matrix[2][0]),
- Fix2X(m.matrix[2][1]));
- return transform;
-}
-
-void QTMovie::setTransform(CGAffineTransform t)
-{
- ASSERT(m_private->m_movie);
- MatrixRecord m = {{
- {X2Fix(t.a), X2Fix(t.b), 0},
- {X2Fix(t.c), X2Fix(t.d), 0},
- {X2Fix(t.tx), X2Fix(t.ty), fract1},
- }};
-
- SetMovieMatrix(m_private->m_movie, &m);
- m_private->cacheMovieScale();
-}
-
-void QTMovie::resetTransform()
-{
- ASSERT(m_private->m_movie);
- SetMovieMatrix(m_private->m_movie, 0);
- m_private->cacheMovieScale();
-}
-
-void QTMovie::setPrivateBrowsingMode(bool privateBrowsing)
-{
- m_private->m_privateBrowsing = privateBrowsing;
- if (m_private->m_movie) {
- bool allowCaching = !m_private->m_privateBrowsing;
- QTSetMovieProperty(m_private->m_movie, 'cach', 'pers', sizeof(allowCaching), &allowCaching);
- }
-}
-
-bool QTMovie::initializeQuickTime()
-{
- static bool initialized = false;
- static bool initializationSucceeded = false;
- if (!initialized) {
- initialized = true;
- // Initialize and check QuickTime version
- OSErr result = InitializeQTML(kInitializeQTMLEnableDoubleBufferedSurface);
- if (result == noErr)
- result = Gestalt(gestaltQuickTime, &quickTimeVersion);
- if (result != noErr) {
- LOG_ERROR("No QuickTime available. Disabling <video> and <audio> support.");
- return false;
- }
- if (quickTimeVersion < minimumQuickTimeVersion) {
- LOG_ERROR("QuickTime version %x detected, at least %x required. Disabling <video> and <audio> support.", quickTimeVersion, minimumQuickTimeVersion);
- return false;
- }
- EnterMovies();
- initializationSucceeded = true;
- }
- return initializationSucceeded;
-}
-
-Movie QTMovie::getMovieHandle() const
-{
- return m_private->m_movie;
-}
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
-{
- switch (fdwReason) {
- case DLL_PROCESS_ATTACH:
- return TRUE;
- case DLL_PROCESS_DETACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- return FALSE;
- }
- ASSERT_NOT_REACHED();
- return FALSE;
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTMovieh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTMovie.h (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTMovie.h        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTMovie.h        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,128 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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.
- */
-
-#ifndef QTMovie_h
-#define QTMovie_h
-
-#include "QTTrack.h"
-#include <wtf/Vector.h>
-
-#ifdef QTMOVIEWIN_EXPORTS
-#define QTMOVIEWIN_API __declspec(dllexport)
-#else
-#define QTMOVIEWIN_API __declspec(dllimport)
-#endif
-
-class QTMovie;
-class QTMoviePrivate;
-typedef struct MovieType** Movie;
-typedef Vector<RefPtr<QTTrack>> QTTrackArray;
-
-class QTMovieClient {
-public:
- virtual void movieEnded(QTMovie*) = 0;
- virtual void movieLoadStateChanged(QTMovie*) = 0;
- virtual void movieTimeChanged(QTMovie*) = 0;
-};
-
-enum {
- QTMovieLoadStateError = -1L,
- QTMovieLoadStateLoaded = 2000L,
- QTMovieLoadStatePlayable = 10000L,
- QTMovieLoadStatePlaythroughOK = 20000L,
- QTMovieLoadStateComplete = 100000L
-};
-
-typedef const struct __CFURL * CFURLRef;
-
-class QTMOVIEWIN_API QTMovie : public RefCounted<QTMovie> {
-public:
- static bool initializeQuickTime();
- static void taskTimerFired();
-
- static void disableComponent(uint32_t[5]);
-
- QTMovie(QTMovieClient*);
- ~QTMovie();
-
- void addClient(QTMovieClient*);
- void removeClient(QTMovieClient*);
-
- void loadPath(const UChar* url, int len, bool preservesPitch);
- void load(const UChar* url, int len, bool preservesPitch);
- void load(CFURLRef, bool preservesPitch);
-
- long loadState() const;
- float maxTimeLoaded() const;
-
- void play();
- void pause();
-
- float rate() const;
- void setRate(float);
-
- float duration() const;
- float currentTime() const;
- void setCurrentTime(float) const;
-
- void setVolume(float);
- void setPreservesPitch(bool);
-
- unsigned dataSize() const;
-
- void getNaturalSize(int& width, int& height);
-
- void disableUnsupportedTracks(unsigned& enabledTrackCount, unsigned& totalTrackCount);
-
- bool isDisabled() const;
- void setDisabled(bool);
-
- bool hasVideo() const;
- bool hasAudio() const;
-
- QTTrackArray videoTracks() const;
-
- bool hasClosedCaptions() const;
- void setClosedCaptionsVisible(bool);
-
- static unsigned countSupportedTypes();
- static void getSupportedType(unsigned index, const UChar*& str, unsigned& len);
-
- CGAffineTransform getTransform() const;
- void setTransform(CGAffineTransform);
- void resetTransform();
-
- Movie getMovieHandle() const;
-
- long timeScale() const;
-
- void setPrivateBrowsingMode(bool);
-
-private:
- QTMoviePrivate* m_private;
- friend class QTMoviePrivate;
-};
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTMovieGWorldcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTMovieGWorld.cpp (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTMovieGWorld.cpp        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTMovieGWorld.cpp        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,465 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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 "config.h"
-
-#include "QTMovieGWorld.h"
-
-#include "QTMovieTask.h"
-#include <GXMath.h>
-#include <Movies.h>
-#include <QTML.h>
-#include <QuickTimeComponents.h>
-#include <wtf/Assertions.h>
-#include <wtf/HashSet.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/Vector.h>
-
-using namespace std;
-
-static const long minimumQuickTimeVersion = 0x07300000; // 7.3
-
-static LPCWSTR fullscreenQTMovieGWorldPointerProp = L"fullscreenQTMovieGWorldPointer";
-
-// Resizing GWorlds is slow, give them a minimum size so size of small
-// videos can be animated smoothly
-static const int cGWorldMinWidth = 640;
-static const int cGWorldMinHeight = 360;
-
-static const float cNonContinuousTimeChange = 0.2f;
-
-union UppParam {
- long longValue;
- void* ptr;
-};
-
-static MovieDrawingCompleteUPP gMovieDrawingCompleteUPP = 0;
-static HashSet<QTMovieGWorldPrivate*>* gTaskList;
-static Vector<CFStringRef>* gSupportedTypes = 0;
-static SInt32 quickTimeVersion = 0;
-
-class QTMovieGWorldPrivate : public QTMovieClient {
-public:
- QTMovieGWorldPrivate(QTMovieGWorld* movieWin);
- virtual ~QTMovieGWorldPrivate();
-
- void registerDrawingCallback();
- void unregisterDrawingCallback();
- void drawingComplete();
- void updateGWorld();
- void createGWorld();
- void deleteGWorld();
- void clearGWorld();
- void updateMovieSize();
-
- void setSize(int, int);
-
- virtual void movieEnded(QTMovie*);
- virtual void movieLoadStateChanged(QTMovie*);
- virtual void movieTimeChanged(QTMovie*);
-
- QTMovieGWorld* m_movieWin;
- RefPtr<QTMovie> m_qtMovie;
- Movie m_movie;
- QTMovieGWorldClient* m_client;
- long m_loadState;
- int m_width;
- int m_height;
- bool m_visible;
- GWorldPtr m_gWorld;
- int m_gWorldWidth;
- int m_gWorldHeight;
- GWorldPtr m_savedGWorld;
- float m_widthScaleFactor;
- float m_heightScaleFactor;
-#if !ASSERT_DISABLED
- bool m_scaleCached;
-#endif
- WindowPtr m_fullscreenWindow;
- GWorldPtr m_fullscreenOrigGWorld;
- Rect m_fullscreenRect;
- QTMovieGWorldFullscreenClient* m_fullscreenClient;
- char* m_fullscreenRestoreState;
- bool m_disabled;
-};
-
-QTMovieGWorldPrivate::QTMovieGWorldPrivate(QTMovieGWorld* movieWin)
- : m_movieWin(movieWin)
- , m_movie(0)
- , m_client(0)
- , m_loadState(0)
- , m_width(0)
- , m_height(0)
- , m_visible(false)
- , m_gWorld(0)
- , m_gWorldWidth(0)
- , m_gWorldHeight(0)
- , m_savedGWorld(0)
- , m_widthScaleFactor(1)
- , m_heightScaleFactor(1)
-#if !ASSERT_DISABLED
- , m_scaleCached(false)
-#endif
- , m_fullscreenWindow(0)
- , m_fullscreenOrigGWorld(0)
- , m_fullscreenClient(0)
- , m_fullscreenRestoreState(0)
- , m_disabled(false)
- , m_qtMovie(0)
-{
- Rect rect = { 0, 0, 0, 0 };
- m_fullscreenRect = rect;
-}
-
-QTMovieGWorldPrivate::~QTMovieGWorldPrivate()
-{
- ASSERT(!m_fullscreenWindow);
-
- if (m_gWorld)
- deleteGWorld();
-}
-
-pascal OSErr movieDrawingCompleteProc(Movie movie, long data)
-{
- UppParam param;
- param.longValue = data;
- QTMovieGWorldPrivate* mp = static_cast<QTMovieGWorldPrivate*>(param.ptr);
- if (mp)
- mp->drawingComplete();
- return 0;
-}
-
-void QTMovieGWorldPrivate::registerDrawingCallback()
-{
- if (!gMovieDrawingCompleteUPP)
- gMovieDrawingCompleteUPP = NewMovieDrawingCompleteUPP(movieDrawingCompleteProc);
-
- UppParam param;
- param.ptr = this;
- SetMovieDrawingCompleteProc(m_movie, movieDrawingCallWhenChanged, gMovieDrawingCompleteUPP, param.longValue);
-}
-
-void QTMovieGWorldPrivate::unregisterDrawingCallback()
-{
- SetMovieDrawingCompleteProc(m_movie, movieDrawingCallWhenChanged, 0, 0);
-}
-
-void QTMovieGWorldPrivate::drawingComplete()
-{
- if (!m_gWorld || m_movieWin->m_private->m_disabled || m_loadState < QTMovieLoadStateLoaded)
- return;
- m_client->movieNewImageAvailable(m_movieWin);
-}
-
-void QTMovieGWorldPrivate::updateGWorld()
-{
- bool shouldBeVisible = m_visible;
- if (!m_height || !m_width)
- shouldBeVisible = false;
-
- if (shouldBeVisible && !m_gWorld)
- createGWorld();
- else if (!shouldBeVisible && m_gWorld)
- deleteGWorld();
- else if (m_gWorld && (m_width > m_gWorldWidth || m_height > m_gWorldHeight)) {
- // need a bigger, better gWorld
- deleteGWorld();
- createGWorld();
- }
-}
-
-void QTMovieGWorldPrivate::createGWorld()
-{
- ASSERT(!m_gWorld);
- if (!m_movie || m_loadState < QTMovieLoadStateLoaded)
- return;
-
- m_gWorldWidth = max(cGWorldMinWidth, m_width);
- m_gWorldHeight = max(cGWorldMinHeight, m_height);
- Rect bounds;
- bounds.top = 0;
- bounds.left = 0;
- bounds.right = m_gWorldWidth;
- bounds.bottom = m_gWorldHeight;
- OSErr err = QTNewGWorld(&m_gWorld, k32BGRAPixelFormat, &bounds, 0, 0, 0);
- if (err)
- return;
- GetMovieGWorld(m_movie, &m_savedGWorld, 0);
- SetMovieGWorld(m_movie, m_gWorld, 0);
- bounds.right = m_width;
- bounds.bottom = m_height;
- SetMovieBox(m_movie, &bounds);
-}
-
-void QTMovieGWorldPrivate::clearGWorld()
-{
- if (!m_movie || !m_gWorld)
- return;
-
- GrafPtr savePort;
- GetPort(&savePort);
- MacSetPort((GrafPtr)m_gWorld);
-
- Rect bounds;
- bounds.top = 0;
- bounds.left = 0;
- bounds.right = m_gWorldWidth;
- bounds.bottom = m_gWorldHeight;
- EraseRect(&bounds);
-
- MacSetPort(savePort);
-}
-
-void QTMovieGWorldPrivate::setSize(int width, int height)
-{
- if (m_width == width && m_height == height)
- return;
- m_width = width;
- m_height = height;
-
- // Do not change movie box before reaching load state loaded as we grab
- // the initial size when task() sees that state for the first time, and
- // we need the initial size to be able to scale movie properly.
- if (!m_movie || m_loadState < QTMovieLoadStateLoaded)
- return;
-
-#if !ASSERT_DISABLED
- ASSERT(m_scaleCached);
-#endif
-
- updateMovieSize();
-}
-
-void QTMovieGWorldPrivate::updateMovieSize()
-{
- if (!m_movie || m_loadState < QTMovieLoadStateLoaded)
- return;
-
- Rect bounds;
- bounds.top = 0;
- bounds.left = 0;
- bounds.right = m_width;
- bounds.bottom = m_height;
- SetMovieBox(m_movie, &bounds);
- updateGWorld();
-}
-
-
-void QTMovieGWorldPrivate::deleteGWorld()
-{
- ASSERT(m_gWorld);
- if (m_movie)
- SetMovieGWorld(m_movie, m_savedGWorld, 0);
- m_savedGWorld = 0;
- DisposeGWorld(m_gWorld);
- m_gWorld = 0;
- m_gWorldWidth = 0;
- m_gWorldHeight = 0;
-}
-
-void QTMovieGWorldPrivate::movieEnded(QTMovie*)
-{
- // Do nothing
-}
-
-void QTMovieGWorldPrivate::movieLoadStateChanged(QTMovie* movie)
-{
- long loadState = GetMovieLoadState(movie->getMovieHandle());
- if (loadState != m_loadState) {
-
- // we only need to erase the movie gworld when the load state changes to loaded while it
- // is visible as the gworld is destroyed/created when visibility changes
- bool movieNewlyPlayable = loadState >= QTMovieLoadStateLoaded && m_loadState < QTMovieLoadStateLoaded;
- m_loadState = loadState;
-
- if (movieNewlyPlayable) {
- updateMovieSize();
- if (m_visible)
- clearGWorld();
- }
- }
-}
-
-void QTMovieGWorldPrivate::movieTimeChanged(QTMovie*)
-{
- // Do nothing
-}
-
-QTMovieGWorld::QTMovieGWorld(QTMovieGWorldClient* client)
- : m_private(new QTMovieGWorldPrivate(this))
-{
- m_private->m_client = client;
-}
-
-QTMovieGWorld::~QTMovieGWorld()
-{
- delete m_private;
-}
-
-void QTMovieGWorld::setSize(int width, int height)
-{
- m_private->setSize(width, height);
- QTMovieTask::sharedTask()->updateTaskTimer();
-}
-
-void QTMovieGWorld::setVisible(bool b)
-{
- m_private->m_visible = b;
- m_private->updateGWorld();
-}
-
-void QTMovieGWorld::getCurrentFrameInfo(void*& buffer, unsigned& bitsPerPixel, unsigned& rowBytes, unsigned& width, unsigned& height)
-{
- if (!m_private->m_gWorld) {
- buffer = 0;
- bitsPerPixel = 0;
- rowBytes = 0;
- width = 0;
- height = 0;
- return;
- }
- PixMapHandle offscreenPixMap = GetGWorldPixMap(m_private->m_gWorld);
- buffer = (*offscreenPixMap)->baseAddr;
- bitsPerPixel = (*offscreenPixMap)->pixelSize;
- rowBytes = (*offscreenPixMap)->rowBytes & 0x3FFF;
- width = m_private->m_width;
- height = m_private->m_height;
-}
-
-void QTMovieGWorld::paint(HDC hdc, int x, int y)
-{
- if (!m_private->m_gWorld)
- return;
-
- HDC hdcSrc = static_cast<HDC>(GetPortHDC(reinterpret_cast<GrafPtr>(m_private->m_gWorld)));
- if (!hdcSrc)
- return;
-
- // FIXME: If we could determine the movie has no alpha, we could use BitBlt for those cases, which might be faster.
- BLENDFUNCTION blendFunction;
- blendFunction.BlendOp = AC_SRC_OVER;
- blendFunction.BlendFlags = 0;
- blendFunction.SourceConstantAlpha = 255;
- blendFunction.AlphaFormat = AC_SRC_ALPHA;
- AlphaBlend(hdc, x, y, m_private->m_width, m_private->m_height, hdcSrc,
- 0, 0, m_private->m_width, m_private->m_height, blendFunction);
-}
-
-void QTMovieGWorld::setDisabled(bool b)
-{
- m_private->m_disabled = b;
-}
-
-bool QTMovieGWorld::isDisabled() const
-{
- return m_private->m_disabled;
-}
-
-LRESULT QTMovieGWorld::fullscreenWndProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- QTMovieGWorld* movie = static_cast<QTMovieGWorld*>(GetPropW(wnd, fullscreenQTMovieGWorldPointerProp));
-
- if (message == WM_DESTROY)
- RemovePropW(wnd, fullscreenQTMovieGWorldPointerProp);
-
- if (!movie)
- return DefWindowProc(wnd, message, wParam, lParam);
-
- return movie->m_private->m_fullscreenClient->fullscreenClientWndProc(wnd, message, wParam, lParam);
-}
-
-HWND QTMovieGWorld::enterFullscreen(QTMovieGWorldFullscreenClient* client)
-{
- m_private->m_fullscreenClient = client;
-
- BeginFullScreen(&m_private->m_fullscreenRestoreState, 0, 0, 0, &m_private->m_fullscreenWindow, 0, fullScreenAllowEvents);
- QTMLSetWindowWndProc(m_private->m_fullscreenWindow, fullscreenWndProc);
- CreatePortAssociation(GetPortNativeWindow(m_private->m_fullscreenWindow), 0, 0);
-
- GetMovieBox(m_private->m_movie, &m_private->m_fullscreenRect);
- GetMovieGWorld(m_private->m_movie, &m_private->m_fullscreenOrigGWorld, 0);
- SetMovieGWorld(m_private->m_movie, reinterpret_cast<CGrafPtr>(m_private->m_fullscreenWindow), GetGWorldDevice(reinterpret_cast<CGrafPtr>(m_private->m_fullscreenWindow)));
-
- // Set the size of the box to preserve aspect ratio
- Rect rect = m_private->m_fullscreenWindow->portRect;
-
- float movieRatio = static_cast<float>(m_private->m_width) / m_private->m_height;
- int windowWidth = rect.right - rect.left;
- int windowHeight = rect.bottom - rect.top;
- float windowRatio = static_cast<float>(windowWidth) / windowHeight;
- int actualWidth = (windowRatio > movieRatio) ? (windowHeight * movieRatio) : windowWidth;
- int actualHeight = (windowRatio < movieRatio) ? (windowWidth / movieRatio) : windowHeight;
- int offsetX = (windowWidth - actualWidth) / 2;
- int offsetY = (windowHeight - actualHeight) / 2;
-
- rect.left = offsetX;
- rect.right = offsetX + actualWidth;
- rect.top = offsetY;
- rect.bottom = offsetY + actualHeight;
-
- SetMovieBox(m_private->m_movie, &rect);
- ShowHideTaskBar(true);
-
- // Set the 'this' pointer on the HWND
- HWND wnd = static_cast<HWND>(GetPortNativeWindow(m_private->m_fullscreenWindow));
- SetPropW(wnd, fullscreenQTMovieGWorldPointerProp, static_cast<HANDLE>(this));
-
- return wnd;
-}
-
-void QTMovieGWorld::exitFullscreen()
-{
- if (!m_private->m_fullscreenWindow)
- return;
-
- HWND wnd = static_cast<HWND>(GetPortNativeWindow(m_private->m_fullscreenWindow));
- DestroyPortAssociation(reinterpret_cast<CGrafPtr>(m_private->m_fullscreenWindow));
- SetMovieGWorld(m_private->m_movie, m_private->m_fullscreenOrigGWorld, 0);
- EndFullScreen(m_private->m_fullscreenRestoreState, 0L);
- SetMovieBox(m_private->m_movie, &m_private->m_fullscreenRect);
- m_private->m_fullscreenWindow = 0;
-}
-
-void QTMovieGWorld::setMovie(PassRefPtr<QTMovie> movie)
-{
- if (m_private->m_qtMovie) {
- m_private->unregisterDrawingCallback();
- m_private->m_qtMovie->removeClient(m_private);
- m_private->m_qtMovie = 0;
- m_private->m_movie = 0;
- }
-
- m_private->m_qtMovie = movie;
-
- if (m_private->m_qtMovie) {
- m_private->m_qtMovie->addClient(m_private);
- m_private->m_movie = m_private->m_qtMovie->getMovieHandle();
- m_private->registerDrawingCallback();
- }
-}
-
-QTMovie* QTMovieGWorld::movie() const
-{
- return m_private->m_qtMovie.get();
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTMovieGWorldh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTMovieGWorld.h (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTMovieGWorld.h        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTMovieGWorld.h        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,83 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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.
- */
-
-#ifndef QTMovieGWorld_h
-#define QTMovieGWorld_h
-
-
-#include "QTMovie.h"
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <windows.h>
-
-#ifdef QTMOVIEWIN_EXPORTS
-#define QTMOVIEWIN_API __declspec(dllexport)
-#else
-#define QTMOVIEWIN_API __declspec(dllimport)
-#endif
-
-class QTMovieGWorld;
-class QTMovieGWorldPrivate;
-
-class QTMovieGWorldClient {
-public:
- virtual void movieNewImageAvailable(QTMovieGWorld*) = 0;
-};
-
-class QTMovieGWorldFullscreenClient {
-public:
- virtual LRESULT fullscreenClientWndProc(HWND, UINT message, WPARAM, LPARAM) = 0;
-};
-
-class QTMOVIEWIN_API QTMovieGWorld : public RefCounted<QTMovieGWorld> {
-public:
- QTMovieGWorld(QTMovieGWorldClient*);
- ~QTMovieGWorld();
-
- void getNaturalSize(int& width, int& height);
- void setSize(int width, int height);
-
- void setVisible(bool);
- void paint(HDC, int x, int y);
- void getCurrentFrameInfo(void*& buffer, unsigned& bitsPerPixel, unsigned& rowBytes, unsigned& width, unsigned& height);
-
- void setDisabled(bool);
- bool isDisabled() const;
-
- // Returns the full-screen window created
- HWND enterFullscreen(QTMovieGWorldFullscreenClient*);
- void exitFullscreen();
-
- void setMovie(PassRefPtr<QTMovie>);
- QTMovie* movie() const;
-
-private:
- static LRESULT fullscreenWndProc(HWND, UINT message, WPARAM, LPARAM);
-
- QTMovieGWorldPrivate* m_private;
- friend class QTMovieGWorldPrivate;
-};
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTMovieTaskcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTMovieTask.cpp (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTMovieTask.cpp        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTMovieTask.cpp        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,105 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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 "config.h"
-
-#include "QTMovieTask.h"
-
-// Put Movies.h first so build failures here point clearly to QuickTime
-#include <Movies.h>
-
-#include <wtf/HashSet.h>
-#include <wtf/StdLibExtras.h>
-#include <wtf/Vector.h>
-
-QTMovieTask::QTMovieTask()
- : m_setTaskTimerDelay(0)
- , m_stopTaskTimer(0)
-{
-}
-
-QTMovieTask::~QTMovieTask()
-{
-}
-
-QTMovieTask* QTMovieTask::sharedTask()
-{
- static QTMovieTask* s_sharedTask = new QTMovieTask;
- return s_sharedTask;
-}
-
-void QTMovieTask::updateTaskTimer(double maxInterval, double minInterval)
-{
- ASSERT(m_setTaskTimerDelay);
- if (!m_setTaskTimerDelay)
- return;
-
- ASSERT(m_stopTaskTimer);
- if (!m_taskList.size() && m_stopTaskTimer) {
- m_stopTaskTimer();
- return;
- }
-
- long intervalInMS;
- OSStatus status = QTGetTimeUntilNextTask(&intervalInMS, 1000);
- double interval = intervalInMS / 1000.0;
- if (interval < minInterval)
- interval = minInterval;
- if (interval > maxInterval)
- interval = maxInterval;
- m_setTaskTimerDelay(interval);
-}
-
-void QTMovieTask::fireTaskClients()
-{
- Vector<QTMovieTaskClient*> clients;
- copyToVector(m_taskList, clients);
- for (Vector<QTMovieTaskClient*>::iterator i = clients.begin(); i != clients.end(); ++i)
- (*i)->task();
-}
-
-void QTMovieTask::addTaskClient(QTMovieTaskClient* client)
-{
- ASSERT(client);
- if (!client)
- return;
-
- m_taskList.add(client);
-}
-
-void QTMovieTask::removeTaskClient(QTMovieTaskClient* client)
-{
- ASSERT(client);
- if (!client)
- return;
-
- m_taskList.remove(client);
-}
-
-void QTMovieTask::setTaskTimerFuncs(SetTaskTimerDelayFunc setTaskTimerDelay, StopTaskTimerFunc stopTaskTimer)
-{
- m_setTaskTimerDelay = setTaskTimerDelay;
- m_stopTaskTimer = stopTaskTimer;
-}
-
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTMovieTaskh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTMovieTask.h (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTMovieTask.h        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTMovieTask.h        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,69 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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.
- */
-
-#ifndef QTMovieTask_h
-#define QTMovieTask_h
-
-#include <wtf/HashSet.h>
-
-#ifdef QTMOVIEWIN_EXPORTS
-#define QTMOVIEWIN_API __declspec(dllexport)
-#else
-#define QTMOVIEWIN_API __declspec(dllimport)
-#endif
-
-class QTMovieTaskClient {
-public:
- virtual void task() = 0;
-};
-
-typedef void (*SetTaskTimerDelayFunc)(double);
-typedef void (*StopTaskTimerFunc)();
-
-class QTMOVIEWIN_API QTMovieTask {
-public:
- static QTMovieTask* sharedTask();
-
- void addTaskClient(QTMovieTaskClient* client);
- void removeTaskClient(QTMovieTaskClient*);
- void fireTaskClients();
-
- void updateTaskTimer(double maxInterval = 1.0, double minInterval = 1.0 / 30);
- void setTaskTimerFuncs(SetTaskTimerDelayFunc setTaskTimerDelay, StopTaskTimerFunc stopTaskTimer);
-
-protected:
- QTMovieTask();
- ~QTMovieTask();
-
- SetTaskTimerDelayFunc m_setTaskTimerDelay;
- StopTaskTimerFunc m_stopTaskTimer;
- HashSet<QTMovieTaskClient*> m_taskList;
-
-private:
- QTMovieTask(const QTMovieTask&);
- QTMovieTask& operator=(const QTMovieTask&);
-};
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTMovieVisualContextcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTMovieVisualContext.cpp (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTMovieVisualContext.cpp        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTMovieVisualContext.cpp        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,224 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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 "config.h"
-
-#include "QTMovieVisualContext.h"
-
-#include "QTMovieTask.h"
-#include <CVBase.h>
-#include <CVHostTime.h>
-#include <ImageCompression.h>
-#include <Movies.h>
-#include <windows.h>
-#include <wtf/PassOwnPtr.h>
-
-struct QTCVTimeStamp {
- CVTimeStamp t;
-};
-
-class QTMovieVisualContextPriv {
-public:
- QTMovieVisualContextPriv(QTMovieVisualContext* parent, QTMovieVisualContextClient* client, QTPixelBuffer::Type contextType);
- ~QTMovieVisualContextPriv();
-
- bool isImageAvailableForTime(const QTCVTimeStamp*) const;
- QTPixelBuffer imageForTime(const QTCVTimeStamp*);
- void task();
-
- QTVisualContextRef visualContextRef();
-
- void setMovie(PassRefPtr<QTMovie>);
- QTMovie* movie() const;
-
- static void imageAvailableCallback(QTVisualContextRef visualContext, const CVTimeStamp *timeStamp, void *refCon);
-
-private:
- QTMovieVisualContext* m_parent;
- QTMovieVisualContextClient* m_client;
- QTVisualContextRef m_visualContext;
- RefPtr<QTMovie> m_movie;
-
-};
-
-static CFDictionaryRef createPixelBufferOptionsDictionary(QTPixelBuffer::Type contextType)
-{
- const void* key = kQTVisualContextPixelBufferAttributesKey;
- const void* value = QTPixelBuffer::createPixelBufferAttributesDictionary(contextType);
- CFDictionaryRef pixelBufferOptions = CFDictionaryCreate(kCFAllocatorDefault, &key, &value, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
- CFRelease(value);
- return pixelBufferOptions;
-}
-
-static CFDictionaryRef pixelBufferCreationOptions(QTPixelBuffer::Type contextType)
-{
- if (contextType == QTPixelBuffer::ConfigureForCAImageQueue) {
- static CFDictionaryRef imageQueueOptions = createPixelBufferOptionsDictionary(contextType);
- return imageQueueOptions;
- }
-
- ASSERT(contextType == QTPixelBuffer::ConfigureForCGImage);
- static CFDictionaryRef cgImageOptions = createPixelBufferOptionsDictionary(contextType);
- return cgImageOptions;
-}
-
-QTMovieVisualContextPriv::QTMovieVisualContextPriv(QTMovieVisualContext* parent, QTMovieVisualContextClient* client, QTPixelBuffer::Type contextType)
- : m_parent(parent)
- , m_client(client)
- , m_visualContext(0)
-{
- typedef OSStatus ( __cdecl *pfnQTPixelBufferContextCreate)(CFAllocatorRef, CFDictionaryRef, QTVisualContextRef*);
- static pfnQTPixelBufferContextCreate pPixelBufferContextCreate = 0;
- if (!pPixelBufferContextCreate) {
- HMODULE qtmlDLL = ::LoadLibraryW(L"QTMLClient.dll");
- if (!qtmlDLL)
- return;
- pPixelBufferContextCreate = reinterpret_cast<pfnQTPixelBufferContextCreate>(GetProcAddress(qtmlDLL, "QTPixelBufferContextCreate"));
- if (!pPixelBufferContextCreate)
- return;
- }
-
- OSStatus status = pPixelBufferContextCreate(kCFAllocatorDefault, pixelBufferCreationOptions(contextType), &m_visualContext);
- if (status == noErr && m_visualContext)
- QTVisualContextSetImageAvailableCallback(m_visualContext, &QTMovieVisualContextPriv::imageAvailableCallback, static_cast<void*>(this));
-}
-
-QTMovieVisualContextPriv::~QTMovieVisualContextPriv()
-{
- if (m_visualContext)
- QTVisualContextSetImageAvailableCallback(m_visualContext, 0, 0);
-}
-
-bool QTMovieVisualContextPriv::isImageAvailableForTime(const QTCVTimeStamp* timeStamp) const
-{
- if (!m_visualContext)
- return false;
-
- return QTVisualContextIsNewImageAvailable(m_visualContext, reinterpret_cast<const CVTimeStamp*>(timeStamp));
-}
-
-QTPixelBuffer QTMovieVisualContextPriv::imageForTime(const QTCVTimeStamp* timeStamp)
-{
- QTPixelBuffer pixelBuffer;
- if (m_visualContext) {
- CVImageBufferRef newImage = 0;
- OSStatus status = QTVisualContextCopyImageForTime(m_visualContext, kCFAllocatorDefault, reinterpret_cast<const CVTimeStamp*>(timeStamp), &newImage);
- if (status == noErr)
- pixelBuffer.adopt(newImage);
- }
- return pixelBuffer;
-}
-
-void QTMovieVisualContextPriv::task()
-{
- if (m_visualContext)
- QTVisualContextTask(m_visualContext);
-}
-
-QTVisualContextRef QTMovieVisualContextPriv::visualContextRef()
-{
- return m_visualContext;
-}
-
-void QTMovieVisualContextPriv::setMovie(PassRefPtr<QTMovie> movie)
-{
- if (movie == m_movie)
- return;
-
- if (m_movie) {
- SetMovieVisualContext(m_movie->getMovieHandle(), 0);
- m_movie = 0;
- }
-
- if (movie)
- OSStatus status = SetMovieVisualContext(movie->getMovieHandle(), m_visualContext);
-
- m_movie = movie;
-}
-
-QTMovie* QTMovieVisualContextPriv::movie() const
-{
- return m_movie.get();
-}
-
-void QTMovieVisualContextPriv::imageAvailableCallback(QTVisualContextRef visualContext, const CVTimeStamp *timeStamp, void *refCon)
-{
- if (!refCon)
- return;
-
- QTMovieVisualContextPriv* vc = static_cast<QTMovieVisualContextPriv*>(refCon);
- if (!vc->m_client)
- return;
-
- vc->m_client->imageAvailableForTime(reinterpret_cast<const QTCVTimeStamp*>(timeStamp));
-}
-
-PassRefPtr<QTMovieVisualContext> QTMovieVisualContext::create(QTMovieVisualContextClient* client, QTPixelBuffer::Type contextType)
-{
- return adoptRef(new QTMovieVisualContext(client, contextType));
-}
-
-QTMovieVisualContext::QTMovieVisualContext(QTMovieVisualContextClient* client, QTPixelBuffer::Type contextType)
- : m_private(adoptPtr(new QTMovieVisualContextPriv(this, client, contextType)))
-{
-}
-
-QTMovieVisualContext::~QTMovieVisualContext()
-{
-}
-
-bool QTMovieVisualContext::isImageAvailableForTime(const QTCVTimeStamp* timeStamp) const
-{
- return m_private->isImageAvailableForTime(timeStamp);
-}
-
-QTPixelBuffer QTMovieVisualContext::imageForTime(const QTCVTimeStamp* timeStamp)
-{
- return m_private->imageForTime(timeStamp);
-}
-
-void QTMovieVisualContext::task()
-{
- m_private->task();
-}
-
-QTVisualContextRef QTMovieVisualContext::visualContextRef()
-{
- return m_private->visualContextRef();
-}
-
-void QTMovieVisualContext::setMovie(PassRefPtr<QTMovie> movie)
-{
- m_private->setMovie(movie);
-}
-
-QTMovie* QTMovieVisualContext::movie() const
-{
- return m_private->movie();
-}
-
-double QTMovieVisualContext::currentHostTime()
-{
- return CVGetCurrentHostTime() / CVGetHostClockFrequency();
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTMovieVisualContexth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTMovieVisualContext.h (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTMovieVisualContext.h        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTMovieVisualContext.h        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,79 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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.
- */
-
-#ifndef QTMovieVisualContext_h
-#define QTMovieVisualContext_h
-
-#ifdef QTMOVIEWIN_EXPORTS
-#define QTMOVIEWIN_API __declspec(dllexport)
-#else
-#define QTMOVIEWIN_API __declspec(dllimport)
-#endif
-
-#include "QTMovie.h"
-#include "QTMovieTask.h"
-#include "QTPixelBuffer.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/RefCounted.h>
-
-typedef const struct __CFDictionary* CFDictionaryRef;
-typedef struct OpaqueQTVisualContext* QTVisualContextRef;
-
-// QTCVTimeStamp is a struct containing only a CVTimeStamp. This is to
-// work around the inability of CVTimeStamp to be forward declared, in
-// addition to it being declared in different header files when building
-// the QTMovieWin and WebCore projects.
-struct QTCVTimeStamp;
-
-class QTMovieVisualContextClient {
-public:
- virtual void imageAvailableForTime(const QTCVTimeStamp*) = 0;
-};
-
-class QTMOVIEWIN_API QTMovieVisualContext : public RefCounted<QTMovieVisualContext> {
-public:
- static PassRefPtr<QTMovieVisualContext> create(QTMovieVisualContextClient*, QTPixelBuffer::Type);
- ~QTMovieVisualContext();
-
- bool isImageAvailableForTime(const QTCVTimeStamp*) const;
- QTPixelBuffer imageForTime(const QTCVTimeStamp*);
- void task();
-
- QTVisualContextRef visualContextRef();
-
- void setMovie(PassRefPtr<QTMovie>);
- QTMovie* movie() const;
-
- static double currentHostTime();
-
-protected:
- QTMovieVisualContext(QTMovieVisualContextClient*, QTPixelBuffer::Type);
- void setupVisualContext();
-
- friend class QTMovieVisualContextPriv;
- OwnPtr<QTMovieVisualContextPriv> m_private;
-};
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTMovieWinTimercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTMovieWinTimer.cpp (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTMovieWinTimer.cpp        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTMovieWinTimer.cpp        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,137 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007, 2009 Apple Computer, 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 "config.h"
-
-#include <windows.h>
-
-#include "QTMovieWinTimer.h"
-
-#include <wtf/Assertions.h>
-
-// This file is used by the QuickTime access DLL. It copies some WebCore code
-// which can't be used directly due to dependency issues.
-
-// FIXME: Find a way to do timers that can manage <10ms resolution properly too.
-
-static UINT_PTR timerID;
-static void (*sharedTimerFiredFunction)();
-
-static HINSTANCE instanceHandle = 0;
-
-static HWND timerWindowHandle = 0;
-static UINT timerFiredMessage = 0;
-static const LPCWSTR kTimerWindowClassName = L"TimerWindowClass";
-static bool processingCustomTimerMessage = false;
-
-static LRESULT CALLBACK TimerWindowWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- if (message == timerFiredMessage) {
- processingCustomTimerMessage = true;
- sharedTimerFiredFunction();
- processingCustomTimerMessage = false;
- } else if (message == WM_TIMER && wParam == timerID) {
- stopSharedTimer();
- sharedTimerFiredFunction();
- } else
- return DefWindowProc(hWnd, message, wParam, lParam);
- return 0;
-}
-
-static void initializeOffScreenTimerWindow()
-{
- if (timerWindowHandle)
- return;
-
- WNDCLASSEX wcex;
- memset(&wcex, 0, sizeof(WNDCLASSEX));
- wcex.cbSize = sizeof(WNDCLASSEX);
- wcex.lpfnWndProc = TimerWindowWndProc;
- wcex.hInstance = instanceHandle;
- wcex.lpszClassName = kTimerWindowClassName;
- RegisterClassEx(&wcex);
-
- timerWindowHandle = CreateWindow(kTimerWindowClassName, 0, 0,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, instanceHandle, 0);
- timerFiredMessage = RegisterWindowMessage(L"com.apple.WebKit.TimerFired");
-}
-
-void setSharedTimerFiredFunction(void (*f)())
-{
- sharedTimerFiredFunction = f;
-}
-
-void setSharedTimerFireDelay(double interval)
-{
- ASSERT(sharedTimerFiredFunction);
-
- unsigned intervalInMS;
- if (interval < 0)
- intervalInMS = 0;
- else {
- interval *= 1000;
- if (interval > USER_TIMER_MAXIMUM)
- intervalInMS = USER_TIMER_MAXIMUM;
- else
- intervalInMS = (unsigned)interval;
- }
-
- stopSharedTimer();
- initializeOffScreenTimerWindow();
-
- // We don't allow nested PostMessages, since the custom messages will effectively starve
- // painting and user input. (Win32 has a tri-level queue with application messages >
- // user input > WM_PAINT/WM_TIMER.)
- // In addition, if the queue contains input events that have been there since the last call to
- // GetQueueStatus, PeekMessage or GetMessage we favor timers.
- if (intervalInMS < USER_TIMER_MINIMUM
- && !processingCustomTimerMessage
- && !LOWORD(::GetQueueStatus(QS_ALLINPUT))) {
- // Windows SetTimer does not allow timeouts smaller than 10ms (USER_TIMER_MINIMUM)
- PostMessage(timerWindowHandle, timerFiredMessage, 0, 0);
- } else
- timerID = SetTimer(timerWindowHandle, timerFiredMessage, intervalInMS, 0);
-}
-
-void stopSharedTimer()
-{
- if (timerID) {
- KillTimer(timerWindowHandle, timerID);
- timerID = 0;
- }
-}
-
-void setSharedTimerInstanceHandle(HINSTANCE handle)
-{
- instanceHandle = handle;
-}
-
-double systemTime()
-{
- FILETIME ft;
- GetSystemTimeAsFileTime(&ft);
- ULARGE_INTEGER t;
- memcpy(&t, &ft, sizeof(t));
- return t.QuadPart * 0.0000001 - 11644473600.0;
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTMovieWinTimerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTMovieWinTimer.h (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTMovieWinTimer.h        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTMovieWinTimer.h        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,39 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007 Apple Computer, 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.
- */
-
-#ifndef QTMovieWinTimer_h
-#define QTMovieWinTimer_h
-
-// This header should not be included from WebCore.
-// It is used by the QuickTime access DLL. It copies some WebCore code
-// which can't be used directly due to dependency issues.
-
-void setSharedTimerFiredFunction(void (*)());
-void setSharedTimerFireDelay(double delay);
-void stopSharedTimer();
-void setSharedTimerInstanceHandle(HINSTANCE handle);
-double systemTime();
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTPixelBuffercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTPixelBuffer.cpp (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTPixelBuffer.cpp        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTPixelBuffer.cpp        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,256 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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 "config.h"
-
-#include "QTPixelBuffer.h"
-
-#include <CFNumber.h>
-#include <CFString.h>
-#include <CGColorSpace.h>
-#include <CGImage.h>
-#include <CVPixelBuffer.h>
-#include <QuickDraw.h>
-#include <memory.h>
-
-static OSStatus SetNumberValue(CFMutableDictionaryRef inDict, CFStringRef inKey, SInt32 inValue)
-{
- CFNumberRef number;
-
- number = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &inValue);
- if (!number)
- return coreFoundationUnknownErr;
-
- CFDictionarySetValue(inDict, inKey, number);
- CFRelease(number);
-
- return noErr;
-}
-
-CFDictionaryRef QTPixelBuffer::createPixelBufferAttributesDictionary(QTPixelBuffer::Type contextType)
-{
- static const CFStringRef kDirect3DCompatibilityKey = CFSTR("Direct3DCompatibility");
-
- CFMutableDictionaryRef pixelBufferAttributes = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
- if (contextType == QTPixelBuffer::ConfigureForCAImageQueue) {
- // Ask for D3D compatible pixel buffers so no further work is needed.
- CFDictionarySetValue(pixelBufferAttributes, kDirect3DCompatibilityKey, kCFBooleanTrue);
- } else {
- // Use the k32BGRAPixelFormat, as QuartzCore will be able to use the pixels directly,
- // without needing an additional copy or rendering pass.
- SetNumberValue(pixelBufferAttributes, kCVPixelBufferPixelFormatTypeKey, k32BGRAPixelFormat);
-
- // Set kCVPixelBufferBytesPerRowAlignmentKey to 16 to ensure that each row of pixels
- // starts at a 16 byte aligned address for most efficient data reading.
- SetNumberValue(pixelBufferAttributes, kCVPixelBufferBytesPerRowAlignmentKey, 16);
- CFDictionarySetValue(pixelBufferAttributes, kCVPixelBufferCGImageCompatibilityKey, kCFBooleanTrue);
- }
- return pixelBufferAttributes;
-}
-
-QTPixelBuffer::QTPixelBuffer()
- : m_pixelBuffer(0)
-{
-}
-
-QTPixelBuffer::QTPixelBuffer(const QTPixelBuffer& p)
- : m_pixelBuffer(p.m_pixelBuffer)
-{
- CVPixelBufferRetain(m_pixelBuffer);
-}
-
-QTPixelBuffer::QTPixelBuffer(CVPixelBufferRef ref)
- : m_pixelBuffer(ref)
-{
- CVPixelBufferRetain(m_pixelBuffer);
-}
-
-QTPixelBuffer::~QTPixelBuffer()
-{
- clear();
-}
-
-QTPixelBuffer& QTPixelBuffer::operator=(const QTPixelBuffer& p)
-{
- set(p.m_pixelBuffer);
- return *this;
-}
-
-void QTPixelBuffer::set(CVPixelBufferRef ref)
-{
- CVPixelBufferRetain(ref);
- CVPixelBufferRelease(m_pixelBuffer);
- m_pixelBuffer = ref;
-}
-
-CVPixelBufferRef QTPixelBuffer::pixelBufferRef()
-{
- return m_pixelBuffer;
-}
-
-void QTPixelBuffer::adopt(CVPixelBufferRef ref)
-{
- if (ref == m_pixelBuffer)
- return;
- CVPixelBufferRelease(m_pixelBuffer);
- m_pixelBuffer = ref;
-}
-
-void QTPixelBuffer::clear()
-{
- CVPixelBufferRelease(m_pixelBuffer);
- m_pixelBuffer = 0;
-}
-
-CVReturn QTPixelBuffer::lockBaseAddress()
-{
- return CVPixelBufferLockBaseAddress(m_pixelBuffer, 0);
-}
-
-CVReturn QTPixelBuffer::unlockBaseAddress()
-{
- return CVPixelBufferUnlockBaseAddress(m_pixelBuffer, 0);
-}
-
-void* QTPixelBuffer::baseAddress()
-{
- return CVPixelBufferGetBaseAddress(m_pixelBuffer);
-}
-
-size_t QTPixelBuffer::width() const
-{
- return CVPixelBufferGetWidth(m_pixelBuffer);
-}
-
-size_t QTPixelBuffer::height() const
-{
- return CVPixelBufferGetHeight(m_pixelBuffer);
-}
-
-unsigned long QTPixelBuffer::pixelFormatType() const
-{
- return CVPixelBufferGetPixelFormatType(m_pixelBuffer);
-}
-
-bool QTPixelBuffer::pixelFormatIs32ARGB() const
-{
- return CVPixelBufferGetPixelFormatType(m_pixelBuffer) == k32ARGBPixelFormat;
-}
-
-bool QTPixelBuffer::pixelFormatIs32BGRA() const
-{
- return CVPixelBufferGetPixelFormatType(m_pixelBuffer) == k32BGRAPixelFormat;
-}
-
-size_t QTPixelBuffer::bytesPerRow() const
-{
- return CVPixelBufferGetBytesPerRow(m_pixelBuffer);
-}
-
-size_t QTPixelBuffer::dataSize() const
-{
- return CVPixelBufferGetDataSize(m_pixelBuffer);
-}
-
-bool QTPixelBuffer::isPlanar() const
-{
- return CVPixelBufferIsPlanar(m_pixelBuffer);
-}
-
-size_t QTPixelBuffer::planeCount() const
-{
- return CVPixelBufferGetPlaneCount(m_pixelBuffer);
-}
-
-size_t QTPixelBuffer::widthOfPlane(size_t plane) const
-{
- return CVPixelBufferGetWidthOfPlane(m_pixelBuffer, plane);
-}
-
-size_t QTPixelBuffer::heightOfPlane(size_t plane) const
-{
- return CVPixelBufferGetHeightOfPlane(m_pixelBuffer, plane);
-}
-
-void* QTPixelBuffer::baseAddressOfPlane(size_t plane) const
-{
- return CVPixelBufferGetBaseAddressOfPlane(m_pixelBuffer, plane);
-}
-
-size_t QTPixelBuffer::bytesPerRowOfPlane(size_t plane) const
-{
- return CVPixelBufferGetBytesPerRowOfPlane(m_pixelBuffer, plane);
-}
-
-void QTPixelBuffer::getExtendedPixels(size_t* left, size_t* right, size_t* top, size_t* bottom) const
-{
- return CVPixelBufferGetExtendedPixels(m_pixelBuffer, left, right, top, bottom);
-}
-
-CFDictionaryRef QTPixelBuffer::attachments() const
-{
- return CVBufferGetAttachments(m_pixelBuffer, kCVAttachmentMode_ShouldPropagate);
-}
-
-void QTPixelBuffer::retainCallback(void* refcon)
-{
- CVPixelBufferRetain(static_cast<CVPixelBufferRef>(refcon));
-}
-
-void QTPixelBuffer::releaseCallback(void* refcon)
-{
- CVPixelBufferRelease(static_cast<CVPixelBufferRef>(refcon));
-}
-
-void QTPixelBuffer::imageQueueReleaseCallback(unsigned int type, uint64_t id, void* refcon)
-{
- CVPixelBufferRelease(static_cast<CVPixelBufferRef>(refcon));
-}
-
-void QTPixelBuffer::dataProviderReleaseBytePointerCallback(void* refcon, const void* pointer)
-{
- CVPixelBufferUnlockBaseAddress(static_cast<CVPixelBufferRef>(refcon), 0);
-}
-
-const void* QTPixelBuffer::dataProviderGetBytePointerCallback(void* refcon)
-{
- CVPixelBufferLockBaseAddress(static_cast<CVPixelBufferRef>(refcon), 0);
- return CVPixelBufferGetBaseAddress(static_cast<CVPixelBufferRef>(refcon));
-}
-
-size_t QTPixelBuffer::dataProviderGetBytesAtPositionCallback(void* refcon, void* buffer, size_t position, size_t count)
-{
- char* data = (char*)CVPixelBufferGetBaseAddress(static_cast<CVPixelBufferRef>(refcon));
- size_t size = CVPixelBufferGetDataSize(static_cast<CVPixelBufferRef>(refcon));
- if (size - position < count)
- count = size - position;
-
- memcpy(buffer, data+position, count);
- return count;
-}
-
-void QTPixelBuffer::dataProviderReleaseInfoCallback(void* refcon)
-{
- CVPixelBufferRelease(static_cast<CVPixelBufferRef>(refcon));
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTPixelBufferh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTPixelBuffer.h (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTPixelBuffer.h        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTPixelBuffer.h        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,100 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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.
- */
-
-#ifndef QTPixelBuffer_h
-#define QTPixelBuffer_h
-
-#ifdef QTMOVIEWIN_EXPORTS
-#define QTMOVIEWIN_API __declspec(dllexport)
-#else
-#define QTMOVIEWIN_API __declspec(dllimport)
-#endif
-
-#include <stdint.h>
-
-typedef struct __CVBuffer *CVBufferRef;
-typedef CVBufferRef CVPixelBufferRef;
-typedef struct CGImage* CGImageRef;
-typedef int32_t CVReturn;
-typedef const struct __CFDictionary * CFDictionaryRef;
-
-// QTPixelBuffer wraps QuickTime's implementation of CVPixelBuffer, so its functions are
-// safe to call within WebKit.
-class QTMOVIEWIN_API QTPixelBuffer {
-public:
- enum Type { ConfigureForCGImage, ConfigureForCAImageQueue };
- static CFDictionaryRef createPixelBufferAttributesDictionary(Type);
-
- QTPixelBuffer();
- QTPixelBuffer(const QTPixelBuffer&);
- QTPixelBuffer(CVPixelBufferRef);
- QTPixelBuffer& operator=(const QTPixelBuffer&);
- ~QTPixelBuffer();
-
- void set(CVPixelBufferRef);
- CVPixelBufferRef pixelBufferRef();
- void adopt(CVPixelBufferRef);
- void clear();
-
- CVReturn lockBaseAddress();
- CVReturn unlockBaseAddress();
- void* baseAddress();
-
- size_t width() const;
- size_t height() const;
- unsigned long pixelFormatType() const;
- bool pixelFormatIs32ARGB() const;
- bool pixelFormatIs32BGRA() const;
- size_t bytesPerRow() const;
- size_t dataSize() const;
-
- bool isPlanar() const;
- size_t planeCount() const;
- size_t widthOfPlane(size_t) const;
- size_t heightOfPlane(size_t) const;
- void* baseAddressOfPlane(size_t) const;
- size_t bytesPerRowOfPlane(size_t) const;
-
- void getExtendedPixels(size_t* left, size_t* right, size_t* top, size_t* bottom) const;
- CFDictionaryRef attachments() const;
-
- // Generic CFRetain/CFRelease callbacks
- static void releaseCallback(void* refcon);
- static void retainCallback(void* refcon);
-
- // CAImageQueue callbacks
- static void imageQueueReleaseCallback(unsigned int type, uint64_t id, void* refcon);
-
- // CGDataProvider callbacks
- static void dataProviderReleaseBytePointerCallback(void* refcon, const void* pointer);
- static const void* dataProviderGetBytePointerCallback(void* refcon);
- static size_t dataProviderGetBytesAtPositionCallback(void* refcon, void* buffer, size_t position, size_t count);
- static void dataProviderReleaseInfoCallback(void* refcon);
-
-private:
- CVPixelBufferRef m_pixelBuffer;
-};
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTTrackcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTTrack.cpp (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTTrack.cpp        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTTrack.cpp        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,120 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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 "config.h"
-
-#include "QTTrack.h"
-
-#include <Movies.h>
-#include <QTML.h>
-
-using namespace std;
-
-class QTTrackPrivate {
- WTF_MAKE_NONCOPYABLE(QTTrackPrivate);
-public:
- QTTrackPrivate();
- ~QTTrackPrivate();
-
- QTTrack* m_track;
- Track m_trackHandle;
-};
-
-QTTrackPrivate::QTTrackPrivate()
- : m_track(0)
- , m_trackHandle(0)
-{
-}
-
-QTTrackPrivate::~QTTrackPrivate()
-{
- m_trackHandle = 0;
-}
-
-PassRefPtr<QTTrack> QTTrack::create(Track trackHandle)
-{
- return adoptRef(new QTTrack(trackHandle));
-}
-
-QTTrack::QTTrack(Track trackHandle)
- : m_private(new QTTrackPrivate())
-{
- m_private->m_track = this;
- m_private->m_trackHandle = trackHandle;
-}
-
-QTTrack::~QTTrack()
-{
- delete m_private;
-}
-
-bool QTTrack::isEnabled() const
-{
- ASSERT(m_private->m_track);
- return GetTrackEnabled(m_private->m_trackHandle);
-}
-
-void QTTrack::setEnabled(bool enabled)
-{
- ASSERT(m_private->m_trackHandle);
- SetTrackEnabled(m_private->m_trackHandle, enabled);
-}
-
-CGAffineTransform QTTrack::getTransform() const
-{
- ASSERT(m_private->m_trackHandle);
- MatrixRecord m = {0};
- GetTrackMatrix(m_private->m_trackHandle, &m);
-
- ASSERT(!m.matrix[0][2]);
- ASSERT(!m.matrix[1][2]);
- CGAffineTransform transform = CGAffineTransformMake(
- Fix2X(m.matrix[0][0]),
- Fix2X(m.matrix[0][1]),
- Fix2X(m.matrix[1][0]),
- Fix2X(m.matrix[1][1]),
- Fix2X(m.matrix[2][0]),
- Fix2X(m.matrix[2][1]));
-
- return transform;
-}
-
-void QTTrack::setTransform(CGAffineTransform t)
-{
- ASSERT(m_private->m_trackHandle);
- MatrixRecord m = {{
- {X2Fix(t.a), X2Fix(t.b), 0},
- {X2Fix(t.c), X2Fix(t.d), 0},
- {X2Fix(t.tx), X2Fix(t.ty), fract1},
- }};
-
- SetTrackMatrix(m_private->m_trackHandle, &m);
-}
-
-void QTTrack::resetTransform()
-{
- ASSERT(m_private->m_trackHandle);
- SetTrackMatrix(m_private->m_trackHandle, 0);
-}
-
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinQTTrackh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/win/QTTrack.h (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/QTTrack.h        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/platform/graphics/win/QTTrack.h        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,64 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007, 2008, 2009, 2010 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.
- */
-
-#ifndef QTTrack_h
-#define QTTrack_h
-
-#include <windows.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-
-#include <CoreGraphics/CGAffineTransform.h>
-
-#ifdef QTMOVIEWIN_EXPORTS
-#define QTMOVIEWIN_API __declspec(dllexport)
-#else
-#define QTMOVIEWIN_API __declspec(dllimport)
-#endif
-
-class QTTrack;
-class QTTrackPrivate;
-typedef struct TrackType** Track;
-
-class QTMOVIEWIN_API QTTrack : public RefCounted<QTTrack> {
-public:
- static PassRefPtr<QTTrack> create(Track);
- ~QTTrack();
-
- CGAffineTransform getTransform() const;
- void setTransform(CGAffineTransform);
- void resetTransform();
-
- bool isEnabled() const;
- void setEnabled(bool);
-
- Track getTrackHandle() const;
-private:
- QTTrack(Track);
- QTTrackPrivate* m_private;
- friend class QTTrackPrivate;
-};
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorepluginswinPluginDatabaseWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/win/PluginDatabaseWin.cpp (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/win/PluginDatabaseWin.cpp        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Source/WebCore/plugins/win/PluginDatabaseWin.cpp        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -257,20 +257,6 @@
</span><span class="cx"> directories.append(String(installationDirectoryStr, installationDirectorySize / sizeof(WCHAR) - 1));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline void addQuickTimePluginDirectory(Vector<String>& directories)
-{
- DWORD type;
- WCHAR installationDirectoryStr[_MAX_PATH];
- DWORD installationDirectorySize = sizeof(installationDirectoryStr);
-
- HRESULT result = getRegistryValue(HKEY_LOCAL_MACHINE, L"Software\\Apple Computer, Inc.\\QuickTime", L"InstallDir", &type, &installationDirectoryStr, &installationDirectorySize);
-
- if (result == ERROR_SUCCESS && type == REG_SZ) {
- String pluginDir = String(installationDirectoryStr, installationDirectorySize / sizeof(WCHAR) - 1) + "\\plugins";
- directories.append(pluginDir);
- }
-}
-
</del><span class="cx"> static inline void addAdobeAcrobatPluginDirectory(Vector<String>& directories)
</span><span class="cx"> {
</span><span class="cx"> HKEY key;
</span><span class="lines">@@ -414,7 +400,6 @@
</span><span class="cx">
</span><span class="cx"> if (!ourDirectory.isNull())
</span><span class="cx"> directories.append(ourDirectory);
</span><del>- addQuickTimePluginDirectory(directories);
</del><span class="cx"> addAdobeAcrobatPluginDirectory(directories);
</span><span class="cx"> addMozillaPluginDirectories(directories);
</span><span class="cx"> addWindowsMediaPlayerPluginDirectory(directories);
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Tools/ChangeLog        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-03-12 Brent Fulgham <bfulgham@apple.com>
+
+ [Win] Remove use of QTSDK
+ https://bugs.webkit.org/show_bug.cgi?id=130049
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (initialize): Remove QuickTime code.
+ * win/AssembleBuildLogs/AssembleLogs.cmd: Don't grab logs from
+ building QTMovieWin.
+
</ins><span class="cx"> 2014-03-12 Martin Robinson <mrobinson@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK][CMAKE] Too verbose build output
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinDumpRenderTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -296,43 +296,6 @@
</span><span class="cx"> return path;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void addQTDirToPATH()
-{
- static LPCWSTR pathEnvironmentVariable = L"PATH";
- static LPCWSTR quickTimeKeyName = L"Software\\Apple Computer, Inc.\\QuickTime";
- static LPCWSTR quickTimeSysDir = L"QTSysDir";
- static bool initialized;
-
- if (initialized)
- return;
- initialized = true;
-
- // Get the QuickTime dll directory from the registry. The key can be in either HKLM or HKCU.
- WCHAR qtPath[MAX_PATH];
- DWORD qtPathBufferLen = sizeof(qtPath);
- DWORD keyType;
- HRESULT result = SHGetValue(HKEY_LOCAL_MACHINE, quickTimeKeyName, quickTimeSysDir, &keyType, (LPVOID)qtPath, &qtPathBufferLen);
- if (result != ERROR_SUCCESS || !qtPathBufferLen || keyType != REG_SZ) {
- qtPathBufferLen = sizeof(qtPath);
- result = SHGetValue(HKEY_CURRENT_USER, quickTimeKeyName, quickTimeSysDir, &keyType, (LPVOID)qtPath, &qtPathBufferLen);
- if (result != ERROR_SUCCESS || !qtPathBufferLen || keyType != REG_SZ)
- return;
- }
-
- // Read the current PATH.
- DWORD pathSize = GetEnvironmentVariableW(pathEnvironmentVariable, 0, 0);
- Vector<WCHAR> oldPath(pathSize);
- if (!GetEnvironmentVariableW(pathEnvironmentVariable, oldPath.data(), oldPath.size()))
- return;
-
- // And add the QuickTime dll.
- wstring newPath;
- newPath.append(qtPath);
- newPath.append(L";");
- newPath.append(oldPath.data(), oldPath.size());
- SetEnvironmentVariableW(pathEnvironmentVariable, newPath.data());
-}
-
</del><span class="cx"> #ifdef DEBUG_ALL
</span><span class="cx"> #define WEBKITDLL TEXT("WebKit_debug.dll")
</span><span class="cx"> #else
</span><span class="lines">@@ -395,10 +358,6 @@
</span><span class="cx"> for (int i = 0; i < ARRAYSIZE(fontsToInstall); ++i)
</span><span class="cx"> textRenderer->registerPrivateFont(wstring(resourcesPath + fontsToInstall[i]).c_str());
</span><span class="cx">
</span><del>- // Add the QuickTime dll directory to PATH or QT 7.6 will fail to initialize on systems
- // linked with older versions of qtmlclientlib.dll.
- addQTDirToPATH();
-
</del><span class="cx"> // Register a host window
</span><span class="cx"> WNDCLASSEX wcex;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolswinAssembleBuildLogsAssembleLogscmd"></a>
<div class="modfile"><h4>Modified: trunk/Tools/win/AssembleBuildLogs/AssembleLogs.cmd (165475 => 165476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/win/AssembleBuildLogs/AssembleLogs.cmd        2014-03-12 16:46:49 UTC (rev 165475)
+++ trunk/Tools/win/AssembleBuildLogs/AssembleLogs.cmd        2014-03-12 17:02:06 UTC (rev 165476)
</span><span class="lines">@@ -118,16 +118,7 @@
</span><span class="cx"> echo _________________________________________________________ >> "%CONFIGURATIONBUILDDIR%\BuildOutput.htm"
</span><span class="cx"> type "%CONFIGURATIONBUILDDIR%\obj%PlatformArchitecture%\WebCoreGenerated\BuildLog.htm" >> "%CONFIGURATIONBUILDDIR%\BuildOutput.htm"
</span><span class="cx">
</span><del>-if not exist "%CONFIGURATIONBUILDDIR%\obj%PlatformArchitecture%\QTMovieWin\BuildLog.htm" GOTO SkipQTMovieWin
-
</del><span class="cx"> echo _________________________________________________________ >> "%CONFIGURATIONBUILDDIR%\BuildOutput.htm"
</span><del>-echo COMPILING QTMovieWin... >> "%CONFIGURATIONBUILDDIR%\BuildOutput.htm"
-echo _________________________________________________________ >> "%CONFIGURATIONBUILDDIR%\BuildOutput.htm"
-type "%CONFIGURATIONBUILDDIR%\obj%PlatformArchitecture%\QTMovieWin\BuildLog.htm" >> "%CONFIGURATIONBUILDDIR%\BuildOutput.htm"
-
-:SkipQTMovieWin
-
-echo _________________________________________________________ >> "%CONFIGURATIONBUILDDIR%\BuildOutput.htm"
</del><span class="cx"> echo COMPILING WebCore... >> "%CONFIGURATIONBUILDDIR%\BuildOutput.htm"
</span><span class="cx"> echo _________________________________________________________ >> "%CONFIGURATIONBUILDDIR%\BuildOutput.htm"
</span><span class="cx"> type "%CONFIGURATIONBUILDDIR%\obj%PlatformArchitecture%\WebCore\BuildLog.htm" >> "%CONFIGURATIONBUILDDIR%\BuildOutput.htm"
</span></span></pre>
</div>
</div>
</body>
</html>