glsurfaceview

setPreviewTexture failed in MTK device

泄露秘密 提交于 2021-02-07 12:52:26
问题 Recently I am learning android Camera and OpenglES by grafika (Thanks fadden).It's good on most device, but I encounter bugs in some device, espacially MTK device(such as MT6580,MT8163...). For example, when "CameraCaptureActivity" run in MTK. I am getting this error: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.Camera.setPreviewTexture(android.graphics.SurfaceTexture)' on a null object reference so I changed "handleSetSurfaceTexture" function to

Overlapping GLSurfaceView on SurfaceView and vice versa

浪子不回头ぞ 提交于 2020-06-01 05:31:05
问题 ExoPlayer - SurfaceView Camera2 + MediaCodec - GLSurfaceView I am using the above view groups for playing video and camera recording. UI-1: Exo-Surf at the center and Cam-GLS in the top right corner. UI-2: Cam-GLS at the center and Exo-Surf in the top right corner. To achieve this I am using setZOrderOnTop to set z-index, as both are inside RelativeLayout. (exoPlayerView.videoSurfaceView as? SurfaceView)?.setZOrderOnTop(true/false) It seems working fine on Samsung S9+ with API 29 - Android 10

Android CameraX GLSurfaceView

本秂侑毒 提交于 2020-04-13 06:07:20
问题 Please, can someone provide good example of using CameraX library with GLSurfaceView, can't find any information. 回答1: The documentation for using CameraX with Custom surface / TextureView is non-existent. After the beta release of CameraX many API have changed so the existing examples online would work only with alpha versions. Link for using TextureView/GLSUrfaceView with alpha-xx versions: https://github.com/android/camera-samples/tree/master/CameraXBasic However these samples wont work

Android OpenGL(1)

。_饼干妹妹 提交于 2020-03-26 12:40:56
OpenGL开发基础 OpenGL简介: Android通过OpenGL包含了对高性能2D和3D图形的支持.尤其支持OpenGL ES API。OpenGL是一个跨平台的图形API,提供了软件操作3D图形硬件的接口。OpenGL ES是一个专用于嵌入式设备的OpenGL规格。 在Android框架中有两个基本的类使你可以通过OpenGL ES API创建和操作图形系统: GLSurfaceView 和 GLSurfaceView.Renderer 。如果你的目标是在你的Android应用中使用OpenGL,了解如何在一个activity中实现这些类是首要目标. GLSurfaceView:这个类是一个View,你可以用OpenGLAPI调用来绘制对象并管理它们.它与SurfaceView很相似.你可以创建一个GLSurfaceView的实例然后把你的绘制操作添加给它.然而,如果你想捕获触屏事件,你应扩展GLSurfaceView类来实现触屏事件监听器。 GLSurfaceView.Renderer:此接口定义了在一个OpenGL GLSurfaceView上作画所需的方法.你必须提供另一个类来实现这个接口然后把它附加到你的GLSurfaceView实例上,使用GLSurfaceView.setRenderer(). OpenGL包 OpenGLES 1.0/1.1 API 包

Android研究-Android 画图方式[zz]

时光毁灭记忆、已成空白 提交于 2020-02-22 03:51:27
GUIer们应该对Android的GUI实现这有所好奇,肯定也是经过一番搜索的,比如先找TextView这种简单的,draw接口了、onDraw接口了、paint接口了、onPaint接口了,通过这些接口进一步找到发现Drawable的draw接口实际绘制的,接着发现是Canvas接口绘制的,接着发现是jni到了SkCanvas这样的本地接口了,SkCanas原来是skia(类似cairo)这个纯2D少量3D图形引擎的核心类,问题就转移到了skia机制和实现身上了. 本文是一位大牛的文章,介绍了你想知道的Android的图形方面的东西,很全,很系统,地址: http://blog.csdn.net/arm10504/article/details/5483971 Android apk 里面的画图分为2D和3D两种:2D是由 Skia 来实现的,也就是我们在框架图上看到的SGL,SGL也会调用部分 opengl 的内容来实现简单的3D效果;3D部分是由OpenGL|ES实现的,OpenGL|ES是Opengl的嵌入式版本,我们先了解一下Android apk的几种画图方式,然后再来来看一看这一整套的图形体系是怎么建立的。 首先画图都是针对提供给 应用 程序的一块内存填充 数据 , 没去研究过一个Activity是否就对应着底层的一个surface

Android OpenGL 开发

▼魔方 西西 提交于 2020-02-06 13:45:11
2013-06-30 Android OpenGL 开发 Android提供OpenGL包,专门用于3D的加速和渲染等。 OpenGL, Open Graphics Library, 是一个专业的图形程序接口,是一个功能强大、调用方便的底层图形库。 OpenGL ES ,基于OpenGL API设计,是OpenGL三维图形API的子集,是专为内嵌和移动设备设计的一个2D/3D轻量图形库。 OpenGL ES 1.0 基于OpenGL 1.3,OpenGL ES 1.1 基于 OpenGL 1.5,OpenGL ES 2.0 基于 OpenGL 2.0。 1. Android构建一个3D开发的基本框架 // 导入库 import javax.microedition.khronos.opengles. GL10 ; // 实例化OpenGLContext GL10 gl = (GL10) mOpenGLContext.getGL(); // 在onDraw方法开始 mOpenGLContext.waitNative(); // 在onDraw方法结束 mOpenGLContext.waitGL(); GLSurfaceView包含一个专门用于渲染3D的接口Renderer // 引入Renderer import android.opengl. GLSurfaceView .

setContentView says source not found

柔情痞子 提交于 2020-01-24 13:54:36
问题 I am trying to have a custom GLSurfaceView with some text over it, to display the score in a game. I have made a uniform xml layout based off of someones post here but when I try to load it with a setContentView the app crashes. after debugging I found that it says "Source can not be found". I have rebuilt the R file but that doesn't help. For reference my class that extends GLSurfaceView is called GLView. Any help would be appreciated. package org.kizik.WLTBO; import android.app.Activity;

setContentView says source not found

a 夏天 提交于 2020-01-24 13:54:11
问题 I am trying to have a custom GLSurfaceView with some text over it, to display the score in a game. I have made a uniform xml layout based off of someones post here but when I try to load it with a setContentView the app crashes. after debugging I found that it says "Source can not be found". I have rebuilt the R file but that doesn't help. For reference my class that extends GLSurfaceView is called GLView. Any help would be appreciated. package org.kizik.WLTBO; import android.app.Activity;

setContentView says source not found

我怕爱的太早我们不能终老 提交于 2020-01-24 13:53:56
问题 I am trying to have a custom GLSurfaceView with some text over it, to display the score in a game. I have made a uniform xml layout based off of someones post here but when I try to load it with a setContentView the app crashes. after debugging I found that it says "Source can not be found". I have rebuilt the R file but that doesn't help. For reference my class that extends GLSurfaceView is called GLView. Any help would be appreciated. package org.kizik.WLTBO; import android.app.Activity;

How can I make circle GLSurfaceView on Videoview?

China☆狼群 提交于 2020-01-16 00:49:09
问题 I'm using camera recorder library for video recording it's use GLSurfaceView. In my layout on VideoView I overlay GLSurfaceView. It's showing Circle shape when I overlay GLSurfaceView over ImageView It's showing Square shape when I overlay GLSurfaceView over VideoView. I have tried below code for making circle GLSurfaceView. public class SampleGLView extends GLSurfaceView implements View.OnTouchListener { private Path clippingPath; public SampleGLView(Context context) { this(context, null); }