本文整理汇总了C++中IDeckLinkDisplayMode::AddRef方法的典型用法代码示例。如果您正苦于以下问题:C++ IDeckLinkDisplayMode::AddRef方法的具体用法?C++ IDeckLinkDisplayMode::AddRef怎么用?C++ IDeckLinkDisplayMode::AddRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDeckLinkDisplayMode
的用法示例。
在下文中一共展示了IDeckLinkDisplayMode::AddRef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RefreshDisplayModeMenu
void CSignalGeneratorDlg::RefreshDisplayModeMenu(void)
{
// Populate the display mode combo with a list of display modes supported by the installed DeckLink card
IDeckLinkDisplayModeIterator* displayModeIterator;
IDeckLinkDisplayMode* deckLinkDisplayMode;
BMDPixelFormat pixelFormat;
pixelFormat = (BMDPixelFormat)m_pixelFormatCombo.GetItemData(m_pixelFormatCombo.GetCurSel());
for (int i = 1; i < m_videoFormatCombo.GetCount(); i++)
{
deckLinkDisplayMode = (IDeckLinkDisplayMode*)m_videoFormatCombo.GetItemDataPtr(i-1);
deckLinkDisplayMode->Release();
}
m_videoFormatCombo.ResetContent();
if (m_deckLinkOutput->GetDisplayModeIterator(&displayModeIterator) != S_OK)
return;
while (displayModeIterator->Next(&deckLinkDisplayMode) == S_OK)
{
BSTR modeName;
int newIndex;
HRESULT hr;
BMDDisplayModeSupport displayModeSupport;
BMDVideoOutputFlags videoOutputFlags = bmdVideoOutputDualStream3D;
if (deckLinkDisplayMode->GetName(&modeName) != S_OK)
{
deckLinkDisplayMode->Release();
continue;
}
CString modeNameCString(modeName);
newIndex = m_videoFormatCombo.AddString(modeNameCString);
m_videoFormatCombo.SetItemDataPtr(newIndex, deckLinkDisplayMode);
hr = m_deckLinkOutput->DoesSupportVideoMode(deckLinkDisplayMode->GetDisplayMode(), pixelFormat, videoOutputFlags, &displayModeSupport, NULL);
if (hr != S_OK || ! displayModeSupport)
{
SysFreeString(modeName);
continue;
}
CString modeName3DCString(modeName);
modeName3DCString += _T(" 3D");
newIndex = m_videoFormatCombo.AddString(modeName3DCString);
m_videoFormatCombo.SetItemDataPtr(newIndex, deckLinkDisplayMode);
deckLinkDisplayMode->AddRef();
SysFreeString(modeName);
}
displayModeIterator->Release();
m_videoFormatCombo.SetCurSel(0);
}