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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: onPreviewFrame
	    } 
	  
	@Override 
	public void onPreviewFrame(byte[] data, Camera camera) {
	    	if (callback!=null)
	    		callback.onPreviewFrame(data, camera);        	
	} 
 
	@Override 
	public void surfaceChanged(SurfaceHolder holder, int format, int width,
			int height) {
		// TODO Auto-generated method stub 
		 
	} 
 
	@Override 
	public void surfaceCreated(SurfaceHolder holder) {
		System.out.println("Surface Created - CAM");
		mCamera = Camera.open();
		 
Full Snippet Info
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Android Camera.PreviewCallback Questions & Answers:

See Code Examples for Android Camera.PreviewCallback Methods: