¡@

Home 

2014/10/16 ¤W¤È 08:25:29

android Programming Glossary: surfaceholder

How can I capture a video recording on Android?

http://stackoverflow.com/questions/1817742/how-can-i-capture-a-video-recording-on-android

VideoCapture extends Activity implements OnClickListener SurfaceHolder.Callback MediaRecorder recorder SurfaceHolder holder boolean.. SurfaceHolder.Callback MediaRecorder recorder SurfaceHolder holder boolean recording false @Override public void onCreate.. holder.addCallback this holder.setType SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS cameraView.setClickable true cameraView.setOnClickListener..

How to draw an overlay on a SurfaceView used by Camera on Android?

http://stackoverflow.com/questions/2933882/how-to-draw-an-overlay-on-a-surfaceview-used-by-camera-on-android

public class Superficie extends SurfaceView implements SurfaceHolder.Callback SurfaceHolder mHolder public Camera camera Superficie.. extends SurfaceView implements SurfaceHolder.Callback SurfaceHolder mHolder public Camera camera Superficie Context context super.. mHolder getHolder mHolder.addCallback this mHolder.setType SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS public void surfaceCreated final SurfaceHolder..

Android and MJPEG

http://stackoverflow.com/questions/3205191/android-and-mjpeg

import android.util.AttributeSet import android.view.SurfaceHolder import android.view.SurfaceView public class MjpegView extends.. public class MjpegView extends SurfaceView implements SurfaceHolder.Callback public final static int POSITION_UPPER_LEFT 9 public.. public class MjpegViewThread extends Thread private SurfaceHolder mSurfaceHolder private int frameCounter 0 private long start..

Android - Camera preview is sideways

http://stackoverflow.com/questions/3841122/android-camera-preview-is-sideways

So this is how I implement it public void surfaceChanged SurfaceHolder holder int format int width int height if isPreviewRunning.. public void previewCamera try mCamera.setPreviewDisplay mSurfaceHolder mCamera.startPreview isPreviewRunning true catch Exception..

How can I use the animation framework inside the canvas?

http://stackoverflow.com/questions/4938822/how-can-i-use-the-animation-framework-inside-the-canvas

import android.view.MotionEvent import android.view.SurfaceHolder import android.view.SurfaceView public class SurfaceViewActivity.. ball class BallBounces extends SurfaceView implements SurfaceHolder.Callback GameThread thread int screenW Device's screen width... framesCount 0 @Override public void surfaceChanged SurfaceHolder holder int format int width int height @Override public void..

how to make surfaceview transparent

http://stackoverflow.com/questions/5391089/how-to-make-surfaceview-transparent

R.id.sfvTrack sfvTrack.setZOrderOnTop true necessary SurfaceHolder sfhTrackHolder sfvTrack.getHolder sfhTrackHolder.setFormat PixelFormat.TRANSPARENT..

Android ICS and MJPEG using AsyncTask

http://stackoverflow.com/questions/10550139/android-ics-and-mjpeg-using-asynctask

private Bitmap ovl public MjpegViewThread SurfaceHolder surfaceHolder Context context mSurfaceHolder surfaceHolder private Rect.. surfaceHolder Context context mSurfaceHolder surfaceHolder private Rect destRect int bmw int bmh int tempx int tempy..

How to capture and save an image using custom camera in Android?

http://stackoverflow.com/questions/10913682/how-to-capture-and-save-an-image-using-custom-camera-in-android

@Override public void surfaceCreated SurfaceHolder surfaceHolder try mCamera.setPreviewDisplay surfaceHolder mCamera.startPreview.. SurfaceHolder surfaceHolder try mCamera.setPreviewDisplay surfaceHolder mCamera.startPreview catch IOException e left blank for now.. now @Override public void surfaceDestroyed SurfaceHolder surfaceHolder mCamera.stopPreview mCamera.release @Override public void surfaceChanged..

EXIF orientation tag value always 0 for image taken with portrait camera app android

http://stackoverflow.com/questions/13245556/exif-orientation-tag-value-always-0-for-image-taken-with-portrait-camera-app-and

null camera Camera.open try camera.setPreviewDisplay surfaceHolder catch IOException e TODO Auto generated catch block e.printStackTrace..

Android and MJPEG

http://stackoverflow.com/questions/3205191/android-and-mjpeg

