本文整理汇总了C++中FramePtr::GetDataPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ FramePtr::GetDataPtr方法的具体用法?C++ FramePtr::GetDataPtr怎么用?C++ FramePtr::GetDataPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FramePtr
的用法示例。
在下文中一共展示了FramePtr::GetDataPtr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
bool TargaProducer::Initialize(FrameManagerPtr pFrameManager) {
if(pFrameManager != 0) {
FramePtr pFrame = pFrameManager->CreateFrame();
if(pFrame != 0 && pFrame->GetDataPtr() != 0) {
PixmapDataPtr pResult = TargaManager::CropPadToFrameFormat(pImage_, pFrameManager->GetFrameFormatDescription());
unsigned char* pFrameData = pFrame->GetDataPtr();
unsigned char* pImageData = pResult->GetDataPtr();
memcpy(pFrameData, pImageData, pFrame->GetDataSize());
frameBuffer_.push_back(pFrame);
return true;
}
}
return false;
}
示例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");
}
}
示例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());
}
}
}
示例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);
}