surfaceview

How to show the camera preview on a SurfaceView?

别等时光非礼了梦想. 提交于 2019-12-03 05:55:21
问题 I am trying to open the camera hardware on a SurfaceView. In the layout, I created a SurfaceView and I open the camera as shown in the code below. When I run the code, the toast in the CameraAvailableCB shows up and says "onCameraAvailable" but nothing appears on the SurfaceView. How do I show the camera display on the SurfaceView? Code @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); this.mBtnCapture =

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

自闭症网瘾萝莉.ら 提交于 2019-12-03 04:23:17
问题 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 OpenGL ES? How do Surface and EGLSurface interact? What does SurfaceTexture do? Why does the stuff I draw on a SurfaceView have to go above or below everything else? What is SurfaceFlinger? How does composition of the status and navigation bars work?

How to make a crop camera view on SurfaceView Android

青春壹個敷衍的年華 提交于 2019-12-03 04:04:43
I want to create an cropping application using surfaceview on the android operating system. I've made ​​a display surface for displaying direct view camera, but I still fails when I want to add a cropping feature directly on the camera display. Figure edits below this is going to accomplish: When the capture button is clicked then the images result will appear on the screen, as shown below: The following is the source code MainActivity.java package com.example.CameraPreview1; import java.io.IOException; import java.util.List; import curso.citic15.camara.R; import android.app.Activity; import

Android Camera Live Filter

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What is the best way for Camera Live filters. I am recently using GPUImage Library from Link: https://github.com/CyberAgent/android-gpuimagelibrary . Than I have found SurfaceView and GLSurfaceView. Problem is: How to apply live filter to camera using SurfaceView or GLSurfaceView. Thanks in advance. 回答1: This link uses Texture View https://github.com/google/grafika/blob/master/src/com/android/grafika/LiveCameraActivity.java This uses surface view to play a movie..u can manipulate it for live camera https://github.com/google/grafika/blob

java.lang.RuntimeException: Method called after release()

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: If i am not using mCamera.release(); in surfaceDestroyed(....) then not able to launch CameraActivity again from another Activity [in short getting Unfortunately app has stopped ] error, even not releasing Camera , but if i do tap on Home button [ from CameraActivity ], and then again launching my app , not getting any error (in short works fine, and opening CameraActivity without any problem) And if i am using * mCamera.release(); * in surfaceDestroyed(....) then able to launch CameraActivity again from another Activity and releasing Camera

Media Recorder start failed in android for camera

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on video recording app in which i want to display preview and when user click on record button it start recording and when user click stop button it stop recording. I got video preview on my surface but when i press start button it crash with error "MEDIA.RECORDER.START(Native MEthod). Here is my code Please help me guys. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); surfaceView = (SurfaceView) findViewById(R.id.surface_camera);

Android TextureView vs VideoView Performance

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to be able to rotate a video on screen, so I created a custom TextureView which provides a convenience layer over a MediaPlayer similar to how the current implementation of VideoView does. This Android blog post says the following about TextureView: Because a SurfaceView’s content does not live in the application’s window, it cannot be transformed (moved, scaled, rotated) efficiently. This makes it difficult to use a SurfaceView inside a ListView or a ScrollView. SurfaceView also cannot interact properly with some features of the UI

Move an object on on a Bézier curve path

谁说胖子不能爱 提交于 2019-12-03 02:27:39
问题 I want to move my image on a Bézier curve path from top to bottom but I can't get how can I calculate x/y points and slope from this path. The path looks like the following image: I have start points, end points and two control points. Path path = new Path(); Point s = new Point(150, 5); Point cp1 = new Point(140, 125); Point cp2 = new Point(145, 150); Point e = new Point(200, 250); path.moveTo(s.x, s.y); path.cubicTo(cp1.x, cp1.y, cp2.x, cp2.y, e.x, e.y); 回答1: This is a cubic Bézier curve

Getting a frame from SurfaceView

匿名 (未验证) 提交于 2019-12-03 02:15:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: The difficulty I am having now is to take a screenshot of the SurfaceView. Could anyone please help? My team is doing an Android project where we use MediaCodec to decode the video feed and render the feed onto a Surface. The activity implements SurfaceHolder . Callback Then we created a SurfaceView and add the Callback: mySurfaveView . getHolder (). addCallback ( this ); Then we start decode the video feed in (we have a method that does the decode) surfaceChanged ( SurfaceHolder holder , int format , int width , int height ) The

Getting Camera error in Zxing Barcode Application

匿名 (未验证) 提交于 2019-12-03 01:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use Zxing Library for developing a barcode scanner. My activity is as follows: public class Scanner extends Activity { private static final String PACKAGE = "com.test.scan"; private static final String SCANNER = "com.google.zxing.client.android.SCAN"; private static final String SCAN_FORMATS = "UPC_A,UPC_E,EAN_8,EAN_13,CODE_39,CODE_93,CODE_128"; private static final String SCAN_MODE = "QR_CODE_MODE"; public static final int REQUEST_CODE = 1; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView