MCPcopy Create free account
hub / github.com/axmolengine/axmol / GetNativeVideoSize

Method GetNativeVideoSize

core/media/WmfMediaEngine.cpp:1763–1800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1761}
1762
1763HRESULT WmfMediaEngine::GetNativeVideoSize(DWORD* cx, DWORD* cy)
1764{
1765 if (!m_videoInputType || !cx || !cy)
1766 return E_POINTER;
1767
1768 HRESULT hr = S_OK;
1769 UINT32 width = 0, height = 0;
1770
1771 MFVideoArea mfArea = {0};
1772
1773 do
1774 {
1775 BOOL bPanScan = MFGetAttributeUINT32(m_videoInputType.Get(), MF_MT_PAN_SCAN_ENABLED, FALSE);
1776 if (bPanScan)
1777 {
1778 hr = m_videoInputType->GetBlob(MF_MT_PAN_SCAN_APERTURE, (UINT8*)&mfArea, sizeof(MFVideoArea), nullptr);
1779 AX_BREAK_IF(SUCCEEDED(hr));
1780 }
1781
1782 hr = m_videoInputType->GetBlob(MF_MT_MINIMUM_DISPLAY_APERTURE, (UINT8*)&mfArea, sizeof(MFVideoArea), nullptr);
1783 AX_BREAK_IF(SUCCEEDED(hr));
1784
1785 hr = m_videoInputType->GetBlob(MF_MT_GEOMETRIC_APERTURE, (UINT8*)&mfArea, sizeof(MFVideoArea), nullptr);
1786
1787 } while (false);
1788
1789 if (SUCCEEDED(hr))
1790 {
1791 *cx = mfArea.Area.cx;
1792 *cy = mfArea.Area.cy;
1793 }
1794 else // fallback to frame extent
1795 {
1796 *cx = m_frameExtent.x;
1797 *cy = m_frameExtent.y;
1798 }
1799 return hr;
1800}
1801
1802}
1803

Callers 1

UpdateVideoExtentMethod · 0.80

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected