Questions tagged [surfaceholder]

Abstract interface to someone holding a display surface. Allows you to control the surface size and format, edit the pixels in the surface, and monitor changes to the surface. This interface is typically available through the SurfaceView class.

Abstract interface to someone holding a display surface.
Allows you to control the surface size and format, edit the pixels in the surface, and monitor changes to the surface.
This interface is typically available through the SurfaceView class.

When using this interface from a thread other than the one running its SurfaceView, you will want to carefully read the methods lockCanvas() and Callback.surfaceCreated().

Reference page: http://developer.android.com/reference/android/view/SurfaceHolder.html

175 questions
3
votes
0 answers

Android duplicate SurfaceView

I want to create an android app with a surfaceview that fills the left part of the screen and with another second surfaceview that fills the right part of the screen. In both surfaceviews should be a preview of the camera. So that there are two…
3
votes
0 answers

Very Strange Error with Camera

I added code to pick Camera using CameraInfo because just adding Camera.open() was not working on HTC devices and I changed the holder in mCamera.setPreviewDisplay(holder) to mHolder which is an instance variable. I try to open the custom Camera in…
vamsiampolu
  • 6,328
  • 19
  • 82
  • 183
3
votes
1 answer

surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS) is deprecated

I am capturing video using MediaRecorder. The part of the code is given below. surfaceView = (SurfaceView) findViewById(R.id.surface_camera); mCamera = Camera.open(); surfaceHolder = surfaceView.getHolder(); …
Ameer
  • 2,709
  • 1
  • 28
  • 44
3
votes
2 answers

Failed to take picture using auto-focus

I have searched some solutions with my problem and sure there are many related issues regarding it but nothing solves my concern. I am receiving a runtime exception : takepicture failed:native_autofocus..etc. I tried to take picture from camera…
She Smile GM
  • 1,322
  • 1
  • 11
  • 33
3
votes
4 answers

Change size of Android custom SurfaceView

I'm trying to create a 2D game engine for an Android app. I've followed this tutorial, which works fine for creating a full screen display, but I don't want that. I want to make my view take the top 2/3 (or whatever) of the screen, and fill the…
seibelj
  • 890
  • 2
  • 10
  • 22
3
votes
2 answers

Android : holder.getSurface() always return null

My view is a bunch of normal widget and a surfaceview. I don't know why after I get surfaceholder of SurfaceView and use getSurface() again on holder, I will always return null. Here is my example code : public void onCreate(Bundle…
hqt
  • 29,632
  • 51
  • 171
  • 250
3
votes
2 answers

Inconsistent dimensions when surfaceView callback calls surfaceChanged in Android

I am using a SurfaceView to draw to a part of the screen, whereby I update the drawing with a background thread. The surfaceview implements a SurfaceView.callback. On the onDraw method I am using canvas.drawpont(x,y,paint) and draw to pretty much…
digiphd
  • 2,319
  • 3
  • 23
  • 22
2
votes
3 answers

.setPreviewDisplay(holder) throwing null pointer exception

I am developing a custom camera application.Given below is my Activity class. public class MyCustomCam extends Activity { private Camera mCamera; private CameraPreview mPreview; /** Called when the activity is first created. */ @Override public…
andro-girl
  • 7,989
  • 22
  • 71
  • 94
2
votes
0 answers

How to Open Camera with surface holder in class which extends BroadcastReceiver

My Class extends broadcastReceiver .I want to turn on torch in ICS ,and it is posible only if you have a surfaceview.How can I make a widget which can turn on torch !Thanks!This code is inccorect!Please help Im a beginner in Android! public void…
2
votes
2 answers

Problem with SurfaceHolder.Callback Interface in Android SDK

I've been tinkering with the idea of delving into the Android SDK since I got my Droid X a while ago, and just recently acted on it. I installed the ADT plugin in Eclipse, downloaded and installed the Android SDK (Rev. 11), and tried some stuff…
Rich Hoffman
  • 742
  • 1
  • 7
  • 23
2
votes
1 answer

Stack ImageView on top of surface where camera preview is running?

I'm trying to display an image on top of a surface where a camera preview is running. So far I have the camera running using a SurfaceHolder. I thought maybe I could use a FrameLayout to stack an image on top of the camera preview, but I don't know…
Shubham
  • 949
  • 6
  • 21
  • 29
2
votes
0 answers

How to reuse SurfaceHolder on WallpaperService ,

How to reuse SurfaceHolder on WallpaperService, I want to Loop switch the content to Surface on the WallpaperService. 1."play movie", 2."draw a picture" , 3."play movie" .looping It work. 1. playPlayer() 2. playImage(). An error occurs. 1.…
2
votes
1 answer

Sharing VideoView between two MediaPlayers not working

I have one main MediaPlayer which plays nicely an RTSP stream and I have used an AsyncTask to buffer the content of another stream. It achieves this. When I try to switch to the second stream, I can hear that the stream switched and it doesn't lag,…
2
votes
1 answer

Blank view when application is launched (SurfaceView)

I'm getting a blank view when the application is launched. I can see what should be displaying in the XML preview however when the application is launched it is just white. I can see the outline of the SurfaceView however it has no content. I am…
Frenchie
  • 151
  • 1
  • 1
  • 9
2
votes
0 answers

How to take screenshot from surfaceView in VLC

I am playing streaming in vlc player and using surfaceView to show streaming, Now, i want to take screenshot of streaming at any time. Problem Now problem is that we can not take screenshot of SurfaceView. I also saw a sample of Media Projection but…
1 2
3
11 12