本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4:
~DeckLinkConsumer()
{
if ( m_deckLinkOutput )
m_deckLinkOutput->Release();
if ( m_deckLink )
m_deckLink->Release();
if ( m_videoFrameQ )
mlt_deque_close( m_videoFrameQ );
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}