In Android 4.1 (API 16) and above, MediaCodec is introduced by Android. By using MediaCodec, we can easily decode video without using Android NDK, like creating video playback application, etc. In game development, video is also needed to make the game environment more realistics, like when you are playing a racing game with video banner around the track. In here, I'll introduce of how to decode the video and render it into OpenGL ES. Firstly, we prepare some stuffs to decode the video, like MediaExtractor and MediaCodec. private boolean initExtractor() { extractor = new MediaExtractor(); try { extractor.setDataSource(mFilePath); } catch (IOException e) { return false; } // get video track for (int i = 0; i < extractor.getTrackCount(); i++) { MediaFormat format = extractor.getTrackFormat(i); String mime = format.getString(MediaFormat.KEY_MIME); if (mime.startsWith("video/")) { ...
GPU, Graphics Processing Unit , is the master of the graphics performance on our Android device.It plays an important role when playing games, playing high quality video (HD), and even showing smooth UI. Therefore, it needs to support many rendering libraries, like OpenGL ES, OpenCV, OpenVG, etc. It seems that GPU on our Android device is performing the same role as our VGA on PC. But, Android is just growing faster recently, so do all GPUs device support all those libraries? After investigating by reading lots of articles, etc, I figured out that GPU on our Android device are still limited. Few GPUs supports OpenCL library. And what does OpenCL really do? OpenCL, Open Computing Language , is recently used for non-graphical computing, like image processing, vector computation, matric computation, etc. See sample from Nvidia for more details by clicking here . Here are Android GPUs that support OpenCL. Qualcomm (Adreno 300 series) References: https://developer.qualcomm.com/...
Comments
Post a Comment