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


C++ FramePtr::GetDataSize方法代码示例

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


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

示例1: Initialize

bool ColorProducer::Initialize(FrameManagerPtr pFrameManager) {
	if(pFrameManager != 0) {
		FramePtr pFrame = pFrameManager->CreateFrame();
		if(pFrame != 0)	{
			memset_d(reinterpret_cast<unsigned long*>(pFrame->GetDataPtr()), colorValue_, pFrame->GetDataSize() / sizeof(unsigned long));
			frameBuffer_.push_back(pFrame);
			return true;
		}
	}
	return false;
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例2: DisplayFrame

		void DisplayFrame(Frame* pFrame)
		{
			if(pFrame != NULL && pFrame->HasValidDataPtr()) {
				if(GetFrameManager()->Owns(*pFrame)) {
					DoRender(pFrame);
				}
				else {
					FramePtr pTempFrame = GetReservedFrame();
					if(pTempFrame && pFrame->GetDataSize() == pTempFrame->GetDataSize()) {
						utils::image::Copy(pTempFrame->GetDataPtr(), pFrame->GetDataPtr(), pTempFrame->GetDataSize());
						DoRender(pTempFrame.get());
					}
					else
						LOG << TEXT("DECKLINK: Failed to get reserved frame");
				}
			}
			else {
				LOG << TEXT("DECKLINK: Tried to render frame with no data");
			}
		}
开发者ID:,项目名称:,代码行数:20,代码来源:

示例3: DoRender

void FramePlaybackControl::DoRender(HANDLE& handle, bool bPureCG) 
{
	//Get next CG-frame if we have a CGProducer
	FramePtr pCGFrame;
	if(pCGProducer_) {
		pCGFrame = pCGProducer_->GetFrameBuffer().front();
		FrameBufferFetchResult fetchResult = pCGProducer_->GetFrameBuffer().pop_front();
		if(pCGFrame != 0) {
			pLastCGFrame_ = pCGFrame;
		}
		else if(fetchResult != FetchEOF) {
			pCGFrame = pLastCGFrame_;
		}
		else {
			pCGProducer_.reset();
			LOG << LogLevel::Debug << TEXT("Frameplayback: Cleared CGProducer");
			OnCGEmpty();
			pLastCGFrame_.reset();
		}
	}

	//Get next video frame unless we're in PureCG-mode
	FramePtr pVideoFrame;
	if(!bPureCG || activeClip_.bStopped_) {
		if(frameQueue_.size() > 0) {
			pVideoFrame = frameQueue_.front();
			frameQueue_.pop();

			if(pVideoFrame != 0) {
				pLastVideoFrame_ = pVideoFrame;
			}
		}
		else {
			pVideoFrame = pLastVideoFrame_;
		}

		if(activeClip_.bStopped_ && !frameQueue_.empty())
			eventRender_.Set();
	}
	else {
		pVideoFrame = pLastVideoFrame_;
	}

	//combine and send to consumer
	FramePtr pResultFrame;
	if(pCGFrame) {
		if(pVideoFrame && this->activeClip_.pFP_ != this->emptyProducer_) {
			pResultFrame = pStrategy_->GetReservedFrame();
			if(pResultFrame) {
				utils::image::PreOver(pResultFrame->GetDataPtr(), pVideoFrame->GetDataPtr(), pCGFrame->GetDataPtr(), pResultFrame->GetDataSize());
				pResultFrame->GetAudioData().insert(pResultFrame->GetAudioData().end(), pVideoFrame->GetAudioData().begin(), pVideoFrame->GetAudioData().end());
				pResultFrame->GetAudioData().insert(pResultFrame->GetAudioData().end(), pCGFrame->GetAudioData().begin(), pCGFrame->GetAudioData().end());
			}
		}
		else
			pResultFrame = pCGFrame;
	}
	else
		pResultFrame = pVideoFrame;

	if(pResultFrame)
		pStrategy_->DisplayFrame(pResultFrame.get());
	else if(bPureCG) {
		pResultFrame = pStrategy_->GetReservedFrame();
		if(pResultFrame) {
			utils::image::Clear(pResultFrame->GetDataPtr(), pResultFrame->GetDataSize());
			pStrategy_->DisplayFrame(pResultFrame.get());
		}
	}
}
开发者ID:,项目名称:,代码行数:70,代码来源:

示例4: BitmapHolder

	BitmapHolderAdapter(HWND hWnd, unsigned int width, unsigned int height, FramePtr pFrame) : BitmapHolder(hWnd, width, height, pFrame->GetDataPtr()), pFrame_(pFrame)
	{
		assert(pFrame->GetDataSize() == width*height*4);
	}
开发者ID:,项目名称:,代码行数:4,代码来源:


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