有以下错误:
void process(const VideoFrame* pFrame) { pFrame->saveToJpeg(); }
编译时出错:
error: passing ‘const VideoFrame’ as ‘this’ argument discards qualifiers [-fpermissive]
原因是参数作为const。修改如下即可:
((VideoFrame*)pFrame)->saveToJpeg();
有以下错误:
void process(const VideoFrame* pFrame) { pFrame->saveToJpeg(); }
编译时出错:
error: passing ‘const VideoFrame’ as ‘this’ argument discards qualifiers [-fpermissive]
原因是参数作为const。修改如下即可:
((VideoFrame*)pFrame)->saveToJpeg();