Android Camera.PreviewCallback - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Camera.PreviewCallback class.

This code example shows how to use the following methods: onPreviewFrame
    public void onPreviewFrame(byte[] data, Camera unused) {
      Preconditions.checkNotNull(camera);
      Preconditions.checkArgument(data == previewBuffer);
      Preconditions.checkState(yuvImage.compressToJpeg(rect, 80, stream));
      if (previewCallback != null) {
        previewCallback.onPreviewFrame(stream.toByteArray(), camera);
        stream.reset();
      } 
      camera.addCallbackBuffer(previewBuffer);
    } 
  } 
 
  private final class SurfaceHolderCallback implements SurfaceHolder.Callback {
    @Override 
    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
    } 
 
    @Override 
    public void surfaceCreated(SurfaceHolder holder) {
      try { 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: onPreviewFrame
    } 
 
    public void onPreviewFrame(byte[] arg0, Camera camera) {
	if (callback != null && isFocused) {
	    if (frameCounter % 2 == 0) {
		callback.onPreviewFrame(arg0, camera);
		if (frameCounter > 2 * 100) {
		    frameCounter = 0;
		} 
 
	    } 
 
	    frameCounter++;
	} 
    } 
} 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: onPreviewFrame
		  mCamera.startPreview();
	  } 
 
	public void onPreviewFrame(byte[] arg0, Camera arg1) {
    	if (callback!=null)
    		callback.onPreviewFrame(arg0, arg1);        
	} 
} 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: onPreviewFrame
        } 
    } 
 
    public void onPreviewFrame(byte[] data, Camera camera) {
        if (callback!=null) {
            callback.onPreviewFrame(data, camera);
        } 
    } 
 
    public void startPreview() { 
        if (cam!=null) {
            cam.startPreview();
        } 
    } 
} 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: onPreviewFrame
 
    } 
 
	public void onPreviewFrame(byte[] arg0, Camera arg1) {
    	if (callback!=null)
    		callback.onPreviewFrame(arg0, arg1);        
	} 
} 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android Camera.PreviewCallback Questions & Answers:

See Code Examples for Android Camera.PreviewCallback Methods: