本文整理汇总了C++中VideoFrame::getTextureRef方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoFrame::getTextureRef方法的具体用法?C++ VideoFrame::getTextureRef怎么用?C++ VideoFrame::getTextureRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoFrame
的用法示例。
在下文中一共展示了VideoFrame::getTextureRef方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void RecLoopRender::draw(){
VideoFrame * bufferFrame = buffer->getNextVideoFrame();
VideoFrame * liveFrame = live->getNextVideoFrame();
if(bufferFrame!=NULL && liveFrame!=NULL){
if(!imageAllocated){
image.allocate(liveFrame->getWidth(),liveFrame->getHeight(),OF_IMAGE_COLOR);
imageAllocated=true;
}
ofEnableAlphaBlending();
ofSetColor(tintR,tintG,tintB,alpha);
if(minmaxBlend)
glBlendEquationEXT(GL_MAX);
else
glBlendEquationEXT(GL_MIN);
liveFrame->getTextureRef().draw(0,0);
if(!stopped){
bufferFrame->getTextureRef().draw(0,0);
image.grabScreen(0,0,liveFrame->getWidth(),liveFrame->getHeight());
bufferFrame->getTextureRef().loadData(image.getPixelsRef());
}
liveFrame->release();
bufferFrame->release();
ofDisableAlphaBlending();
glBlendEquationEXT(GL_FUNC_ADD);
}
}
示例2: draw
void avLooperRenderer::draw(int x,int y,int w,int h)
{
// audio -> video Sync !!
//////////////////////////
// 1
//VideoFrame * frame = vHeader.getVideoFrame(int(float(aHeader2.getIndex())/float(aBuffer->sizeInSamples()))*vBuffer->getMaxSize());
//printf("index %d of size %d = %d\n",aHeader2.getIndex(),aBuffer->sizeInSamples(),int(float(aHeader2.getIndex())/float(aBuffer->sizeInSamples()))*vBuffer->getMaxSize());
// 2
float delayToVideo = (float(aHeader2.getIndex()) / float(audioSampleRate)) * 1000.0;
vHeader.setDelayMs(float(maximumSizeInMs)-delayToVideo-float(videoOffsetInMs));
//printf("avR ::DELAY is = %f || maxSize %d delayToVideo in ms = %f / index %d\n",float(maximumSizeInMs)-delayToVideo-float(videoOffsetInMs),maximumSizeInMs,delayToVideo,aHeader2.getIndex());
//printf("AVLR:: videoDelayMs :: %f \n",float(maximumSizeInMs)-delayToVideo-float(videoOffsetInMs));
VideoFrame frame = vHeader.getNextVideoFrame();
if(frame!=NULL){
// draw the frame texture to screen
ofSetColor(vHeader.getOpacity(),vHeader.getOpacity(),vHeader.getOpacity());
frame.getTextureRef().draw(x,y,w,h);
}
// draw av header interfaces
aBuffer->draw();
vBuffer->draw();
vHeader.draw();
aHeader2.draw();
ofSetColor(255,255,255);
}
示例3: drawNextFrame
void VideoRenderer::drawNextFrame(){
VideoFrame * frame = source->getNextVideoFrame();
if(frame!=NULL){
frame->getTextureRef().draw(0,0);
frame->release();
}
}
示例4: setup
void VideoBuffer::setup(VideoSource & source, int size, bool allocateOnSetup){
this->source=&source;
totalFrames=0;
maxSize = size;
if(allocateOnSetup){
for(int i=0;i<size;i++){
VideoFrame videoFrame = VideoFrame::newVideoFrame(source.getNextVideoFrame().getPixelsRef());
videoFrame.getTextureRef();
newVideoFrame(videoFrame);
}
}
resume();
microsOneSec=-1;
}