当前位置: 首页>>代码示例>>C++>>正文


C++ IDeckLink::Release方法代码示例

本文整理汇总了C++中IDeckLink::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ IDeckLink::Release方法的具体用法?C++ IDeckLink::Release怎么用?C++ IDeckLink::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDeckLink的用法示例。


在下文中一共展示了IDeckLink::Release方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
}
开发者ID:G4GUO,项目名称:datvexpress_gui,代码行数:38,代码来源:dldiscover.cpp

示例2: 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;

}
开发者ID:bawNg,项目名称:krad_radio,代码行数:28,代码来源:krad_decklink_capture.cpp

示例3:

std::vector<std::wstring> get_device_list()
{
	std::vector<std::wstring> devices;
	
	struct co_init
	{
		co_init(){::CoInitialize(nullptr);}
		~co_init(){::CoUninitialize();}
	} init;

	try
	{
		CComPtr<IDeckLinkIterator> pDecklinkIterator;
		if(SUCCEEDED(pDecklinkIterator.CoCreateInstance(CLSID_CDeckLinkIterator)))
		{		
			IDeckLink* decklink;
			for(int n = 1; pDecklinkIterator->Next(&decklink) == S_OK; ++n)	
			{
				BSTR model_name = L"Unknown";
				decklink->GetModelName(&model_name);
				decklink->Release();
				devices.push_back(std::wstring(model_name) + L" [" + boost::lexical_cast<std::wstring>(n) + L"]");	
			}
		}
	}
	catch(...){}

	return devices;
}
开发者ID:Mistobaan,项目名称:CasparCG,代码行数:29,代码来源:decklink.cpp

示例4:

	~DeckLinkConsumer()
	{
		if ( m_deckLinkOutput )
			m_deckLinkOutput->Release();
		if ( m_deckLink )
			m_deckLink->Release();
		if ( m_videoFrameQ )
			mlt_deque_close( m_videoFrameQ );
	}
开发者ID:zaenalarifin,项目名称:mlt,代码行数:9,代码来源:consumer_decklink.cpp

示例5: 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;
}
开发者ID:G4GUO,项目名称:datvexpress_gui,代码行数:57,代码来源:dldiscover.cpp

示例6: 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;
}
开发者ID:kylemcdonald,项目名称:ofxBlackmagicGrabber,代码行数:51,代码来源:ofxBlackmagicGrabber.cpp

示例7: main

int main (int argc, char * const argv[])
{
	IDeckLink *deckLink = getFirstDeckLinkCard();
	
	if (deckLink)
	{
		CaptureHelper helper(deckLink);
		if (helper.init())
		{
			helper.doCapture();
		}
		deckLink->Release();
	}
	
    return 0;
}
开发者ID:DishBird,项目名称:VideoSuiteUtilities,代码行数:16,代码来源:main.cpp

示例8: main

int main (int argc, char * const argv[])
{
	IDeckLink *deckLink = getFirstDeckLinkCard();
	
	if (deckLink)
	{
		ETTHelper* helper = new ETTHelper(deckLink);
		if (helper->init())
		{
			helper->doExport();
		}
		
		deckLink->Release();
		helper->Release();
	}

    return 0;
}
开发者ID:hhool,项目名称:Blackmagic_DeckLink_SDK,代码行数:18,代码来源:main.cpp

示例9: 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;
}
开发者ID:TritonSailor,项目名称:livepro,代码行数:44,代码来源:BMDOutput.cpp

示例10: 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;
}
开发者ID:839687571,项目名称:ffmpeg_sln_vs2013,代码行数:19,代码来源:decklink_common.cpp

示例11: 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;
	}
开发者ID:zaenalarifin,项目名称:mlt,代码行数:42,代码来源:consumer_decklink.cpp

示例12: 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;
}
开发者ID:Hero2000,项目名称:CainCamera,代码行数:40,代码来源:decklink_common.cpp

