本文整理汇总了C++中VideoFrame::release方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoFrame::release方法的具体用法?C++ VideoFrame::release怎么用?C++ VideoFrame::release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoFrame
的用法示例。
在下文中一共展示了VideoFrame::release方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
frame->release();
}
// 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: update
void FileGrabber::update(){
ofVideoPlayer::update();
if(isFrameNew()){
VideoFrame * frame = getNextVideoFrame();
newFrameEvent.notify(this,*frame);
frame->release();
}
}
示例5: draw
void RecLoopRender::draw(){
VideoFrame * bufferFrame = buffer->getNextVideoFrame();
VideoFrame * liveFrame = live->getNextVideoFrame();
if(bufferFrame!=NULL && liveFrame!=NULL){
if(!imageAllocated){
image.allocate(liveFrame->w,liveFrame->h,OF_IMAGE_COLOR);
imageAllocated=true;
}
if(!bufferFrame->isTexAllocated())
bufferFrame->update(recLoopVoidArgs);
if(!liveFrame->isTexAllocated())
liveFrame->update(recLoopVoidArgs);
ofEnableAlphaBlending();
ofSetColor(tintR,tintG,tintB,alpha);
if(minmaxBlend)
glBlendEquationEXT(GL_MAX);
else
glBlendEquationEXT(GL_MIN);
bufferFrame->getTexture()->draw(0,0);
liveFrame->getTexture()->draw(0,0);
image.grabScreen(0,0,liveFrame->w,liveFrame->h);
//unsigned char * pixels = bufferFrame->getVideoFrame();
//memcpy(pixels,image.getPixels(),liveFrame->w*liveFrame->h*3*sizeof(unsigned char));
bufferFrame->getTexture()->loadData(image.getPixels(),liveFrame->w,liveFrame->h,GL_RGB);
liveFrame->release();
//bufferFrame->setTexAllocated(false);
//bufferFrame->update();
bufferFrame->release();
ofDisableAlphaBlending();
glBlendEquationEXT(GL_FUNC_ADD);
}
}