@Override
public void run() {
while (!stop) {
Canvas canvas = holder.lockCanvas();
int[] colors = ffmpeg4Buffer.getRGB();
if (colors != null) {
canvas.drawBitmap(colors, 0, 704, 0, 0, width, height, false, null);
}
holder.unlockCanvasAndPost(canvas);
}
}
使用继承SurfaceView,并实现SurfaceHolder.Callback接口
即可显示。
解决方案 »
- android 遇到"Source not found"的错误
- 安卓启动后,能不能不进入桌面程序,而直接打开需要的程序
- 如何立即关闭屏幕,但cpu不休眠?
- 简单Button问题
- android的listView有滚动条时(即实际Item数比显示出来的Item数多),点击item变色事件报空指针错
- 有在windows下使用eclipse + cygwin写C/C++程序的吗?
- 寻Android平台下能编辑OFFICE办公软件
- 求助:sdk目录下的docs目录
- 真心请教一个问题,三星S4 4.2.2系统1920*1080运行异常
- 这种效果要怎么做啊~求大神
- android MediaPlayer.getFrame
- 我的Service为什么不运行了?
我解码后是RGB24 类型为byte[]; int[] colors = new int[width * height * numBands];
for(int i = 0; i < width * height * numBands -1; i++)
{
colors[i] = byteArray[i];
}
if (colors != null) {
canvas.drawBitmap(colors, 0, width, 0, 0, width, height, false, null);
}