示例13: 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;
}
开发者ID:Gastd,项目名称:oh-distro,代码行数:22,代码来源:Config.cpp

示例14: BMDOutputDelegate

BMDOutputDelegate *BMDOutputDelegate::openDevice(QString deviceName)
{
	if(enumDeviceNames().indexOf(deviceName) < 0)
		return 0;
		
	QString name = deviceName.replace("bmd:","");
	int cardNum = name.toInt();
	
	IDeckLinkIterator *deckLinkIterator = CreateDeckLinkIteratorInstance();
	if (deckLinkIterator == NULL)
	{
		qDebug() << "BMDOutputDelegate::openDevice: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed.";
		return 0;
	}
		
	
	int index = 0;
	
	IDeckLink* deckLink;
	
	// Find the card requested
	while (deckLinkIterator->Next(&deckLink) == S_OK)
	{
		if(index == cardNum)
			return new BMDOutputDelegate(deckLink);
		
		index ++;
		
		// Release the IDeckLink instance when we've finished with it to prevent leaks
		deckLink->Release();
	}
	
	deckLinkIterator->Release();
		
	return 0;
}
开发者ID:TritonSailor,项目名称:livepro,代码行数:36,代码来源:BMDOutput.cpp

示例15: krad_decklink_capture_info

void krad_decklink_capture_info () {

	IDeckLink *deckLink;
	IDeckLinkInput *deckLinkInput;
	IDeckLinkIterator *deckLinkIterator;
	IDeckLinkDisplayModeIterator *displayModeIterator;
	IDeckLinkDisplayMode *displayMode;
	
	HRESULT result;
	int displayModeCount;
	char *displayModeString;

	displayModeString = NULL;
	displayModeCount = 0;
	
	deckLinkIterator = CreateDeckLinkIteratorInstance();
	
	if (!deckLinkIterator) {
		printke ("Krad Decklink: This application requires the DeckLink drivers installed.\n");
	}
	
	/* Connect to the first DeckLink instance */
	result = deckLinkIterator->Next(&deckLink);
	if (result != S_OK) {
		printke ("Krad Decklink: No DeckLink PCI cards found.\n");
	}
    
	result = deckLink->QueryInterface(IID_IDeckLinkInput, (void**)&deckLinkInput);
	if (result != S_OK) {
		printke ("Krad Decklink: Fail QueryInterface\n");
	}
	
	result = deckLinkInput->GetDisplayModeIterator(&displayModeIterator);
	if (result != S_OK) {
		printke ("Krad Decklink: Could not obtain the video output display mode iterator - result = %08x\n", result);
	}


    while (displayModeIterator->Next(&displayMode) == S_OK) {

        result = displayMode->GetName((const char **) &displayModeString);
        
        if (result == S_OK) {
			
			BMDTimeValue frameRateDuration, frameRateScale;
			displayMode->GetFrameRate(&frameRateDuration, &frameRateScale);

			printkd ("%2d:  %-20s \t %li x %li \t %g FPS\n", 
				displayModeCount, displayModeString, displayMode->GetWidth(), displayMode->GetHeight(), 
				(double)frameRateScale / (double)frameRateDuration);
			
            free (displayModeString);
			displayModeCount++;
		}
		
		displayMode->Release();
	}
	
	if (displayModeIterator != NULL) {
		displayModeIterator->Release();
		displayModeIterator = NULL;
	}

    if (deckLinkInput != NULL) {
        deckLinkInput->Release();
        deckLinkInput = NULL;
    }

    if (deckLink != NULL) {
        deckLink->Release();
        deckLink = NULL;
    }

	if (deckLinkIterator != NULL) {
		deckLinkIterator->Release();
	}
}
开发者ID:bawNg,项目名称:krad_radio,代码行数:77,代码来源:krad_decklink_capture.cpp


注:本文中的IDeckLink::Release方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。