private Bitmap ovl public MjpegViewThread SurfaceHolder surfaceHolder Context context mSurfaceHolder surfaceHolder private Rect destRect.. SurfaceHolder surfaceHolder Context context mSurfaceHolder surfaceHolder private Rect destRect int bmw int bmh int tempx int tempy if..

How can I use the animation framework inside the canvas?

http://stackoverflow.com/questions/4938822/how-can-i-use-the-animation-framework-inside-the-canvas

e class GameThread extends Thread private SurfaceHolder surfaceHolder private BallBounces gameView private boolean run false public.. private boolean run false public GameThread SurfaceHolder surfaceHolder BallBounces gameView this.surfaceHolder surfaceHolder this.gameView.. SurfaceHolder surfaceHolder BallBounces gameView this.surfaceHolder surfaceHolder this.gameView gameView public void setRunning..

android camera surfaceview orientation

http://stackoverflow.com/questions/5157984/android-camera-surfaceview-orientation

startPreview surfaceCreated opens camera edits params sets surfaceHolder surfaceDestroyed calls stopPreview release camera this all work..

Android crash when app is closed and reopened

http://stackoverflow.com/questions/5318847/android-crash-when-app-is-closed-and-reopened

class TutorialThread extends Thread private SurfaceHolder _surfaceHolder private Panel _panel private boolean _run false public TutorialThread.. boolean _run false public TutorialThread SurfaceHolder surfaceHolder Panel panel _surfaceHolder surfaceHolder _panel panel public.. TutorialThread SurfaceHolder surfaceHolder Panel panel _surfaceHolder surfaceHolder _panel panel public void setRunning boolean run..

Custom camera android

http://stackoverflow.com/questions/8543244/custom-camera-android

Camera camera SurfaceView surfaceView SurfaceHolder surfaceHolder @Override public void onCreate Bundle savedInstanceState super.onCreate.. surfaceView SurfaceView findViewById R.id.surfaceview surfaceHolder surfaceView.getHolder surfaceHolder.addCallback this surfaceHolder.setType.. R.id.surfaceview surfaceHolder surfaceView.getHolder surfaceHolder.addCallback this surfaceHolder.setType SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS..

Is it possible to set an animated gif file as live wallpaper in android?

http://stackoverflow.com/questions/9158310/is-it-possible-to-set-an-animated-gif-file-as-live-wallpaper-in-android

yPixelOffset nyan void nyan tick SurfaceHolder surfaceHolder getSurfaceHolder Canvas canvas null try canvas surfaceHolder.lockCanvas.. getSurfaceHolder Canvas canvas null try canvas surfaceHolder.lockCanvas if canvas null nyanNyan canvas finally if canvas.. if canvas null nyanNyan canvas finally if canvas null surfaceHolder.unlockCanvasAndPost canvas mNyanHandler.removeCallbacks mNyanNyan..

SurfaceHolder.lockCanvas() Returning null

http://stackoverflow.com/questions/6921412/surfaceholder-lockcanvas-returning-null

is the only case where the surface is created android surfaceholder share improve this question You are starting a thred in..

Android Camera will not work. startPreview fails

http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails

you for any help. java android surfaceview android camera surfaceholder share improve this question I took your code and got the..

Play m3u8 video in android

http://stackoverflow.com/questions/8270060/play-m3u8-video-in-android

public void surfaceChanged SurfaceHolder surfaceholder int i int j int k Log.d TAG surfaceChanged called public void.. called public void surfaceDestroyed SurfaceHolder surfaceholder Log.d TAG surfaceDestroyed called public void surfaceCreated..

SurfaceView height + width gets ignored

http://stackoverflow.com/questions/8293909/surfaceview-height-width-gets-ignored

public void surfaceChanged SurfaceHolder surfaceholder int i int j int k Log.d TAG surfaceChanged called i j k public.. called i j k public void surfaceDestroyed SurfaceHolder surfaceholder Log.d TAG surfaceDestroyed called public void surfaceCreated..

VideoView onResume loses buffered portion of the video

http://stackoverflow.com/questions/9987042/videoview-onresume-loses-buffered-portion-of-the-video

percent @Override public void surfaceChanged SurfaceHolder surfaceholder int i int j int k Log.d TAG surfaceChanged called @Override.. @Override public void surfaceDestroyed SurfaceHolder surfaceholder Log.d TAG surfaceDestroyed called mMediaPlayer.pause buffered_media_player.xml..

How can I capture a video recording on Android?

http://stackoverflow.com/questions/1817742/how-can-i-capture-a-video-recording-on-android

