Git Product home page Git Product logo

glsurface's Introduction

GLSurface

demo code for remote(seperate process) GLSurface Renderin

Surface是EGL的“画布”,一块内存buffer加上config,就可以生成一块画布 config包含了display的属性,包括颜色深度,位长等 surface类型,window,pixmap,pbuffer

以采集Camera数据后,进行绘制为例

  1. 获取界面对象GLSurfaceView
  2. setRenderer
  3. 收到onSurfaceCreated回调,在回调中准备如下工作 3.1. 申请一块buffer,rgb or nv21 3.2. addCallbackBuffer 3.3 setPreviewCallbackWithBuffer 3.4 startPreview
  4. 收到相机预览帧onPreviewFrame,调用GLSurfaceView.requestRender,通知界面渲染
  5. 收到render的回调onDrawFrame,在此函数中可以用buffer或者textureID进行纹理绘图,然后调用SurfaceTexture.updateTexImage通知消耗buffer

reference: 《EGL Specification 1.0 的研读笔记》 https://www.cnblogs.com/bpasser/archive/2011/09/26/2191710.html

使用GLSurface绘制相机预览 https://www.jianshu.com/p/affeb48e465c apk代码的原型

Android sharing SurfaceTexture between two processes https://stackoverflow.com/questions/33222621/android-sharing-surfacetexture-between-two-processes

一个demo https://github.com/Faceunity/FULiveDemoDroid

玩转Android Camera开发 https://blog.csdn.net/yanzi1225627/article/details/33339965/

glsurface's People

Contributors

obanat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.