textureview

What can I do when the BufferQueue has been abandoned?

大兔子大兔子 提交于 2019-11-28 17:52:52
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: BufferQueue has been abandoned! Can someone tell me what's going on here? When my app pauses all I do is deinitialize everything like this from onSurfaceTextureDestroyed() public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) { mCamera.setPreviewCallback(null); mCamera.stopPreview(); mCamera.release(); return true; } What you're doing is

TextureView vs. GLSurfaceView or How to use GLSurfaceView with EGL14

空扰寡人 提交于 2019-11-28 16:19:53
问题 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,

MediaPlayer cannot render to TextureView after image render

你离开我真会死。 提交于 2019-11-28 10:28:58
I have a MediaPlayer rendering videos to a TextureView . This is working. Now, I want to display a still image on this TextureView for a given time, then get the MediaPlayer to render a video to the same TextureView . Here's my code to render the bitmap: Canvas canvas = mTextureView.lockCanvas(); canvas.drawBitmap(sourceBitmap, matrix, new Paint()); mTextureView.unlockCanvasAndPost(canvas); After this, any attempts to play videos result in ERROR_INVALID_OPERATION (-38) being triggered from the video player. I tried commenting out the call to drawBitmap , and the error still happened. It seems

Android thread controlling multiple texture views causes strange flickering

北城余情 提交于 2019-11-28 09:34:13
问题 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

Glass camera preview display is garbled

拟墨画扇 提交于 2019-11-28 08:45:32
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="fill_parent" /> Here is the Activity code: public class ScanActivity extends Activity { private static

Video rendering is broken MediaCodec H.264 stream

天涯浪子 提交于 2019-11-27 21:42:19
I am implementing a decoder using MediaCodec Java API for decoding live H.264 remote stream. I am receiving H.264 encoded data from native layer using a callback ( void OnRecvEncodedData(byte[] encodedData) ), decode and render on Surface of TextureView . My implementation is completed (retrieving encoded streams using callback, decode and rendering etc). Here is my decoder class: public class MediaCodecDecoder extends Thread implements MyFrameAvailableListener { private static final boolean VERBOSE = true; private static final String LOG_TAG = MediaCodecDecoder.class.getSimpleName(); private

Crop camera preview for TextureView

倾然丶 夕夏残阳落幕 提交于 2019-11-27 19:05:28
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 tie the Surface Texture to OpenGL and how to do the cropping with OpenGL? public class MyActivity extends Activity implements TextureView.SurfaceTextureListener { private Camera mCamera; private TextureView mTextureView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity

What can I do when the BufferQueue has been abandoned?

情到浓时终转凉″ 提交于 2019-11-27 10:31:53
问题 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: BufferQueue has been abandoned! Can someone tell me what's going on here? When my app pauses all I do is deinitialize everything like this from onSurfaceTextureDestroyed() public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) { mCamera

How to reduce latency in MediaCodec video/avc decoding

梦想与她 提交于 2019-11-27 05:12:40
I performed some simple timing of MoviePlayer.java in the Grafika MediaCodec sample code running on a Nexus 5. I put a log statement at these locations: At line 203 just before decoder.queueInputBuffer At line 244 after decoder.dequeueOutputBuffer I correlated the log statements using presentationTimeUs . Here is an excerpt from logcat: 01-29 10:56:43.295: I/Grafika(21286): queueInputBuffer index/pts, 2,0 01-29 10:56:43.305: I/Grafika(21286): queueInputBuffer index/pts, 0,33100 01-29 10:56:43.315: I/Grafika(21286): queueInputBuffer index/pts, 3,66466 01-29 10:56:43.325: I/Grafika(21286):

Video rendering is broken MediaCodec H.264 stream

◇◆丶佛笑我妖孽 提交于 2019-11-26 20:47:09
问题 I am implementing a decoder using MediaCodec Java API for decoding live H.264 remote stream. I am receiving H.264 encoded data from native layer using a callback ( void OnRecvEncodedData(byte[] encodedData) ), decode and render on Surface of TextureView . My implementation is completed (retrieving encoded streams using callback, decode and rendering etc). Here is my decoder class: public class MediaCodecDecoder extends Thread implements MyFrameAvailableListener { private static final boolean