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
1
vote
1 answer

Animation not working in SurfaceView

I have this very simple code cycle, I don't do any complicate thing! The TextAnimation() method get call,but, the animation inside it doesn't start(I can't see any Log) this is my cod: my Activity Main: public class Main extends AppCompatActivity…
MehDi
  • 504
  • 6
  • 20
1
vote
1 answer

SurfaceView of type PUSH_BUFFERS

I have some experience with the SurfaceView. To prevent unneeded redrawing, I always use a countdown variable which tells the thread how often the view should be drawn. countdown > 0 : draw ? doNothing However I was thinking about changing that to…
WarrenFaith
  • 57,492
  • 25
  • 134
  • 150
1
vote
3 answers

How to force SurfaceView to occupy specific section othe screen

I am trying to use SurfaceView. So I created a SurfaceView widget in the layout file as shown below in the code. The problem I have is how to set a weight to the SurfaceView? As shown below in the code I set : android:layout_weight=".4" but still…
1
vote
0 answers

Android Surface view Scrolling endlessly

I have an image view placed in the surface view. Code below if (holder != null) { canvas = holder.lockCanvas(); if (canvas != null) { canvas.drawColor(-1); canvas.save(); …
Renjith
  • 546
  • 1
  • 8
  • 28
1
vote
0 answers

How to preview captured video on a SurfaceView?

I have used this code to capture a video and preview it on surface. But there is some logical error. Camera does not capture video. i don;t understand what is the error public class VideoCapture extends Activity implements …
1
vote
1 answer

ANR on Surface.nativeLockCanvas on some devices

I need to draw over SurfaceView on events from accelerometer. I create callback for checking that surface ready. overlaySurfaceView = (SurfaceView) findViewById(R.id.overlay_surface); overlaySurfaceView.setZOrderMediaOverlay(true); overlayHolder =…
Anton Lashkov
  • 280
  • 3
  • 10
1
vote
1 answer

SurfaceHolder causes flickering

I'm trying to create a specific paint program using a transparent surefaceView, and a brush that was made from a custom bitmap. I looked on this website for answers but couldn't find what I need. Because of the while loop of the run method, the…
SHAI
  • 789
  • 3
  • 10
  • 43
1
vote
0 answers

Android custom Camera app

Trying to develop android Camera App with custom preview layout for recording videos. Folowing this source: http://developer.android.com/guide/topics/media/camera.html Camera's preview works fine, but the problem begins when I try to record…
user4702646
1
vote
2 answers

How to release camera on setOnClickListener?

I am trying to release camera on Imageview's setOnClickListener but the app crashes and shows the following error java.lang.runtimeexception method called after release() Can anyone help me with this? Following is my code snippet ,I don't know what…
jimmy
  • 91
  • 1
  • 1
  • 9
1
vote
0 answers

Consequences of deprecated Camera class

Changed my code from using deprecated Camera class to CameraDevice and now have the errors indicated ("<-- here"). What is the best alternative for replacing these parameters? Looking at the documentation it seems that, at least for the orientation,…
masteryupa
  • 101
  • 13
1
vote
1 answer

Android custom camera SurfaceView OnClick save image on sdcard?

Hi i want to implement custom android camera app which include imageview on top of the camera preview.After click the screen i want to store images in sdcard .So far i have done this part.But i can't click the SurfaceView and save image.Can anyone…
Sajith Vijesekara
  • 1,324
  • 2
  • 17
  • 52
1
vote
1 answer

Grafika TextureMovieEncoder

I have recently been modifying Grafika's TextureMovieEncoder to create a recording of what I displayed onscreen: two Sprite2ds which are overlapping. Using the CameraCaptureActivity example as a reference point, I effectively ported what I created…
kungfoo
  • 597
  • 5
  • 16
1
vote
0 answers

Draw over SurfaceHolder/MediaPlayer on android?

I'm working on a live wallpaper application. For the service, I'm playing a video as a wallpaper on loop using the MediaPlayer class. I would like to know if it's possible to draw over the video like it was a canvas, or at least a work around for do…
Synx
  • 142
  • 1
  • 1
  • 9
1
vote
1 answer

move overlay image on camera preview

I want overlay an image in live camera preview using surface view. There are lot of tutorial in this case and my program run perfectly. Now i want add ability to move overlay image in live camera preview with touch event. I can't find any code or…
1
vote
0 answers

display area is increased

I have created surface in android Java and mentioned its width and height as below. android:layout_width="fill_parent" android:layout_height="fill_parent" My decoded video dimension is w x h (less than surface layout size). When i render the yuv…