我在Android手机中播放视频时捕获图像,并将它们作为原始数据(仅包含0和1)保存在队列中。现在我想将图像的原始数据转换为视频而不将其压缩为任何其他格式,如PNG或JPEG。我想在android C ++中进行。任何人都可以建议我怎么做。下面是我的捕获图像代码。
void const* ptr = 0;
uint32_t w, s, h, f;
size_t size = 0;
for(i = 0; i < 50; i++)
{
ScreenshotClient screenshot;
sp<IBinder> display = SurfaceComposerClient::getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain);
if (display != NULL && screenshot.update(display) == NO_ERROR)
{
ptr = screenshot.getPixels();
w = screenshot.getWidth();
h = screenshot.getHeight();
s = screenshot.getStride();
f = screenshot.getFormat();
size = screenshot.getSize();
}
}