本文整理汇总了C++中FramePtr::CopyScaled方法的典型用法代码示例。如果您正苦于以下问题:C++ FramePtr::CopyScaled方法的具体用法?C++ FramePtr::CopyScaled怎么用?C++ FramePtr::CopyScaled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FramePtr
的用法示例。
在下文中一共展示了FramePtr::CopyScaled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VideoException
void updateBitmapBgr32(uint8_t* pixels, int w, int h)
{
if(currentFrame == 0){
FlogE("Video::updateBitmapBgr32() called but currentFrame is unset");
throw VideoException(VideoException::EScaling);
}
AVPixelFormat fmt = PIX_FMT_RGB32;
AVPicture pict;
int avret = avpicture_fill(&pict, pixels, fmt, w, h);
if(avret < 0){
FlogE("avpicture_fill returned " << avret);
throw VideoException(VideoException::EScaling);
}
currentFrame->CopyScaled(&pict, w, h, fmt);
}
示例2: updateOverlay
void updateOverlay(uint8_t** pixels, const uint16_t* pitches, int w, int h)
{
if(currentFrame == 0){
FlogE("Video::updateOverlay() called but currentFrame is unset");
throw VideoException(VideoException::EScaling);
}
AVPicture pict;
int avret = avpicture_fill(&pict, NULL, AV_PIX_FMT_YUYV422, w, h);
if(avret < 0){
FlogE("avpicture_fill returned " << avret);
throw VideoException(VideoException::EScaling);
}
for(int i = 0; i < 3; i++){
pict.data[i] = pixels[i];
pict.linesize[i] = pitches[i];
}
currentFrame->CopyScaled(&pict, w, h, AV_PIX_FMT_YUYV422);
}