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


C++ Frame::GetHeight方法代码示例

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


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

示例1: query

void AVC_FormatManager::query()
{
	// Find available formats and video standards.

	int port = -1;
	AVC_DeviceDescriptor* dd = dynamic_cast<AVC_DeviceDescriptor*>(mDeviceDescriptor);
	std::auto_ptr<iec61883Reader> reader;
	std::auto_ptr<iec61883Connection> connection;
	int node = discoverAVC(&port, &dd->getGUID());
	
	if(node == -1)
		return;

	if ( port != -1 ) {
		// capture a single frame and retrieve it's properties
		iec61883Connection::CheckConsistency( port, node );
		connection = std::auto_ptr<iec61883Connection>(new iec61883Connection(port, node));
			
		int channel = connection->GetChannel();
		reader = std::auto_ptr<iec61883Reader>(new iec61883Reader( port, channel));

		reader->StartThread();
		
		// Wait for the reader to indicate that something has happened
			
		if(!reader->WaitForAction(5)) {
			std::cerr<<"AVC_FormatManager: Timed out retrieving format.\n";
		} else {
			// Get the next frame
			Frame* frame = reader->GetFrame();
			if(!frame) {
					std::cout<<"AVC_FormatManager: Error retrieving format parameters.\n";
			}

			// get format-properties
			mWidth = frame->GetWidth();
			mHeight = frame->GetHeight();
			mBytesPerLine = mWidth;
			mImageSize = mWidth*mHeight*3;
			
			// create the formats
			Format* yuv = new Format("YUYV", v4l2_fourcc('Y','U','Y','V'));
			mFormats.push_back(yuv);

			Format* rgb = new Format("RGB", v4l2_fourcc('R', 'G', 'B', 0));
			mFormats.push_back(rgb);
			
			setFormat(yuv);
			
			// and the proper video-standards
			mIsPal = frame->IsPAL();
			if(mIsPal) {
				VideoStandard* pal = new VideoStandard("PAL", VideoStandard::PAL);
				mStandards.push_back(pal);
				yuv->addResolution(720, 576);			
				rgb->addResolution(720, 576);			
			} else {
				VideoStandard* ntsc = new VideoStandard("NTSC", VideoStandard::NTSC);
				mStandards.push_back(ntsc);						
				yuv->addResolution(720, 480);			
				rgb->addResolution(720, 480);			
			}
			
			// release the frame 
			reader->DoneWithFrame( frame );
		}
		
		// and stop capturing
		reader->StopThread();
	}
}
开发者ID:Bevara,项目名称:extra_libs_open,代码行数:71,代码来源:AVC_FormatManager.cpp


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