使用opengles播放视频,机器人 [英] play video using opengles, android

查看:136
本文介绍了使用opengles播放视频,机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用OpenGL ES的Andr​​oid中播放视频?

how to play video using opengl es in android?

推荐答案

你的问题有点含糊。如果你想要做的是在GL面播放视频,这是可能的。请参阅<一href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/MediaPlayerDemo_Video.html"相对=nofollow> 媒体播放器样品code 戴夫指的是在他的样本。所有你需要做的还有就是更换 SurfaceView GLSurfaceView 在这两个MediaPlayerDemo_Video.java文件,并在相应的布局文件(mediaplayer_2.xml)。

Your question is a bit vague. If all you want to do is to play a video in a GL surface, it's possible. See the Media Player sample code that Dave was referring to in his sample. All you have to do there is to replace the SurfaceView with a GLSurfaceView in both the MediaPlayerDemo_Video.java file as well as in the corresponding layout file (mediaplayer_2.xml).

此外,你需要创建一个自定义渲染器类(一个实现 GLSurfaceView.Renderer 接口),并将其设置为您的 GLSurfaceView

Also you need to create a custom Renderer class (one that implements the GLSurfaceView.Renderer interface) and set it to your GLSurfaceView.

您做这一切后,你有你自己的视频播放上的GL面,但是这将是所有的。

After you do all this, you will have your video playing on a GL surface, but that would be all.

如果,在另一方面,你要处理的视频,也就是画在GL质感的视频帧,并添加效果,或将其转换(例如缩放,旋转等),那么我这恐怕不能这样做。其原因是你没有访问你的应用程序中的原始视频帧。

If, on the other hand, you want to manipulate the video, i.e. to draw the video frames in a GL texture and add effects to it or transform it (for example scale, rotate, etc.), then I'm afraid this can't be done. The reason is that you don't have access to the raw video frames in your application.

这篇关于使用opengles播放视频,机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