WebKit Bugzilla
Attachment 371573 Details for
Bug 198523
: [WinCairo][MediaFoundation] Remove the unused video window
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198523-20190607164922.patch (text/plain), 11.71 KB, created by
Fujii Hironori
on 2019-06-07 00:49:23 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2019-06-07 00:49:23 PDT
Size:
11.71 KB
patch
obsolete
>Subversion Revision: 246186 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5a9bb699a82b2889ff305d1f5cb109a15cb6236f..51469ad18e762ee2cd1264803e3d5a0b78e25612 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,33 @@ >+2019-06-07 Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ [WinCairo][MediaFoundation] Remove the unused video window >+ https://bugs.webkit.org/show_bug.cgi?id=198523 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove the video window which had been unused since Bug 150941. >+ >+ No behavior change. >+ >+ * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: >+ (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation): >+ (WebCore::MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation): >+ (WebCore::MediaPlayerPrivateMediaFoundation::setSize): >+ (WebCore::MediaPlayerPrivateMediaFoundation::paint): >+ (WebCore::MediaPlayerPrivateMediaFoundation::hostWindow): >+ (WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode): >+ (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow): >+ (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect): >+ (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples): >+ (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample): >+ (WebCore::MediaPlayerPrivateMediaFoundation::VideoViewWndProc): Deleted. >+ (WebCore::MediaPlayerPrivateMediaFoundation::registerVideoWindowClass): Deleted. >+ (WebCore::MediaPlayerPrivateMediaFoundation::createVideoWindow): Deleted. >+ (WebCore::MediaPlayerPrivateMediaFoundation::destroyVideoWindow): Deleted. >+ (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSwapChain): Deleted. >+ (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::updateDestRect): Deleted. >+ * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: >+ > 2019-06-06 Devin Rousso <drousso@apple.com> > > Web Inspector: Timelines: only complete Composite records if the m_startedComposite (followup to r246142) >diff --git a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp >index 00b0d0884fc282b1c7f226ecd6ae507a0a6f85ee..c6fa6d4aaa0471bcad880df88212eb86fb311a66 100644 >--- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp >+++ b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp >@@ -92,18 +92,15 @@ MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation(MediaPlayer > , m_hasVideo(false) > , m_preparingToPlay(false) > , m_volume(1.0) >- , m_hwndVideo(nullptr) > , m_networkState(MediaPlayer::Empty) > , m_readyState(MediaPlayer::HaveNothing) > { > createSession(); >- createVideoWindow(); > } > > MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation() > { > notifyDeleted(); >- destroyVideoWindow(); > endSession(); > } > >@@ -359,8 +356,6 @@ void MediaPlayerPrivateMediaFoundation::setSize(const IntSize& size) > if (!videoDisplay) > return; > >- IntPoint positionInWindow(m_lastPaintRect.location()); >- > FrameView* view = nullptr; > float deviceScaleFactor = 1.0f; > if (m_player && m_player->cachedResourceLoader() && m_player->cachedResourceLoader()->document()) { >@@ -368,22 +363,9 @@ void MediaPlayerPrivateMediaFoundation::setSize(const IntSize& size) > deviceScaleFactor = m_player->cachedResourceLoader()->document()->deviceScaleFactor(); > } > >- LayoutPoint scrollPosition; >- if (view) { >- scrollPosition = view->scrollPositionForFixedPosition(); >- positionInWindow = view->convertToContainingWindow(IntPoint(m_lastPaintRect.location())); >- } >- >- positionInWindow.move(-scrollPosition.x().toInt(), -scrollPosition.y().toInt()); >- >- int x = positionInWindow.x() * deviceScaleFactor; >- int y = positionInWindow.y() * deviceScaleFactor; > int w = m_size.width() * deviceScaleFactor; > int h = m_size.height() * deviceScaleFactor; > >- if (m_hwndVideo) >- ::MoveWindow(m_hwndVideo, x, y, w, h, FALSE); >- > RECT rc = { 0, 0, w, h }; > videoDisplay->SetVideoPosition(nullptr, &rc); > } >@@ -393,8 +375,6 @@ void MediaPlayerPrivateMediaFoundation::paint(GraphicsContext& context, const Fl > if (context.paintingDisabled() || !m_player->visible()) > return; > >- m_lastPaintRect = rect; >- > if (m_presenter) > m_presenter->paintCurrentFrame(context, rect); > } >@@ -645,64 +625,14 @@ bool MediaPlayerPrivateMediaFoundation::addBranchToPartialTopology(int stream) > return true; > } > >-LRESULT CALLBACK MediaPlayerPrivateMediaFoundation::VideoViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) >-{ >- return DefWindowProc(hWnd, message, wParam, lParam); >-} >- >-LPCWSTR MediaPlayerPrivateMediaFoundation::registerVideoWindowClass() >-{ >- const LPCWSTR kVideoWindowClassName = L"WebVideoWindowClass"; >- >- static bool haveRegisteredWindowClass = false; >- if (haveRegisteredWindowClass) >- return kVideoWindowClassName; >- >- haveRegisteredWindowClass = true; >- >- WNDCLASSEX wcex; >- >- wcex.cbSize = sizeof(WNDCLASSEX); >- >- wcex.style = CS_DBLCLKS; >- wcex.lpfnWndProc = VideoViewWndProc; >- wcex.cbClsExtra = 0; >- wcex.cbWndExtra = 0; >- wcex.hInstance = nullptr; >- wcex.hIcon = nullptr; >- wcex.hCursor = ::LoadCursor(0, IDC_ARROW); >- wcex.hbrBackground = nullptr; >- wcex.lpszMenuName = nullptr; >- wcex.lpszClassName = kVideoWindowClassName; >- wcex.hIconSm = nullptr; >- >- if (RegisterClassEx(&wcex)) >- return kVideoWindowClassName; >- >- return nullptr; >-} >- >-void MediaPlayerPrivateMediaFoundation::createVideoWindow() >-{ >- HWND hWndParent = nullptr; >- FrameView* view = nullptr; >- if (!m_player || !m_player->cachedResourceLoader() || !m_player->cachedResourceLoader()->document()) >- return; >- view = m_player->cachedResourceLoader()->document()->view(); >- if (!view || !view->hostWindow()) >- return; >- hWndParent = view->hostWindow()->platformPageClient(); >- >- m_hwndVideo = CreateWindowEx(WS_EX_NOACTIVATE | WS_EX_TRANSPARENT, registerVideoWindowClass(), 0, WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, >- 0, 0, 0, 0, hWndParent, 0, 0, 0); >-} >- >-void MediaPlayerPrivateMediaFoundation::destroyVideoWindow() >+HWND MediaPlayerPrivateMediaFoundation::hostWindow() > { >- if (m_hwndVideo) { >- DestroyWindow(m_hwndVideo); >- m_hwndVideo = nullptr; >+ if (m_player && m_player->cachedResourceLoader() && !m_player->cachedResourceLoader()->document()) { >+ auto* view = m_player->cachedResourceLoader()->document()->view(); >+ if (view && view->hostWindow() && view->hostWindow()->platformPageClient()) >+ return view->hostWindow()->platformPageClient(); > } >+ return GetDesktopWindow(); > } > > void MediaPlayerPrivateMediaFoundation::invalidateFrameView() >@@ -784,7 +714,7 @@ bool MediaPlayerPrivateMediaFoundation::createOutputNode(COMPtr<IMFStreamDescrip > return false; > > m_presenter = new CustomVideoPresenter(this); >- m_presenter->SetVideoWindow(m_hwndVideo); >+ m_presenter->SetVideoWindow(hostWindow()); > if (FAILED(rendererActivate->SetUnknown(MF_ACTIVATE_CUSTOM_VIDEO_PRESENTER_ACTIVATE, static_cast<IMFActivate*>(m_presenter.get())))) > return false; > m_hasVideo = true; >@@ -2748,7 +2678,6 @@ HRESULT MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow(HWN > { > LockHolder locker(m_lock); > m_hwnd = hwnd; >- updateDestRect(); > } > > return createD3DDevice(); >@@ -2762,7 +2691,6 @@ HRESULT MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect > LockHolder locker(m_lock); > > m_destRect = rcDest; >- updateDestRect(); > > return S_OK; > } >@@ -2793,8 +2721,6 @@ HRESULT MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples > return hr; > } > >- updateDestRect(); >- > static const int presenterBufferCount = 3; > > for (int i = 0; i < presenterBufferCount; i++) { >@@ -2902,13 +2828,6 @@ HRESULT MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample(IMFS > } > } > >- // Since we want to draw to the GraphicsContext provided in the paint method, >- // and not draw directly to the window, we skip presenting the swap chain: >- >- // COMPtr<IDirect3DSwapChain9> swapChain; >- // hr = surface->GetContainer(__uuidof(IDirect3DSwapChain9), (LPVOID*)&swapChain)); >- // hr = presentSwapChain(swapChain, surface)); >- > // Keep the last surface for repaints. > m_surfaceRepaint = surface; > } >@@ -3074,14 +2993,6 @@ HRESULT MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DSample(ID > return MFCreateVideoSampleFromSurfacePtr()(surface.get(), &videoSample); > } > >-HRESULT MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSwapChain(IDirect3DSwapChain9* swapChain, IDirect3DSurface9* surface) >-{ >- if (!m_hwnd) >- return MF_E_INVALIDREQUEST; >- >- return swapChain->Present(nullptr, &m_destRect, m_hwnd, nullptr, 0); >-} >- > HRESULT MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getSwapChainPresentParameters(IMFMediaType* type, D3DPRESENT_PARAMETERS* presentParams) > { > if (!m_hwnd) >@@ -3122,25 +3033,6 @@ HRESULT MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getSwapChainPresen > return S_OK; > } > >-HRESULT MediaPlayerPrivateMediaFoundation::Direct3DPresenter::updateDestRect() >-{ >- if (!m_hwnd) >- return S_FALSE; >- >- RECT rcView; >- if (!GetClientRect(m_hwnd, &rcView)) >- return E_FAIL; >- >- // Clip to the client area of the window. >- if (m_destRect.right > rcView.right) >- m_destRect.right = rcView.right; >- >- if (m_destRect.bottom > rcView.bottom) >- m_destRect.bottom = rcView.bottom; >- >- return S_OK; >-} >- > } // namespace WebCore > > #endif >diff --git a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h >index d85f17590206c1784fea24eb66fb8e5af0916a72..44be63611d126aba95874c1577e36bd95b5c1f57 100644 >--- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h >+++ b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h >@@ -110,10 +110,8 @@ private: > bool m_hasVideo; > bool m_preparingToPlay; > float m_volume; >- HWND m_hwndVideo; > MediaPlayer::NetworkState m_networkState; > MediaPlayer::ReadyState m_readyState; >- FloatRect m_lastPaintRect; > > class MediaPlayerListener; > HashSet<MediaPlayerListener*> m_listeners; >@@ -151,10 +149,7 @@ private: > void onSessionStarted(); > void onSessionEnded(); > >- LPCWSTR registerVideoWindowClass(); >- void createVideoWindow(); >- void destroyVideoWindow(); >- >+ HWND hostWindow(); > void invalidateFrameView(); > > void addListener(MediaPlayerListener*); >@@ -162,8 +157,6 @@ private: > void setNaturalSize(const FloatSize&); > void notifyDeleted(); > >- static LRESULT CALLBACK VideoViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); >- > bool setAllChannelVolumes(float); > > class MediaPlayerListener { >@@ -299,9 +292,6 @@ private: > HRESULT getSwapChainPresentParameters(IMFMediaType*, D3DPRESENT_PARAMETERS* presentParams); > HRESULT createD3DDevice(); > HRESULT createD3DSample(IDirect3DSwapChain9*, COMPtr<IMFSample>& videoSample); >- HRESULT updateDestRect(); >- >- HRESULT presentSwapChain(IDirect3DSwapChain9*, IDirect3DSurface9*); > > UINT m_deviceResetToken { 0 }; > HWND m_hwnd { nullptr };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198523
:
371262
|
371571
| 371573