android.view.SurfaceView.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中android.view.SurfaceView.<init>()方法的一些代码示例,展示了SurfaceView.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SurfaceView.<init>()方法的具体详情如下:
包路径:android.view.SurfaceView
类名称:SurfaceView
方法名:<init>

SurfaceView.<init>介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

SurfaceView view = new SurfaceView(this);
c.setPreviewDisplay(view.getHolder());
c.startPreview();
c.takePicture(shutterCallback, rawPictureCallback, jpegPictureCallback);

代码示例来源:origin: googlesamples/android-vision

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  mContext = context;
  mStartRequested = false;
  mSurfaceAvailable = false;
  mSurfaceView = new SurfaceView(context);
  mSurfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(mSurfaceView);
}

代码示例来源:origin: googlesamples/android-vision

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  mContext = context;
  mStartRequested = false;
  mSurfaceAvailable = false;
  mSurfaceView = new SurfaceView(context);
  mSurfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(mSurfaceView);
}

代码示例来源:origin: googlesamples/android-vision

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  mContext = context;
  mStartRequested = false;
  mSurfaceAvailable = false;
  mSurfaceView = new SurfaceView(context);
  mSurfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(mSurfaceView);
}

代码示例来源:origin: googlesamples/android-vision

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  mContext = context;
  mStartRequested = false;
  mSurfaceAvailable = false;
  mSurfaceView = new SurfaceView(context);
  mSurfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(mSurfaceView);
}

代码示例来源:origin: googlesamples/android-vision

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  this.context = context;
  startRequested = false;
  surfaceAvailable = false;
  surfaceView = new SurfaceView(context);
  surfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(surfaceView);
}

代码示例来源:origin: googlesamples/android-vision

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  mContext = context;
  mStartRequested = false;
  mSurfaceAvailable = false;
  mSurfaceView = new SurfaceView(context);
  mSurfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(mSurfaceView);
}

代码示例来源:origin: guardianproject/haven

SurfaceView surfaceView = new SurfaceView(context);
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(
    1, 1,

代码示例来源:origin: robolectric/robolectric

@Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_ACTION_BAR);
  setContentView(new SurfaceView(this));
 }
}

代码示例来源:origin: googlesamples/android-vision

/**
 * Opens the camera and starts sending preview frames to the underlying detector.  The preview
 * frames are not displayed.
 *
 * @throws IOException if the camera's preview texture or display could not be initialized
 */
@RequiresPermission(Manifest.permission.CAMERA)
public CameraSource start() throws IOException {
  synchronized (cameraLock) {
    if (camera != null) {
      return this;
    }
    camera = createCamera();
    // SurfaceTexture was introduced in Honeycomb (11), so if we are running and
    // old version of Android. fall back to use SurfaceView.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      dummySurfaceTexture = new SurfaceTexture(DUMMY_TEXTURE_NAME);
      camera.setPreviewTexture(dummySurfaceTexture);
    } else {
      dummySurfaceView = new SurfaceView(context);
      camera.setPreviewDisplay(dummySurfaceView.getHolder());
    }
    camera.startPreview();
    processingThread = new Thread(frameProcessor);
    frameProcessor.setActive(true);
    processingThread.start();
  }
  return this;
}

代码示例来源:origin: googlesamples/android-vision

/**
 * Opens the camera and starts sending preview frames to the underlying detector.  The preview
 * frames are not displayed.
 *
 * @throws IOException if the camera's preview texture or display could not be initialized
 */
@RequiresPermission(Manifest.permission.CAMERA)
public CameraSource start() throws IOException {
  synchronized (mCameraLock) {
    if (mCamera != null) {
      return this;
    }
    mCamera = createCamera();
    // SurfaceTexture was introduced in Honeycomb (11), so if we are running and
    // old version of Android. fall back to use SurfaceView.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      mDummySurfaceTexture = new SurfaceTexture(DUMMY_TEXTURE_NAME);
      mCamera.setPreviewTexture(mDummySurfaceTexture);
    } else {
      mDummySurfaceView = new SurfaceView(mContext);
      mCamera.setPreviewDisplay(mDummySurfaceView.getHolder());
    }
    mCamera.startPreview();
    mProcessingThread = new Thread(mFrameProcessor);
    mFrameProcessor.setActive(true);
    mProcessingThread.start();
  }
  return this;
}

代码示例来源:origin: daniulive/SmarterStreaming

bgSurfaceView = new SurfaceView(this);

代码示例来源:origin: googlesamples/android-vision

/**
 * Opens the camera and starts sending preview frames to the underlying detector.  The preview
 * frames are not displayed.
 *
 * @throws IOException if the camera's preview texture or display could not be initialized
 */
@RequiresPermission(Manifest.permission.CAMERA)
public CameraSource start() throws IOException {
  synchronized (mCameraLock) {
    if (mCamera != null) {
      return this;
    }
    mCamera = createCamera();
    // SurfaceTexture was introduced in Honeycomb (11), so if we are running and
    // old version of Android. fall back to use SurfaceView.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      mDummySurfaceTexture = new SurfaceTexture(DUMMY_TEXTURE_NAME);
      mCamera.setPreviewTexture(mDummySurfaceTexture);
    } else {
      mDummySurfaceView = new SurfaceView(mContext);
      mCamera.setPreviewDisplay(mDummySurfaceView.getHolder());
    }
    mCamera.startPreview();
    mProcessingThread = new Thread(mFrameProcessor);
    mFrameProcessor.setActive(true);
    mProcessingThread.start();
  }
  return this;
}

代码示例来源:origin: journeyapps/zxing-android-embedded

private void setupSurfaceView() {
  if(useTextureView) {
    textureView = new TextureView(getContext());
    textureView.setSurfaceTextureListener(surfaceTextureListener());
    addView(textureView);
  } else {
    surfaceView = new SurfaceView(getContext());
    surfaceView.getHolder().addCallback(surfaceCallback);
    addView(surfaceView);
  }
}

代码示例来源:origin: stackoverflow.com

addContentView(mGLSurfaceView, new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
 mSurfaceView = new SurfaceView(this);
  addContentView(mSurfaceView, new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
 mSurfaceHolder = mSurfaceView.getHolder();

代码示例来源:origin: google/ExoPlayer

break;
default:
 surfaceView = new SurfaceView(context);
 break;

代码示例来源:origin: stackoverflow.com

surfaceView = new SurfaceView(this);
LayoutParams layoutParams = new WindowManager.LayoutParams(
  1, 1,

代码示例来源:origin: stackoverflow.com

SurfaceView surface = new SurfaceView(this);
 Camera camera = Camera.open();
 try {

代码示例来源:origin: stackoverflow.com

super.onCreate(savedInstanceState);
SurfaceView view = new SurfaceView(this);
setContentView(view);
view.getHolder().addCallback(this);

代码示例来源:origin: TrustWallet/trust-wallet-android-source

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  mContext = context;
  mStartRequested = false;
  mSurfaceAvailable = false;
  mSurfaceView = new SurfaceView(context);
  mSurfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(mSurfaceView);
}

相关文章