textureview

GLConsumer is already attached to a context for new SurfaceTexture

大城市里の小女人 提交于 2019-12-01 12:30:01
Is SurfaceTexture attached to GLContext by default when created manually? If so, how? Here is an example, I'm trying to create my own SurfaceTexture and set it to TextureView : public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView textView = (TextView) findViewById(R.id.version); TextureView textureView = (TextureView) findViewById(R.id.texture); int[] arr = new int[1]; GLES20.glGenTextures(1, arr, 0); int texName = arr[1]; SurfaceTexture

GLConsumer is already attached to a context for new SurfaceTexture

怎甘沉沦 提交于 2019-12-01 10:28:41
问题 Is SurfaceTexture attached to GLContext by default when created manually? If so, how? Here is an example, I'm trying to create my own SurfaceTexture and set it to TextureView : public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView textView = (TextView) findViewById(R.id.version); TextureView textureView = (TextureView) findViewById(R.id.texture);

Glass camera preview display is garbled

半城伤御伤魂 提交于 2019-11-30 05:56:38
问题 I am trying to get a live camera preview to display in Google Glass. I'm using all of the camera defaults (and have also tried using a few different image formats; ideally, I can use one of the YUV formats), but the image that shows up in the display is garbled, like this: The layout is simple: <?xml version="1.0" encoding="utf-8"?> <TextureView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scan_preview" android:layout_width="fill_parent" android:layout_height=

Android TextureView / Drawing / Painting Performance

柔情痞子 提交于 2019-11-30 05:24:59
I am attempting to make a drawing/painting app using TextureView on Android. I want to support a drawing surface of up to 4096x4096 pixels, which seems reasonable for my minimum target device (which I use for testing) which is a Google Nexus 7 2013 which has a nice quad core CPU and 2GB memory. One of my requirements is that my view must be inside of a view that allows it to be zoomed in and out and panned, which is all custom code I have written (think UIScrollView from iOS). I've tried using a regular View (not TextureView ) with OnDraw and performance was absolutely horrible - less than 1

BufferQueue has been abandoned: When playing video with TextureView

不想你离开。 提交于 2019-11-30 05:09:02
Every time I pause my activity (actually Fragment) to go to another app, upon returning with onResume I try to resume the video playing but it does not play: I get a blank screen. Upon investigation, I see the following in the Logcat E/BufferQueueProducer: [unnamed-23827-0] queueBuffer: BufferQueue has been abandoned E/MediaPlayer: error (1, -38) E/MediaPlayer: error (1, -38) E/MediaPlayer: error (1, -38) E/MediaPlayer: error (1, -38) E/BufferQueueProducer: [unnamed-23827-0] connect(P): BufferQueue has been abandoned Here is the code I call inside on resume player.seekTo(mVideoSeekPosition);

Android SDK - camera2 - Draw rectangle over TextureView

别等时光非礼了梦想. 提交于 2019-11-30 05:02:12
Im new to android development, and I'm finding it hard to find good examples on the camera2 api. Im working my way slowly through most issues, but on this one I am stuck. In the default camera, when you touch the screen to focus, it shows a rectangle of the focus area for a moment. I want to do something similar (Or in this case, the exact same thing to start off with so i can figure it out). I read somewhere (I think the TextureView page in the SDK docs) that you cant draw on a textureview while its being used as a camera preview - and calling the lock method will return null rather than a

基于textureview编写opengl程序

99封情书 提交于 2019-11-29 21:42:25
与SurfaceView相比,TextureView并没有创建一个单独的Surface用来绘制,这使得它可以像一般的View一样执行一些变换操作,设置透明度等。 另外,Textureview必须在硬件加速开启的窗口中。下面的例子演示了通过TextureView来创建一个opengl程序。 基于TextureView的程序,我们需要实现TextureView.SurfaceTextureListener这个接口,首先给出Activity的代码,在该类中,我们实现了此接口: package com.fyj.test; import java.util.concurrent.atomic.AtomicBoolean; import android.app.Activity; import android.graphics.SurfaceTexture; import android.os.Bundle; import android.view.TextureView; import android.view.View; import android.view.Window; import android.view.WindowManager; public class TextureviewtestActivity extends Activity implements

TextureView vs. GLSurfaceView or How to use GLSurfaceView with EGL14

青春壹個敷衍的年華 提交于 2019-11-29 20:20:03
I am getting confused with EGL. My GLSurfaceView creates an EGLContext. Now I create a shared context. Now I need to use a EGLExtension. The Method I have to use is called (>=API18): EGLExt.eglPresentationTimeANDROID(android.opengl.EGLDisplay display, android.opengl.EGLSurface surface, long time); The Problem is, that the GLSurfaceView does only creates javax.microedition.khronos.egl.EGLContext s. Which tells me, NOT to use GLSurfaceView. So I tried TextureView, which is slightly similar, with the difference that you have to handle your own EGL stuff. Which is good for that purpose. But: The

Android thread controlling multiple texture views causes strange flickering

对着背影说爱祢 提交于 2019-11-29 16:17:06
I am trying to use a single thread to render three separate TextureView's off the UI thread using canvas lock/unlock. The problem observed is the consistent flickering of each of the Texture Views being drawn, with the flicker consisting of a DIFFERENT TextureView's frame. So for example, I draw frames A,B and C in that order. Frame C will appear fine, however frames A and B will flicker with occasional instances of Frame C, and frame A will occasionally flicker with instances of Frame B. I have read through the documentation describing Android Core Graphics, and have a fairly good

BufferQueue has been abandoned: When playing video with TextureView

浪子不回头ぞ 提交于 2019-11-29 04:02:02
问题 Every time I pause my activity (actually Fragment) to go to another app, upon returning with onResume I try to resume the video playing but it does not play: I get a blank screen. Upon investigation, I see the following in the Logcat E/BufferQueueProducer: [unnamed-23827-0] queueBuffer: BufferQueue has been abandoned E/MediaPlayer: error (1, -38) E/MediaPlayer: error (1, -38) E/MediaPlayer: error (1, -38) E/MediaPlayer: error (1, -38) E/BufferQueueProducer: [unnamed-23827-0] connect(P):