video recording example using the MediaRecorder public class VideoCapture extends Activity implements OnClickListener SurfaceHolder.Callback MediaRecorder recorder SurfaceHolder holder boolean recording false @Override public void onCreate Bundle savedInstanceState.. public class VideoCapture extends Activity implements OnClickListener SurfaceHolder.Callback MediaRecorder recorder SurfaceHolder holder boolean recording false @Override public void onCreate Bundle savedInstanceState super.onCreate savedInstanceState.. cameraView SurfaceView findViewById R.id.CameraView holder cameraView.getHolder holder.addCallback this holder.setType SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS cameraView.setClickable true cameraView.setOnClickListener this private void initRecorder recorder.setAudioSource..

How to draw an overlay on a SurfaceView used by Camera on Android?

http://stackoverflow.com/questions/2933882/how-to-draw-an-overlay-on-a-surfaceview-used-by-camera-on-android

. This is a simplify version of the SurfaceView subclass I have public class Superficie extends SurfaceView implements SurfaceHolder.Callback SurfaceHolder mHolder public Camera camera Superficie Context context super context mHolder getHolder mHolder.addCallback.. of the SurfaceView subclass I have public class Superficie extends SurfaceView implements SurfaceHolder.Callback SurfaceHolder mHolder public Camera camera Superficie Context context super context mHolder getHolder mHolder.addCallback this mHolder.setType.. Camera camera Superficie Context context super context mHolder getHolder mHolder.addCallback this mHolder.setType SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS public void surfaceCreated final SurfaceHolder holder camera Camera.open try camera.setPreviewDisplay..

Android and MJPEG

http://stackoverflow.com/questions/3205191/android-and-mjpeg

import android.graphics.Rect import android.graphics.Typeface import android.util.AttributeSet import android.view.SurfaceHolder import android.view.SurfaceView public class MjpegView extends SurfaceView implements SurfaceHolder.Callback public final.. android.view.SurfaceHolder import android.view.SurfaceView public class MjpegView extends SurfaceView implements SurfaceHolder.Callback public final static int POSITION_UPPER_LEFT 9 public final static int POSITION_UPPER_RIGHT 3 public final static.. int dispWidth private int dispHeight private int displayMode public class MjpegViewThread extends Thread private SurfaceHolder mSurfaceHolder private int frameCounter 0 private long start private Bitmap ovl public MjpegViewThread SurfaceHolder surfaceHolder..

Android - Camera preview is sideways

http://stackoverflow.com/questions/3841122/android-camera-preview-is-sideways

to mCamera.setDisplayOrientation degrees available in API 8. So this is how I implement it public void surfaceChanged SurfaceHolder holder int format int width int height if isPreviewRunning mCamera.stopPreview Parameters parameters mCamera.getParameters.. parameters previewCamera And the previewCamera method public void previewCamera try mCamera.setPreviewDisplay mSurfaceHolder mCamera.startPreview isPreviewRunning true catch Exception e Log.d APP_CLASS Cannot start preview e This was on an HTC..

How can I use the animation framework inside the canvas?

http://stackoverflow.com/questions/4938822/how-can-i-use-the-animation-framework-inside-the-canvas

import android.graphics.Rect import android.os.Bundle import android.view.MotionEvent import android.view.SurfaceHolder import android.view.SurfaceView public class SurfaceViewActivity extends Activity BallBounces ball @Override public void.. savedInstanceState ball new BallBounces this setContentView ball class BallBounces extends SurfaceView implements SurfaceHolder.Callback GameThread thread int screenW Device's screen width. int screenH Devices's screen height. int ballX Ball x position... now framesTimer 1000 framesTimer now framesCountAvg framesCount framesCount 0 @Override public void surfaceChanged SurfaceHolder holder int format int width int height @Override public void surfaceCreated SurfaceHolder holder thread new GameThread getHolder..

how to make surfaceview transparent

http://stackoverflow.com/questions/5391089/how-to-make-surfaceview-transparent

Android ICS and MJPEG using AsyncTask

http://stackoverflow.com/questions/10550139/android-ics-and-mjpeg-using-asynctask

mSurfaceHolder private int frameCounter 0 private long start private Bitmap ovl public MjpegViewThread SurfaceHolder surfaceHolder Context context mSurfaceHolder surfaceHolder private Rect destRect int bmw int bmh int tempx int tempy if displayMode.. long start private Bitmap ovl public MjpegViewThread SurfaceHolder surfaceHolder Context context mSurfaceHolder surfaceHolder private Rect destRect int bmw int bmh int tempx int tempy if displayMode MjpegView.SIZE_STANDARD tempx dispWidth 2 bmw..

