textureview

Android TextureView OpenGLRenderer﹕ GL_INVALID_OPERATION

孤街浪徒 提交于 2019-12-11 03:38:25
问题 I have two fragments that has a TextureView to show camera preview or to play video. after using the app for a while, playing with the screens, i get this error in the logcat OpenGLRenderer﹕ GL_INVALID_OPERATION i release everything from my fragments, all members are set to null. @Override public void onDestroyView() { Logg.DEBUG(TAG, "onDestroyView"); super.onDestroyView(); if (mMediaPlayer != null) { mMediaPlayer.stop(); mMediaPlayer.release(); mMediaPlayer = null; } nextButton = null;

Semi-Transparent TextureViews not working

这一生的挚爱 提交于 2019-12-10 17:28:58
问题 I cannot change the transparency of a TextureView by setAlpha method to maske it semi-transparent as it is promised by the android SDK. For example mTextureView.setAlpha(0.5f) does not have any effect. 回答1: You need to make sure and setOpaque(false). From the docs: public void setOpaque (boolean opaque) Added in API level 14 Indicates whether the content of this TextureView is opaque. The content is assumed to be opaque by default. 回答2: The solution I used to make it happen was to wrap the

TextureView throwing fatal signal 11 after resuming application

我的梦境 提交于 2019-12-10 15:19:53
问题 I have a TextureView based on Romain Guy's example which can be found here. On Android 4.3 and 4.4, after a few rounds of pausing and resuming the application, the application crashes and the only trace of an error is a fatal signal 11 in LogCat. I created a test application which uses Romain Guy's exact code to see if it was something I had done in my code and Romain's code crashes with the fatal signal 11, too. I have determined that if I run the code with a Handler instead of a Thread, it

Get Bitmap from TextureView efficiently

喜欢而已 提交于 2019-12-09 15:37:51
问题 I am trying to get each frame from a TextureView , unfortunately trying: textureView.getBitmap(); Results in slow performance is there a faster way to obtain a bitmap. Is it better to use the NDK instead? Looking for actual examples 回答1: A TextureView receives frames on a SurfaceTexture, which takes frames sent to its Surface and converts them to a GLES texture. To get the pixel data out, the texture must be rendered to a framebuffer, then read out with glReadPixels() . The pixel data can

SurfaceTexture,TextureView,GLsurfaceview的区别与联系详解

折月煮酒 提交于 2019-12-09 15:04:12
Android 中的SurfaceTexture,TextureView, GLsurfaceview的区别与联系详解 SurfaceView, GLSurfaceView, SurfaceTexture和TextureView是 Android 当中名字比较绕,关系又比较密切的几个类。本文基于Android 5.0(Lollipop)的代码理一下它们的基本原理,联系与区分。 SurfaceView从Android 1.0(API level 1)时就有 。它继承自类View,因此它本质上是一个View。但与普通View不同的是,它有自己的Surface。我们知道,一般的Activity包括的多个View会组成View hierachy的树形结构,只有最顶层的DecorView,也就是根结点视图,才是对WMS可见的。这个DecorView在WMS中有1个对应的WindowState。相应地,在SF中对应的Layer。而SurfaceView自带1个Surface,这个Surface在WMS中有自己对应的WindowState,在SF中也会有自己的Layer。以下图所示: public class TriangleActivity extends Activity { protected void onCreate(Bundle savedInstanceState) {

Android SurfaceView vs TextureView

我怕爱的太早我们不能终老 提交于 2019-12-09 14:55:28
This page is intended to briefly introduce the differences between SurfaceView and TextureView. SurfaceView and TextureView Both SurfaceView and TextureView are inherited from android.view.View class. They can be drawn and rendered from a separate thread, which is the major difference from other views. The feature of drawing separately is employed by Crosswalk to improve rendering performance greatly by a dedicated GPU thread. SurfaceView provides a dedicated drawing surface embedded inside of a view hierarchy. You can control the format of this surface and, if you like, its size; the

SurfaceView or TextureView combination

吃可爱长大的小学妹 提交于 2019-12-08 01:12:14
问题 I am trying to apply real-time effects to camera preview and show in multiple views , how can I do? (just like the camera2) (snapshot) I know 2 approaches to show real-time effects on camera preivew if no ScrollView involved on the left side. Use GLSurfaceView and setRenderer. Bind SurfaceTexture as GLES external texture, and use GLSL(OpenGL Shading Language) to apply effects. Use TextureView. It is more complex because need to setup EGLContext/EGLSurface and do thread management. However, I

Play video in Android listview

霸气de小男生 提交于 2019-12-07 12:18:20
问题 I am trying to play videos in my listview just like Vine or Instgram. I have been trying to use TextureView with a media player except that when attaching TextureView to the media player I experience issues where the textureview is not being reused properly by the GetView method. The textureview renders some old incorrect videos when scrolling down in my list. Does anyone know how to play videos in ListViews (Not using VideoView!!!)?? 回答1: Just wanna give you advice. You can use WebView

Z-order issue with MediaCodec and TextureView

你。 提交于 2019-12-06 05:52:48
In my Android app I have the need to render three views with the following Z-order: At bottom, the output surface of a MediaCodec decoder covering the whole screen. I have the requirement that I have to transform the image produced by MediaCodec (e.g. scale it) In the middle, a GLSurfaceView (or other surface/view running GL shaders I define), covering the whole screen. Obviously some of the pixels in this layer will be transparent, in order to see the MediaCodec output beneath. On top, any other view - say an ImageView . Not sure if I will require transparency for these topmost views, maybe

SurfaceView or TextureView combination

岁酱吖の 提交于 2019-12-06 05:51:12
I am trying to apply real-time effects to camera preview and show in multiple views , how can I do? (just like the camera2 ) ( snapshot ) I know 2 approaches to show real-time effects on camera preivew if no ScrollView involved on the left side. Use GLSurfaceView and setRenderer . Bind SurfaceTexture as GLES external texture, and use GLSL(OpenGL Shading Language) to apply effects. Use TextureView . It is more complex because need to setup EGLContext/EGLSurface and do thread management. However, I don't know how to make ScrollView with real-time effect items overlay GLES composition. Should I