i420buf = webrtc::I420Buffer::Create(w,h);
uint8_t* yplane=i420buf->MutableDataY();
uint8_t* uplane=i420buf->MutableDataU();
uint8_t* vplane=i420buf->MutableDataV();
libyuv::ConvertToI420(reinterpret_cast<uint8_t *>(base),0,//源buff指针
yplane,w,//y分量和长度
uplane,(w+1)/2,//u分量和长度
vplane,(w+1)/2,//v分量和长度
0,0,//处理x,y坐标
w,h,//源宽高
w,h,//目标宽高
libyuv::kRotate0,//旋转
libyuv::FOURCC_ARGB);//类型
上面这个函数处理有色差,下面这个接口则没有
libyuv::ABGRToI420(reinterpret_cast<uint8_t *>(base),
s*4,
yplane,w,
uplane,(w+1)/2,
vplane,(w+1)/2,
w,h);