How to capture and save an image using custom camera in Android?

http://stackoverflow.com/questions/10913682/how-to-capture-and-save-an-image-using-custom-camera-in-android

this.mSurfaceHolder.setType SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS @Override public void surfaceCreated SurfaceHolder surfaceHolder try mCamera.setPreviewDisplay surfaceHolder mCamera.startPreview catch IOException e left blank for now @Override public.. @Override public void surfaceCreated SurfaceHolder surfaceHolder try mCamera.setPreviewDisplay surfaceHolder mCamera.startPreview catch IOException e left blank for now @Override public void surfaceDestroyed SurfaceHolder surfaceHolder.. mCamera.startPreview catch IOException e left blank for now @Override public void surfaceDestroyed SurfaceHolder surfaceHolder mCamera.stopPreview mCamera.release @Override public void surfaceChanged SurfaceHolder surfaceHolder int format int width..

EXIF orientation tag value always 0 for image taken with portrait camera app android

http://stackoverflow.com/questions/13245556/exif-orientation-tag-value-always-0-for-image-taken-with-portrait-camera-app-and

camera Camera.open i defaultCameraId i if camera null camera Camera.open try camera.setPreviewDisplay surfaceHolder catch IOException e TODO Auto generated catch block e.printStackTrace Camera.Parameters parameters camera.getParameters..

Android and MJPEG

http://stackoverflow.com/questions/3205191/android-and-mjpeg

mSurfaceHolder private int frameCounter 0 private long start private Bitmap ovl public MjpegViewThread SurfaceHolder surfaceHolder Context context mSurfaceHolder surfaceHolder private Rect destRect int bmw int bmh int tempx int tempy if displayMode MjpegView.SIZE_STANDARD.. long start private Bitmap ovl public MjpegViewThread SurfaceHolder surfaceHolder Context context mSurfaceHolder surfaceHolder private Rect destRect int bmw int bmh int tempx int tempy if displayMode MjpegView.SIZE_STANDARD tempx dispWidth 2 bmw..

How can I use the animation framework inside the canvas?

http://stackoverflow.com/questions/4938822/how-can-i-use-the-animation-framework-inside-the-canvas

try thread.join retry false catch InterruptedException e class GameThread extends Thread private SurfaceHolder surfaceHolder private BallBounces gameView private boolean run false public GameThread SurfaceHolder surfaceHolder BallBounces gameView.. SurfaceHolder surfaceHolder private BallBounces gameView private boolean run false public GameThread SurfaceHolder surfaceHolder BallBounces gameView this.surfaceHolder surfaceHolder this.gameView gameView public void setRunning boolean run this.run.. gameView private boolean run false public GameThread SurfaceHolder surfaceHolder BallBounces gameView this.surfaceHolder surfaceHolder this.gameView gameView public void setRunning boolean run this.run run public SurfaceHolder getSurfaceHolder..

android camera surfaceview orientation

http://stackoverflow.com/questions/5157984/android-camera-surfaceview-orientation

extends SurfaceView and overrides surfaceChanged just calls startPreview surfaceCreated opens camera edits params sets surfaceHolder surfaceDestroyed calls stopPreview release camera this all work great because when the orientation is Portrait from surfaceCreated..

Android crash when app is closed and reopened

http://stackoverflow.com/questions/5318847/android-crash-when-app-is-closed-and-reopened

InterruptedException e we will try it again and again... class TutorialThread extends Thread private SurfaceHolder _surfaceHolder private Panel _panel private boolean _run false public TutorialThread SurfaceHolder surfaceHolder Panel panel _surfaceHolder.. SurfaceHolder _surfaceHolder private Panel _panel private boolean _run false public TutorialThread SurfaceHolder surfaceHolder Panel panel _surfaceHolder surfaceHolder _panel panel public void setRunning boolean run _run run @Override public void.. private Panel _panel private boolean _run false public TutorialThread SurfaceHolder surfaceHolder Panel panel _surfaceHolder surfaceHolder _panel panel public void setRunning boolean run _run run @Override public void run Canvas c while _run c..

Custom camera android

http://stackoverflow.com/questions/8543244/custom-camera-android

