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 图像


猜你喜欢
- Android - 拆分 Drawable 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01