本文整理汇总了C++中IDeckLinkOutput::SetScheduledFrameCompletionCallback方法的典型用法代码示例。如果您正苦于以下问题:C++ IDeckLinkOutput::SetScheduledFrameCompletionCallback方法的具体用法?C++ IDeckLinkOutput::SetScheduledFrameCompletionCallback怎么用?C++ IDeckLinkOutput::SetScheduledFrameCompletionCallback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDeckLinkOutput
的用法示例。
在下文中一共展示了IDeckLinkOutput::SetScheduledFrameCompletionCallback方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: open
bool open( unsigned card = 0 )
{
IDeckLinkIterator* deckLinkIterator = CreateDeckLinkIteratorInstance();
unsigned i = 0;
if ( !deckLinkIterator )
{
mlt_log_verbose( NULL, "The DeckLink drivers not installed.\n" );
return false;
}
// Connect to the Nth DeckLink instance
do {
if ( deckLinkIterator->Next( &m_deckLink ) != S_OK )
{
mlt_log_verbose( NULL, "DeckLink card not found\n" );
deckLinkIterator->Release();
return false;
}
} while ( ++i <= card );
// Obtain the audio/video output interface (IDeckLinkOutput)
if ( m_deckLink->QueryInterface( IID_IDeckLinkOutput, (void**)&m_deckLinkOutput ) != S_OK )
{
mlt_log_verbose( NULL, "No DeckLink cards support output\n" );
m_deckLink->Release();
m_deckLink = 0;
deckLinkIterator->Release();
return false;
}
// Provide this class as a delegate to the audio and video output interfaces
m_deckLinkOutput->SetScheduledFrameCompletionCallback( this );
m_deckLinkOutput->SetAudioCallback( this );
pthread_mutex_init( &m_mutex, NULL );
pthread_cond_init( &m_condition, NULL );
m_maxAudioBuffer = bmdAudioSampleRate48kHz;
m_videoFrameQ = mlt_deque_init();
return true;
}
示例2: open_card
void open_card( ) {
IDeckLinkDisplayModeIterator *it;
/* get the DeckLinkOutput interface */
if (deckLink->QueryInterface(IID_IDeckLinkOutput,
(void **)&deckLinkOutput) != S_OK) {
throw std::runtime_error(
"Failed to get DeckLink output interface handle"
);
}
if (deckLinkOutput->SetScheduledFrameCompletionCallback(this)
!= S_OK) {
throw std::runtime_error(
"Failed to set DeckLink frame completion callback"
);
}
/* attempt to determine field dominance */
if (deckLinkOutput->GetDisplayModeIterator(&it) != S_OK) {
throw std::runtime_error(
"DeckLink output: failed to get display mode iterator"
);
}
dominance = find_dominance(norms[norm].mode, it);
it->Release( );
/* and we're off to the races */
if (deckLinkOutput->EnableVideoOutput(norms[norm].mode,
bmdVideoOutputFlagDefault) != S_OK) {
throw std::runtime_error(
"Failed to enable DeckLink video output"
);
}
}