本文整理汇总了C++中IDeckLinkIterator::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ IDeckLinkIterator::Release方法的具体用法?C++ IDeckLinkIterator::Release怎么用?C++ IDeckLinkIterator::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDeckLinkIterator
的用法示例。
在下文中一共展示了IDeckLinkIterator::Release方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: krad_decklink_cpp_detect_devices
int krad_decklink_cpp_detect_devices () {
IDeckLinkIterator *deckLinkIterator;
IDeckLink *deckLink;
int device_count;
//HRESULT result;
device_count = 0;
deckLinkIterator = CreateDeckLinkIteratorInstance();
if (deckLinkIterator == NULL) {
printke ("krad_decklink_detect_devices: The DeckLink drivers may not be installed.");
return 0;
}
while (deckLinkIterator->Next(&deckLink) == S_OK) {
device_count++;
deckLink->Release();
}
deckLinkIterator->Release();
return device_count;
}
示例2: init
bool DeckLinkController::init() {
IDeckLinkIterator* deckLinkIterator = NULL;
IDeckLink* deckLink = NULL;
bool result = false;
// Create an iterator
deckLinkIterator = CreateDeckLinkIteratorInstance();
if (deckLinkIterator == NULL) {
ofLogError("DeckLinkController") << "Please install the Blackmagic Desktop Video drivers to use the features of this application.";
goto bail;
}
// List all DeckLink devices
while (deckLinkIterator->Next(&deckLink) == S_OK) {
// Add device to the device list
deviceList.push_back(deckLink);
}
if (deviceList.size() == 0) {
ofLogError("DeckLinkController") << "You will not be able to use the features of this application until a Blackmagic device is installed.";
goto bail;
}
result = true;
bail:
if (deckLinkIterator != NULL) {
deckLinkIterator->Release();
deckLinkIterator = NULL;
}
return result;
}
示例3: dl_list_devices
//
// Get a list of the names of the cards
//
int dl_list_devices( CaptureCardList *cards ){
IDeckLinkIterator* deckLinkIterator;
IDeckLink* deckLink;
int numDevices = 0;
HRESULT result;
// Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system
deckLinkIterator = CreateDeckLinkIteratorInstance();
if (deckLinkIterator == NULL)
{
//fprintf(stderr, "A DeckLink iterator could not be created. The DeckLink drivers may not be installed.\n");
return 0;
}
while (deckLinkIterator->Next(&deckLink) == S_OK)
{
char * deviceNameString = NULL;
// *** Print the model name of the DeckLink card
result = deckLink->GetModelName((const char **) &deviceNameString);
if (result == S_OK){
if(numDevices < MAX_CAPTURE_LIST_ITEMS){
strcpy(cards->item[numDevices],deviceNameString);
}
numDevices++;
free(deviceNameString);
}
// Release the IDeckLink instance when we've finished with it to prevent leaks
deckLink->Release();
}
deckLinkIterator->Release();
cards->items = numDevices;
return numDevices;
}
示例4: CreateDeckLinkIteratorInstance
int old_main (int argc, char** argv)
{
IDeckLinkIterator* deckLinkIterator;
IDeckLink* deckLink;
int numDevices = 0;
HRESULT result;
// Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system
deckLinkIterator = CreateDeckLinkIteratorInstance();
if (deckLinkIterator == NULL)
{
fprintf(stderr, "A DeckLink iterator could not be created. The DeckLink drivers may not be installed.\n");
return 1;
}
// Enumerate all cards in this system
while (deckLinkIterator->Next(&deckLink) == S_OK)
{
char * deviceNameString = NULL;
// Increment the total number of DeckLink cards found
numDevices++;
if (numDevices > 1)
printf("\n\n");
// *** Print the model name of the DeckLink card
result = deckLink->GetModelName((const char **) &deviceNameString);
if (result == S_OK)
{
printf("=============== %s ===============\n\n", deviceNameString);
free(deviceNameString);
}
print_attributes(deckLink);
// ** List the video output display modes supported by the card
print_output_modes(deckLink);
// ** List the video input display modes supported by the card
print_input_modes(deckLink);
// ** List the input and output capabilities of the card
print_capabilities(deckLink);
// Release the IDeckLink instance when we've finished with it to prevent leaks
deckLink->Release();
}
deckLinkIterator->Release();
// If no DeckLink cards were found in the system, inform the user
if (numDevices == 0)
printf("No Blackmagic Design devices were found.\n");
printf("\n");
return 0;
}
示例5: 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;
}
示例6: InitDeckLink
bool BMDOpenGLOutput::InitDeckLink()
{
bool bSuccess = FALSE;
IDeckLinkIterator* pDLIterator = NULL;
pDLIterator = CreateDeckLinkIteratorInstance();
if (pDLIterator == NULL)
{
QMessageBox::critical(NULL,"This application requires the DeckLink drivers installed.", "Please install the Blackmagic DeckLink drivers to use the features of this application.");
goto error;
}
if (pDLIterator->Next(&pDL) != S_OK)
{
QMessageBox::critical(NULL,"This application requires a DeckLink device.", "You will not be able to use the features of this application until a DeckLink device is installed.");
goto error;
}
if (pDL->QueryInterface(IID_IDeckLinkOutput, (void**)&pDLOutput) != S_OK)
goto error;
pRenderDelegate = new RenderDelegate(this);
if (pRenderDelegate == NULL)
goto error;
if (pDLOutput->SetScheduledFrameCompletionCallback(pRenderDelegate) != S_OK)
goto error;
bSuccess = TRUE;
error:
if (!bSuccess)
{
if (pDLOutput != NULL)
{
pDLOutput->Release();
pDLOutput = NULL;
}
if (pDL != NULL)
{
pDL->Release();
pDL = NULL;
}
}
if (pDLIterator != NULL)
{
pDLIterator->Release();
pDLIterator = NULL;
}
return bSuccess;
}
示例7: CreateDeckLinkIteratorInstance
static void
init_devices (void)
{
IDeckLinkIterator *iterator;
IDeckLink *decklink = NULL;
HRESULT ret;
int i;
static gboolean inited = FALSE;
if (inited) return;
inited = TRUE;
iterator = CreateDeckLinkIteratorInstance ();
if (iterator == NULL) {
GST_ERROR ("no driver");
return;
}
i = 0;
ret = iterator->Next (&decklink);
while (ret == S_OK) {
devices[i].decklink = decklink;
ret = decklink->QueryInterface (IID_IDeckLinkInput,
(void **) &devices[i].input);
if (ret != S_OK) {
GST_WARNING ("selected device does not have input interface");
}
ret = decklink->QueryInterface (IID_IDeckLinkOutput,
(void **) &devices[i].output);
if (ret != S_OK) {
GST_WARNING ("selected device does not have output interface");
}
ret = decklink->QueryInterface (IID_IDeckLinkConfiguration,
(void **) &devices[i].config);
if (ret != S_OK) {
GST_WARNING ("selected device does not have config interface");
}
ret = iterator->Next (&decklink);
i++;
if (i == 10) {
GST_WARNING ("this hardware has more then 10 devices");
break;
}
}
n_devices = i;
iterator->Release();
}
示例8: CreateDeckLinkIteratorInstance
vector<ofVideoDevice> ofxBlackmagicGrabber::listDevices() {
IDeckLinkIterator* deckLinkIterator;
IDeckLink* deckLink;
int numDevices = 0;
HRESULT result;
vector<ofVideoDevice> devices;
// Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system
deckLinkIterator = CreateDeckLinkIteratorInstance();
if (deckLinkIterator == NULL){
ofLogError(LOG_NAME) << "A DeckLink iterator could not be created. The DeckLink drivers may not be installed.";
}
// Enumerate all cards in this system
while (deckLinkIterator->Next(&deckLink) == S_OK){
CFStringRef deviceNameString;
// Increment the total number of DeckLink cards found
numDevices++;
if (numDevices > 1)
printf("\n\n");
// *** Print the model name of the DeckLink card
result = deckLink->GetModelName(&deviceNameString);
if (result == S_OK)
{
printf("=============== %s ===============\n\n", deviceNameString);
// free(deviceNameString);
}
print_attributes(deckLink);
// ** List the video output display modes supported by the card
print_output_modes(deckLink);
// ** List the input and output capabilities of the card
print_capabilities(deckLink);
// Release the IDeckLink instance when we've finished with it to prevent leaks
deckLink->Release();
}
deckLinkIterator->Release();
// If no DeckLink cards were found in the system, inform the user
if (numDevices == 0)
ofLogError(LOG_NAME) << "No Blackmagic Design devices were found.";
return devices;
}
示例9: CreateDeckLinkIteratorInstance
static void
gst_decklinksrc_class_probe_devices (GstElementClass * klass)
{
IDeckLinkIterator *iterator;
IDeckLink *decklink;
n_devices = 0;
iterator = CreateDeckLinkIteratorInstance ();
if (iterator) {
while (iterator->Next (&decklink) == S_OK) {
n_devices++;
}
}
iterator->Release();
probed = TRUE;
}
示例10: CreateDeckLinkIteratorInstance
/* former device probe code, redux */
static void
gst_decklinksrc_list_devices (void)
{
IDeckLinkIterator *iterator;
IDeckLink *decklink;
int n_devices;
n_devices = 0;
iterator = CreateDeckLinkIteratorInstance ();
if (iterator) {
while (iterator->Next (&decklink) == S_OK) {
n_devices++;
}
}
iterator->Release();
g_print ("%d devices\n", n_devices);
}
示例11: enumDeviceNames
QStringList BMDOutputDelegate::enumDeviceNames(bool forceReload)
{
if(!s_knownDevices.isEmpty())
{
if(!forceReload)
return s_knownDevices;
else
s_knownDevices.clear();
}
IDeckLinkIterator *deckLinkIterator = CreateDeckLinkIteratorInstance();
if (deckLinkIterator == NULL)
{
fprintf(stderr, "BMDCaptureDelegate::enumDeviceNames: A DeckLink iterator could not be created. The DeckLink drivers may not be installed.\n");
return QStringList();
}
IDeckLink *deckLink;
IDeckLinkInput *deckLinkOutput;
int index = 0;
// Enumerate all cards in this system
while (deckLinkIterator->Next(&deckLink) == S_OK)
{
if (deckLink->QueryInterface(IID_IDeckLinkOutput, (void**)&deckLinkOutput) == S_OK)
{
s_knownDevices << QString("bmd:%1").arg(index);
deckLinkOutput->Release();
deckLinkOutput = NULL;
}
index ++;
// Release the IDeckLink instance when we've finished with it to prevent leaks
deckLink->Release();
}
deckLinkIterator->Release();
return s_knownDevices;
}
示例12: ff_decklink_list_devices
int ff_decklink_list_devices(AVFormatContext *avctx)
{
IDeckLink *dl = NULL;
IDeckLinkIterator *iter = CreateDeckLinkIteratorInstance();
if (!iter) {
av_log(avctx, AV_LOG_ERROR, "Could not create DeckLink iterator\n");
return AVERROR(EIO);
}
av_log(avctx, AV_LOG_INFO, "Blackmagic DeckLink devices:\n");
while (iter->Next(&dl) == S_OK) {
const char *displayName;
ff_decklink_get_display_name(dl, &displayName);
av_log(avctx, AV_LOG_INFO, "\t'%s'\n", displayName);
av_free((void *) displayName);
dl->Release();
}
iter->Release();
return 0;
}
示例13: ff_decklink_init_device
int ff_decklink_init_device(AVFormatContext *avctx, const char* name)
{
struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx;
IDeckLink *dl = NULL;
IDeckLinkIterator *iter = CreateDeckLinkIteratorInstance();
if (!iter) {
av_log(avctx, AV_LOG_ERROR, "Could not create DeckLink iterator\n");
return AVERROR_EXTERNAL;
}
while (iter->Next(&dl) == S_OK) {
const char *displayName;
ff_decklink_get_display_name(dl, &displayName);
if (!strcmp(name, displayName)) {
av_free((void *)displayName);
ctx->dl = dl;
break;
}
av_free((void *)displayName);
dl->Release();
}
iter->Release();
if (!ctx->dl)
return AVERROR(ENXIO);
if (ctx->dl->QueryInterface(IID_IDeckLinkConfiguration, (void **)&ctx->cfg) != S_OK) {
av_log(avctx, AV_LOG_ERROR, "Could not get configuration interface for '%s'\n", name);
ff_decklink_cleanup(avctx);
return AVERROR_EXTERNAL;
}
if (ctx->dl->QueryInterface(IID_IDeckLinkAttributes, (void **)&ctx->attr) != S_OK) {
av_log(avctx, AV_LOG_ERROR, "Could not get attributes interface for '%s'\n", name);
ff_decklink_cleanup(avctx);
return AVERROR_EXTERNAL;
}
return 0;
}
示例14: GetDeckLink
IDeckLink* BMDConfig::GetDeckLink(int idx)
{
HRESULT result;
IDeckLink* deckLink;
IDeckLinkIterator* deckLinkIterator = CreateDeckLinkIteratorInstance();
int i = idx;
while((result = deckLinkIterator->Next(&deckLink)) == S_OK)
{
if (i == 0)
break;
--i;
deckLink->Release();
}
deckLinkIterator->Release();
if (result != S_OK)
return NULL;
return deckLink;
}
示例15: CreateDeckLinkIteratorInstance
IDeckLink *getFirstDeckLinkCard()
{
IDeckLink *deckLink = NULL;
IDeckLinkIterator *deckLinkIter = CreateDeckLinkIteratorInstance();
if (deckLinkIter)
{
// get the first decklink card
if (deckLinkIter->Next(&deckLink) != S_OK)
{
printf("Could not detect a DeckLink card\n");
}
deckLinkIter->Release();
}
else
{
printf("Could not enumerate DeckLink cards\n");
}
return deckLink;
}