Questions tagged [textureview]

A TextureView can be used to display a content stream. Such a content stream can for instance be a video or an OpenGL scene. The content stream can come from the application's process as well as a remote process.

290 questions
34
votes
1 answer

What can I do when the BufferQueue has been abandoned?

I am using a texture view to show the preview of the camera in my android app. What I noticed, however, is that every time my app gets paused, I am getting this error: 03-18 18:23:44.315: W/BufferQueue(19582): [unnamed-19582-20] cancelBuffer:…
user2426316
  • 5,911
  • 18
  • 48
  • 77
27
votes
6 answers

Crop camera preview for TextureView

I have a TextureView with a fixed width and height and I want to show a camera preview inside of it. I need to crop the camera preview so that it doesn't look stretched inside my TextureView. How to do the cropping? If I need to use OpenGL, how to…
Catalin Morosan
  • 7,693
  • 11
  • 51
  • 73
25
votes
2 answers

TextureView vs. GLSurfaceView or How to use GLSurfaceView with EGL14

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…
andre
  • 1,434
  • 2
  • 16
  • 36
18
votes
1 answer

How do I use Android’s “Surface” classes?

Is there a detailed explanation of Surface, SurfaceHolder, EGLSurface, SurfaceView, GLSurfaceView, SurfaceTexture, and TextureView?  In particular: What’s the difference between SurfaceView and TextureView? Do I need to use GLSurfaceView to use…
fadden
  • 48,613
  • 5
  • 104
  • 152
15
votes
4 answers

Playing video on texture view with aspect ratio of video

I am playing video from my server on surface using texture view, but its stretching the video and not able maintain aspect ratio of video. But, I wish to maintain aspect ratio as per the video as in vine app or instagram app.
Ravish Rajput
  • 163
  • 1
  • 8
14
votes
0 answers

OpenGL scene with transparent background + native widgets below and above

I'm trying to achieve the following view: If the views were layered (bottom to top): layer 1: basic XML layout (image, buttons etc) layer 2: OpenGL scene with transparent background such that we can see through layer 3: some widgets over the…
mbmc
  • 4,573
  • 5
  • 21
  • 50
14
votes
3 answers

Android SDK - camera2 - Draw rectangle over TextureView

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…
aescript
  • 1,324
  • 4
  • 15
  • 26
12
votes
2 answers

How to clear SurfaceTexture after using it with a MediaPlayer?

I'm using a ListView with TextureView children. The TextureView uses a MediaPlayer to play videos. When the TextureView gets recycled, the last frame remains on the surface until the next MediaPlayer makes use of it. What is the easiest way to…
Gilbert
  • 543
  • 7
  • 20
11
votes
1 answer

Get Bitmap from TextureView efficiently

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
AndyRoid
  • 4,754
  • 8
  • 33
  • 70
11
votes
3 answers

BufferQueue has been abandoned: When playing video with TextureView

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…
learner
  • 11,452
  • 24
  • 87
  • 160
11
votes
3 answers

Camera2 with a SurfaceView

I'm trying to get the new Camera2 working with a simple SurfaceView and I'm having some problems with the live preview. On some devices the image is stretched out of proportions while looking fine on others. I've setup a SurfaceView that I…
slott
  • 3,106
  • 1
  • 32
  • 30
11
votes
1 answer

How come that a camera preview in a textureview is much more fuzzy than in a surfaceview?

I have found out that when using a textureview instead of a surfaceview as a camera preview (both hooked up to the camera via a mediarecorder) then the preview is much more fuzzy. What I mean by fuzzy is that in a texture view you can see the…
10
votes
2 answers

How Do I Determine the Default Orientation of Camera Preview Frames?

I am trying (again) to create camera preview logic that actually works properly, for all scenarios: any device: phone, tablet, toaster, whatever any camera: front-facing, rear-facing, side-facing, dog-facing, whatever android.hardware.Camera and…
CommonsWare
  • 910,778
  • 176
  • 2,215
  • 2,253
10
votes
0 answers

How do I draw Bitmap on TextureView

I'm trying to play video on android with TextureView. Regarding video everithing works well. But MediaPlayer.prepare(); takes some time. So I would like to show some placeholder for that time. I'm trying to do it with Glide like this: public static…
oleg.semen
  • 2,662
  • 22
  • 50
10
votes
2 answers

When Is a TextureView's "Consumer Side" Closed?

One of the official Google samples for the Camera2 API suffers from the same BufferQueue has been abandoned problem as is seen in: What can I do when the BufferQueue has been abandoned? Android LogCat shows BufferQueueProcedure Specifically, the…
CommonsWare
  • 910,778
  • 176
  • 2,215
  • 2,253
1
2 3
19 20