surfaceview

SurfaceTexture has been abandoned

吃可爱长大的小学妹 提交于 2020-08-05 04:21:33
问题 i am a newbie here and to android :) i have an android app that is receiving frames from camera and trying to process them(finding a specific color using also OpenCv). im using SurfaceTexture setPreviewCallbackWithBuffer() and then displaying them using canvas. But,after processing some frames,my camera freezes and i receive: SurfaceTexture has been abandoned! Note that is processing some frames before displaying this,how many?-depends each time.. My question is: is this caused by the buffers

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

surface view does not show camera after i gave permission

让人想犯罪 __ 提交于 2020-05-29 03:43:07
问题 public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_camera, container, false); cameraId = Camera.CameraInfo.CAMERA_FACING_BACK; flipCamera = view.findViewById(R.id.flipCamera); flashCameraButton = view.findViewById(R.id.flash); captureImage = view.findViewById(R.id.captureImage); surfaceView = view.findViewById(R.id.surfaceView); surfaceHolder = surfaceView.getHolder(); surfaceHolder

surface view does not show camera after i gave permission

守給你的承諾、 提交于 2020-05-29 03:42:47
问题 public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_camera, container, false); cameraId = Camera.CameraInfo.CAMERA_FACING_BACK; flipCamera = view.findViewById(R.id.flipCamera); flashCameraButton = view.findViewById(R.id.flash); captureImage = view.findViewById(R.id.captureImage); surfaceView = view.findViewById(R.id.surfaceView); surfaceHolder = surfaceView.getHolder(); surfaceHolder

surface view does not show camera after i gave permission

☆樱花仙子☆ 提交于 2020-05-29 03:42:45
问题 public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_camera, container, false); cameraId = Camera.CameraInfo.CAMERA_FACING_BACK; flipCamera = view.findViewById(R.id.flipCamera); flashCameraButton = view.findViewById(R.id.flash); captureImage = view.findViewById(R.id.captureImage); surfaceView = view.findViewById(R.id.surfaceView); surfaceHolder = surfaceView.getHolder(); surfaceHolder

surface view does not show camera after i gave permission

别说谁变了你拦得住时间么 提交于 2020-05-29 03:41:49
问题 public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_camera, container, false); cameraId = Camera.CameraInfo.CAMERA_FACING_BACK; flipCamera = view.findViewById(R.id.flipCamera); flashCameraButton = view.findViewById(R.id.flash); captureImage = view.findViewById(R.id.captureImage); surfaceView = view.findViewById(R.id.surfaceView); surfaceHolder = surfaceView.getHolder(); surfaceHolder

音视频入门之如何绘制一张图片

烂漫一生 提交于 2020-04-06 10:35:59
Android 的音视频入门学习,首先了解一下绘制图片。在 Android 平台绘制一张图片,使用至少 3 种不同的 API,ImageView,SurfaceView,自定义 View作绘制图片。下面我以SurfaceView作重点来讲,为什么不用其他的来作例子,分析完SurfaceView就是知道为什么要用SurfaceView作例子。 SurfaceView 我们以下面几个点来了解SurfaceView SurfaceView 有那些相关类。 SurfaceView 有那些特点。 如何使用SurfaceView呢。 SurfaceView的优缺。 SurfaceView 在视频开发中应用在那里。 SurfaceView 其实是继承了View ,但与View又有一些区别,View是通过 onDraw(Canvas canvas)方法中的Canvas去绘制自身显示有界面上,而SurfaceView则不需要onDraw方法,有人会有些疑问,如果SurfaceView不需要实现onDraw方法怎么去绘制自身呢?其实View是在UI线程中绘制的,SurfaceView是在子线程中绘制的(即在一个子线程中对自己进行绘制)。在子线程中绘制怎么拿到canvas呢?下面我们去了解SurfaceView 有那些相关类。 SurfaceView 有那些相关类。 有三个重要的类,分别如下:

OpenGL中 Canvas 性能分析

此生再无相见时 提交于 2020-04-06 02:02:44
本文将通过分析部分源码,描述 Android 里面的 Canvas 的大致实现。并且会对 Canvas 的性能做一定分析,提供对 Canvas 的使用建议。 GLES20RecordingCanvas 类 这个类是什么?为什么我从没用过? 我们来看看它的代码: class GLES20RecordingCanvas extends GLES20Canvas { ... } class GLES20Canvas extends HardwareCanvas { ... } public abstract class HardwareCanvas extends Canvas { ... } 它是不暴露给开发者的,所以我们也使用不了它。 而由 extends Canvas 可见,它是 Canvas 的一个实现类,所以应当也提供和 Canvas 一样的功能。那么它在哪里被使用了呢? 它是在 Android framework 源码处的,我们可以自定义一个 view,在 debug 时,断点到 @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); } 就可以看到这个 canvas 的实例是 GLES21RecordingCanvas 了。 也就是说,几乎 Android 的所有 View