SurfaceHolder.Callback Called when the activity is first created. Camera camera SurfaceView surfaceView SurfaceHolder surfaceHolder @Override public void onCreate Bundle savedInstanceState super.onCreate savedInstanceState setContentView R.layout.main.. R.layout.main getWindow .setFormat PixelFormat.UNKNOWN surfaceView SurfaceView findViewById R.id.surfaceview surfaceHolder surfaceView.getHolder surfaceHolder.addCallback this surfaceHolder.setType SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS camera.. PixelFormat.UNKNOWN surfaceView SurfaceView findViewById R.id.surfaceview surfaceHolder surfaceView.getHolder surfaceHolder.addCallback this surfaceHolder.setType SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS camera Camera.open if camera null try camera.setPreviewDisplay..

Is it possible to set an animated gif file as live wallpaper in android?

http://stackoverflow.com/questions/9158310/is-it-possible-to-set-an-animated-gif-file-as-live-wallpaper-in-android

xOffset yOffset xOffsetStep yOffsetStep xPixelOffset yPixelOffset nyan void nyan tick SurfaceHolder surfaceHolder getSurfaceHolder Canvas canvas null try canvas surfaceHolder.lockCanvas if canvas null nyanNyan canvas finally if.. yPixelOffset nyan void nyan tick SurfaceHolder surfaceHolder getSurfaceHolder Canvas canvas null try canvas surfaceHolder.lockCanvas if canvas null nyanNyan canvas finally if canvas null surfaceHolder.unlockCanvasAndPost canvas mNyanHandler.removeCallbacks.. Canvas canvas null try canvas surfaceHolder.lockCanvas if canvas null nyanNyan canvas finally if canvas null surfaceHolder.unlockCanvasAndPost canvas mNyanHandler.removeCallbacks mNyanNyan if isVisible mNyanHandler.postDelayed mNyanNyan 1000L..

SurfaceHolder.lockCanvas() Returning null

http://stackoverflow.com/questions/6921412/surfaceholder-lockcanvas-returning-null

the game but it waited forever. How come the first instance is the only case where the surface is created android surfaceholder share improve this question You are starting a thred in activity on create while it should be started only when the..

Android Camera will not work. startPreview fails

http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails

GL10.GL_TEXTURE_MIN_FILTER GL10.GL_LINEAR Thank you for any help. java android surfaceview android camera surfaceholder share improve this question I took your code and got the same error as you however on debugging it appears to me that..

Play m3u8 video in android

http://stackoverflow.com/questions/8270060/play-m3u8-video-in-android

true if mIsVideoReadyToBePlayed mIsVideoSizeKnown startVideoPlayback public void surfaceChanged SurfaceHolder surfaceholder int i int j int k Log.d TAG surfaceChanged called public void surfaceDestroyed SurfaceHolder surfaceholder Log.d TAG surfaceDestroyed.. surfaceholder int i int j int k Log.d TAG surfaceChanged called public void surfaceDestroyed SurfaceHolder surfaceholder Log.d TAG surfaceDestroyed called public void surfaceCreated SurfaceHolder holder Log.d TAG surfaceCreated called playVideo..

SurfaceView height + width gets ignored

http://stackoverflow.com/questions/8293909/surfaceview-height-width-gets-ignored

true if mIsVideoReadyToBePlayed mIsVideoSizeKnown startVideoPlayback public void surfaceChanged SurfaceHolder surfaceholder int i int j int k Log.d TAG surfaceChanged called i j k public void surfaceDestroyed SurfaceHolder surfaceholder Log.d TAG.. surfaceholder int i int j int k Log.d TAG surfaceChanged called i j k public void surfaceDestroyed SurfaceHolder surfaceholder Log.d TAG surfaceDestroyed called public void surfaceCreated SurfaceHolder holder Log.d TAG surfaceCreated called playVideo..

VideoView onResume loses buffered portion of the video

http://stackoverflow.com/questions/9987042/videoview-onresume-loses-buffered-portion-of-the-video

onBufferingUpdate MediaPlayer mp int percent Log.i TAG percent @Override public void surfaceChanged SurfaceHolder surfaceholder int i int j int k Log.d TAG surfaceChanged called @Override public void surfaceCreated SurfaceHolder holder Log.d TAG surfaceCreated.. if mIsVideoReadyToBePlayed playVideo else mMediaPlayer.start @Override public void surfaceDestroyed SurfaceHolder surfaceholder Log.d TAG surfaceDestroyed called mMediaPlayer.pause buffered_media_player.xml xml version 1.0 encoding utf 8 LinearLayout..