Displaying YUV Image in Android(在 Android 中显示 YUV 图像)
本文介绍了在 Android 中显示 YUV 图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中,我们需要显示从服务器接收到的视频帧到我们的 android 应用程序,
服务器正在以每秒 50 帧的速度发送视频数据,已在 WebM 中编码,即使用 libvpx 对图像进行编码和解码,
In my application, we need to display the Video frame receives from server to our android application,
Server is sending video data @ 50 frame per second, having encoded in WebM i.e. using libvpx to encode and decode the images,
现在从 libvpx 解码后,它得到 YUV 数据,我们可以显示在图像布局上,
Now after decoding from libvpx its getting YUV data, that we can displayed over the image layout,
目前的实现是这样的,
在 JNI/Native C++ 代码中,我们将 YUV 数据转换为 RGB 数据在Android框架中,调用
In JNI / Native C++ code, we are converting YUV data to RGB Data In Android framework, calling
public Bitmap createImgae(byte[] bits, int width, int height, int scan) {
Bitmap bitmap=null;
System.out.println("video: creating bitmap");
//try{
bitmap = Bitmap.createBitmap(width, height,
Bitmap.Config.ARGB_8888);
bitmap.copyPixelsFromBuffer(ByteBuffer.wrap(bits));
/
织梦狗教程
本文标题为:在 Android 中显示 YUV 图像
基础教程推荐
猜你喜欢
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
